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

Finding and fixing some nasty bugs

It’s amazing what bugs you find when you just sit and play through the game for hours (I’m playtesting and balancing the game so that the AI fleets give you a bit of a challenge).

Two bugs squashed today are these:

Firstly, the code that detected that an enemy target was being ‘painted’ by a target painting laser (and thus easier to hit for missiles) was just not working at all. I’d checked and double checked it many times, but because the ‘is it painted’ code is just one of about 6 factors determining optimum target selection, it was hard to tell if it was working right without stepping through everything each time.

It turns out that code worked fine, but some *other* code which told a targeted module whether or not it even *was* a missile launcher, was buggy, and so the code was never even being run. doh!

The second bug was investigated after I noticed some very slow missiles which looked like multiple-warhead missiles but never split into their sub-munitions. It turns out that this code has never worked correctly! The code works fine the first time a missile splits into sub-munitions, but if it gets to live long enough to shoot another missile later, the sub-munitions are never triggered. That was an easy fix.

Unfortunately, that means I’ve been underestimating the destructive power of multiple-warhead missiles all the time, which means I need to re-play through every battle, on every difficulty, and both re-balance the fleets, and maybe re-balance the cost and strength of the appropriate missile modules too. This will take all of today at least.

Damn :(

One thing I did notice, that was pretty cool was an imperial AI fleet I’d put together that sends its fighters in ahead, and the rest of the fleet shows up afterwards (moving slower). By lucky hap, although the fighters were useless against the heavily armoured federation cruisers, they did manage to blow the crap out of the row of point-defense equipped escort frigates that flew alongside them. So when the Imperial cruisers got into range, they could bombard the feds with missiles without opposition. This is exactly the kind of design and thinking I hoped the game would reward, so it’s cool to see it is all about strategy and not just luck :D (Obviously when you play against that fleet, make sure you don’t have a line of unarmed frigates sitting waiting to be blown up :D)

Challenge!

This is the current challenge list screen (click to enlarge). It’s not exactly an MMO quality on-line browser, but it’s what there is right now, at this beta stage of the game. (BTW I’m aiming for pre+orders + beta for pre-order customers as of next Monday).

There are basically 3 types of challenge. Automatic ones, open to all, which get uploaded whenever you beat an AI fleet from the game (these come from ‘auto’), open challenges where a player has posted up an open invite to beat their fleet (sent to ‘all’) or personal challenges sent to another GSB player by username.

Only the target player will see personal challenges you upload. I’d imagine 90% of challenges people play will be the personal or ‘all’ ones, the auto ones are just there to ensure some challenge population is available. I will also be developing some kickass fleets for you all to lose against :D

The browser downloads a list of all the challenges, and you can then filter them using those top buttons. Every time you attempt to fight against a challenge, the ‘Attempts’ is incremented globally. Every time you beat a challenge, it’s ‘Victory’ will go up. You click the download button to grab the challenge from the server and play against it. From then on, that challenge is a local downloaded one you can revisit easily.

I haven’t done the code yet that means only one victory per challenge, per person can happen… must do that!

I must also add a button to only show *your* challenges, so you can check on how many attempts your fleet has had, and how many people have beaten it. Ideally there would be TONS of community based features like this, it really does depend how well the game does, and if people enjoy this sort of thing. The minute there are some pre-order buyers playing the game, I’ll have a decent idea as to where to direct my energy in terms of development.

Thoughts?

Raw PIX data for gratuitous space battles

I’ve never seen anyone share data like this, but I don’t see why they wouldn’t, it’s hardly source code. PIX is a free program from Microsoft that lets you analyze your games directx performance. I haven’t analyzed this data or changed any code yet, but here is a quick 2 minute start of a battle in the game (release build) analyzed with pix. Click the image for a larger version

This is great for working out why you get occasional slow frames, or working out where bottlenecks are. TYhe FPS seems to never go above 60 FPS, because the game caps it there, making a note of the ‘headroom’ available for potentially enabling higher-demand effect (not all done yet).

This is under Vista, 2 gig RAM, Core 2 Duo 6600 2.4 gig CPU and a Geforce 8800 GTS with latest drivers.

Please feel free to comment on how the numebr compare to agmes you might have worked on or develop now. I’d lvoe to see other peoples pix data as a sanity check. Is 83 set textures a frame a lot?  it seems to depend on what else is going on.

RangeFinder

In my play testing and balancing sessions, I found myself really wanting to know what the ranges were of a specific weapon mid-battle. You get to see this in pre-battle deployment, but that’s only the initial formation. There is nothing more frustrating than watching your ship sit there, minding its own business while an enemy ship sits just out of range and missiles it to pieces :D I should adjust the ‘retaliate’ AI order to allow it to move within range

So anyway, I’ve added in a new range-display GUI to the battles. Basically you just click on your ship to show the window with its details, then click a module with a turret on that window for it to highlight that weapons range on the map. I’ve toggled on the background grid here for extra ‘tactical display mode’ fun.

The last few days have been really hard work battling an obscure texture corruption bug. I was working on it at 1AM last night. I’ve completely rewritten my vertex buffer code to use a different locking strategy, and I’m pretty sure it’s for the better, although I do too much memory copying for my liking. Still, the game runs pretty fast even so.

Victory Conditions for GSB

For a long time the code that checks for the end of battle has basically looked for the first fleet whose number of live hit points as a ratio to its total (damage is ignored, only active or destroyed ships matter) drops below 10%. At that point you lose.
Theoretically you can pull back from 10% of your fleet to victory, but the code is there to prevent the game going on for hours trading shots between two closely balanced fighters.

Some play testing today has made it obvious that there are other clear cases of victory / defeat that need detecting. You may well have played an RTS where it’s pretty flipping obvious whose won, but you have to endure another hour of it. Hopefully this won’t affect GSB.
The new rules include this:

  • If three minutes has gone by without any ship being destroyed, and one fleet is less than 50% of the strength (in percentage terms, not absolute hitpoints*) of the other, then it loses.

also:

  • If one fleet is reduced to nothing but fighters, and the other fleet is not, AND that other fleet outnumbers you by two-to-one in hit points. You lose.

As I code this, I’m wondering if that initial 10% calculation should also be contingent on the three minutes without a ship destruction being introduced too. It should at least consider extending it if it’s a close battle.

This is the kind of stuff that gamers who want to be game-designers think designers do all day. In fact a lot of the time its more obscure crap like “If the player designs a cheap ship, then edits it in the editor and goes back to the deployment screen, but the fleet is now too expensive, do we prune ships automatically? or do we put up a dialog or disable the fight button? zzzzzzzzzzzzzzzzzzzzz

*on expert difficulty, the AI outnumbers you, so this needs to be calculated as a fraction of totals.