The Basic Process

When I start a new Script, I always consider this first: What do I need? By this, I’m referring to what variables I’ll be needing in the script. These could be in-game objects that I’m either changing or collecting information from, arbitrary values that I’d need to change later for balancing or values that I need other scripts to be aware of. At this point, it would be sensible to note these down and start designing the code. Instead, I declare the variables, and start writing the script. Not the smartest way, but I prefer to solve issues as they arise.

I do this by developing the script essentially one action at a time. Add, then test, edit, test etc. until that single item is complete (e.g. a few lines of error handling, a Switch Case or an If statement). Then, I move onto the next small item. By tackling the issue bit by bit, I always feel less daunted by the task as a whole, limiting my vision of it to a single part. This does have a tendecy to cause issues based around each part failing to work together properly, but so far these issues have failed to take longer than a quick fix to correct.

As for developing each small piece, I have two primary tactics that I use in the same order every time. First, I check the API for the IDE or Language I’m developing in, whichever is most appropriate, for the details on whatever the focus of the piece is (e.g. searching for Unity’s API entry on Buttons when trying to figure out how to create an event listener for its OnClick). I leave that tab open, typically on a second screen, for reference whilst I type up the code.
Then, when the issues invariably arise, I scour forums for cases of similiar issues, read the provided answers to try and work out what their code is doing, and use the new knowledge to try and fix the code.

And that’s all there really is to it. If I get especially stuck, I call on some friends who are more adept at coding then we look through the code together until a solution is found.

Leave a comment