Jump to content
IGNORED

random playfield


RHillFake

Recommended Posts

 temp1 = (rand&31)
 temp2 = (rand&7) - 1
 pfpixel temp1 temp2 flip

If you run some loops of this it'll fill the playfield with stuff (and things)

 

Of what I can tell, it is the same every time just with some missing that will be added again (if that makes sense :P )

 

This program creates a new random-ish maze whenever the Atari 2600 is turned on and when the reset switch is pressed:

 

atariage.com/forums/topic/186523-random-maze-test-2011/

 

Is that the kind of thing you are talking about?

Yeah, that's what I mean. Although, based on the posts on it, I cant figure out how to do it.

Link to comment
Share on other sites

Of what I can tell, it is the same every time just with some missing that will be added again (if that makes sense :P )

 

Yeah, that's what I mean. Although, based on the posts on it, I cant figure out how to do it.

Yep - that's because there's no such thing as Random when computers are involved. For Atari games we use what's known as a Linear Feedback Shift Register (LFSR) to simulate random numbers. Due to limited RAM, 2600 games typically use an 8-bit LFSR, which will generate a sequence of numbers that repeat after 255 values. If you have RAM to spare, using a 16-bit LFSR will give you a sequence that repeats after 65,535 numbers.

 

One way to help make the sequence appear more random is to make the user's actions a contributing factor. In my games I'll read the LFSR once every frame and throw the value away. This makes it so when the user hits RESET to start the game you'll be at an unknown position in the sequence for when the game code starts to use the random numbers.

Edited by SpiceWare
Link to comment
Share on other sites

For that random-ish maze, I used the data that VbB can make. Take a look at this thread:

 

atariage.com/forums/topic/205563-whats-so-great-about-vbbs-convert-to-data-file-example-program/

Thanks, I'll try to see if I can figure out how to do it :)

 

Yep - that's because there's no such thing as Random when computers are involved. For Atari games we use what's known as a Linear Feedback Shift Register (LFSR) to simulate random numbers. Due to limited RAM, 2600 games typically use an 8-bit LFSR, which will generate a sequence of numbers that repeat after 255 values. If you have RAM to spare, using a 16-bit LFSR will give you a sequence that repeats after 65,535 numbers.

 

One way to help make the sequence appear more random is to make the user's actions a contributing factor. In my games I'll read the LFSR once every frame and throw the value away. This makes it so when the user hits RESET to start the game you'll be at an unknown position in the sequence for when the game code starts to use the random numbers.

Interesting...who knew...well, you did...and Wikipedia :P

Thanks :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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...