Random level generator (0.3 for Blender 2.49)

Download v0.3 (Zip, 339kb)
Download v0.3 (7z, 169kb)

I started to work on random levels.
A few screenshots below, and a demo video here.
More details soon.


http://lh4.ggpht.com/_NgXGR9y5w6o/ScNeoCDUQUI/AAAAAAAAAMc/fjaeqCh8mbk/s400/dungeon1.jpghttp://lh6.ggpht.com/_NgXGR9y5w6o/ScNeoB6Ka8I/AAAAAAAAAMs/8frFFGdb8Os/s400/dungeon2.jpg
http://lh3.ggpht.com/_NgXGR9y5w6o/ScNjphmtrdI/AAAAAAAAAM0/KQTNFQ34oSU/s400/dungeon3.jpg
http://lh4.ggpht.com/_NgXGR9y5w6o/ScNeoLegZwI/AAAAAAAAAMk/xvgLPoK-Cjk/s800/dungeon%20medium.jpg

Ooo… I love it!!
Very claustrophobic looking…
I guess one could be lost for ages in there…
Now a nice monster/enemy animation that spawns all over the place and we’re set!

cool! i especialy liked the second appearing tower at 0:23 in the example video.

This is great, reminds me of rogue/angband.

I assume you are planning on releasing the script?

Very impressive, but please don’t tease, Will you release the script?

Of course I will release it, I just want it to have a clean GUI.
It won’t be too long (hopefully, if I got some spare time…).

Great, thanks.

Keep scriptin. nice job.

Wow, really cool!

I’m assuming these work in GE? I mean, that would seem to be self-evident.
I’ve been toying with the idea of a 3D re-imagining of NetHack for some time. With some item placement scripts and enemies, and of course the items and enemies to be placed, you’d be mostly there.
Out of curiosity, are all of the elements individual objects? I’m wondering how hard it would be to script in pseudo-dynamic level pieces, like ‘digging’ into a wall.
Anywho, looks amazing, and I’d love to get my hands on it, if only to test new character movement and rigs in a good environment.

Sweet!
You got referenced on Blender Nation BTW.:wink:

Yup cool, and they mention there’s already a downloadable version of the script, is that so? :wink:

Very nice work piiichan. I’m diggin it.

release?
please send a link

release?
please send a link

Its awesome Piiichan. Can wait for this scripts so i can try it out. Thanks a bunch!

Reminds me of The Elder Scrolls: Arena. Very nice work.

The script is released here.

It should be quite straightforward to use.

http://lh3.ggpht.com/_NgXGR9y5w6o/Sc9GhQOq_UI/AAAAAAAAAOE/QPOBskbSwmQ/s800/dungeon_generator_GUI.png

Just a few words about the algorithm so that you can understand what the various parameters are:
For each floor, a “worm” will carve its way through it in a random fashion. Every time the worm steps forward, it has to decide whether it will change its heading direction or not, and whether it should put a room at its current location or not. You can increase / decrease these two probabilities. When the worm has put all rooms in the current floor, the next floor is treated exactly in the same way.

Nb of rooms
The most basic way to control the size of a dungeon: more rooms = bigger dungeons
http://lh3.ggpht.com/_NgXGR9y5w6o/Sc9EGYNm4tI/AAAAAAAAANU/kJCzT1bDcEU/s800/rooms%3D5.pnghttp://lh6.ggpht.com/_NgXGR9y5w6o/Sc9EUfn94QI/AAAAAAAAAN8/1--vdBPm2Zg/s800/rooms%3D20.png

proba room
The probability that the worm will put a room each time its moves forward. Low values = longer corridors.
http://lh5.ggpht.com/_NgXGR9y5w6o/Sc9EGl53pZI/AAAAAAAAANc/tp7tqUAdpRI/s800/rooms%3D10_probaRoom%3D0.001.pnghttp://lh3.ggpht.com/_NgXGR9y5w6o/Sc9EGygIvAI/AAAAAAAAANk/8JDFFYJ8mMw/s800/rooms%3D10_probaRoom%3D0.05.png

proba turn
The probability that the worm will change its heading direction each time its moves forward. Low values = straight corridors, high values = twisty corridors.
http://lh4.ggpht.com/_NgXGR9y5w6o/Sc9EHdXfN2I/AAAAAAAAANs/7UZ4SElShgg/s800/rooms%3D10_probaTurn%3D0.01.pnghttp://lh4.ggpht.com/_NgXGR9y5w6o/Sc9EHhz2d8I/AAAAAAAAAN0/TGwR5-jrRBk/s800/rooms%3D10_probaTurn%3D0.2.png

Various notes

  • a black & white picture (called “Dungeon”) of the first floor of your dungeon is created every time you generate a new dungeon. If you change the dungeon dimensions, a new picture will be created with an incremented name (Dungeon.001, Dungeon.002, etc…)

  • many more features could be added, so feel free to customize this script to fit your needs

  • for now, floors do not communicate between one another, but this addition is very easy to do. Tell me if you need this functionality.

  • this script is unfortunately not usable in the Blender Game Engine, because updating a mesh is not possible while a game is running (as far as I know). I tried it without success, the mesh is updated as soon as the game is stopped though.

  • spotted a bug? Post it here.

  • thank you all for your kind comments!

ENJOY

I opened up the Blend file and deleted the existing dungeon, then I ran the script. I turned on “With Lights” and set the lights probability to 0.3. I get an error when click “Create Dungeon”.

File dungeon.py, line 172 in bevent
File dungeon.py, line 436 in createMesh
Runtime ERror, can’t find an object for the mesh

I also deleted the existing dungeon, and it didn’t work. I then tried not deleting the existing dungeon, and that worked fine. Very nice. Thanks.

Don’t delete the existing Dungeon, it kind of becomes the new one…

Wonderful script, I can just imagine what this can be used for!