"Gauntlet" engine

So I’ve been obsessing about the game “Dandy” (originally entitled “Thesis of
Terror” – btw, “dandy” is what you hear if you say “D&D”, as in Dungeons &
Dragons, out loud). It was an Atari Program Exchange (APX) title back in
the early 1980s, and was the inspirtion for Gauntlet, the arcade game.

Last night, in ~500 lines of totally uncommented code, using a plain
ASCII text file for a map, and using different colored SDL_FillRect()s for
the different shapes/monsters, I whipped together a basic 1-player
implementation of a ‘Gauntlet/Dandy engine’. :slight_smile:

I will eventually turn this into a honest-to-goodness Open Source game,
but in the meantime (because who knows how much free time I’ll have to
do that!), feel free to take a peek and learn from it. (Either what to do,
or what not to do. Heheheh)

http://www.sonic.net/~nbs/gauntlet.tar.gz

(Weighs in at less than 4KB)–
-bill!
“Tux Paint” - free children’s drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/

BTW - The map is a cellular automata (like Conway’s ‘Game of Life’).
Everything except the player and the ‘arrows’ you shoot are stored directly
in the map (and I’m thinking the arrows should be stored too, maybe).

This means there’s no limit to the number of bad guys that can spawn
and clamour around the maze, trying to get you.

See: http://en.wikipedia.org/wiki/Dandy_(computer_game)

And if you’re anywhere near Davis, California on March 28th, come play
Dandy with me at my big ‘Atari Party’!
http://www.newbreedsoftware.com/atariparty/

-bill!On Thu, Feb 26, 2009 at 12:48:27PM -0800, Bill Kendrick wrote:

Last night, in ~500 lines of totally uncommented code, using a plain
ASCII text file for a map, and using different colored SDL_FillRect()s for
the different shapes/monsters, I whipped together a basic 1-player
implementation of a ‘Gauntlet/Dandy engine’. :slight_smile:

Quite CPU hungry probably for the reason of a naive CA implementation,
but very amusing! I love how the bad guys (if I am interpreting the
meanings of these colored squares correctly) are kind of dark and hard
to see! I am very tempted to add some old school synthesizer sound
effects!On Thu, Feb 26, 2009 at 3:53 PM, Bill Kendrick wrote:

On Thu, Feb 26, 2009 at 12:48:27PM -0800, Bill Kendrick wrote:

Last night, in ~500 lines of totally uncommented code, using a plain
ASCII text file for a map, and using different colored SDL_FillRect()s for
the different shapes/monsters, I whipped together a basic 1-player
implementation of a ‘Gauntlet/Dandy engine’. :slight_smile:

BTW - The map is a cellular automata (like Conway’s ‘Game of Life’).
Everything except the player and the ‘arrows’ you shoot are stored directly
in the map (and I’m thinking the arrows should be stored too, maybe).


http://codebad.com/

donny at teamspace:~/gauntlet$ git commit gauntlet.c -m ‘square waves
play different tones for each direction you walk’

http://github.com/hdon/gauntlet-ca/tree/masterOn Thu, Feb 26, 2009 at 8:21 PM, Donny Viszneki <@Donny_Viszneki> wrote:

I am very tempted to add some old school synthesizer sound effects!


http://codebad.com/

Should have included this i suppose:
http://github.com/hdon/gauntlet-ca/commit/fa2268142a86bbb1d299a7a9403b57bb6c79faddOn Thu, Feb 26, 2009 at 8:55 PM, Donny Viszneki <@Donny_Viszneki> wrote:

On Thu, Feb 26, 2009 at 8:21 PM, Donny Viszneki <@Donny_Viszneki> wrote:

I am very tempted to add some old school synthesizer sound effects!


http://codebad.com/

I don’t see it taking much on my end. And sorry for my continued
naivety, but “CA implementation?” :slight_smile:

Sorry… sick, tired & have a sick wife and baby.
I’m surprised I was able to code this to begin with. ;)On Thu, Feb 26, 2009 at 08:21:15PM -0500, Donny Viszneki wrote:

Quite CPU hungry probably for the reason of a naive CA implementation,


-bill!
“Tux Paint” - free children’s drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/

Quite CPU hungry probably for the reason of a naive CA implementation,

I don’t see it taking much on my end. And sorry for my continued
naivety, but “CA implementation?” :slight_smile:

I believe you described it as a “Cellular Automata (like Conway’s ‘Game of Life’).”>----- Original Message ----

From: Bill Kendrick
Subject: Re: [SDL] “Gauntlet” engine
On Thu, Feb 26, 2009 at 08:21:15PM -0500, Donny Viszneki wrote:

Quite CPU hungry probably for the reason of a naive CA implementation,

I don’t see it taking much on my end.

Well I suppose by modern standards it’s next to nothing, but for a
game with pong-era graphics, it’s surprisingly CPU heavy (15% or 20%
of my 1GHz Athlon? It might be my crappy 2D graphics drivers pushing
the CPU usage up, too.)

