Tuesday, February 23, 2021

Java game improvement status

 I'm working on improving four long time ago abandoned games written in Java and while the progress has been rather slow in last couple of weeks compared to the beginning, I'm still making progress. I also have a better picture now regarding what can be done and what cannot. I definitely got into Java and Gradle again. Here is an unordered list of what I learned so far:

  • Refactoring Java code with IntelliJ is quite simple and safe. Reflection and use of raw types (especially mixed use) can be difficult, but otherwise everything behaves very nicely and IntelliJ is a real strength in that regard.
  • Gradle got easier over time. The plugins do more of the work with less customization needed. That is good because I mainly want to use Gradle as build system.
  • Modularization of Java code is not as cumbersome as I thought. The benefits may not be large but updating old code to use modules isn't that difficult either.
  • The transition from Swing as GUI framework to JavaFX isn't that bad either. It's important to clean up and simplify the GUI parts of old software as much as possible, but otherwise one can transition from one to the other quite nicely.
  • Packaging and distribution of Java desktop apps is easy enough with jlint now, but the sizes of the packaged app (a 200 kb jar becomes a 100 MB bundle) are crazy. Not sure if shipping a Java runtime with each and every simple, small app is really the best way to go.
  • The most time consuming factor is still understanding and refactoring the game logic. That is a task that can take weeks and is surprisingly different for every new game.
  • There is demand for serialization (storing and loading) of complex structured data (game states for example) and it's not sure currently what the most convenient format is for that (JSON, XML, some custom format, Javas own serialization format...) and equally how best to serialize/de-serialize that.

No comments:

Post a Comment