This week I got nothing visible on screen done. But I am only working here…
First priority was creation of Interplanetary travel system. I effectively copied everything done in interstellar travel system to support this with a new interplanetary travel display. However, it also meant I had to think carefully map system for interstellar, interplanetary and planetary movement. In essence it was all planning with a pot of coffee and pen and paper. Frustrating but necessary work with little to show at this point.
The second priority of the week was use of JSON files. In reality what was being worked was rethinking of the directory structure and how/why these files are accessed and changed. I soon came into conclusion that there are two possible approaches:
1) Player can modify things within game going through numerous menus and inserting values she wants to use in game. For instance how galaxy is generated. This is massive undertaking from programming standpoint and effectively means building specialist campaign generator software.
2) Player can access and change JSON files used to generate things. Then she starts the game and uses files found in particular campaign setting. In essense I need Default files that are accessed first and then I need <CAMPAING_NAME> files that override key-value pairs of default files when/if necessary.
I settled to idea that I would have a Data directory which would have separate directories for Default and <MyUniverse> campaigns.
Second problem is a question of maps and other data that needs to be generated and tracked during the game. Logical answer would be some kind of database but I decided to use JSON files as interim solution. My idea was that this way I can do testing easier as these files can be manipulated into whatever I wish.
My solution was following:
First, game reads material in Default directory.
Second, game reads material in <MyUniverse> directory with the same file name(s) overriding material of the Default directory.
Third, game reads material in <MyUniverse> directory without same file name(s) adding to lists of stuff found in Default directory.
This allowed me to override everything for a total conversion or just add new stuff to test. I think that it serves to industrious player too as it allows her to flexibly add-on or even rewrite entire material if necessary.
Example on doing code:
dynamic jsonobject = JObject.Parse(Json);
foreach (JProperty iter in jsonobject)
if (iter.Name == ”GalaxySize”)
GameSettings.GalaxySize = iter.Value;
Other Things I did:
I added acknowledgements page and a simple Game Guide page to guide players how to play game with.
I made a simple random name generator which now creates random names from letters to all random star systems. It is quite crude and allows similar names (why not?) but it is a start.
Activities with Future Potential:
I decided how the game map telescopes between different layers. My original 9×9 map became SubSector. The next level was Sector made of 9×9 SubSectors and SuperSector was made of 9×9 Sectors. In order to save memory only subsector (and neighbouring subsectors) where player’s spaceship is currently is kept in memory. Nothing is generated unless player goes there. The ”generated parts of space” are simply stored in JSON files to be added when necessary.
Travel across Orbital system of individual planet is next and after that perhaps drawing a map of a planet for landing location. However, proper data files need to come out first.
Finally the game needs ”limited FTL system”. Jumping between systems and going to planets is core fun but there must be some limits to what can be done and why.
** Strategic Numbers: **
Maintainability Index: 88
Cyclomatic Complexity: 1057
Depth of Inheritance Hierarchy: 3
Class Coupling: 114
Lines of Code: 2059