Hey guys So my game has 3 layers to the Game Levels. Islands - Kingdoms - Towns Each Island has x number of Kingdoms to it and each Kingdom has y number of Towns in it. To start with, Ive got 2 Islands 7 Kingdoms in total 350 Levels in total I have an Island Class that holds the total points of the kingdoms and a Dictionary of Kingdoms. Each Kingdom holds the total points of the Towns and a collection of Towns Each Town has the points obtained in it. The Towns hold in various data such as stars obtained, level setup info, score (population), etc. Code (CSharp): _IslandInfo = new Dictionary<ISLAND_NAMES, IslandInfo> (); #region Island 1 //ISLAND DATABASE _IslandInfo.Add(ISLAND_NAMES.Island1, new IslandInfo () { name = ISLAND_NAMES.Island1, //Add a Kingdom to Island 1 kingdomInfo = new Dictionary<KINGDOM_NAMES, KingdomInfo> () { {KINGDOM_NAMES.Island1_Kingdom1, new KingdomInfo () { name = KINGDOM_NAMES.Island1_Kingdom1, //Add levels to the Kingdom levelInfo = new LevelInfo[] { new LevelInfo () { basePopulation = 100, starValues = new int[]{ 1000, 5000, 10000 }, levelMakeup = LEVEL_MAKEUP.GRID_4x4 }, new LevelInfo () { basePopulation = 1000, starValues = new int[]{ 2500, 7000, 12000 }, levelMakeup = LEVEL_MAKEUP.GRID_5x5 }, new LevelInfo () { basePopulation = 5000, starValues = new int[]{ 4000, 6500, 10000 }, levelMakeup = LEVEL_MAKEUP.GRID_6x6 } }, } }, //Add another Kingdom {KINGDOM_NAMES.Island1_Kingdom2, new KingdomInfo () { name = KINGDOM_NAMES.Island1_Kingdom2, levelInfo = new LevelInfo[] { new LevelInfo () { basePopulation = 100, starValues = new int[]{ 1000, 5000, 10000 }, levelMakeup = LEVEL_MAKEUP.GRID_4x4 }, new LevelInfo () { basePopulation = 10000, starValues = new int[]{ 10000, 50000, 100000 }, levelMakeup = LEVEL_MAKEUP.GRID_4x4 } } } }, {KINGDOM_NAMES.Island1_Kingdom3, new KingdomInfo () { name = KINGDOM_NAMES.Island1_Kingdom3, levelInfo = new LevelInfo[] { new LevelInfo () { basePopulation = 100, starValues = new int[]{ 1000, 5000, 10000 }, levelMakeup = LEVEL_MAKEUP.GRID_4x4 }, new LevelInfo () { basePopulation = 10500, starValues = new int[]{ 100000, 500000, 1000000 }, levelMakeup = LEVEL_MAKEUP.GRID_4x4 }, } } } } }); #endregion This code creates the first Island in 1 line. This island has 3 kingdoms which have 3, 2 and 2 Towns in them. To figure out total Score (Population) I iterate through the Island's Kingdoms and through the Kingdom's Towns. All of this works fine, but im not sure how well this kind of system will work when it gets bigger. When I add the second Island, my total Towns will be up to about 50. The third island will bring that up to 150, etc. Is there any problems that anyone can forsee ill run in to creating a system like this? There is no 'thinking' that goes on, no level creation or anything, this is just allocating heaps of data into organised lists/dictionarys. When the levels are loaded they will be created based on this info.
It's a good start, organized into a nice hierarchical structure. But in the long run you'll find it much easier to maintain your data separately from your code. For example, you could put it in a JSON file and convert it to this data structure using JsonUtility.FromJson(). Also, if non-programming level designers join your project, they'll be able to edit data without having to touch any code.
Thanks TonyLi Before I read this I had already found, learnt and moved over to JSON. But you are right, this is definitely the right direction.