I am getting this odd issue when I am using a Tilemap using any number of layers. As I am working on my own RPG engine, I thought leveraging Tilemap would be a good idea, but it seems some internal issue is causing crashes with it at the moment:
I’ve been exploding trying to figure out what’s causing this error.
I’ve tested using BunnyMark the Tilemap API and it seems to work fine there, but my project, for some reason, caused the above error.
I’ve tried to mimic the order of methods used in BunnyMark in my engine, but to no avail.
You can find the engine, plus a test project, in which you can identify for yourself the error here.
The subject line of code is in
rpgfl.display.Map on Line 158. Everything else is fine, I’ve traced code to determine if there was anything wrong with my generation logic, but if there were errors there, it would have crashed then and not at render time (at least I would have thought). What’s ironic is that the callstack makes no mention of the Tilemap in any way, but:
causes the above callstack error. Obviously it can render maps, because I’ve got it working with BunnyMark. I’ve probably overlooked some obvious and missing logic somewhere in the loading code, but I just can’t quite see it. Since one layer has a lot of -1’s on it, I was curious if that would have been an issue. But as it turns out, removing that layer does not solve the problem.
I’ve tested this on Flash, Neko and C++. Neko and C++ just flat out crash. Flash doesn’t crash, it does render but the results are not as you would expect:
I understand I am using the develop branch of OpenFL for most of these tests. The latest stable version and develop seem to have the same results, though.
What I’ve also noticed in the error is that the render call is being called four times, even though there is only one child, which is a bit odd. Whether the Tilemap itself is causing this or not I’m not sure.
Any help would be greatly appreciated.