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


I’ve been tweaking and fixing a few small things lately, sounds that do not play, some graphical problems, and some bugs caused by recently introduced new features (I managed to screw up the way shields worked when I added cod to make ‘stacked’ shields less effective.

In amongst this, the only true ‘new’ feature that has gone in is the alliance ‘lightning gun’. It’s basically just a beam laser, but drawn entirely differently. 10 minutes of reading photoshop tutorials got me up to speed with rendering lightning, and then a bunch of rendered strips of lightning later, I wrote code which works out how many ‘chunks fit in a beam, and stuck together a string of them so the ship looks like its electrocuting its enemies.

The code isn’t that simple, because you want the beam to zig zag everywherem, but hit its origin and target exactly, which is a bit fiddly. I also had it change which bits of lightning to use every 10th of a second so it looks like it flickers, and had to ensure that multiple beams from the same ship start at different points so you can’t tell the same texture pattern was being used.

Having said all this, the biggest effort was picking out a sound effect for it, which I’m still not happy with and am not confident is playing right. 30 minutes of previewing sounds of electrical static is a bit wearisome in 86 degrees in the indoors with an overheating PC by your legs.

All good fun I guess.

5 thoughts on Lightning!

  1. …..inFAMOUS’ lightning sounds, anyone?

    “Missile launchers now show if they have decoys or not on the ship design screen. About time too.”

    Wait, what?

  2. I can’t wait to see this new cod in action, should be delicious ^_^

    Being more serious: New weapon sounds awesome, even if it doesn’t sound awesome yet.

  3. Stop fooling around on slashdot and get back to work!

    Its nice to randomly see people whose blogs I follow turn up on. . the other blogs I follow. I wonder if the Introversion guys hang out there too. .

  4. My favorite lightning weapon (look, feel, sound) was in the old game outpost2.

    I programmed one once, the way I did it was to have each part of the beam go along a vector towards the target added to a random vector, and also make it fork sometimes. I think I made the random distance shorter as it went closer to the target.

Comments are currently closed.