Jump to content
  • entries
    650
  • comments
    2,592
  • views
    867,803

There be Walls

SpiceWare

1,405 views

Initial wall routines.

 

The way this works is you are in a room denoted by X, Y coordinates. Exiting left/right will change the X coordinate while exiting up/down will change the Y coordinate. Each coordinate is an 8 bit value, so it wraps at 0/255.

 

Starting with a room with 8 posts:

blogentry-3056-0-99971800-1304474346_thumb.png

 

Draw a single wall from each post, going either up/down/left/right. To control the drawing, I'm currently* using the X coordinate for the top 4 posts and the Y coordinate for the bottom 4 posts. There's 8 bits per coordinate, so I'm using paired bits to control the direction. Walls can overlap, so you won't always see 8 walls.

 

  • direction control
  • 00 = up
  • 01 = right
  • 10 = down
  • 11 = left

 

By using the room coordinates as the starting point for wall generation, you'll be able to exit right, up, left, then down and return to the room you started from.

 

For test purposes the joystick currently controls the coordinates, which are shown in the score. I shut my eyes and held the joystick in a few directions before stopping - results are:

blogentry-3056-0-30868900-1304474106_thumb.png

blogentry-3056-0-40394700-1304474115_thumb.png

blogentry-3056-0-46351400-1304474123_thumb.png

 

* I plan to use the X-Y coordinates as a 16 bit seed into a 16 bit random number generator. To draw the walls I'll then seed the generated with the coordinates and advance it to the next random number (I might need to advance it 2 times, or even more, but whatever I use will be a fixed # of advances). That number will be split into the high and low bytes and those bytes will control the drawing of the walls.

 

 

 

NTSC

f20110503_NTSC.bin

 

PAL - let me know if the score is visible on PAL TVs, I made need to shift it upward based on Stella.

f20110503_PAL.bin

 

Source

Frantic20110503.zip



3 Comments


Recommended Comments

Thanks!

 

I'd read something last year about how the arcade version of Berzerk drew the maze, and it was along these lines. In theory there are 65,536 distinct rooms, but the reality is some of the rooms will look the same even if they're not drawn the same. For instance, both of these wall patterns will result in the center of the room being walled off from the edges:

 

DLLL

RRRU

 

RRRD

ULLL

Share this comment


Link to comment

We've been considering doing a Berzerk game for the Jag, I'll watch this with interest :)

Share this comment


Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...