Game Design, Programming and running a one-man games business…

Gratuitous Level Editor

The GSB ship editor sucked, and the custom scenario interface wasn’t a Picasso either, mainly because in both cases, I insanely bodged them at the last minute, actually using mere text files to make the assets during the games production.

Now I am less insane, I’m using a built-in level editor for GTB from the near-start, which means there is plenty of time to polish it, and indeed it will be a major component of the game. I’m hoping to encourage almost everyone who plays GTB to make their own maps, and share them, LittleBigPlanet style, rather than fencing it off as something only the hardcore modders do.

That’s the current (placeholder UI art) level editor. It has a ton of features in it. Today I was working on code that lets you take an existing level from the game, and save it out as a new custom map, whilst editing loads of parameters for that battle, hopefully in a quite straightforward manner.

Actual level editing, such as setting paths, territory for unit placement, and all the scenery, is already done, although it needs a real usability makeover before it’s considered shippable.

In other news, I got a new ipad build of GSB today. Definitely making progress, but getting a huge complex PC sim like GSB onto the ipad is no quick and easy port. It still needs some work. As does everything.
I have a day off tomorrow, hence my manic working today :D

Planning out Gratuitous Tank Battles Development

This is one of those brain-dump blog posts where I just use the blog as a public todo list…

Major Things I need to do for GTB (still remaining)

  • Support for creating new custom maps from scratch and saving them to your local disk as new singleplayer maps. (includes final work on the map editor, and support for browsing custom maps, rather than the campaign maps)
  • Support for uploading new maps as scenarios for other players to download. (system for describing a map, verifying it is valid, ensuring no content is modded, listing it in the online database, and for clients to refresh that database quickly and smoothly).
  • Code for online profiles and stats checking, player friends lists, messaging and leaderboard stuff. (Possibly including regimental banners and descriptions, and integration of that into loading screens).
  • Code to support auto-updating for direct-bought copies, with registry-enabled paths so we don’t need to tell installers wheer the game is any more.
  • Tutorial, and method to reset it in the options screen.
  • Manual
  • Re-checking the unlocking system and choosing unlocks.
  • Support for modding. Allowing new unit variations, new hulls, new ground and prop textures, new sounds.
  • Integration with steam achievements (assuming steam approves the game) and maybe other steam features.
  • Integration of final art assets for battles, and construction of the singleplayer campaign maps, enemy units.
  • Integration of final, improved menu GUI to remove all that GSB placeholder stuff from the unit design screen
  • Optimisation
  • Bug testing
  • Play Testing and Balancing

The list doesn’t see quite so terrifying when I list it like that. Maybe things aren’t as huge as they seem. I should probably start thinking about releasing some screenshots at some point.

Stripping back the game to a simple start

I’ve been having a few days of angst (ok a few weeks) regarding game design and ‘fun’ in Gratuitous Tank Battles. I guess I was panicking at the intangibility of ‘fun’ and thinking I might be constructing a huge and very elaborate ‘system’ and ‘simulation’ rather than a game. Essentially, it became clear to me that the game was a bit too much like company of heroes and not enough like chess.

Now COH is a great game, but I think it suffers a bit from unit-balance hell. This is something GSB really struggles with, especially for new players. Chess, on the other hand, is awesome in this regard.

Chess only has a handful of unit types, and their capabilities are simply explained. Chess is all about the complex interactions between simple units. This is a good game. COH and GSB are about the super-complex interactions between complex units, and a huge number of them. This is a deep, but also hard to learn, and possibly frustrating game.

