BlockLinesIterator is broken(?)

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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.
User avatar
FishyClockwork
Posts: 732
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

BlockLinesIterator is broken(?)

Post by FishyClockwork »

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
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.
You do not have the required permissions to view the files attached to this post.
User avatar
FishyClockwork
Posts: 732
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: BlockLinesIterator is broken(?)

Post by FishyClockwork »

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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48537
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: BlockLinesIterator is broken(?)

Post by Graf Zahl »

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
User avatar
FishyClockwork
Posts: 732
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference

Re: BlockLinesIterator is broken(?)

Post by FishyClockwork »

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

Return to “Closed Bugs [GZDoom]”