31 Jul 2013
July 2013 - PenTest
3dunity7drtsactionmultiplayeronlinepostmortemdigital

I don't know why I choose to abuse myself this way. It's not hard enough to find time between family and a full-time development job to get one game done each month, oh no. This month I had to go and decide to unofficially try out a mini-jam, specifically 7dRTS, and even better, to make it online multiplayer, which I knew essentially nothing about.

And that's how I ended up with PenTest.

The Concept

So the ingredients in this month's experiment were:

RTS
Testing the waters of participating in mini-jams, I made this an unofficial 7dRTS project, which is to say I don't have a Ludum Dare profile or anything yet - I just forced myself to make a game during the jam window that's both real time and has some form of strategy involved.
Online Multiplayer
This is a fairly fundamental component of gaming that I knew very little about, so I figured it was time I fixed that.
Metal
This month's 1GAM theme gave me what little theme and presentation I managed to squeeze into my time limit. Robots, digital landscape, circuit boards — metal.

7dRTS

I did really want to stick to the rules of the jam even if I was just doing it on my own as practice, and luckily the definition of "RTS" for this jam was pretty flexible. What I ended up with feels like it landed somewhere between Burn Zombie Burn and scriptwelder's Primal Sands - a central target has to be defended from waves of attackers, tower defense style, without the pre-set attack paths of a typical tower defense game.


PenTest is specifically designed such that you don't have anywhere near enough direct firepower from your towers to defend the core after the first couple of waves. The main play mechanic and the place where strategy is involved is in the ability to generate barriers, which the attackers have to pathfind around to reach the core. Blocking their paths intelligently with your limited barriers will force them to spend time finding their way around obstacles while your towers wear them down.

The progression path is fairly straigthforward from that point - attackers drop piles of scrap when defeated, which you can gather as currency. Three upgrades are available (more barriers, more towers, stronger towers), at increasing costs, while the waves of attackers grow stronger and more frequent. Nothing terribly complicated, but I enjoyed making a game where a central mechanic involves exploiting your enemies' pathfinding logic to force them to move where you want them to maximize the effect of your limited towers.

I also took some admittedly sick pleasure in making your barrier limit, tower limit, scrap total and upgrade choices shared between both players in multiplayer, so your choices can complicate things for the other player if you don't adapt quickly and carefully.

Online Multiplayer

I happened to read Paladin Studios' very helpful Unity networking tutorial just before hearing about 7dRTS, and that basically sealed my fate here. I decided my project needed online multiplayer.

Luckily my day job involves a lot of custom programming of network communication protocols, so I got up to speed conceptually pretty quickly, and mostly just needed to learn how Unity handled this stuff.

What I ended up with still has the bones from that tutorial, but as an experiment I decided to rework it to be entirely server-authoritative, which is to say the server is responsible for the actions of all objects and propogating the updates out to clients, while the clients only send keyboard/mouse input and a few remote procedure calls to the server, and once I got my head wrapped around managing how the code for various objects behaved differently based on ownership, I got that part working fairly well, I think. It's definitely at least a good start that I should be able to clean up and extend for any future online projects I may decide to attempt.

Presentation

I very specifically forced myself to almost entirely ignore presentation to keep myself on schedule. The play area is a dark simple grid, barriers are cubes, towers are just shorter barriers with spheres on top that fire cylinders with rotating textures on their materials, and nearly every visible texture and bump map is either the grid or a single circuit board image. The player and all creeps are just slightly differently scaled and re-colored instances of the Robot Kyle mesh distributed by Unity, and the UI is a combination of 3D text meshes and Unity's default UI system. Given time, there are plenty of places where a little attention to presentation would go a long way (no sound effects, creeps spawn and despawn without any visual effect, a minimap would sure be nice, etc.) but just getting everything playable pretty much ran out the clock for me.

Luckily I could at least include some fitting music from my usual supplier, Ben Freund. Ben's music is available on his SoundCloud page.

The Verdict

Given the time frame and the amount of new material I was trying to cram into my brain last week, I'm thrilled that this is even playable, and I'm happy that it at least has something going for it, in the form of exploiting naive pathfinding as a gameplay element. It runs, it's real time, there's some minor strategy involved, and it was playable on time, so I'm happy.

Note: the following builds are available for testing purposes but I don't have the ability to test them. These are Unity builds so I don't anticipate any serious issues, but I can't vouch for correctness or performance of these builds.