Project Rework
How can I rework an entire project to be more expandable, so I can more easily add new features in the future?
SugarVita was originally created around 2017/2018. This makes some ways of working a bit out of date. Unfortunately this was not the only problem as the code was made without expansion in mind which made it very hard for me and the other intern to implement new features. The idea is to fully change the way the code together with the assets work without disturbing the overall flow of the game.
Research Methods
Library
- Best good and bad practices
As mentioned in the research question above, I want the code to be more SOLID. One of the most important things when talking about SOLID code is that code would be split into multiple classes and each class tells the developer something about what can be found inside that class. In the screenshots below you can clearly see how before there was only 1 GameManager.cs which had about 900 lines of code and did everything from instantiating players to calculating the end score. I changed it so there are multiple manager classes which all manage their own data.
Before


After

Some classes like the BagManager.cs already existed, but were stored in a completely random folder (or no folder at all), so I changed the folder structure and namespaces as well so everything was much cleaner and made more sense when trying to find what you are looking for.
For some reason the old company didn't split up the code, but they did split up all the UI panels into dozens of prefabs while the functionality and look of the panels were almost identical. Another intern fixed to problem. This merged together with my changes to make it much clearer in Unity too. Click here to have a look at his devlog entry
Results & Validation
The result is code that is better for readability, usability and expandability. This has already proven itself when fixing the bugs that occurred after implementing the virtual opponent. The code readability was much better and without it, it would've been near impossible to fix some of the bugs. All this is done without having to change the way any of the features work.
Usage
The rework is used to be able to gain time by being able to expand on the project more easily from this point on. It will also make it easier to spot bugs and overall the game now provides code that's easier to understand for new developers later on in the project.
Sources
Cuelenaere, J. J. P. (n.d.-a). Recording Virtual Opponent (Implementation). Graduation Internship Jasper Cuelenaere. Retrieved March 7, 2022, from https://graduationinternshipjaspercuelenaere.webnode.nl/devlog/virtual-opponent/recording-implementation/