About Map Files

🚧

These sample maps only work with an unedited copy of the kit

Once you start customizing your game, these files will not work as your game may no longer have these prefabs and attempting to load these original maps will cause unexpected errors.
Create your own sample map set after developing your game by building your base in Unity and pressing Local Save. Retrieve the save file from your computer files and keep for later use.

What are map files?

Every map file contains all the player data. If loaded into the game, it will prefill all the settings including buildings, active construction projects, trees and other terrain objects, troops trained, and other stats.

We've built a few premade bases using the Complete Strategy Kit v7.2 for testing. They are included in the server download player files but you can also get a copy from this page below in the dropbox download link.

When you test your game with the CityBuildingKit.com demo server using your license code, Server Load, Campaign, and Battles load these sample maps.

What is the Player ID?

Player ID is the unique map file name. For example if the Player ID is demouser then the map file will be saved like demouser.txt

Player ID is saved and retrieved locally here on your computer:
C:\Users\user\AppData\LocalLow\StartupKits\StrategyKit\MyMapID.txt

(By the way, the player name that shows next to the XP in the Player Stats is a text label set in the Stats.cs script - you can customize this or remove it depending on your game needs. For now it's just a placeholder.)

Can I add a login system to my game to load player map files?

The idea can be worked into the existing demo scripts: storing a one-way hash of the password with the player save data and using the player ID variable as the username. All you would have to do is setup a login menu which uses the the existing SaveLoadWWW system to download the PlayerID (username) and check the player's typed password with the one-way hashed password in the saved player data. If it matches - load otherwise show an error message.

How can I use these maps?

There are 3 ways you can use these sample map files:

UsageDescription
Load for TestingLoad these demo maps for your player base. By default when testing with the city building kit demo server, we are actually loading these demo map files to your game when you press Server Load.
Preseed Enemy Player Battle MapsFor competition, preseed your enemy base search with these battle maps
Seed Maps for Campaign BattlesThe 20 campaign battle buttons in the game Campaign menu each call their own battle map. We've designed a few you can use to preseed your campaign battle maps.

Player / Campaign Map Files

Get all the demo player map files included in a zip together in the link below. These map files will only work with the original strategy kit.

👍

v6.0 Sample Maps Download Link

https://www.dropbox.com/s/34p2ly8wqwxyjn6/v6_demo_map_files.zip?dl=0

Player and campaign map files are exactly the same so creating these files for your game is easy. (See the section below on how to create your own map files)

Map FilenameDescription
demoplayer5,demoplayer6,demoplayer7The sample player maps. Player maps can have any filename, so we called these three maps demoplayer5-demoplayer7
0000camp00-0000camp20The 21 campaign maps. Campaign maps must use the same filename order as the script loads them by calling these exact filenames (#00-20)

Map File Structure

The following is a table breakdown of how map files are created. All of this data is saved by the Scripts/Save/SaveLoadMap.cs script under the SaveGame() function.

Section SegmentDescription
###StartofFile###Checked by ServerLoadWWW.cs to verify the player data has been successfully uploaded.
###PosStruct###A list of the player structures and their grid coordinates.
###GridStruct###A list of the player walls and their grid coordinates.
###Construction###A list of any ongoing player constructions, timer data, and their grid coordinates. If the time has passed, on load the construction is removed from this section and changes to a structure.
###Removables###A list of terrain obstacles and their grid coordinates.
###RemovableTimers###A list of any ongoing player terrain object removals, timer data, and their grid coordinates. If the time has passed, on load the removable is removed from this section and changes to a structure.
###Numerics###Array data like structure storage data, units in training, and other units the player has already trained in their population
###Stats###Stats, experience, gold, crystals, sound settings, tutorials seen, and other player data.
###UnitsInfo###A list of game units.
###EndofFile###Checked by ServerLoadWWW.cs to verify the player data has been successfully uploaded.

Map File Item Structure

A sample item from the map:

WoodFence,WoodEndSW,116,2,3

The following table is a breakdown of one of the items in the Map file so you understand what is done by Scripts/Save/SaveLoadMap.cs

ItemDescription
WoodFenceObject Class (structureClass)
WoodEndSWObject Type (structureType)
116Unique Object Index (structureIndex)
(this left blank on purpose)For walls, not used. (grassType) For buildings, grass patch size under, e.g. 1 = 1x1, 2 = 2x2 or 3 = 3x3.
2Row #2 (transform.position.x)
3Column #3 (transform.position.y)

Map File Example

A sample map player base with one cannon, two storage barrels, a fence, and trees and clam terrain objects.

###StartofFile###
###PosStruct###
Weapon,Cannon,118,2,-384,362
Building,Barrel,119,3,-128,633.5
Building,Barrel,120,3,-768,181
###GridStruct###
WoodFence,WoodFenceNE,93,22,15
WoodFence,WoodFenceNE,94,22,16
WoodFence,WoodFenceNE,95,22,17
WoodFence,WoodFenceNE,96,22,18
WoodFence,WoodFenceNE,97,22,19
WoodFence,WoodFenceNE,98,22,20
WoodFence,WoodFenceNE,99,22,21
WoodFence,WoodFenceNE,100,22,22
WoodFence,WoodCornerS,101,17,14
WoodFence,WoodCornerW,102,22,14
WoodFence,WoodFenceNW,103,21,14
WoodFence,WoodFenceNW,104,20,14
WoodFence,WoodFenceNW,105,19,14
WoodFence,WoodFenceNW,106,18,14
WoodFence,WoodCornerN,107,22,23
WoodFence,WoodFenceNW,110,21,23
WoodFence,WoodFenceNW,111,20,23
WoodFence,WoodFenceNW,112,19,23
WoodFence,WoodFenceNW,113,18,23
WoodFence,WoodCornerE,115,17,23
WoodFence,WoodEndSW,116,17,22
WoodFence,WoodEndNE,117,17,15
###Construction###
###Removables###
TreeA,0,0,2,30
ClamA,2,0,3,4
ClamA,3,0,3,6
TreeA,4,0,3,7
TreeD,5,0,3,31
TreeC,6,0,4,12
ClamA,7,0,4,23
ClamA,8,0,4,27
ClamB,9,0,5,22
TreeD,10,0,5,30
TreeB,11,0,6,9
TreeB,12,0,6,22
TreeA,13,0,6,33
TreeC,14,0,7,17
ClamC,15,0,7,18
ClamC,16,0,7,23
TreeD,17,0,8,12
TreeB,18,0,8,17
ClamA,19,0,8,19
ClamB,20,0,8,32
TreeB,21,0,8,33
TreeA,22,0,9,6
ClamA,23,0,9,18
ClamB,24,0,9,20
TreeD,25,0,9,21
ClamA,26,0,9,31
ClamA,27,0,10,5
TreeB,28,0,10,7
TreeB,29,0,10,12
TreeA,30,0,11,9
ClamA,31,0,11,18
TreeD,32,0,11,30
TreeB,33,0,11,33
TreeC,34,0,13,5
ClamC,35,0,13,14
ClamA,36,0,13,26
ClamA,37,0,14,7
TreeA,38,0,14,14
TreeA,39,0,15,8
TreeC,40,0,15,29
TreeB,41,0,16,12
ClamC,43,0,16,29
TreeD,44,0,17,5
ClamC,46,0,18,3
ClamA,48,0,18,28
TreeA,49,0,18,30
TreeD,50,0,19,6
TreeC,53,0,20,26
ClamC,54,0,20,28
TreeA,55,0,21,5
TreeC,57,0,21,26
ClamB,58,0,22,3
TreeA,59,0,22,25
TreeB,60,0,23,32
TreeB,61,0,24,14
TreeA,62,0,24,26
TreeB,63,0,25,5
TreeA,64,0,25,16
ClamC,65,0,25,17
ClamC,66,0,25,20
TreeC,67,0,26,8
TreeD,68,0,26,9
TreeD,69,0,26,10
TreeD,70,0,26,16
TreeC,71,0,26,23
TreeA,72,0,26,24
TreeC,73,0,27,5
TreeA,74,0,27,9
ClamA,75,0,27,16
TreeB,76,0,27,31
TreeC,77,0,28,9
ClamB,78,0,28,13
ClamC,79,0,28,15
TreeA,80,0,28,20
ClamA,81,0,28,25
TreeC,82,0,29,14
TreeB,83,0,29,15
TreeB,84,0,29,16
ClamB,85,0,29,19
ClamC,86,0,29,22
TreeA,87,0,29,33
TreeA,88,0,31,22
TreeC,89,0,31,29
ClamB,90,0,32,31
ClamB,91,0,33,6
ClamC,92,0,33,16
###RemovableTimers###
###Numerics###
120,117,118
0.00,0
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
0,0,0,0,0,0,0,0,0,0
###Stats###
120,342,1,0,0,100,496400,499900,6696,500000,505000,7502,True,True,True,True,True
11/10/2016 9:35:58 PM
###EndofFile###

How can I create my own map files?

Using the City Building Kit in Unity, design your map and then press Local Save to store a copy of the map file on your computer. Retrieve this copy and keep it for further use. Stop the scene and start it again to build another.

Alternatively, you can press Server Save to save a copy online. Just make sure to change the ID in case you accidentally overwrite it when building another map.

How about creating campaign map files?

Same thing as normal map files - but they need a special file name in the server map folder. There are 21 campaign maps 0000camp00-0000camp20. Campaign maps must use the same filename order as the script loads them by calling these exact filenames (#00-20)

What's the difference between player files and campaign files?

686

Campaign maps screen.

510

Click and drag the screen in Unity to see more campaign maps.

FilenameDescription
0000camp00.txtThe first campaign (most left button)
0000camp01.txtThe second campaign map
0000camp02.txtThe third campaign map
0000camp03.txtThe fourth campaign map
0000camp04.txtThe fifth campaign map
0000camp05.txtThe sixth campaign map
0000camp06.txtThe seventh campaign map
0000camp07.txtThe eighth campaign map
0000camp08.txtThe ninth campaign map
0000camp09.txtThe tenth campaign map
0000camp10.txtThe eleventh campaign map
0000camp11.txtThe twelfth campaign map
0000camp12.txtThe thirteenth campaign map
0000camp13.txtThe fourteenth campaign map
0000camp14.txtThe fifteenth campaign map
0000camp15.txtThe sixteen campaign map
0000camp16.txtThe seventeenth campaign map
0000camp17.txtThe eighteenth campaign map
0000camp18.txtThe nineteenth campaign map
0000camp19.txtThe twentieth campaign map
0000camp20.txtThe last campaign map at the furthest right of the screen.