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

Reflecting beam lasers

My recent design thoughts and today’s tweaks make it clear I needed a way to see visually that lasers were just bouncing off enemy shields and achieving nothing, so I added a sort of ‘bounce’ effect to the lasers (see video below). I didn’t bother doing any fancy maths for the collision reflection, it just skews off at a slightly random angle. Does this look ok? (also there is some quite cool shooting of rockets by a point defence laser going on in the second clip).

Spaceship speed

I’m having balancing issues with some of the existing game mechanics. One of the things that I use to differentiate weapons is their tracking speed. Some smaller weapons track fast but do less damage, and vice versa. Basically the tracking speed is compared to the targets current speed, and this gives some multiplier for the ‘hit chance’.¬† Obviously big cruisers are slower than small fighters.

So far so lovely.

The problem is that in general, you want your ships to position themselves at a certain optimum range, and pound their enemies from a distance. In the case of the big cruisers, that means move into range, sit there and go zap until you or the enemy dies. The problem is, the minute you sit still, tracking speed becomes irrelevant. This means that when fighting against cruisers, tracking speed is basically no big deal, and the weapon with the highest damage-per-second, range and penetration of armor/shields wins.

The solutions are many and varied:

1) Have an optional¬†ship ai-behavior of ‘keep moving’ where your ship basically spins in circles at a certain range (clunky and difficult to get a reasonable turning circle)

2) Always assume the ship is at max speed for hit purposes (might look silly)

3) Introduce a new mechanic to compensate (maybe ECM resistance?) and ignore tracking speed for weapons aimed at the bigger ships.

4) Just make greater use of balancing the existing mechanics to still make the choices interesting

I’m currently drawn mainly to 3) and 4). Any thoughts?

Lots of things

I’ve been busy. The first thing to mention is that there is now a web forum for GSB here:

That should allow people to let their opinions and suggestions and questions run wild, and keep things a bit organised. Feel free to post whatever thoughts you have there.

Today I’ve been doing some debug GUI which is handy for finding bugs, I already found and fixed a bug where ships didn’t reselect optimum targets correctly. I also redid the tractor beam graphic so it didn’t have one aliased edge and one straight one (needed to use two overlapping textures to get it right). Plus recently I totally re-jigged the sound system for the game so the positional sounds now pan correctly as you move the camera. Last but not least, I’m adding a system where you can have race-specific weapons. Initially you will have one race to play and need to unlock others, so I’m hoping this makes for better game play because:

a() you will initially be zapped by weapons you don’t recognise or know the exact statistics of and

b) when playing as one race, you will not have access to all weapons, so playing a different race will mean adjusting your tactics accordingly.

There is so much to do, but the game is coming along nicely.

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.


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