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

Optimum Range

I’ve been playing eve-online again for a few days, partly as research, partly because it’s l33t. Something that struck me was the insane complexity of the game. The sheer number of ship modules available is breathtaking, and this is a game that doesn’t revolve around them as much as GSB.

The level of detail of the modules is also very high. A weapon in eve has a silly number of statistics associated with it. I quite like complex sim games, so it’s reassuring to see that there are so many people happy to play a game that has that much involvement.

With this in mind, I’ve added one of my favorite space battle concepts, which is optimum range. For example, a cruiser beam-laser will have a range of 1200 meters, but an optimum range of 800 meters. The way I’m calculating it is to leave armor and shield penetration the same for the whole range, but damage done varies by 50%. So at range 0 damage is 50%, it scales up to 100% at range 800, then drops down to 50% at 1200 where it then drops to zero.

Is that realistic? maybe to some extent, most weapons in real life have an optimum and max range. I know my bow does, although thats mainly a matter of accuracy rather than damage done. (getting hit by an arrow is bad news at any range).

I think this will lead to much more intricate strategy, In theory, one fleet could sit at maximum range blasting away and doing X damage, out of range of their enemies guns. Closing to optimum range might deal more deadly blows, but would open you up to return fire.

It also means that there is real gameplay advantage to keeping your distance a bit, which makes the game look nicer and less cluttered.

The complexities of drawing laser beams

laser beams are easy right? just a sprite yes? You work out where it goes on the screen, at what angle and what size (due to zoom) and you just blap it. Job done.

Nope.

Not if you want them to look good. There are lots of concerns. Firstly, you probably want the turret that shoots the beam to have a seperate ‘blast’ graphic rather than just a straight beam squeezing out like toothpaste. So that’s two sprites. Then you probably want them to fade out slightly at the end so they aren’t too abrupt. Thats 3 sprites (and for efficiency you need to check they are all onscreen, often only the beam will be.) You also need a wobbly seeking effect for when the beam fires but misses.

Then you probably want your beam to fade in and out over a certain portion of the (variable) beam duration. Even if its a tenth of a second fade, it still makes things look better. Then you probably don’t want the beam to be static, a sort of ‘pulsing’ effect over time makes them look better. I use (as always) a sine wave calculated over time to vary the beam intensity. That means changing the colors of all three sprites.

Then…. you will find that the beam is pretty cool, but it’s very static, and doesn’t seem to indicate direction. You can do this in one pass or two, but you probably want a seperate layer drawn on top with some ‘inteference’ that scrolls along the path of the beam. That has to be in the right direction obviously, and it needs to smoothly wrap around.

Then…. if a single weapon has several beam ‘sources’ you need them to have different start values for the inteference, otherwise people spot the patterns.

I’ve got all this in, and working and looking fab, there is just one last thing: The inteference starts abruptly just where the ‘blast’ sprite ends and the beam sprite starts. If you zoom in, it looks really obvious. So what I need is to split the inteference sprite into a ‘beam’ and a ‘start’ section, and do a sort of reverse beam-tip thing for the start of the inteference. I also need to ensure its synched with the scrolling of the core beam inteference so it looks smooth.

Ideally I also need some level-of-detail stuff so I ignore the fiddly bits when really zoomed out on small beams, and need to hook it into a general graphics options setting for older machines.

I’ll get that finished tomorrow I reckon :D

ModDB + Eve

As a few people suggested I do so, I added a page to moddb.com about Gratuitous Space Battles. The link is here:

http://www.moddb.com/games/gratuitous-space-battles

TBH, I’m having some problems getting videos to upload there right, but I’ll sort it eventually. The reason I mention all this is that fi you are interested in the game, and have an account there, it would be great if you could ‘watch’ the game. Just makes it seem less ignored :D

I just signed up to eve-online, after not playing it for 2 whole years. Jesus it’s complex. I’m re-joining it mainly to have a play with its graphics and UI and get some inspiration for GSB. I’m already determined to make my beam weapons look better…

More Waffle about Spaceship Shields

Lets continue mulling over the space shields dilemma a little. I worry that my idea of concentrated fire taking down shields might be a bit too fiddly and non-intuitive.
I also worry that its too easy to just ‘uber shield’ a ship and laugh at your enemies.
So I conclude this (please let me have your feedback):

Shield penetration should be decoupled from actual shield strength.

What I mean by this, is a ship could have say 3 standard shield modules (for example). These modules would give the ship a shield strength of 60 (20 points per module). This means that ships blasting away would need to do 60 points of damage before they got through to the armour, and then the internals.

Right now, I take the shield strength and divide it by the size of the ship, and that gives me a shield penetration value, and and weapons attacking it with a lower shield pen value than this just bounce off. This means if I up the number of shield modules, the required shield penetration value rises.

What I’m considering is having the shields strength (hit points) be additive as now, but the shield penetration value is just the highest value of your shield modules. Or maybe their average.

So you could have configs like this:

  • Ship A has 3 type I shields with a total strength of 60 points and needs >5 shield penetration to actually damage the shields
  • Ship B has just a single type III shield. Its total strength is only 20 but it needs >8 shield penetration to do any damage.

Note, I’m talking about damaging the shields, not going through them. You can’t actually penetrate the shields until they are down (so far). My aim is to allow for some tactical flexibility. You could protect your ships against fighters just by having a single highly reflective shield module. But defence against bigger ships would mean you take penetration for granted (penetration is the wrong word really) and concentrate on brute strength of the shield itself. It also allows me to have small weapons that arent entirely useless against shields.

What do you think? Too complex? Thanks for your comments so far, I read all of them.

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