?And sorry for my continued
naivety, but “CA implementation?” :slight_smile:

CA = cellular automata

Sorry… sick, tired & have a sick wife and baby.
I’m surprised I was able to code this to begin with. :wink:

Good luck!On Thu, Feb 26, 2009 at 9:28 PM, Bill Kendrick wrote:

On Thu, Feb 26, 2009 at 08:21:15PM -0500, Donny Viszneki wrote:


http://codebad.com/

Oh, heh. Never abbreviated that. It’s doing pretty basic stuff on a 128x128
map, max 10x per second. What kind of CPU are you on? :slight_smile:

Also, I’m curious, what’s a better way of doing the automata?
I haven’t really done it before, aside from a very basic “Game of Life”, years
ago…On Thu, Feb 26, 2009 at 06:33:29PM -0800, Mason Wheeler wrote:

I don’t see it taking much on my end. And sorry for my continued
naivety, but “CA implementation?” :slight_smile:

I believe you described it as a “Cellular Automata (like Conway’s ‘Game of Life’).”


-bill!
“Tux Paint” - free children’s drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/

Heh, it must be. I’m on a 2GHz dual-core and it was doing 1% CPU.

FWIW, I’ve added graphics. PNGs with basic on/off transparency,
which I SDL_DisplayFormatAlpha(). It’s a lot easier to understand
the game now. :wink: I’m thinking maybe an isometric view might be fun.

-bill!On Thu, Feb 26, 2009 at 09:33:35PM -0500, Donny Viszneki wrote:

Well I suppose by modern standards it’s next to nothing, but for a
game with pong-era graphics, it’s surprisingly CPU heavy (15% or 20%
of my 1GHz Athlon? It might be my crappy 2D graphics drivers pushing
the CPU usage up, too.)

This thing is pretty cool, simple, but cool never the less.On Fri, Feb 27, 2009 at 12:25 PM, Bill Kendrick wrote:

On Thu, Feb 26, 2009 at 09:33:35PM -0500, Donny Viszneki wrote:

Well I suppose by modern standards it’s next to nothing, but for a
game with pong-era graphics, it’s surprisingly CPU heavy (15% or 20%
of my 1GHz Athlon? It might be my crappy 2D graphics drivers pushing
the CPU usage up, too.)

Heh, it must be. I’m on a 2GHz dual-core and it was doing 1% CPU.

FWIW, I’ve added graphics. PNGs with basic on/off transparency,
which I SDL_DisplayFormatAlpha(). It’s a lot easier to understand
the game now. :wink: I’m thinking maybe an isometric view might be fun.

-bill!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Oh, heh. Never abbreviated that. It’s doing pretty basic stuff on a 128x128
map, max 10x per second. What kind of CPU are you on? :slight_smile:

If your game is only processing 16kcells/second then I doubt it’s your
CA, probably just my video driver’s crappy 2D graphics handling.

Also, I’m curious, what’s a better way of doing the automata?
I haven’t really done it before, aside from a very basic “Game of Life”, years
ago…

Precalculating repeating patterns and indexing. It’s possible that
your CA does not have patterns that can precalculate. But maintaining
an index to skip over empty space can help, though as I said above, I
don’t think it’s your CA anymore.

The most sophisticated Conway’s Life implementation I saw would hash
isolated chunks of the grid and store them in a b-tree index so that
it could skip over empty space. When repeating patterns were revealed,
it would store links alongside the chunk index so that it didn’t have
to recompute anything.On Fri, Feb 27, 2009 at 3:23 PM, Bill Kendrick wrote:

On Fri, Feb 27, 2009 at 3:25 PM, Bill Kendrick wrote:

FWIW, I’ve added graphics. PNGs with basic on/off transparency,
which I SDL_DisplayFormatAlpha(). It’s a lot easier to understand
the game now. :wink: I’m thinking maybe an isometric view might be fun.

You should host it on github so that we can more easily share patches


http://codebad.com/

Also, I’m curious, what’s a better way of doing the automata?
I haven’t really done it before, aside from a very basic “Game of Life”, years
ago…

Precalculating repeating patterns and indexing. It’s possible that
your CA does not have patterns that can precalculate. But maintaining
an index to skip over empty space can help, though as I said above, I
don’t think it’s your CA anymore.

The most sophisticated Conway’s Life implementation I saw would hash
isolated chunks of the grid and store them in a b-tree index so that
it could skip over empty space. When repeating patterns were revealed,
it would store links alongside the chunk index so that it didn’t have
to recompute anything.

Yeah, hashlife, for the truly nutbar:

Bill Gosper is so awesome, it’s beyond words.On Fri, Feb 27, 2009 at 6:58 PM, Donny Viszneki <donny.viszneki at gmail.com> wrote:


