Maze Heightmap???

Blitz3D Forums/Blitz3D Beginners Area/Maze Heightmap???

sonokong(Posted 2006) [#1]
Does anyone have a maze heightmap that I can use? If so, please post it here. Thanks.


H&K(Posted 2006) [#2]
http://images.google.co.uk/images?q=Mazes&hl=en


sonokong(Posted 2006) [#3]
Hey, thanks


PowerPC603(Posted 2006) [#4]
You can create your own heightmaps using my maze-generator.
It produces only square mazes and saves the generated maze as a bitmap.
When executing MazeGenerator.exe, you're asked for the size of the maze.

You can also convert the maze structure into a datafile (custom filetype, created by me) using MazeConverter.exe.
It scans the bitmap and generates some codes, which will be used by Maze3D.exe to generate the maze in 3D.
Maze3D.exe reads the Maze.dat file and generates the maze in 3D. You're allowed to walk through it and collect coins, nothing more (there isn't any more to do).

http://users.telenet.be/vge/downloads
The file MazePack.zip only contains the EXEs and the textures (feel free to replace them by your own).
The file Maze3DComplete.zip contains all source-files of Maze3D.exe.

NOTE:
When you plan to walk through it in 3D (using MazeConverter.exe and Maze3D.exe), you can use values up to 50, otherwise the maze becomes too big and DirectX can't handle it (max 32.000 polygons per mesh) and you'll get an "Memory Access Violation" error.


Boiled Sweets(Posted 2006) [#5]
PowerPC603,

how are you building your 3d maze, is it effectively a cube per wall chunk. This would be hugely inefficient as you have discovered.

Perhaps you could be a little smarter, ie. if a wall went...

01110

then all you would need is 8 triangles not 16 as the 'long' walls could be made of 2 triangles not 6.


PowerPC603(Posted 2006) [#6]
If you have a maze of size 5x5, then the maze has 25 sections.
Each section is created separately, without scanning neighboring sections to cut down on triangles or anything.
If you look ate the Maze.dat file using Notepad (it's a simple ASCII textfile), you'll see that each section has a single-char code, using values 1-9 and A-F.
If you take the bitmap and the Maze.dat file, you can see which section-structure has which code.
I've all forgotten them, because it was a project of more than 1 year ago.

But all sections are joined into 1 big mesh, as the maze-generator code (which creates the layout of the maze) was code from a Visual Basic project, which I found on the Internet.
There each section was created using separate meshes and a maze of size 10x10 was lagging like hell (that maze had 100 separate meshes and thus 100 separate surfaces).
Now even a maze of size 50x50 runs smooth, because it's only 1 big mesh with only 1 surface.

Indeed, this results in more triangles as there is no real optimization.
But when you look at the code, you will see that a "long wall" has 4 triangles.
2 triangles are for creating the wall, the other 2 are for creating the top of the wall.
If you press the spacebar (deactivate gravity) and then Z or S (going up or down respectively), you'll see that the walls are not actually open when you look down.
You can also walk on top of the walls.
Pressing spacebar toggles gravity on/off (default is On), pressing z and s raises or lowers the camera in height, so you can see the maze from above.


But this was my first attempt to create meshes using code, so it's not that bad for a first try, is it?

Optimizing the maze would cut down on vertices and triangles, but then each section would need to scan all surrounding sections to see if a wall can be created that's longer than one section (joining 2 or more sections together).

This would go beyond my programming skills.