Excerpt from tile save file
1|grass|a|(25, 25)
2|stone|a|(75, 25)
3|grass|a|(125, 25)
4|grass|a|(175, 25)
5|grass|b|(225, 25)
6|grass|a|(275, 25)
7|grass|a|(325, 25)
8|grass|a|(375, 25)
9|grass|a|(425, 25)
10|grass|b|(475, 25)
11|grass|b|(525, 25)
12|grass|a|(575, 25)
13|wood|a|(625, 25)
14|grass|a|(675, 25)
15|grass|a|(725, 25)
16|grass|b|(775, 25)
17|grass|a|(825, 25)
18|wood|b|(875, 25)
19|wood|a|(925, 25)
20|grass|a|(975, 25)
21|grass|b|(1025, 25)
22|wood|a|(1075, 25)
23|grass|a|(1125, 25)
24|grass|a|(1175, 25)
25|grass|a|(1225, 25)
26|grass|a|(1275, 25)
The tiles are stored in this format for now, so if you ever want to change the type of a certain tile (you big cheater) then just edit the wood/grass/stone entry in the save file (/township-pre-alpha/saves/1/tiles.twn). Never change the tuple of numbers though, or you will run the risk of messing your map up.
The code for saving this is really simple...
# Save tiles
tileFile = open('./saves/' + str(mapnumber) + '/tiles.twn', 'w')
for tile in tiles:
tosave = str(tile.id) + '|' + str(tile.type) + '|' + str(tile.variation) + '|' + str(tile.center) + '\n'
tileFile.write(tosave)
Other things like buildings, creeps and villagers are stored in a similar format.
Sorry for not yet updating the .zip, its exam time atm so I was revising instead of having free time.
Also, the creeps only work slightly better, in that they tend to move rather than jitter now, but they still aren't reliable. I'm going to totally recode them sometime. Probably after saving/loading is working and I update the zip.