Jump to content



1

Random Maze Test 2011


12 replies to this topic

#1 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Aug 18, 2011 7:03 AM

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


Latest Version

Here's the .bin file to use with an emulator or Harmony cart:

Attached File  random_maze_test_16x16x16_with_scroll_32x23_2011y_08m_21d_2001t.bin   32K   48 downloads



----------------------------------------------------



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:

Attached File  random_maze_test_with_scroll_32x23_2011y_08m_21d_0321t.bin   32K   26 downloads



----------------------------------------------------



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:

Attached File  random_maze_test_with_scroll_32x23_2011y_08m_20d_0820t.bin   32K   41 downloads


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:

Attached File  random_maze_test_32x23_2011y_08m_18d_0830t.bin   32K   54 downloads


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.

Edited by Random Terrain, Sun Aug 21, 2011 7:49 PM.


#2 Trinity ONLINE  

Trinity

    Dragonstomper

  • 663 posts

Posted Thu Aug 18, 2011 7:37 AM

View PostRandom Terrain, on Thu Aug 18, 2011 7:03 AM, said:

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:

Attachment 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... :ponder:

Random Terrain.... :ponder:

#3 Animan OFFLINE  

Animan

    River Patroller

  • 2,124 posts
  • I'm a guy... I just happen to like Sailor Moon.

Posted Thu Aug 18, 2011 8:46 PM

While they all look a bit "the same", it's certainly really nice. Very good random maze generator.

#4 theloon OFFLINE  

theloon

    Stargunner

  • 1,015 posts

Posted Thu Aug 18, 2011 9:45 PM

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.

#5 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Aug 19, 2011 1:40 AM

View Posttheloon, on Thu Aug 18, 2011 9:45 PM, said:

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.



View Posttheloon, on Thu Aug 18, 2011 9:45 PM, said:

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 by Random Terrain, Fri Aug 19, 2011 5:34 AM.


#6 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Aug 20, 2011 2:04 AM

View PostRandom Terrain, on Fri Aug 19, 2011 1:40 AM, said:

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:

Attached File  scroll_test_slow_2011y_08m_20d_0332t.bin   32K   30 downloads


Here's a faster version that blanks the screen while scrolling so it won't make people puke:

Attached File  scroll_test_fast_2011y_08m_20d_0410t.bin   32K   30 downloads


(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 by Random Terrain, Sat Aug 20, 2011 2:13 AM.


#7 theloon OFFLINE  

theloon

    Stargunner

  • 1,015 posts

Posted Sat Aug 20, 2011 2:49 AM

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.

#8 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Aug 20, 2011 3:01 AM

Oops. Double post. I got boned by the 5 a.m. forum backup.

Edited by Random Terrain, Sat Aug 20, 2011 3:13 AM.


#9 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Aug 20, 2011 3:11 AM

View Posttheloon, on Sat Aug 20, 2011 2:49 AM, said:

I think it's fast enough.
Thanks. I'll start converting the program in the first post right now.

#10 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Aug 20, 2011 7:07 AM

View PostRandom Terrain, on Sat Aug 20, 2011 3:11 AM, said:

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.

#11 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Aug 21, 2011 1:51 AM

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 by Random Terrain, Sun Aug 21, 2011 8:34 AM.


#12 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Aug 21, 2011 12:19 PM

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 :-o

#13 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Aug 22, 2011 8:59 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users