Re: Clay, how do you DO it?

From: Clay Cowgill <vector_clay_at_hotmail.com>
Date: Wed Oct 11 2000 - 23:54:54 EDT

>How do you actually program
>a game, such as _Battlezone_ or _Tempest_?

Boy, if *that* isn't an open-ended question! ;-)

I'll try to keep this reasonably short and pertinent to developing *now* as
opposed to *then*.

In a nutshell you need the following:

1) Something to develop on, preferably an arcade machine emulator (like
MAME, although I'm sure Retrocade is better-- I just know MAME and have the
source to make tweaks so I use that).

2) Technical details on the hardware. (Usually the MAME machine drivers
will give you what you need, but when those fail the schematics and/or
reverse engineering the hardware is the way to go.)

3) Something to write code with and build images. (For the Battlezone hacks
I'm just writing the patches in-line with the disassembly and
hand-assembling them. For something more sophisticated like Vector Breakout
I used the Pseudocorp "a65" cross assembler and this crusty old DOS text
editor I like "Q-edit".)

You need to understand the hardware and where things live in the memory map
and how they're used. From there I like to just write a little test code
that *should* fire up the hardware and put something on the screen (kind-of
a "hello, world" if you will). With that test running on the Emulator I
burn an EPROM and watch it not work on a real machine. ;-) Then go figure
out what's *really* happening in the hardware instead of the emulator. Once
the "hello,world" type code runs on the real hardware I go back to the PC
for 95% of the development and only make periodic check to make sure the
code still works on the real hardware.

Just putting something on the screen is usually hugely productive-- I then
figure out how to read inputs (once again, check the operation on the *real*
machine). After that I usually figure out how the interrupt system works so
I can set up something that runs from a periodic interrupt and gives me a
stable time-base (a "master-clock" if you will). Once you can read inputs,
draw stuff on the screen, and control the speed/behavior of your code,
making a game is just a small matter of programming. ;-)

Programming style is a largely personal issue, but I like to set stuff up so
that the game "free runs". Essentially, the actual game code is running
full-speed all the time as fast as it can. Then from my stable time-base
(the interrupt service routine) I keep track of time and draw the display
from time to time to reflect what's going on in the main code.
VectorBreakout uses that so that I can get really high-accuracy for all the
fixed-point math for the ball bouncing around. Curiously enough, now that I
look at Battlezone it works the same way-- many things occur multiple times
in-between screen redraws.

That's why VectorBreakout works well compared to some other breakout
clones-- in some clones when the ball gets moving fast it'll skip a row or
two of bricks and "kill" a brick in the center of the wall. Vector breakout
is actually running the main code 4-6 times in between every re-draw, so
although the ball may appear to be moving half a brick-width "every time",
the main-loop actually gets to do collision checks 4-6 times which means it
seldom "misses" lower brick. (When it *does* miss, it's almost always
because the ball came in at a precise angle along a diagnal-- but since the
*real* breakout did the same thing I didn't call that a bug. ;-)

Battlezone does the same deal with "bullets". Every pass of the main loop
actually has 4 "sub-passes" for both the player enemy shells. So although a
"miss" by an enemy shot might look like the bullet just kind-of "blinked" by
with 6" in-between each position, the program was still checking for hits on
a much finer scale.

There's literally dozens (hundreds?) of books on game design and programming
in general, but hopefully that's a little more insight into
"retro-programming" for old vector games. ;-)

-Clay
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

---------------------------------------------------------------------------
** To UNSUBSCRIBE from vectorlist, send a message with "UNSUBSCRIBE" in the
** message body to vectorlist-request@synthcom.com. Please direct other
** questions, comments, or problems to neil@synthcom.com.
Received on Thu Oct 12 00:15:15 2000

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2003 - 00:32:52 EDT