BlockLinesIterator is broken(?)

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: BlockLinesIterator is broken(?)

Re: BlockLinesIterator is broken(?)

by Fishytza » Mon Jun 13, 2022 7:04 am

better leave it as it is and accept the limitation
Will do.

Re: BlockLinesIterator is broken(?)

by Graf Zahl » Mon Jun 13, 2022 6:57 am

Thanks for that bit of info. I think the problem here comes from the BlockLinesIterator using 'validcount' to weed out duplicates. That, however, means that you cannot call actions from there that also use validcount. Actor spawning is one of these things.

Here's the problem: Trying to fix this will be very performance-costly, because the only way would be to use a check array like the BlockThingsIterator - and that check array is one of the biggest performance killers compared to simpler Doom ports. So, I think the cost would be higher than the benefits, which means, better leave it as i t is and accept the limitation

Re: BlockLinesIterator is broken(?)

by Fishytza » Mon Jun 13, 2022 5:41 am

Here's an interesting fact. The iterator works as intended if I don't spawn any actors until after all lines are found.

Like so:
Spoiler: code
So I'm not supposed to spawn actors while iterating through lines.
Should this be dismissed as a [User Error] or is it still a bug?

BlockLinesIterator is broken(?)

by Fishytza » Mon Apr 18, 2022 1:51 am

Tested with GZDoom 4.7.1 and g4.8pre-310-g1c4d48f5f

In short, the iterator will sometimes fail to detect lines that are right next to the (actor's) position where the iterator is created.

This PK3 has a replacement MAP01, but really, you can test this with any map. It also has a event handler that creates the line iterator where ever player 1 is with a search radius of 64. It prints the index of each found line and spawns a visual indicator in the middle of the line.
bmap-line-iterator-test.pk3
(2.81 KiB) Downloaded 40 times
In the test map, for example, no matter how close I get to it the iterator will never find linedef 11.
And right at the start, you can see it detects line 6 twice.

Top