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.
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.
BlockLinesIterator is broken(?)
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.
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.
-
- Posts: 732
- Joined: Wed Feb 23, 2011 11:04 am
- Preferred Pronouns: No Preference
BlockLinesIterator is broken(?)
You do not have the required permissions to view the files attached to this post.
-
- Posts: 732
- Joined: Wed Feb 23, 2011 11:04 am
- Preferred Pronouns: No Preference
Re: BlockLinesIterator is broken(?)
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:
Should this be dismissed as a [User Error] or is it still a bug?
Like so:
Spoiler: codeSo 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?
-
- Lead GZDoom+Raze Developer
- Posts: 48537
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: BlockLinesIterator is broken(?)
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
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
-
- Posts: 732
- Joined: Wed Feb 23, 2011 11:04 am
- Preferred Pronouns: No Preference
Re: BlockLinesIterator is broken(?)
Will do.better leave it as it is and accept the limitation