Paper2D-Tilemap Component Generated at Runtime not Generating Collision

Hm, I’ll link to the files that were changed directly, and these are links to these files in the Master Branch.

PaperTileMapComponent.cpp has been edited at line 712, 731, and 743

[PaperTileMap.h][2] has been edited at line 210.

[PaperTileMap.cpp][3] has been edited at line 533.

I would just post direct pictures and pastebins, but we must keep that contained to Github for EULA reasons.

[3]:

I downloaded the master branch and I couldn’t ever seem to get the proper tilemapcomponent. So I updated the three files you posted.

When I run the game now, I just get a bitarray less than error. I’m not sure at all what this error is and the program crashes out before I can get a screen grab or write it down. I’ll try again in a bit and see if I can screen cap the error.

Here’s my error window that pops up now when I’m running the game with this updated code.

100247-spritetilemaperror.png

Well, for the record, i just got it to work once…

That particular error above might be unrelated and just from upgrading from 4.11 to 4.12

I seem to remember getting it on a similar project when upgrading.

Are you still having crash issues with your project? also, when you say that you “just got it to work once.”, do you mean in relation to opening the project or the expected behavior after getting the fix?

I’m still having crashing issues, but I really think it’s unrelated to the paper 2d tile map update.

Basically, when I wasn’t sure the tile map issue would ever be fixed I moved on and removed it from my project. I then updated that project without the tile map component to 4.12. I had crashes after the update related to the update. I fixe those crashes.

When you posted this fix, I went back to the old 4.11 project with the tile map component. I had to update that project to 4.12. And as a result I got the crashes I originally had that were unrelated to the tile map. I’m not 100% sure how I fixed them anymore. So I’m still having those crashes. One time, though, the project happened to load without crashing, and the collision mesh got generated properly with the new tile map code.

I’ll create a new project in a bit to double check that collision tile map does indeed work.

Thank you for working with me on this. As mentioned, I don’t have any experience using this component so this helps a lot. Whenever you get around to testing it, please let me know the results.

Yup. I started a new project and built a tilemap on the fly in code, and it works as expected. :slight_smile:

Also, to give a little acknowledgement, the sprite in this example is from [http://opengameart.org/content/platformer-art-deluxe][2]

Thank you for the help. Hopefully these changes will be available in the 4.13 previews but should definitely be available in the full 4.13 release. I’ve verified the bug report so we’re all done.

Have a good day!

I also ran into the problem of generating collisions for the TileMap component, now the RebuildCollision() procedure works. I have a test TileSet that has multiple tiles without collision and the function takes that into account! At first I thought that I would have to manually create collisions for each tile
Thank you for your work! I’m happy