Game Development Community

tile map resets on save

by Dan Pascal · in iTorque 2D · 07/02/2010 (6:29 pm) · 16 replies

Hey guys,
when I make a tile map, then go to save my level, it prompts to save the tile layer, if i save it, the layer resets or something so it's blank in tgb. If i cancel out of saving the tile layer, it cancels out of saving the level.
I'm doing this on mac with it2d1.3.1,

is this that bug?

should I stop using tile maps?

#1
07/02/2010 (6:41 pm)
Dan, you need to save the tilemap first before saving your level. I think if you do that you should be ok. I've also experienced the problem you are talking about, but I think I've only had the problem when I forgot to the save the tilemap. Whenever you add a new tilemap and edit it, you need to save it first as a xxx.lyr file.
#2
07/02/2010 (6:43 pm)
You should see a "Save Layer" button in the editor.
#3
07/02/2010 (7:52 pm)
ya as soon as I save it (xxx.lyr) it disapears (or resets) in tgb
is there somewhere special i need to save it?
right now it's in game/data/tilemaps

i tried saving the lyr before saving the level
same thing
#4
07/02/2010 (8:41 pm)
Hmm, not sure what to say then. I've not experienced this problem, but I do all of my level editing using the Windows version, and I only move to the Mac when I want to test the code. Perhaps it is a bug. I will try it on the Mac version to see what happens, and I'll let you know.

Do you have a PC, so that you could try the same thing using the Windows version?

BTW, I am using version 1.3.1 also.
#5
07/02/2010 (8:56 pm)
serialization of layers has had some ugly problems with 1.3.x
#6
07/02/2010 (9:02 pm)
ok I'll try the editor on my windows box
#7
07/02/2010 (10:05 pm)
Marc, what do you mean by serialization of layers? You always talk complicated language that seems to have no direct relevance to the thread.

I've been using tilemap layers since day one, and I've not had any problems.

Dan, just ignore the BS. Trust me, tilemaps work.
#8
07/02/2010 (10:40 pm)
serialization has nothing to do with "complicated". Thats the regular term for storing and retrieving data and actually even how its called in the code if you look in.
Its actually standard programming vocabulary.


And no, they don't work in iTGB 1.3.x, independent of the animal you take the shit from :)
When storing a layer or particle effect, it will flush the file to which you store, leaving it empty after the operation (so if you already had something in you will lose that work too)

But you can use the 1.2 editor for layers and particle effects, they will work fine.
#9
07/02/2010 (10:57 pm)
Yikes What a mess
I didn't see that in the docs

@MarK you are running 1.3.1 and can save layers/particle effects?

@MarC that's exactly what's happening to me.
#10
07/03/2010 (2:51 pm)
Dan, yes, I'm using tilemaps and particle effects, and no, I haven't had an serialization problems. Tilemaps are an essential part of the way I've designed my game levels, so if tilemaps did not work I would have abandoned Torque ages ago and moved to a completely different engine.

I have noticed one problem that seems to be common to both particles and tilemaps (so this might be what Marc is talking about). I've found that I can only save them once, and if I want to edit one of them I have to save it with a different file name, otherwise it won't work. This might be the problem you are describing? There is a simple workaround though, just save it with a different filename, delete the previous one and then rename the new one.

#11
07/03/2010 (5:47 pm)
ok so on the PC 1.3.1 seems to be working with saving tilemaps and effects
so i copy the MyGame folder to the Mac:
I can get the editor playing the game on mac- but when i try to deploy to ipad - no images (actually what looks like the edge of a white box)
i will try the iphone instead of the ipad just incase that's what's causing it

@MarK after the PC, what is your workflow to get it on the device?

thanks
#12
07/03/2010 (6:00 pm)
Dan, it seems like you've made some progress, so that's good news.

My general workflow is as follows:

1) Any level editing, creating tilemaps, animations etc, is done using the Windows version of iTGB.

2) Initial testing of my script code is done using Torsion, with the Windows version of iTGB.

3) Initial testing of any C++ code that I develop is done using Visual Studio 2005, in Windows.

4) Once I have the game running, with most of the obvious syntax-type bugs and simple logical errors fixed, I then move to the Mac.

5) To move my code to the Mac, I copy 2 folders plus one other file:

These two folders:
\T2D_iPhone_1_3_1\MyProjects\MyGame\projectFiles\data\*.*
\T2D_iPhone_1_3_1\MyProjects\MyGame\projectFiles\game\*.*
Plus the project file:
\T2D_iPhone_1_3_1\MyProjects\MyGame\projectFiles\project.t2dProj

and I copy those to my Mac project, which overwrites those files. This copies all of your scripts, and all of your data (images, sound files etc).

I don't touch any of the common files. I think there are some differences in the common files, so don't copy those otherwise you'll experience some weird problems.
#13
07/03/2010 (8:05 pm)
hey thanks
my data folder is in my game folder game/data,
anyway, using your method i was able to get it running in the editor on the mac
but no deploy- just a blank screen

what build# do you build for? and could i get your other settings in xcode?

clean dso
clean targets
clean out user/apps/roaming ..whatever

when do you do those and why?

touch/untouch- in xcode, what does that do?

thanks


#14
07/03/2010 (8:17 pm)
Well, that's good progress I think. Getting things to run for the first time on the device isn't trivial, trust me, so progress is good in my opinion.

I think to begin with I would clean everything. Clean DSOs, and clean all targets. I'm not really an expert using XCode, and I don't find it as easy to use compared to VS. For some reason, incremental builds don't seem to work well in Xcode (i.e. when you only change one or two files, and don't do a clean all), and sometimes new changes are not picked up properly. It's possible that I'm doing something wrong in XCode, but I've never seen this problem when I use VS. In any case, until you get something working I'd recommend just doing a clean all and rebuild from scratch. It takes a while (a few minutes), but it's the only way to know for sure that everything is getting compiled and linked correctly.

If it runs ok in the editor, you must be very close, because normally whenever I get mine running in the editor it has always worked fine on the device. Have you tried using the simulator?
#15
07/04/2010 (7:52 am)
IT WORKS!
DEPLOYED!!

like a new baby it just happened, im staring at it

thanks



#16
07/04/2010 (11:15 pm)
Dan, that's awesome. Glad to hear that you managed to get it working on the device.