http://pphaneuf.livejournal.com/

The most sophisticated Conway’s Life implementation I saw would hash
isolated chunks of the grid and store them in a b-tree index so that
it could skip over empty space. When repeating patterns were revealed,
it would store links alongside the chunk index so that it didn’t have
to recompute anything.

This’d be a bit tricky since the enemies attempt to head towards
the player (and when/if I add multiplayer, they’ll have to ‘pick’).
They also move randomly, rather than rushing constantly.

> You should host it on github so that we can more easily share patches

Heh, well… in the meantime:
http://www.sonic.net/~nbs/gauntlet-20090227.tar.gz

Now includes graphics & a few bug fixes.
Get it while it’s still there. I’ll eventually pick a proper name and
purpose for the game, and put up a web page.

In the meantime, I’ve got hard disks burning up and MySQL databases
exploding.On Fri, Feb 27, 2009 at 06:58:49PM -0500, Donny Viszneki wrote:


-bill!
“Tux Paint” - free children’s drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/

The most sophisticated Conway’s Life implementation I saw would hash
isolated chunks of the grid and store them in a b-tree index so that
it could skip over empty space. When repeating patterns were revealed,
it would store links alongside the chunk index so that it didn’t have
to recompute anything.

This’d be a bit tricky since the enemies attempt to head towards
the player (and when/if I add multiplayer, they’ll have to ‘pick’).
They also move randomly, rather than rushing constantly.

Yeah it wouldn’t be useful for your game really.

Heh, well… in the meantime:
?http://www.sonic.net/~nbs/gauntlet-20090227.tar.gz

Now includes graphics & a few bug fixes.
Get it while it’s still there. ?I’ll eventually pick a proper name and
purpose for the game, and put up a web page.

Committed the changesOn Fri, Feb 27, 2009 at 8:16 PM, Bill Kendrick wrote:

On Fri, Feb 27, 2009 at 06:58:49PM -0500, Donny Viszneki wrote:


http://codebad.com/

something about isometric version

i have an 8 way isometic thing kicking about somewhere, was gonna do 8 way
isometric pacman clone, but, er, never finished it, i’ll did it out if
anyone is interested, and perhpas attempt to explain how it works, still
using cells but overlayed on an isometic thing,

I’ve done some isometric mapping before. It was just a matter of positioning
the cells properly. THe cells themselves just looked like this:On Wed, Mar 04, 2009 at 02:10:38PM +0000, Neil White wrote:

i have an 8 way isometic thing kicking about somewhere, was gonna do 8 way
isometric pacman clone, but, er, never finished it, i’ll did it out if
anyone is interested, and perhpas attempt to explain how it works, still
using cells but overlayed on an isometic thing,

#

#########

#

or somesuch.

Or maybe I don’t know what you mean by 8-way.


-bill!
“Tux Paint” - free children’s drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/

I would assume by ‘8-way’ that he means that movement is allowed not
just on the cardinal directions, but also on the diagonals. I spent
quite a lot of time on an isometric tile-based tactical RPG and,
frankly, it was a pain in the tuckus in a lot of ways. 8-way movement
in a real-time game like Pac-Man adds problems I didn’t have to deal
with, 'cause there are issues of diagonal movements being longer in
terms of cells passed than cardinal ones and thus should take more
time, etc, etc.

    • note that by cardinal in an isometric perspective I mean
      ’up-right’, ‘up-left’, 'down-right, ‘down-left’ relative to player
      perspective

Ah. Actually, in my game (based on how Dandy works on the Atari),
true diagonal movement isn’t possible (except for your arrows;
they can, for example, shoot inbetween wall segments that are
positioned checkerboard-style).

You can hold [Left]+[Down] arrows, or push down and left on a joystick,
but what happens in the game is your character moves down once, then left
(or left, then down).

True Gauntlet (arcade, NES version, etc.) usually uses sprites for the
players’ characters, meaning they can move wherever. The way I’ve coded it,
I could actually be dropping the players onto the map as cellular-automata
cells. :slight_smile: I don’t… nor with arrows (so far).

So it’s a pretty ‘chunky’ experience, but…

-bill!
(gotta run)On Wed, Mar 04, 2009 at 11:48:03AM -0800, NBarnes wrote:

I would assume by ‘8-way’ that he means that movement is allowed not
just on the cardinal directions, but also on the diagonals.

Bill Kendrick wrote:

True Gauntlet (arcade, NES version, etc.) usually uses sprites for the
players’ characters, meaning they can move wherever. ?The way I’ve coded it,
I could actually be dropping the players onto the map as cellular-automata
cells. :slight_smile: ?I don’t… nor with arrows (so far).

Without having a Gauntlet handy to check, I can’t confirm that. But a
lot of games that use sprites like that actually are quantized
movement based, rather than arbitrary movement. Even Diablo 2 only
seems arbitrary, because of the small cells used.