Conquest

Overview

The year is 2014[1], Java applets are still all over the internet, and I'm super into game development. But was I really? In hindsight, I was more into game engine development judging by what I spent the vast majority of my time on. At the time, I think I was also quite into StarCraft II, as well as the intro screen from Yoshi's Island on DS. I think Notch (the creator of Minecraft) was tinkering with something similar at the time and I think the name "Mini Conquest" was inspired by his Minicraft. You'll see why this is all relevant later.

Because I liked writing things from scratch, I didn't use any libraries. This had the pleasant side-effect that somehow I was able to compile and run this project on my first try, even after all these years, which I can rarely do.

All source code is on GitHub. It's possible that I wrote this before 2014 and only put it on GitHub in 2014, given that I committed all the code at once, but let's just assume it was 2014 since it would be too complicated to figure out when exactly I wrote this. I used make, so could compile with that, and ran the project with the command java -cp bin core.MiniConquest. Of course applets aren't a thing anymore, but I had the foresight to have it run standalone too for development. Behold!

RTS pathfinding

As the name "conquest" might hint to, I wanted to create a Real-Time Strategy (RTS) game. I remember watching some videos on how to make selections of units flow together as you move them around and wanted to work my way up to there. I started off with what I knew and made the "hero" use A* pathfinding. I added some panning and a little mini-map and didn't bother drawing any nice sprites. Even the Link sprites I nicked didn't have diagonal sprites so I just drew an arrow. I'm pretty sure the map loading system eventually evolved into this though.

Physics

Of course I decided to write my own physics engine. It was relatively simple AABB stuff but sometimes I look back and my old code and I'm a bit surprised that I wrote it. It's all so structured and clean, and it makes me wonder if I might not be as sharp as I once was? But at the same time, I didn't know about ECSs, overdid it a bit with the OOP, and created a lot of cognitive load with the synchronisation juggling between threads.

I can't believe I wrote my own vector, geometry, and even fast-maths functions. I even wrote my own fast sin/cos functions (cached values in an array), but remember, this isn't premature optimisation, this is learning and having fun on the journey! Holding shift let you place multiple units.

There was a notion of static units and dynamic ones. I always likes the way that zerglings move our of the way in SC2 when your marines walk through them, so I made it so that these barrels can be pushed around too.

2.5D

Now comes the fun part and the main thing that I wanted to do with all that custom rendering code. With a bunch of affine transforms centred around the middle of the screen (no perspective transforms), we can get a pretty cool effect. The sprites stay flat on top of their position, but the tiles and mini-map are scaled, skewed, rotated, translated. The only sprite with special logic is the hero, that changes the direction he's facing as you rotate the world. This lets you go from flat top-down to a pseudo-isometric view for those cinematic battles!

Multiplayer

The idea was that this is a two-player RTS where you play against an opponent. It looks like I already did the plumbing for some basic networking (one player acts as a host, the other a client) but didn't really do much more with that except have them send coordinates back and forth.

Future

I doubt I will ever do anything more with this project. It was fun at the time and a learning experience. I might one day revisit this 2.5D concept and RTS mechanics in general, but certainly not over this codebase. Feel free to tinker with this!


  1. It might not have been 2014 after all! It could have been as far back as 2012. See here for an explanation. ↩︎

Amar Memoranda > Conquest

Log

Forgotten Conquest port

A while ago I wrote about discovering a long-forgotten project from 2014 I had worked on in the past called Mini Conquest. As the kind of person who likes to try a lot of different things all the time, over my short 30 years on this earth I have forgotten about most of the things I've tried. It can therefore be quite fun to forensically try and piece together what my past self was doing. I thought I had gotten to the bottom of this project and figured it out: an old Java gamedev project that allowed me to play around with the 2.5D mechanic.

Well, it turns out that's not where it ended. Apparently, I had ported the whole thing to Javascript shortly after, meaning it actually runs in the browser, even today somehow! I had renamed it to "Conquest" by then. As was my style back then, I had 0 dependencies and wanted to write everything from scratch.

If you've read what I wrote about the last one, you might be wondering why the little Link character is no longer there, and what the deal with that house and the stick figure is. Well, turns out I decided to change genres too! It was no longer a MOBA/RTS but more like a civilisation simulator / god game.

The player can place buildings, but the units have their own AI. The house, when place, can automatically spawn a "Settler". I imagine that I probably envisioned these settlers mining and gathering resources on their own, with which you can decide what things to build next, and eventually fight other players with combat units. To be totally honest though, I no longer remember what my vision was. This forgetfulness is why I write everything down now!

The way I found out about this evolution of Mini Conquest was also kind of weird. On the 24th of January 2023, a GitHub user called markeetox forked my repo, and added continuous deployment to it via Vercel. The only evidence I have of this today is the notification email from Vercel's bot; all traces of this repo/deployment disappeared shortly after. Maybe he was just curious what this is.

I frankly don't quite understand how this works. The notification came from his repo on a thread related to a commit or something, that is apparently authored by me (since I authored the commit?) and I've been automatically subscribed in his fork? Odd!

Jul 29, 2023 • #dev #projects