Jump to content

Photo

Random Maze Test 2011


16 replies to this topic

#1 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 28,877 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Aug 18, 2011 7:03 AM

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:

Attached File  random_maze_test_16x16x16_with_fast_data_32x23_2012y_11m_22d_0322t.bin   32KB   195 downloads


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:

Attached File  random_maze_test_16x16x16_with_scroll_32x23_2011y_08m_21d_2001t.bin   32KB   187 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   32KB   164 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   32KB   214 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   32KB   221 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.

#2 Trinity ONLINE  

Trinity

    Stargunner

  • 1,944 posts

Posted Thu Aug 18, 2011 7:37 AM

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   32KB   221 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.


Random Maze... :ponder:

Random Terrain.... :ponder:

#3 Animan OFFLINE  

Animan

    River Patroller

  • 2,391 posts
  • Just some guy who plays Atari and watches Anime.
  • Location:Texas

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 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,313 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 ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Aug 19, 2011 1:40 AM

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


#6 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Aug 20, 2011 2:04 AM

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   32KB   206 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   32KB   206 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 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,313 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 ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 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 ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Aug 20, 2011 3:11 AM

I think it's fast enough.

Thanks. I'll start converting the program in the first post right now.

#10 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Aug 20, 2011 7:07 AM

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 ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 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 ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 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 ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 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.

#14 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Nov 22, 2012 3:27 AM

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.

#15 Retro Lord OFFLINE  

Retro Lord

    Moonsweeper

  • 363 posts
  • Location:Sweden

Posted Wed Mar 11, 2015 5:32 PM

Your A.I is really good for the ghost, it seems to work really well, would you mind telling how you did it? =)



#16 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 28,877 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Wed Mar 11, 2015 6:30 PM

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.



#17 Retro Lord OFFLINE  

Retro Lord

    Moonsweeper

  • 363 posts
  • Location:Sweden

Posted Wed Mar 11, 2015 9:43 PM

Cheers!






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users