-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor crash on torus maps #479
Comments
Thanks for the report and the logs. I should investigate what happens when you group lots of black terrain, then move it, then ungroup it. Does the ungrouping put tiles at wrongly wrapped coordinates? All editor operations are independently responsible for wrapping coordinates. This responsibility is not centralized in the level or the tiles themselves, which would prevent the bug cleanly but would go heavily against the stroke of the level data structures. |
Here is an example with grouping and ungrouping that leads to wrong torus invariants. Repro below. Definition (torus invariant): When a dimension is wrapped (the x-dimension, the y-dimension, or both x and y for a torus map), all tiles on that map must have coordinates in [0, L[ for that dimension, where L is the map size in that dimension. E.g., Hopscotch has size 256x160 and wraps only the y-dimension. On Hopscotch, each tile must have a y-coordinate of 0, 1, 2, ..., 157, 158, or 159. It's not allowed to have a y coordinates of −16, 160, or 500. The purpose of the invariant is to enforce a unique representation of each tile. This example wont doesn't necessarily lead to your crash, but it shows invariant-violating coordinates. I'll investigate it and fix the invariant preservation. This example has only vertical wrapping, but horizontal wrapping should violate the invariant too. Repro:
After 2, the invariant still holds. After 3, the invariant is violated: The tile group has a y coordinate that is larger than the y-length of the map. After 4, the invariant holds again. After 5, it still holds. After 6, the invariant is violated again: The black tile has a negative y coordinate. |
In unpublished code, I've added wrap to the grouping (computation and creation of the group, not the resulting Above invariant violations are fixed. But, in a debug build, I can nonetheless force a crash as follows. Steps 1-3 are identical to above post's steps 1-3, except that it's irrelevant whether tile A is black or normal.
This crashes because, after step 4, tile B's coordinates violate the torus invariant (see previous post). Between steps 2 and 3, tile B's torus invariant was still fulfilled. I'll have to investigate and fix this, too. |
I have a fix candidate for all known crashes in my unstable Lix repo, branch |
I managed to get two crashes on the same map (which was newly created in 0.10.18). The map was a torus map with tile groups and black terrain, unfortunately I don't know the exact steps for reproduction. Logs below.
The text was updated successfully, but these errors were encountered: