Tilemap loading issue

0 favourites
  • 4 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • Hey guys, I have a strange issue while loading tilemaps from "external source".

    It's a stripped down version of my level editor. I just left ability to draw, change size, save and load tiles. Tilemap is saved into an array X:0 and after pressing Save it will save that array into a json file.

    If you run the capx you can draw, save and load... and it works fine.

    But if you change the width to something higher (in my case it's 41), draw a line or something from the first tile on the left to the last one on the right, save it, restart (to start fresh) and load that file you will noticed that not all tiles are displayed.

    I'm saving this image

    41x5 tiles in size

    If you check the Array_minimaps in the debugger - last part of index X:0

    "data":{"w":41,"h":5,"d":"4x-1,0,7x-1,0,7x-1,0,7x-1,0,7x-1,0,7x-1,0,-1,0,5x-1,0,-1,0,5x-1,0,-1,0,5x-1,0,-1,0,5x-1,0,-1,0,5x-1,0,3x-1,0,3x-1,0,3x-1,0,3x-1,0,3x-1,0,3x-1,0,3x-1,0,3x-1,0,3x-1,0,3x-1,0,5x-1,0,-1,0,5x-1,0,-1,0,5x-1,0,-1,0,5x-1,0,-1,0,5x-1,0,-1,0,7x-1,0,7x-1,0,7x-1,0,7x-1,0,7x-1,0"}}

    "w":41 is the width in tiles of tilemap object and rest represents the tile states in current tilemap.

    (Like always arrays are displayed very nicly in the debugger )

    After loading back that file it look like this

    If you check that array again in the debugger you can notice that everything is fine with that tilemap - size and data (or even checking the tilemap itselfs you can see that highlited size is correct), but for some reasons it's not displayed fully. At first I thought it's an issue with screen space. Not rendered tiles are simply outside of the visible area and therefore not rendered. But after some tests on different pcs and different resolutions it looks like it's random. And same happens on tilemap height as well, after some height value it gets clipped away.

    Another strange thing is I can not draw tiles anymore on that missing part of the tilemap

    DId I'm missing something? or Ashley did you accidentally changed something in the C2 in r209?

    I don't want to post it as a bug until someone can confirm that behavior.

    Here's the capx file

    https://dl.dropboxusercontent.com/u/34375299/Construct%202/bugs%20and%20fixes/Load_Tilemap.capx

  • The changes in the beta releases since r206 may mean that you need to save your tilemap data again in the latest beta for it to definitely load correctly. In older releases the width and height saved in the JSON data can be flat out wrong which could cause some weird issues when loading it. Are you still seeing issues loading data which was saved with r209?

  • The changes in the beta releases since r206 may mean that you need to save your tilemap data again in the latest beta for it to definitely load correctly. In older releases the width and height saved in the JSON data can be flat out wrong which could cause some weird issues when loading it. Are you still seeing issues loading data which was saved with r209?

    Hey Ashley, all of this was made and comes from new r209 - after you've fixed my tilemap bug issue part 2 xD.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sorry for the bump, but this is very important for me at this right moment in time xD

    Ashley did you, by any chance had a look into this?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)