XaiJu
Puppygames
Puppygames

patreon


Bitrot

Do you know, I've been working on Battledroid now for 8 years. I measure its development time by noting the advancing years of my eldest daughter. She was 2 when I started it. She's now 10. She cannot remember a time in her entire life that I wasn't making Battledroid.

It's been in development for so long that bits of it have been slowly crumbling away, in the same way that finished products that need supporting will gradually crumble and need patching as the rug gets slowly inched from under them. (I'm looking at you Apple).

The underlying code framework upon which Battledroid is built was begun in 2000 and saw the first light of day in an actual game in 2003 with the release of Alien Flux. It was, shall we say, a bit idiosyncratic. It's grown, evolved, and be rewritten no less than four times in the intervening 15 years or so, from JGLIB to SPGL to SPGL2 and now finally the latest and greatest incarnation, SPGL3.

Certain pain points have been bothering me for all that time and I'm determined to deal with them this time.

Firstly, XML. XML is developed by one of the devil's own minions and it really does suck as a way of defining resource data for games. It's pernickety, verbose, complex, and strangely inflexible in some of the ways you need it to not be. Chaz doesn't like it either, and he's the one that fiddles with it the most. So I've replaced all the XML with a brand new DSL for defining data, called THJSON. It stands for "Tagged Human JSON". I've already opened the source to this on Github but I need to upload the latest and greatest code.

Secondly, resource loading and creation. It's always bothered me that starting the game up takes so long (used to be 10 seconds on spinning rust - cut to 4 seconds with SSD). It's also always slightly irked me that all my resources had to implement a specific interface, which means I couldn't just plonk something in my resources that came from somebody else's library or framework. So that's been replaced with my new Resources library. This, at the root of it all, is a dictionary of resource names to POJOs (that's Plain Old Java Objects to the lay). It can load resources from THJSON by means most ingenious. It's pretty well extensible and compatible with mostly any other libraries by way of configuration APIs. It's also got some nifty multi-threading going on in it which has enabled me to slash game resource creation time in half to just 2 seconds (the gap will widen further when there are a very large number of resources in the game, as there will eventually be). This too I plan to open-source.

Thirdly, LWJGL2. LWJGL2 has been kicking around since the mid-2000s, and I think even Minecraft might still be based on it. It's no longer maintained, is missing newer and nicer ways of doing things, and has a few pesky shortcomings. I need to migrate to LWJGL3 which is actively and fairly aggressively maintained by Spasi and friends at lwjgl.org.

Finally, JDK8. I've been veeeery slowly following Java's evolution over the years, and the reason for that is because Java evolved veeeery slowly itself. Then there was this cataclysmic schism with JDK9, which introduced the Byzantine complexity of the so-called Java Module System (also known as the Everything That Used To Work Is Now Broken System). Then it's rapidly been firing out new JDKs every six months and eludes my grasp like a bar of soap in the bath. To make matters more amusing free Oracle JDK8 support is officially ending or ended by the time you read this so we need to update to OpenJDK 11. OpenJDK 12 would be nice except for Eclipse doesn't support it properly and even the 11 support is sketchy.

So far I've managed to port SPGL2 to SPGL3, port Battledroid to SPGL3, and convert something like 60 XML files into THJSON in the process. There are a few small bugs that have crept in which I'm in the process of squishing before we move on to the next step (LWJGL3). It's always best to move on from a position of everything working absolutely 100% perfectly.

Once we're on Java 11, the fun can actually begin: the integration of the Voxoid 3D voxel engine into SPGL3 and the deployment screen!

Sorry it's taking so long, but I've still gotta work mostly full-time in the oil industry :(


Bitrot

Comments

<p>Spite the Bitrot, it sounds like a lot of progress is being made! </p><p><b>HJSON</b> and <b>THJSON</b> are interesting. Used somthing similar for a few years called <a href="https://github.com/lightbend/config/blob/master/HOCON.md" rel="nofollow noopener" target="_blank"><b>HOCON</b></a> (<i>Human-Optimized Config Object Notation</i>). Comes with a nice parsing library too. Combined with <a href="https://github.com/FasterXML/jackson-databind" rel="nofollow noopener" target="_blank"><b>Jackson Databind</b></a> makes for a nice serialization pipeline. </p><p>Keep up the good work! And the offer still stands if you need help. I was a Java guy for 15+ years and wouldn't mind taking off my Go hat for my Java one for a bit :)</p>

Matthew Nicholls

Reading this I realize I almost have a fetish for porting and updating things, so much so it gets in the way of doing actual work. Sounds like a lot of good work has been done though! Long live JSON

Patrick Kennedy


More Creators