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

Shaders, and then on to game data and weapons

I spent the weekend mucking around with pixel shaders. I’ve not used shaders before, and tbh, the documentation for such things assume you already know how they work, which is insane. I was originally hoping to get some shockwave distortion effects in for ship explosions, and although I got it working, there are some artefacts I’m not happy with. I might still use shaders to do some simple stuff like tinting the whole screen certain colours in some of the nebulas (I think it looks kinda eerie). Of course, thsi kinda stuff will be optional for anyone with older cards.

So this coming week I’ll be turning my attention to game play balance issues and getting some proper data in there. I need to knock up a few decent, balanced enemy fleets to fight against and check the game mechanics as they are. My concern right now is that putting a ton of effort into shields and armour may ‘trump’ everything else. A small proportion of shots always penetrate each (lucky shoT!), so they are not absolutes, but still they are probably too beneficial.

One idea I had was for shields to operate only under certain ‘loads’. So say we have a shield with a strength of 20, and its hit by a laser beam with penetration of 11. That beam won’t make it through, which is fine, but I was considering allowing multiple beams at the same time to ‘overload’ shields.
So if you had simultaneous beams of a strength of say 40, all hitting a shield at once (or over some short period) they would knock the shield out entirely for a second or two. That would mean that large groups of frigates with relatively low power lasers could still take down a cruiser, despite its shields if they concentrate their fire.

Right now you have a damage and a penetration value for each weapon, so you might have a weapon with massive shield penetration but tiny damage, which always damages the shield strength a bit, or a weapon with tiny penetration and massive damage, which is easily deflected by a shield, but if it isn’t deflected, does major damage.
Hopefully a wide range of options on equipment like this will lead to the emergence of a ton of interesting ship designs. Maybe :D

Racial and Ship Bonuses

Something that went in yesterday, but I haven’t put final data in for, is bonuses for individual ships. The actual ship designs are handled by the player (although the game ships with one sample design for each hull), based upon a range of ship ‘hull’s which determine how the ship physically looks, it’s size and base cost and base power production.

The thing is, given that frigates are roughly the same size as each other, I need reasons that a player picks frigate hull A instead of B, etc. So that is where ship bonuses come in. There are currently five different bonus types, Shields, Armour, Integrity, Speed and Power. So if a ship has a 20% power bonus, any power plant modules on that ship produce 20% more power. The Integrity bonus increases the hit points of every module on the ship.

This system us augmented by additional ‘racial’ bonuses which I’m applying to every hull in a fleet, so all the Alliance ships are getting a 10% armour bonus, for example. Hopefully this means that the different races will tend to use different tactics, and play to different strengths.

The individual ship bonuses will encourage the player to pick specific ships for a task, so one frigate might have a big power bonus, and thus be a good choice for beam lasers.  Another might have a speed bonus, and thus be more use for flying out first to intercept the first wave of enemies, and so on. It also means that a player who prefers armour over shields will tend to pick specific hulls within a fleet. In theory, it also means that when you see the enemy fleet coming, you might eventually get a feel for which what strategy he has gone with by looking at the ship choice (you can’t see the module load-out of enemy ships during battle).

This is the current theory and hope anyway, I haven’t spent enough time configuring fleets and playing full battles yet to get it all tweaked.

Emergent L33tness

I was just testing a new laser blast graphic I added to the game, and had two big fleets of cruisers and frigates flying towards each other blasting away like mad, and noticed that the front frigate (which was under serious attack) seemed to be drifting backwards.

This puzzled me, because although i did once code support for reverse thrusters, I turned it off, and knew anyway that ship didn’t have any,

Then I realised that it was the physics of the blast effect. The number of enemy blasts piling onto the ships hull was not only damaging it big time, it was knocking it slightly backwards. I had forgotten that could happen :D

I wish this game was finished already so I could just sit down and edit some cool videos of stuff like that…

One of the main changes today was for fighters. To get a better sense of huge ships, I scaled all the fighters down by a fair chunk. Now when you add a fighter squadron, you get 16 ships instead of 9, and they are smaller. It does seem to look a lot better. The cruisers never looked big enough before. The AI is pretty fast and it doesn’t seem to matter with a few hundred ships per side, even with all guns blazing.

Gratuitous Empire Selection

I’ve got a new ship added today, plus fixed some turret-related fun, and got the interface in for the race-selection screen, where you get to actually choose who to fight as (subject to unlocks). Small screenshot below:

Because that sort of thing isn’t as much fun as coding new weapon types or improving the visual effects, I might treat myself to improving some graphical stuff for the rest of the day. I’m looking forward to the time when all I have to do is balance the weapons and arrange basic ai fleets to fight against, but I suspect that it’s a long while to go yet.

Difficulty levels and other ‘wrapper stuff’

I’ve been trying to avoid acting too much like a graphics junkie and getting some work done on the gamey stuff instead. I’ve put in difficulty levels today, and also made some decisions regarding what race of aliens the player controls.

The main part of the game currently has ten missions, basically defined by a certain backdrop, of a certain size (some maps are bigger than others) which some other variables such as nebula effects on shields etc. These levels also define the maximum fleet size (in ship and pilot terms) and which race the player fights against.

So today, each of these missions has three enemy fleets rather than one, the normal, hard and expert AI fleets, which are of differing sizes. Obviously the bigger fleets are harder :D. During combat, the enemy AI is the same as yours, so the difficulty comes purely from the force that is fielded against you. I may get around to the AI evolving its own fleets, but thats a whole can of worms.

There will be some ‘other stuff’ that will give the game longevity beyond those 3 fleets in 10 different missions, but I’m not talking about that stuff yet :D

The other thing decided today was that the player will fight the game as ‘the federation’ which is a ferengi inspired race whose backstory I’m still mulling over. Once you have beaten every mission on Normal, you will unlock the Rebels as a selectable playable race for each mission, beat them all on Hard and you unlock the Alliance, Beat them all of Expert, and you unlock the Empire. That’s the plan anyway. Any thoughts?