TJ again,
This week involved changing our code to meet a new coding standard. WE had a document that had some guidelines on what to do in terms of variable naming schemes and such, but it was for C++ and was made for custom engines, Our team needed C# examples, and had to use unity's built in datatypes and functions. I went ahead and fixed up the original coding standard documentation to better suit our project. I came up with rules and conventions to follow to better utilize newer visual studio 2022 features for a more efficient coding environment. It wasn't hard just time consuming.
The hard part was implementing it. The refactoring part wasn't hard either, but the thing is, The first script I changed was the game manager. The Game manager is the lifeblood of most of the scripts in the game because it has globalized data for every other script to access and it also handles the flow of the game. By changing the variable names to fit the new standard, it ended up messing with other peoples scripts. Every time the other scripts used the game managers variables, they all had to be changed to reflect the new variable names. This made it hard to work simultaneously because it someone else made changes to their scripts it would conflict with my changes to the variable names. We also were not aware that the same changes were affecting the editor as well, so not only were the scripts falling apart, but the unity editor was changing as well and causing all sorts of features to break.
Eventually, we all stopped working on things and we had to work together to make sure everything in the repo was sorted out, and then go into the project and make sure everything in the editor was setup properly. During this time we discovered ways to make individual scripts and features not so dependent on each other so if it were to happen again, (which it might because not everyone is done refactoring) it won't break so many things all at once and people can keep working.
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.