randy wrote:Graf Zahl wrote:For the set in question it effectively invalidates every single potential candidate for use as a splitter.
I think it should still be able to pick something, though. That's why the score is modified rather than rejected outright.
Sure. But it is modified in a way that invalidates every single candidate. If you look at the list everything got a negative score.
randy wrote:
Graf Zahl wrote:node builder does not select an exact vertex but allows some tolerance
Necessary because of floating point, and because the final vertex is fixed point with only 16 bits of fractional precision.
That part in itself is ok. But with cata.wad what happens if the fudging code is removed (or the score altered to always be positive) the splitter vertex would not be the real ending vertex but it's close enough to get mapped to it (The distance is 5/65536 map units.) That also wouldn't be a problem if the code that divides a set of segs would deal with such a case. But it doesn't. It just goes along assuming that everything can be properly divided.
Instead the code should check if the seg splitting is successful and not just assume that it will always succeed. It can deal with an undividable set after this check and not preemptively mess around with the score to make it less likely. The UDMF map clearly shows that that doesn't work.
Graf Zahl wrote:and the fudging code posted above can be removed
I don't think that's a good idea. If the segment is too short, it won't be well-represented by fixed point coordinates, and if it's especially short, it could even degenerate to a single vertex when converted to fixed point.
Am I right in assuming this only happens with UDMF maps because they allow fractional coordinates? It might be a good idea to restrict the amount of fractional precision allowed for them.[/quote]
Only partially. In this map some things come together to create this mess. First, due to the high tendency to avoid splits the map gets reduced to a section that only contains high precision vertices and second, this section contains lines which are almost colinear but not quite. As a result every single splitter candidate comes too close to another vertex. In the end the precision of the vertices was not too high but not high enough so fudging around here will only create more problems.
I think if you fix the splitting code to check its results and deal with failure cases properly the problems will go away.