Tilemap loading issue

Discussion and feedback on Construct 2

Post » Wed Jul 01, 2015 11:54 pm

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
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.

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

After loading back that file it look like this
Image

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
Image

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
Last edited by shinkan on Mon Jul 06, 2015 3:35 pm, edited 1 time in total.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,597
Reputation: 34,821

Post » Thu Jul 02, 2015 11:09 am

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?
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Thu Jul 02, 2015 11:14 am

Ashley wrote: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.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,597
Reputation: 34,821

Post » Fri Jul 03, 2015 7:45 pm

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?
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,597
Reputation: 34,821


Return to Construct 2 General

Who is online

Users browsing this forum: huZba, Refeuh, tdcostas and 6 guests