I’m pretty sure I’ve sorted it all now :D. Essentially, GTB needed the starting game stripping back to very few unit types. Maybe 9 units to attack with, 9 to defend. That already makes it a fairly complex tower-defense style game. The joy of GTB is that there are so many more layers for the player to explore beyond that basic game. For example:

  1. After the player has got the hang of the basic UI and mechanics, we can flip things and make them the attacker instead of the defender. yay!
  2. After that, the player can unlock extra units on top of the starting nine. Yay!
  3. After that, the player can start to customise his units, choose different modules for them, and also edit their colors to look distinctive. Mega yay!
  4. After that, the player can try different game modes (Rush, or possibly waves rather than continous attack). And also try online challenges (eventually).
  5. After that, the player can fiddle with the built-in level editor and design their own maps either to upload and share, or to play against the AI. Woohoo!

So, if I can get that basic 9 types vs 9 types defence game working just great, then I am pretty convinced everything else will fall into place quite nicely. It just needs a ton of work, but that doesnt bother me at all. I’m just keen to get the initial mechanics of the early game to be perfect, and I made decent progress on that today :D.


Slipped back into graphics tartery…

Ok, so for a few days I was working on graphics stuff for GTB, rather than gameplay. A lot of this came about because I wanted some GUI in there for issuing movement orders to units, and that is mostly done now. It also looks pretty nice too. The idea is not that you will generally be issuing movement orders, because like most tower defence games, your troops attack on rails, but sometimes there is branching, and you might want to ensure a certain unit goes left, or right, so you can give them an override-path manually. My current thinking is that in the GSB style challenge battles, this just isn’t an option, so it retains it’s hands-off style for that game mode.

A bit of profiling through a lot of doubt over my claimed 400% increase, and it looks like it’s a lot lower than that :( I blame Visual studio often not realising it needs to overwrite an exe when you change configuration. pesky Visual Studio…

However, my profiling binge did point out something scary (and slowdown-inducing) which was that in some average night-time battles, I was calling SetRenderTarget about 45-50 times a frame. Ouch! This was mostly stuff like searchlights and laser beams, that render to the screen, then also get rendered to a light map for later composition and niceness. They were handling this individually, rather than being batched as they are now, meaning less that 18 SetRenderTargets per frame, and several more of those will get optimised away soon. Many of them are essential, for selection UI, lightmaps, shockwave distortion and fog of war.

The ups-hot of this is that I can play fullscreen, release-build 1920 x 1200 res with all graphics options on, at night-time, with toggling night vision on and off, explosions, lasers, searchlights, unit selection UI and range GUI, path selection-GUI and the windowed UI for minimaps and unit selection…. All at a consistent unwavering 60 FPS, with fraps and windows media player running in the background.


Like GSB, this will be a game that really sells itself through videos of gameplay.
Also today I might peak at 9.5kwh of power from my little garden power-station. When that pesky tree gets trimmed, it should climb even higher. Oh yeah.

400% speedup in a pesky transform thing

This code was slow*:

    D3DTLVERTEX* pvert = LocalMem;
    for(int c = 0; c < CopiedIn; c++)
        pvert[c].dvSX -= TransformX;
        pvert[c].dvSY -= TransformY;
        pvert[c].dvSX *= TransformZoom;
        pvert[c].dvSY *= TransformZoom;

This code runs in one quarter of the time:

    D3DTLVERTEX* pvert = LocalMem;
    for(int c = 0; c < CopiedIn; c++)
        pvert->dvSX -= TransformX;
        pvert->dvSY -= TransformY;
        pvert->dvSX *= TransformZoom;
        pvert->dvSY *= TransformZoom;

Pointers FTW!

I’m doing this sort of stuff now, which isn’t as fast as actually using hardware T&L, but is better than my older, hacky software transforms which happened on individual sprites, rather than at the VB level. Yeah I know… everyone uses world matrices and hardware T&L, I won’t bore you with the reasons I’m not, but there ya go. It works! (GSB uses a per-object world -> screen software transform for each object).

EDIT: These measurements may be a glitch. I’ve run and re-run, and re-run the profiler on both versions and now cannot get as big a discrepancy (although there is still a speed difference). Getting accurate measurements on a multi-core PC that has a live internet connection and various background services running is hell. Now I know why people like console dev :D

*relatively speaking.