+Random Terrain Posted August 18, 2011 Share Posted August 18, 2011 Thanks to jwierer's latest change to Visual batari Basic, I can use data that can be read and poked directly into playfield variables, starting and ending anywhere I want, so this random maze test is even faster now: Latest Version Here's the .bin file to use with an emulator or a Harmony cart on a real Atari 2600: random_maze_test_16x16x16_with_fast_data_32x23_2012y_11m_22d_0322t.bin Press Reset or the fire button to get a new maze. Related thread: http://www.atariage.com/forums/topic/205563-whats-so-great-about-vbbs-convert-to-data-file-example-program/ ---------------------------------------------------- OK, this one has 16 x 16 x 16 pieces that the program can randomly choose from. After getting math help from RevEng, I now understand that this maze has 4,096 possible combinations. [Oops! I introduced a bug where the top section was sharing the memory of the middle section. That has been fixed.] Here's the .bin file to use with an emulator or Harmony cart: random_maze_test_16x16x16_with_scroll_32x23_2011y_08m_21d_2001t.bin ---------------------------------------------------- I forgot to do it before, but I just remembered and added a little bit of memory so no section can display a piece twice in a row. For example, if piece 6 was the last middle piece used, piece 6 can't be displayed this time. Here's the .bin file to use with an emulator or Harmony cart: random_maze_test_with_scroll_32x23_2011y_08m_21d_0321t.bin ---------------------------------------------------- Below is an updated version using the scrolling technique posted by theloon instead of reading data. You can see a slowed down working example in this post. The random-ish mazes in my original post were in 3 section and each section had 7 pieces that the program could randomly choose from. This version is similar, but I adjusted the look of a couple of the pieces and added one more piece to each of the 3 parts, so now each section has 8 pieces that the program can choose from. Here's the .bin file to use with an emulator or Harmony cart: random_maze_test_with_scroll_32x23_2011y_08m_20d_0820t.bin Please let me know if you like it or hate it or find a mistake in the mazes. Once this is working properly, I'll use the mazes for the new version of Bloober and the Gnarl. ---------------------------------------------------- Original Post Below is a test program that creates random-ish mazes. Press the Reset switch or the fire button to make a new maze. Here's the .bin file to use with an emulator or Harmony cart: random_maze_test_32x23_2011y_08m_18d_0830t.bin I created the mazes using Visual batari Basic's playfield editor, then converted the playfields to data using jrok's idea. It seems to waste more space and is clearly slower than using pfhline and pfvline, but converting the playfields to data is faster and easier (and you can see the shape of the playfields in the data). If you get a chance, try it out and let me know if you think the mazes are good enough the way they are or if you think I should work on them some more. Thanks. Quote Link to comment Share on other sites More sharing options...
Trinity Posted August 18, 2011 Share Posted August 18, 2011 Below is a test program that creates random-ish mazes. Press the Reset switch or the fire button to make a new maze. Here's the .bin file to use with an emulator or Harmony cart: random_maze_test_32x23_2011y_08m_18d_0830t.bin I created the mazes using Visual batari Basic's playfield editor, then converted the playfields to data using jrok's idea. It seems to waste more space and is clearly slower than using pfhline and pfvline, but converting the playfields to data is faster and easier (and you can see the shape of the playfields in the data). If you get a chance, try it out and let me know if you think the mazes are good enough the way they are or if you think I should work on them some more. Thanks. Random Maze... Random Terrain.... Quote Link to comment Share on other sites More sharing options...
Animan Posted August 19, 2011 Share Posted August 19, 2011 While they all look a bit "the same", it's certainly really nice. Very good random maze generator. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted August 19, 2011 Share Posted August 19, 2011 Nothing wrong with your mazes for Pac-Man or Wizards of Wor. Have you considered anything like my Destiny WIP where I stack 3 random sections to make one screen? You could then augment them with a few random walls or passages. Bet it'd be slightly quicker. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 19, 2011 Author Share Posted August 19, 2011 (edited) Nothing wrong with your mazes for Pac-Man or Wizards of Wor. I'm redoing Bloober and the Gnarl because the old 'maze' was too small and my old code sucked. After I'm satisfied with this random-ish maze, I'll change the sprites, add sound effects, make the Gnarl see again and upgrade his brain. Have you considered anything like my Destiny WIP where I stack 3 random sections to make one screen? You could then augment them with a few random walls or passages. Bet it'd be slightly quicker. The old smaller maze from 2008 was basically created in 3 parts (top, middle and bottom) using pfhline and pfvline. Each section had 7 'pieces' to randomly choose from. I did a similar thing this time, but instead of using pfhline and pfvline, I used data and pfpixel like this: data Maze_Data_Middle_04 1,1,1,0,0,1,0,0,1,1,1,0,0,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,1,1, 0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0, 0,0,1,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0, 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, 0,0,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,0,0, 255 end That's why it's so slow. I forgot to look at your Destiny WIP code until now. I see that you're using scrolling, but I'm not exactly sure how it works. If you get a chance, do you think you could post a new thread with a small example program showing how others could use your technique? Then I could link to it from the bB page (and hopefully use it in the test program in the first post to make faster random-ish mazes). Edited August 19, 2011 by Random Terrain Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 20, 2011 Author Share Posted August 20, 2011 (edited) I forgot to look at your Destiny WIP code until now. I see that you're using scrolling, but I'm not exactly sure how it works. If you get a chance, do you think you could post a new thread with a small example program showing how others could use your technique? Then I could link to it from the bB page (and hopefully use it in the test program in the first post to make faster random-ish mazes). No need for that. I thought it was more complicated than it was. I made a couple of quick non-random test programs just to see what it would look like using scrolling. Here's a slow version that shows the scrolling: scroll_test_slow_2011y_08m_20d_0332t.bin Here's a faster version that blanks the screen while scrolling so it won't make people puke: scroll_test_fast_2011y_08m_20d_0410t.bin (Press the Reset switch or the fire button to restart the program.) Here's a question for anyone reading this. The blanking out of the faster version would only happen at the beginning of a game, when the reset switch is pressed, or if I make it so the player can move from one maze to another after completing a task of some kind. Do you think it's fast enough? (Press the fire button over and over again to see if you think the screen stays black for too long.) Edited August 20, 2011 by Random Terrain Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted August 20, 2011 Share Posted August 20, 2011 I think it's fast enough. My Destiny WIP is in danger of being annoying because you're constantly changing screens. The time it takes to wend your way to the exits in your mazes is enough delay. I'm glad you figured it out I was a bit confused looking at my old code. The premise, fortunately, is simple: Use partial playfield: statements and then push the screen so a new layer of playfield: statements can be drawn. 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 20, 2011 Author Share Posted August 20, 2011 (edited) Oops. Double post. I got boned by the 5 a.m. forum backup. Edited August 20, 2011 by Random Terrain Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 20, 2011 Author Share Posted August 20, 2011 I think it's fast enough. Thanks. I'll start converting the program in the first post right now. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 20, 2011 Author Share Posted August 20, 2011 Thanks. I'll start converting the program in the first post right now. I'm finally done. The latest version is in the first post. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 21, 2011 Author Share Posted August 21, 2011 (edited) I added a little change so there are no immediate repeats. The latest .bin file is in the first post. Next step is to see if I can have 16 pieces for each section instead of 8. Edited August 21, 2011 by Random Terrain Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 21, 2011 Author Share Posted August 21, 2011 New version is in the first post. This time each of the 3 sections has 16 pieces to choose from, instead of 8. 16 x 16 x 16 = 4,096 combinations Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 23, 2011 Author Share Posted August 23, 2011 If nobody can find any problems, I'm moving to the next step: Time to get Bloober and the Gnarl finished for the Atari 2600 I'm still trying to work out the details. If anyone has any ideas, please post a reply in my blog (or here in this thread if you want). Thanks. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted November 22, 2012 Author Share Posted November 22, 2012 I just put the latest version in the first post. It uses super-fast data that can be read and poked directly into the playfield variables. Quote Link to comment Share on other sites More sharing options...
Retro Lord Posted March 11, 2015 Share Posted March 11, 2015 Your A.I is really good for the ghost, it seems to work really well, would you mind telling how you did it? =) Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 12, 2015 Author Share Posted March 12, 2015 Your A.I is really good for the ghost, it seems to work really well, would you mind telling how you did it? =) There are two versions on the bB page, but I think the ghost movement code is basically the same: randomterrain.com/atari-2600-memories-batari-basic-commands.html#maze_32x23 randomterrain.com/atari-2600-memories-batari-basic-commands.html#maze_32x12 Just remember that a better programmer could have done it using less code. I haven't moved past the bloated code stage. Quote Link to comment Share on other sites More sharing options...
Retro Lord Posted March 12, 2015 Share Posted March 12, 2015 Cheers! 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.