RHillFake Posted October 31, 2014 Share Posted October 31, 2014 Would there be a way to have a random generated playfield every time the Atari boots up? Thanks Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted October 31, 2014 Share Posted October 31, 2014 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? Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted October 31, 2014 Share Posted October 31, 2014 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) Quote Link to comment Share on other sites More sharing options...
RHillFake Posted November 1, 2014 Author Share Posted November 1, 2014 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 ) 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. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted November 1, 2014 Share Posted November 1, 2014 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/ Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted November 1, 2014 Share Posted November 1, 2014 (edited) Of what I can tell, it is the same every time just with some missing that will be added again (if that makes sense ) 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 November 1, 2014 by SpiceWare Quote Link to comment Share on other sites More sharing options...
RHillFake Posted November 2, 2014 Author Share Posted November 2, 2014 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 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.