In short – lots of work got done, I redid a lot of stuff and it’s nearly there (again!)
The Backstory
To explain the amount I’ve done, I need to go back to the scale of the original setup. This was my first “big” game, so I used the lifeline that was visual scripting to help me structure the project and make sense of the darn thing. After all, I tend to flow chart on a whiteboard anyway, so it was a great thing.
Only… the data storage… the data storage. I had a functional system using xml files to store data entries for a save, they then got loaded up into hash tables, lovely stuff. Only…the hash table system I was using… only supported ints, floats, strings etc. This meant that every parameter in the game data had to be stored in a separate hash table. This is generally considered a terrible idea – what if the records on each table get out of sync and you give the wrong wrestler the title or store it in the wrong place due to being tired when coding and not realising?
Not to mention… the flow charts…
The flow charts…
To load up one save took 4 flow charts (FSMs to be precise)… it was not pretty, it had 90 nodes on some of them. Adding a new feature could take months to iron out every change or reference that needed to be added/updated. Then came the bugs. There was so many moving parts and it often stopped working. Testers (thanks again everyone!) were losing saves, or worse couldn’t get it to open as the settings file had been corrupted! This left them with a load screen and deafening music blaring (it had dumped the volume preference).
The solution
I was not pleased and decided to look into simplification. I actually learnt to code, partly due to my shiny new Unity job, and partly out of a desire to make my life easier. The plan was to create a data structure that could store the data – no more hash tables – just classes stored in data, that could be called with for example:
save.instance.wrestler[“Raymondo”].popularity = 50
This sentence here would have normally involved at least 5 nodes of visual scripting. It would need nodes for error handling, getting the number, converting the text to a float, setting the number, storing it again. The scale was just getting silly and the potential of a one-line solution sounded fantastic.
The future
In the space of a month, I have rewritten the lion’s share of CWL code; I’m adding in features over the course of a night in some cases! Not only that, it’s followable, clean code. I can actually explain it to people when they ask! I’m in a much better place to see the project through. Localisation is pretty much done, and the core of that only took 2 evenings to implement due to my system being so easy to set up! I can’t stress how much better the game is to work on.
In the near future there will be a test build for everyone. I hope that the time between the builds (the last was November 2020) and now will be worth it.