Repository navigation
Development Issues
5. A few significant issues during development and how they were overcome, as well as a discussion of the suitability of the tools for the application (eg. Java).
During the development process of our game, we came across lots of minor issues which were overcome after doing some research into the problem. The scale of these issues is what every programmer would come across during the coding process. However, some significant issues were identified towards the end of the game development process. This includes our biggest issue, the idea of memory leaks on the Linux OS.
Towards the end of the project, whilst we started testing the game iteratively on the university desktops, we noticed that our game was failing to load images and functionality of the game was failing after running for a certain amount of time. Upon compilation, we started getting errors stating there was “no space left on device.” Thinking the problem may have been external, a total of 36 man hours of debugging and research were carried out to identify and overcome the problem. Using software tools such as Visual VM, we were able to monitor heap space and heap dumps and were able to identify where and why the program behaviour was as such.
Eventually, the problem was identified as a memory leak, where Linux did not provide enough dynamic space for the Java IDE to run. The same Java application, being run on Windows OS as a .jar file was working perfectly fine. We established that Windows has a default way of managing memory leaks and therefore was able to perform without errors. Looking back over the code, we were able to identify the reason for such behaviour. We were constantly calling the GameFont class which read the I/O Font File. This was being called within the render() function which was being performed 1000 times every second. This caused the heap to overload and therefore was unable to carry out any other I/O function calls. This significant issue cost the team a lot of time but also taught a valuable lesson. It was surprising to see that the smallest file was causing the biggest issue within our game.
While the game could have been developed in C++, a Java IDE was a suitable tool for development as it contained default packages including Swing, Awt and Canvas. This allowed smooth development of the game within the specified time. Java, unlike C++, has a garbage collector which is managed at runtime. This makes coding easier and less prone to errors. This is one of the main reasons for using Java as a tool for application developments.
Furthermore, developing the game in Java opens the publication to Android and the open Web. Java is primarily used in android games and is the primary language for that platform. Similarly, web-based games run in Java. This allows the game to be publishable if it comes in popular demand.
https://github.com/uoa-cs302/2019-Java-Group10/wiki/General-Discussion