Code Restructuring


Hello everyone!

As mentioned in the previous message, I am currently working on a first update. The most interesting part of the update is quite technical. The most important thing to remember is that the changes made will make future updates much easier.

Today's paper will present these technical changes and see the consequences they will bring.

In the initial version of the game, everything you can see (resources, plants and the market) is coded independently and spread out in lines of code.

To understand the situation, it is as if you were a publisher but each machine at your disposal could only make one book. Since you want to make four different books, you must have four different production lines. You then have several problems: the multiplication of machines increases the probability of having set one of them up wrong; each machine is under-used; each new book to be manufactured requires the installation of new machines which quickly creates a little chaos.

All the work in this update consists in creating two objects: a resource object (which includes plants) and a market object. Each of these objects will have a series of characteristics. For example, we need to determine which resources can be exchanged in the market. An important part of the work is also to build the links between the different resources. For example, a mine needs cash to be built, will consume electricity and produce cash. In the first version of the game, it was quite easy to describe this whole system. However, in the current version, it is necessary to anticipate the fact that a plant could consume another resource for example.

There are also some design issues. In the original version of the game, the plants degrade with use. In an early version of the update, I added a feature to determine if a resource degrades and how fast. After some thought, I realized that this was the same as saying that the resource consumes itself. So I decided to change the way this degradation was concerned to make the code as simple as possible.

Why make such changes? For two reasons: first of all, because cleaning up your room is good. With these changes in the way the game is coded, some places become much "cleaner". Secondly, this update will introduce more flexibility to the game and allow the creation of mods which will renew a too short experience. By the way, the next update will allow to test at least one mod. Unfortunately, it will not be directly possible to create your own mods but this feature should come soon enough.

Get Market

Leave a comment

Log in with itch.io to leave a comment.