Jump to content
Sign in to follow this  
Atom

[PYTHON] Maze Based Road Generator

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×