A Technical Discussion

So I was thinking yesterday, during a hot walk to the post office “How did Eugene Jarvis do the lasers in Defender?

I swear this is not a joke post. Such thoughts as this do occasionally work their way into my mind.

To see what I am talking about, here’s a video of the arcade version of Defender:

There are countless amazing things about the game Defender. The sound effects, the controls, the particle effects, the sublime design. All this in a game that is 28 years old.

Pay close attention to the lasers the ship puts out. See how they are not an unbroken line? See how they seem to start as a random stream of particles and then connect into a solid line. They are simultanenously chaotic and structured; solid and discrete. Could this be a representation of the wave and particle duality of light in video game form? Who knows… certainly not me… but I do know the laser graphics are mesmerising and one of the most memorable things about the game.

So I wondered to myself yesterday, in my memory, how did he do these very organic and colourful particle-y laser beams? How did he make each beam unique and therefore special?

I came up with what seems like a good technique. Start with an 1 dimensional array representing the laser. Pick some random positions (on the left side) and occupy them: these are the dots that begin the laser. Then do a pass through the array populating empty spots with a frequency depending on the occupancy of nearest and next-nearest neighbours. This gives a good representation of particles knitting together to form a beam. You could even fake the movement of the laser by making the array width the same as the screen width and base the start on the ship start position (ie. no sprite movement is needed). Using this technique you could even write to the screen memory directly and possibly avoid sprites.

I’d solved it! Randomized laser beams that look like those in Defender! Voila!

But…

Take a look at this video:

It’s a little tricky to see but if you inspect the lasers you will notice they all look… similar.

Can’t decide? This may be clearer:

Nothing special about those lasers. Just lines… but more importantly: all the same lines. (As an aside, that previous video deserves a blog post unto itself…)

So is it because the BBC Micro and the 2600 are craptastic computers that the coders couldn’t reproduce the majesty of Jarvis original lasers? Perhaps, and this is certainly an attractive thought.

But go take a look at the original video again. Look very closely.

Yes, the sad truth: all the lasers in Defender are identical. There is no magic coding at work there. Just a sprite.

Another childhood illusion dashed on the shores of truth 🙁

2 Responses to “A Technical Discussion”

  1. Bernard says:

    I was going to suggest that the lasers are a single sprite with some color cycling. Usually machines of that era provided several hardware sprites which could be color cycled with ease.

    However if you read the the wikipedia page for defender it states that the developers chose to animate the graphics using software and not hardware sprites! So the lasers are most likely bit mapped pixels drawn directly to video RAM.

    Still an awesome game, fiendishly difficult and the sound effects are even better than I remember. I think it’s time I got MAME up and running again.

  2. Florence says:

    oOo.. ‘Tech’ category filling up…!