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

Debug Tools and defensive AI.

Life is so much simpler when you bunch up all your hotkeys and toggles for debugging the game into a single menu. I feel like I have a rough idea what’s going on now. I also feel more confident about coding decent defensive AI when you play as the attacker:

The code for defending basically needs to manage three things. The play style (Is it spamming units, hoarding points, or steadily placing), The choice of units (Does the enemy have units weak Vs lasers? Are there lots of infantry needing flamethrowerising?) And the choice of unit placement. I’ve been concentrating on the unit placement debug UI today, so I can see what the AI is thinking when it chooses to place a turret at X rather than Y. More work to do, but currently it evaluates proximity to enemies, their size, victory-point value, closeness to the exit and proximity to the placement, plus it also has bonuses for being able to cover multiple paths from a single location.

It all needs lots of tweaking and balancing obviously, but it’s getting there. Attacking AI is much simpler.

After getting this stuff done, I’m thinking of experimenting with a unit ‘cooldown timer’ beyond a certain level to prevent spamming the same unit everywhere. Essentially there are supply delays if you plonk down 4 heavy tanks all very quickly, as new ones need to be dispatched from your offscreen HQ. I think it might be a good mechanic that encourages variety.

Shadow maps make me happy

I’ve been watching some WW2 footage, some war movies, some video game footage, etc, in a bid to up the visuals in GTB. A lot of it can’t be seen in a screenshot, it’s moving-picture stuff really. UI’ve also been re-visiting how I make the shadow maps, and massively boosting their resolution. What PC’s can’t handle a 2048 square texture these days? None, I suspect.

Anyway here is a very sparse GTB screenshot:

And here is the same frame, but without the shadowmap.

I think the shadowmap wins by a huge margin. (It’s more apparent full screen, when moving and zooming etc. Combining a grayscale shadowmap with tileable textures not only makes it look less 2D, but it also means you can detect the repeating tile patterns a lot less. I am using a tile-based system to afford easy level design for players. I’m also toying with the idea of automatically generating the shadow maps from the player-designed paths. I think it’s quite doable, although non trivial, and better than expecting players to use photoshop etc.

Comments?

Regimental colors

Today I got a decent chunk of work done for the regimental colors editor for GTB. GSB only had your user name, which didn’t really add a feeling of connection to the other player, so GTB will have your regimental logo (like a cap-badge insignia) associated with your maps and armies, so hopefully players will feel more like they are really fighting against proper opponents.

I plan to support user-designed, uploaded logos too, but because 95% of players won’t be arsed to do that, there is a simple editor that arranges a logo out of 3 layers and renders it to disk as your profile logo. The rendering isn’t done yet, but the rest is:

You can choose between a bunch of graphics and the three layers get combined, with a choice of some colors, plus you can move elements up and down and scale them. It’s the bare minimum that will give me an assurance that you will generally see fairly unique logos for all your opponents when playing other players armies. Plus it was fun to do :D

The problem with code like this is you can get *too* into it. I could happily spend a week doing a fully featured military insignia designer with a ton of features, but you can’t have that attitude with a game as huge as GTB if it’s ever going to ship :D I really hope the game does well enough for people to get into designing really cool logos. GSB has a great modding community and I’d love to see them go to town with stuff like this.

 

Patch and games sizes, onlive, bandwidth…

So OnLive is out in the UK. I noticed quite a few people on the interwebs pointing out that they won’t sign up because, like me, they are on limited bandwidth internet plans.

I live out in the country, where there isn’t as much choice of ISP as the cities, and because my business needs the net, I need a rock solid connection with reliability and really good telephone support, so I end up paying over the odds. As a result, I have very reliable broadband, pretty fast, but bandwidth capped to 45 gig /month. I generally never hit the limit, but then when I see a game demo thats 2 gigs, I normally just skip it.

Something that made me think about this was Heroes of Stalingrad, Red Orchestra. This game is a tech-support trainwreck, with numerous bugs, random crashes, occasional dissapearing sound effects, rubber-banding, blah blah. Underneath it all is a great game.

The good news is they keep patching the game (although often introduce more bugs than they fix). The bad news is the patches are normally 400MB+. Apparently the developers claim this is the unreal engines fault in some way, although I find that hard to believe. Almost all bugs in a game are in the .exe and the exe is rarely >20MB.  Regular 400MB patches are crazy.

I definitely think that big games studios totally forget about the ‘bandwidth-challenged’. It’s one thing to release big patches. It’s another thing to release such patches several times a month, and require the patch for online play. If everyone MUST have the latest version, don’t insist on chewing up over a gig or two a month of peoples bandwidth limit just to play a game.

 

 

Starting on the challenge stuff…

GTB is such a huge game that I seem to veer into certain areas of it for weeks at a time, then veer back into other bits of it and think “did I write all this code?”

One of the features from Gratuitous Space Battles that I was very happy with, was the online challenge system. It was very popular. About 226 trillion billion zillion challenge games have been played (roughly). Obviously I want a similar system incorporated into GTB, and naturally I want to fix the things that were not perfect, which I identify as:

  • The challenge browser was not as good as it could be. You couldn’t filter out played/downloaded challenges.
  • Any challenge that had content, be it DLC or a mod that you did not have, could crash the game, and not be pre-filtered
  • The emotional connection between you and the challenger was limited. (Rarely used messaging, and rating, but not leaving comments etc).

I plan to fix all of this, but the middle one is the current one of interest.

GSB had a binary .gsb format for a challenge, which basically packed in binary data for the fleets designs, deployments and orders, and a little bit of data about the challenge (custom settings etc) and that was it.

GTB will use a new .pak format I’ve written that will behave a lot like a zip file. (no compression yet, sadly). It will be a folder full of stuff for each battle, all the enemies unit designs, the deployment timings for their attacking units (or initial deployments of defending units), and all of the data from the scenario file, down to the location of every tree, crate, barrel, barbed wire etc…

That makes a GTB challenge file slightly larger than before, but I can live with that. They are under 100k. How many custom maps in games are under 100k now? It also means you could move a few trees or change the texture of a single tile, and upload an existing scenario trivially without any inconvenience.

Anyway…. The upshot of this new file format is that theoretically, if I write the code for it, the format could include custom sounds, graphics etc. That means you could do a mod for GTB which included different textures for the terrain, and custom units, issue it as a challenge, and EVERYONE could play it, because the required content gets downloaded with it.

Sadly, there is no way to prevent dupes there, so if you have a custom tank texture, and upload 10 challenges, someone downloading all 10 gets the texture 10 times, but I think that’s not so bad. Only a minority of players are likely to issue or play modded challenges anyway.

The main thing is, my pak file format pakker and unpakker all works fine, so it’s another step along the path to having online play working. Now I need to replicate a lot of the GSB functionality (and improve on it).

Edit: I swapped out my code to use some zip code instead , after finding a zip wrapper that was extremely lightweight.