[Won't change] 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.

BlockLinesIterator is broken(?)

Postby FishyClockwork » 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

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
 
Joined: 23 Feb 2011

Re: BlockLinesIterator is broken(?)

Postby FishyClockwork » 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?
User avatar
FishyClockwork
 
Joined: 23 Feb 2011

Re: BlockLinesIterator is broken(?)

Postby 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
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: BlockLinesIterator is broken(?)

Postby FishyClockwork » Mon Jun 13, 2022 7:04 am

better leave it as it is and accept the limitation

Will do.
User avatar
FishyClockwork
 
Joined: 23 Feb 2011


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests