Level generation stuff/VMF manipulation

Discussion in 'Mapping Questions & Discussion' started by Hai, Dec 28, 2018.

  1. Hai

    Hai L1: Registered

    Messages:
    36
    Positive Ratings:
    63
    2019 New link to project page: https://hai.dogpixels.net/projects/Badger/
    Link to new knockout.chat thread: https://knockout.chat/thread/1846/1
    New link to Twitter: https://twitter.com/bestyeen/

    - - - - - 8< - - - - - -

    Hello there.
    As originally posted in this thread, I've aborted my level editor project and focused on a little tool to do some level generation research.
    The tool is named Badger and can be found here or here. It targets the Black Mesa version of the Source engine and all scripts are tested with the Black Mesa version of Hammer. Using a bit of copying forth and back, the techniques from the tool can be harnessed for Team Fortress 2, too.

    I've added a bunch of scripts lately that can modify existing vmf files.
    One current example is entity support for skewed textures as portrayed in the tutorial here. The tool scans a vmf for entities with special names and properties, and applies uv projections to some brush faces. It requires a bit of getting used to, but should ultimately be easier to use than the method with the texture alignment from the camera.

    Here's a result with the control entities preserved:
    upload_2018-12-28_22-38-20.png
    (^ This script requires textures to be registered in data\tex dimensions.txt)

    Here's another tool to rotate props within a given radius of a control entity randomly about their up axis:
    upload_2018-12-28_22-39-10.png

    And today I've made a script to detect mirrored textures and mirror them about their horizontal axis:
    upload_2018-12-28_22-40-17.png

    upload_2018-12-28_22-40-25.png

    My earlier work involves, among other things, curvy extrusions:
    upload_2018-12-28_22-41-2.png
    ^ Those are not yet very accessible because the user would need to edit the script, but I hope I can make a version of those with control entities later on, too.

    More info about this can be found in my first thread about this over at facepunch and on my twitter. :)

    Hope it's useful to someone.
     
    • Like Like x 4
    • Thanks Thanks x 1
    Last edited: Jul 7, 2019
  2. Hai

    Hai L1: Registered

    Messages:
    36
    Positive Ratings:
    63
    Crosspost from facepunch:

    I've scrapped my original idea for a deathmatch level and started anew.

    This is how far I've gotten so far.
    p1.png

    My todo list is still long, but it's a nice feeling to run through a level that, albeit following your own rough layout, is defined by tons of random decisions by the program.

    Thinking about level design is so different when you don't make definite decisions about how things should look in one particular version of the level, but rather work out the rules governing what things can be like. Every corner of the level must have two flights of stairs to reach all stories, but their orientation as well as their order is random, and so is the decision if that corner of the level is even generated in the first place.



    Does this corner look nice? If so, that is by chance.
    r1.jpg

    There are 2^4 = 16 ways the central room can be connected to the corners if all four are generated - with the small tunnels going either way:
    r2.jpg

    Some key measurements of the floor plan can also be randomized within some constraints - so the central room or a corner needn't be squareish, they could also be elongated a little.



    The lighting here is almost completely random. The light levels are varied slightly between lamps. I had to compromise between scattering lamps randomly and analyzing/defining enough so no too dark spots would occur. That's why all flights of stairs now have lamps directly above them.
    r3.jpg

    The hallway we're looking down here connects two of the level's corners. If only one of them was generated for this side, it would not exist, and there'd instead be a wall ahead.



    When I hit generate again, it looks just a little different:
    p2.png

    And again:
    p3.png
     

    Attached Files:

    • p1.png
      p1.png
      File size:
      80.5 KB
      Views:
      15
    • r1.jpg
      r1.jpg
      File size:
      164.2 KB
      Views:
      20
    • r2.jpg
      r2.jpg
      File size:
      321.5 KB
      Views:
      22
    • Like Like x 5
  3. Tuaam

    Tuaam L6: Sharp Member

    Messages:
    355
    Positive Ratings:
    204
    This is really interesting. I would love to see what you would do for aboveground levels (There's a Doom program that randomly generates maps with aboveground and underground segments).

    As for certain gamemode levels, I would assume you would need to use a different algorithm that generates a varied Mid and Red / Blu area, as well as different tunnels.

    And of course, if you need help there's this https://tf2maps.net/threads/randomly-generated-maps.31512/

    EDIT: (I completely forgot I posted previously on this so it looks really weird to see the same person commenting but whatever, I'll probably delete the original comment).
     
  4. Hai

    Hai L1: Registered

    Messages:
    36
    Positive Ratings:
    63
    Oh, that other generator is nice. :3
     
    • Agree Agree x 1
  5. Hai

    Hai L1: Registered

    Messages:
    36
    Positive Ratings:
    63
    • Like Like x 1
  6. Hai

    Hai L1: Registered

    Messages:
    36
    Positive Ratings:
    63
    I've made another visual theme to print the layout with.

    par1.jpg

    par2.jpg

    par3.jpg
     
    • Like Like x 2
  7. Hai

    Hai L1: Registered

    Messages:
    36
    Positive Ratings:
    63
    Outdoors levels are now possible for my generator. :)
    2019-04-01 dm level 1.jpg
    2019-04-01 dm level 2.jpg
    2019-04-01 dm level 3.jpg
    2019-04-01 dm level 4.jpg
     
    • Like Like x 5
  8. Empyre

    Empyre L6: Sharp Member

    Messages:
    309
    Positive Ratings:
    186
    I love what you are doing, except for the concentric rings landscaping. You might be better off with subtle random height variations.
     
  9. Hai

    Hai L1: Registered

    Messages:
    36
    Positive Ratings:
    63
    Heh, the rings stayed.
    There's a new version available on the project page, now with a script to generate a complete deathmatch level pack. See scripts\level packs and tinker with the stuff that's there.