random level generator

Discussion in 'Mapping Questions & Discussion' started by martijntje, Jan 12, 2010.

  1. martijntje

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    I've been working on this for some days and thought the community might be interested in seeing it.
    [​IMG]
    [​IMG]
    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.
     
    • Thanks Thanks x 2
  2. The Political Gamer

    aa The Political Gamer

    Messages:
    4,468
    Positive Ratings:
    1,684
    Oh wow thats super cool! How did you do it?
     
  3. Drexer

    Drexer L2: Junior Member

    Messages:
    66
    Positive Ratings:
    39
    Oh wow. Nice.

    How about cp/ctf/whatever_rand() ?

    Seriously, I'm still surprised.
     
  4. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    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.
     
  5. Dr. ROCKZO

    Dr. ROCKZO L8: Fancy Shmancy Member

    Messages:
    580
    Positive Ratings:
    159
    Dice.

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

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    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.
     
    • Thanks Thanks x 1
  7. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,570
    I hope they're func_detail'ed.
     
  8. martijntje

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    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)
     
  9. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,570
    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.
     
  10. Dr. Spud

    aa Dr. Spud Grossly Incandescent

    Messages:
    879
    Positive Ratings:
    803
    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.
     
  11. martijntje

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    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.
     
  12. Gundam

    Gundam L1: Registered

    Messages:
    34
    Positive Ratings:
    18
    Even though, as you said, it's just a simple program it looks very useful. How would you feel about releasing the source code?
     
  13. fubarFX

    aa fubarFX The "raw" in "nodraw"

    Messages:
    1,629
    Positive Ratings:
    1,715
    It's impressive really. random blocks won't give you a propper map but it might be usefull for populating a 3d skybox with props and stuff.
     
  14. martijntje

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    when I release the first version, I will include the source code as I think that releasing the source code will probably only benefit it.
     
    • Thanks Thanks x 1
  15. Gundam

    Gundam L1: Registered

    Messages:
    34
    Positive Ratings:
    18
    Excellent. I would love to help by adding some custom features :). Can't wait til version 1.
     
  16. Numerous

    Numerous L4: Comfortable Member

    Messages:
    150
    Positive Ratings:
    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.
     
  17. Bermuda Cake

    Bermuda Cake L9: Fashionable Member

    Messages:
    679
    Positive Ratings:
    192
    call it cuberunner!
     
  18. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    /me begins working on an algorithm to beat martinjeje mwahaha
     
  19. martijntje

    martijntje L8: Fancy Shmancy Member

    Messages:
    539
    Positive Ratings:
    168
    nooooooo.....

    btw somehow more people spell my name wrong here than spell it right
     
  20. Bermuda Cake

    Bermuda Cake L9: Fashionable Member

    Messages:
    679
    Positive Ratings:
    192
    somehow...