Jump to content

[PYTHON] Maze Based Road Generator


Atom

Recommended Posts

Hi All,

 

I have my first success with generating objects using Python in Houdini and I thought I post a couple of images. The concept is that an ASCII based maze is generated internally with gaps and walls. The code converts gaps into roads and walls into grass. At each step in the maze neighbors are examined and a different tile type is used that fits requirement for that space in the maze.

 

ASCII View:

post-12295-0-52717900-1417666341_thumb.j

 

Top View:

post-12295-0-22710300-1417665505_thumb.j

 

Camera View:

post-12295-0-18366200-1417665999_thumb.j

 

The Basic Tile Set: pieces that make up the final image.

post-12295-0-63338600-1417665803_thumb.j

Edited by Atom
  • Like 1
Link to comment
Share on other sites

I have added a simple python based maze solver to the road generator. The solution acts as "high" roads. The path along the solution ares the elevated road segments. There is some logic in place to detect when a hill or ramp is needed to connect to the other low road segments. I have pulled in some more of eRacoon's tiles to support the new features.

 

ASCII View:

post-12295-0-52722900-1418000204_thumb.j

 

Camera Views:

 

The branch rate parameter for the generation algorithm controls how straight or curvy the resulting maze ends up. The usable range is in the value of -10 to 10.

 

Maze Branch Rate: 2

post-12295-0-45466500-1418000209_thumb.j

 

Maze Branch Rate: -6

post-12295-0-79852800-1418000911_thumb.j

 

Maze Branch Rate: 6

post-12295-0-90087100-1418001349_thumb.j

 

Revised Tile Set:

post-12295-0-68426800-1418000200_thumb.j

Edited by Atom
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...