Page 1 of 4 123 ... LastLast
Results 1 to 15 of 48

Thread: HOW?: designing a 3 dimensional, zero gravity maze

  1. #1
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,733

    Question HOW?: designing a 3 dimensional, zero gravity maze

    How might one approach this task:

    Imagine a game in which a cube is divided up into a maze by internal compartments, very like those transparent plastic "guide the marble thru the maze" toys, but with more divisions, maybe twelve to an edge, for a total of ...1728 compartments! Well, maybe that's a bit too many, maybe 8 to the side for 512 compartments.

    Anyway, this will be the playing field for a Unity game, the player will guide "a craft" thru the maze.

    What might be an efficient way to lay out successful paths thru the maze, with a few dead-ends and whatnot?

    I think I've finally found something it makes sense to design INSIDE V.R.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,795
    If you have access to a vectorizing tool (I use CorelDraw), you could use an online maze generator, such as this one:

    http://www.mazegenerator.net/

    NOTE: the usage terms of this maze generator require a commercial license for commercial use

    to generate 8 layers of maze, and specify PNG (with solution) as the download format. Vectorize with the tool of your choice and use Extrude and Move to create the walled maze for each successive layer. Between the layers, you could create a solid wall, using Solid Drill with a set of corridor-sized cubes in the background to create several openings between each two adjacent layers with at least one opening along both the solution paths of the two layers (if such a spot doesn't exist, may have to regenerate one of the layers).

    mTp
    Last edited by MonroePoteet; 09-25-2018 at 11:49 AM.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,795
    For example, attached is a LW2015 scene file and object:

    Click image for larger version. 

Name:	8x8x8_Maze_1_SolutionSplineCrawler_rgb_010.jpg 
Views:	89 
Size:	113.1 KB 
ID:	142890 Click image for larger version. 

Name:	8x8x8_Maze_1_SolutionSplineCrawler_rgb_100.jpg 
Views:	98 
Size:	172.7 KB 
ID:	142891

    Click image for larger version. 

Name:	8x8x8_Maze_1_SolutionSplineCrawler_rgb_150.jpg 
Views:	74 
Size:	140.1 KB 
ID:	142892 Click image for larger version. 

Name:	8x8x8_Maze_1_SolutionSplineCrawler_rgb_190.jpg 
Views:	70 
Size:	104.9 KB 
ID:	142893

    8x8x8_Maze_1_SolutionSplineCrawler.mov

    This scene uses a Spline Control to move a multi-segment tube through the maze along the "multi-layer solution path". The Spline could also be used to move a "vehicle" through the maze on the solution path.

    The method described above (https://forums.newtek.com/showthread...=1#post1555289) was used to create 8 maze layers. For each layer, a "corridor size cube" was pasted into various places to cut the "intra-layer walls" (Layer 10):

    Click image for larger version. 

Name:	MakePortalsBetweenLayers.jpg 
Views:	78 
Size:	1.03 MB 
ID:	142895 Layer 1 in foreground, layer 2 background, position corridor cubes

    Click image for larger version. 

Name:	IntraLayerWallsWithPortalsDrilled.jpg 
Views:	53 
Size:	934.3 KB 
ID:	142896 Intra-layer walls with all corridors drilled with Solid Drill

    Click image for larger version. 

Name:	CreateMultiLayerSolutionCurveForSpline.jpg 
Views:	54 
Size:	932.7 KB 
ID:	142899 Create 2-point polys from each layer to next for multi-layer solution path curve (for Spline)

    This is a simplistic approach to producing the cross-layer corridors with Solid Drill, with the solution path always moving from Layer 1 to Layer 8. A more complex 3D maze could be made by requiring the user to "backtrack" back toward Layer 1, and other variations.

    mTp
    Attached Files Attached Files
    Last edited by MonroePoteet; 09-25-2018 at 03:57 PM. Reason: Add link to "described above"

  4. #4
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,733
    Thanks, MonroePoteet! Amazing finds and work!
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  5. #5
    Super Member XswampyX's Avatar
    Join Date
    Aug 2010
    Location
    Kernow
    Posts
    2,078
    You could create a Lscript to do it...

    Click image for larger version. 

Name:	Lscript_Maze.jpg 
Views:	120 
Size:	455.0 KB 
ID:	142920

  6. #6
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,733
    Quote Originally Posted by XswampyX View Post
    You could create a Lscript to do it...
    Click image for larger version. 

Name:	Lscript_Maze.jpg 
Views:	120 
Size:	455.0 KB 
ID:	142920
    For certain values of "you".

    Is the 2nd part of the IF clauses checking for the boundaries???

    And: did you just have this lying around???
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  7. #7
    Super Member XswampyX's Avatar
    Join Date
    Aug 2010
    Location
    Kernow
    Posts
    2,078
    Quote Originally Posted by jeric_synergy View Post
    For certain values of "you".

    Is the 2nd part of the IF clauses checking for the boundaries???

    And: did you just have this lying around???
    Haha. I'll post it when it's finished.

    I started writing it 2 days ago.

    It's quite clever. start in a grid, select 4 vales for directions, shuffle them, and then check each one to see if it's solid/not visited. If it is then move there and call the procedure again, from inside the procedure.

    But....

    LW's stack is too small and anything over 51 x 51 crashes it.

    Cheers!

  8. #8
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,527
    XswamyX : Stack is too small? Create your own, and instead of making it recursive, have it just keep looping until all cells are visited, ie, the stack is empty.

    I was thinking of a rules based system...

    For the maze:
    -You may have 2 openings leading out of the volume.
    -They may not be next to each other.
    -An arbitrary random seed is used to generate unique maze volumes.

    For each cell:
    -Each cell has a minimum of 1 exit, and a maximum of 3.
    -Any exit is at the center of a face, for a total of 6 possible locations.
    -No cell can have an exit to the outside beyond the first two (Entrance and exit are generated outside of the main loop).

    Certain conditions will have to be checked, and a generated exit will have to be discarded.
    A solution path would be generated first, then branches off that path generated.

    I'll have to start putting some code together, and see what I come up with.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  9. #9
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,733
    Quote Originally Posted by XswampyX View Post
    Haha. I'll post it when it's finished.
    I started writing it 2 days ago.
    It's quite clever. start in a grid, select 4 vales for directions, shuffle them, and then check each one to see if it's solid/not visited. If it is then move there and call the procedure again, from inside the procedure.
    LW's stack is too small and anything over 51 x 51 crashes it.
    Cheers!
    So, it's recursive. (That always makes my head hurt.) Me no comprendo how such an algorithm guarantees that each square gets visited, and what determines if it's cleared or left alone.

    INNNnnnteresting....
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  10. #10
    Founding member raymondtrace's Avatar
    Join Date
    May 2003
    Location
    Ohio
    Posts
    864
    While this exercise is interesting, design ethics should be considered. A 2D maze can be navigated because the viewer can observe the entirety of the path. If you place the viewer within a 3D maze without any visual cues about what is up/down, left/right, or where they have already been, you may very well lead someone to madness. This is on your head. Consult your conscience before proceeding.
    LW7.5D, 2015, 2018, 2019 running portably on a USB drive on an Amiga 2500 running Wine.

  11. #11
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,733
    LOL, yes, I've considered that. For one thing, Walls would be differently colored, textured, or you'd never get out (heck, I get lost in PORTAL). Humans are probably crap at true 3D mazes, considering people manage to get lost in New York City.

    I think aircraft carriers are probably the closest we come to nightmarish 3D mazes.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  12. #12
    Super Member XswampyX's Avatar
    Join Date
    Aug 2010
    Location
    Kernow
    Posts
    2,078
    So I've coded my own stack and can now create them any size!

    But it's a bit s l o w....

    101 x 101

    Click image for larger version. 

Name:	Maze_100x100.jpg 
Views:	90 
Size:	479.6 KB 
ID:	142935

    So now what?

    This with options, or the 3D full on mental maze?
    Attached Files Attached Files
    Last edited by XswampyX; 09-28-2018 at 03:14 PM.

  13. #13
    Super Member XswampyX's Avatar
    Join Date
    Aug 2010
    Location
    Kernow
    Posts
    2,078
    Quote Originally Posted by jeric_synergy View Post
    So, it's recursive. (That always makes my head hurt.) Me no comprendo how such an algorithm guarantees that each square gets visited, and what determines if it's cleared or left alone.

    INNNnnnteresting....
    It's quite simple.... Really!

    Imagine if you will you have a Dwarf who will only dig into an empty grid space.
    He does just that and digs into the empty space.
    But he doesn't walk into the empty space he gets his twin brother to walk into it and dig into another empty space.
    When he has dug into his empty space he doesn't walk into it he gets another twin brother to dig from the new empty space.
    This third brother can only dig one hole from his original (third) space so quits the dig and has a nice cup of tea.
    The second brother then turns around and digs out another free space and calls the third brother back in to dig from this new position.
    They carry this on until only the original dwarf is left on the site, and if he can't dig then the maze is done.

    This is great and all that, but you might need 10,000 brothers!

  14. #14
    Super Member XswampyX's Avatar
    Join Date
    Aug 2010
    Location
    Kernow
    Posts
    2,078
    Well here it is!

    Click image for larger version. 

Name:	AMazeXSX.jpg 
Views:	99 
Size:	446.1 KB 
ID:	142954

    AMaze_XSX.zip

    Don't go mad on the size!

  15. #15
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,733
    Quote Originally Posted by XswampyX View Post
    It's quite simple.... Really!

    Imagine if you will you have a Dwarf who will only dig into an empty grid space.
    He does just that and digs into the empty space.
    But he doesn't walk into the empty space he gets his twin brother to walk into it and dig into another empty space.
    When he has dug into his empty space he doesn't walk into it he gets another twin brother to dig from the new empty space.
    This third brother can only dig one hole from his original (third) space so quits the dig and has a nice cup of tea.
    The second brother then turns around and digs out another free space and calls the third brother back in to dig from this new position.
    They carry this on until only the original dwarf is left on the site, and if he can't dig then the maze is done.

    This is great and all that, but you might need 10,000 brothers!
    ???... still confused: by the first "empty grid space" above, do you mean "unchecked" or "unsurveyed"? This seems like it would eventually just empty the grid. And where does the randomization occur?
    Last edited by jeric_synergy; 09-30-2018 at 12:44 PM.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •