Hello there and welcome back to Metalspy's wondrous game (development) blog!
About four months ago I posted about my first steps using UDK, mainly as a preparation for my internship at a (small) game company. In those four months I have barely done any game development, or software development in general, in my spare time. A lack of time and especially a lack of energy prevented me from doing so. Last week however I got a sudden boost of motivation and energy, so I launched UDK and Visual Studio to finally continue my work on my game project. Oh my, was I in for a surprise. As soon as I exited "Play in editor" mode, the UDK editor crashed. According to the log this was caused by my own code. Diving into the code to fix the error I was met by a second surprise: the code I had written in my 'UDK beginner phase' was ugly, lacked organisation and did not allow a lot of easy expansion of the existing feature. So I decided to throw everything away (it was uploaded to a repository so it wouldn't be permanently lost anyway) and start all over. I did this with the following goals in mind:
- Write easy-to-maintain code with a decent, modular and easily extendable 'architecture'
- Only derive from standard engine classes, not from UDK or UT classes, to prevent having a lot of unused variables and functions
- Apply the new code conventions I have picked up a few weeks back to (hopefully) improve readability
- Use plenty of comments, so other (new) UDK users can easily understand what is going on (I consider releasing the project's source code in a later stadium)
- EDIT (2013-12-28): After reading the first chapters of Robert C. Martin's "Clean Code" (ISBN-10 0-13-235088-2) the last two points above have changed to "apply the lessons learnt from reading Clean Code to make the code readable for new users and improve maintainability".
(Basically: write good software that's accessible to beginners!)
After approximately six hours of work I had set up and recreated most of my previous work (which wasn't all that much and certainly nothing special). Four months ago that took me FOUR WEEKS. This time my code was shorter, a lot better organized and easy to expand. It even changes the material of the object during the placement phase and allows the player to rotate the object (s)he is placing, which was not possible before. Working full-time with UDK during my internship certainly allowed me to gain a lot of experience! And the most important thing: I had a lot of fun during those six hours of developing. I definitely hope I won't lose this energy and motivation anytime soon so I can create a prototype of the game I had in mind!
Anyway, here are some screenshots of the current state. It's basically the same as last time, but the code that's running under the hood is way better :)
1. Placement phase
2. Result after placement phase