random level generator

  • If you're asking a question make sure to set the thread type to be a question!

martijntje

L8: Fancy Shmancy Member
Aug 2, 2009
539
334
I've been working on this for some days and thought the community might be interested in seeing it.
30ht2d4.jpg

33ubtc8.jpg

the current version just creates a field of random cubes, but in future version I plan to make it so it generate blocked out maps, so in case of a mappers block, the program gives you a random layout of the map.

btw, it generates a .vmf, not a .bsp

Still thinking of a fitting name, so if you have a suggestion, you are free to tel me.
 

Drexer

L2: Junior Member
Jun 23, 2009
66
42
Oh wow. Nice.

How about cp/ctf/whatever_rand() ?

Seriously, I'm still surprised.
 
Feb 14, 2008
1,051
931
I've been trying something like this myself, but more ambitious.

You simply have to understand the brush VMF, and then you're literally free to go. You'd need some pretty neat algorithms to make a true random level generator.

I'd class this as an experiment rather than a success.
 

Dr. ROCKZO

L8: Fancy Shmancy Member
Jul 25, 2009
580
159
Dice.

Getting it to go from random cubes to flowing maps would be a massive process, good luck!
 

martijntje

L8: Fancy Shmancy Member
Aug 2, 2009
539
334
Oh wow thats super cool! How did you do it?

a simpel c++ program, generates a vmf, aka a text file. in it simplest form it just generates a empty, yet valid vmf. however I have a function add_brush wich, when given some coordinates adds a brush to the map. then somewhere in between writing the file, I add some brushes to make the skybox and ground and then randomly add a set amount of cubes, finish up writing the file.

then I open up the file in hammer, add light entities, fix all problems (pretty much every brush has the texture perpendicular to face error) and compile it.
 

martijntje

L8: Fancy Shmancy Member
Aug 2, 2009
539
334
I'd class this as an experiment rather than a success.
if you are talking about the one map I show you here, yes that is indeed just an experiment, the final version will act quite different from this one.

the main problem I think I will have are indoor areas and vertical stuff (bridges between buildings etc)
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
To be honest Mart, i think you could get away with just creating world geometry and leave the building of inner and more sophisticated structures to the imagination of the designer.

Simply laying down a block to represent a route or building is usually enough to wet the inspiration glands.
 

Dr. Spud

Grossly Incandescent
aa
Mar 23, 2009
880
854
You could start by simply having it generate a floor plan. That would simplify the coding, but still leave the user with something useful. Plus when you're dealing with planes, you could more easilly implement functions to limit sightlines and such.
 

martijntje

L8: Fancy Shmancy Member
Aug 2, 2009
539
334
You could start by simply having it generate a floor plan. That would simplify the coding, but still leave the user with something useful. Plus when you're dealing with planes, you could more easilly implement functions to limit sightlines and such.

yeah, I already planned my first release to only do ground level stuff. I never thought of using sightlines, I see what I can do with that.
 

Numerous

L4: Comfortable Member
Oct 14, 2009
150
72
Guilt trip any coding mappers (that know c++, ie mappers that can help code) into helping you out. Tell them it could revolutionise mapping.

You don't have to tell them the probability though.
 
Feb 14, 2008
1,051
931
/me begins working on an algorithm to beat martinjeje mwahaha