Level generation stuff/VMF manipulation

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

Hai

L1: Registered
Nov 7, 2015
38
74
2019 New link to project page: http://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.


Hope it's useful to someone.
 
Last edited:

Hai

L1: Registered
Nov 7, 2015
38
74
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
 

Attachments

  • p1.png
    p1.png
    80.5 KB · Views: 355
  • r1.jpg
    r1.jpg
    164.2 KB · Views: 374
  • r2.jpg
    r2.jpg
    321.5 KB · Views: 358

Tuaam

L6: Sharp Member
Jun 26, 2015
376
248
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).
 

Hai

L1: Registered
Nov 7, 2015
38
74

Empyre

L6: Sharp Member
Feb 8, 2011
309
187
I love what you are doing, except for the concentric rings landscaping. You might be better off with subtle random height variations.
 

Hai

L1: Registered
Nov 7, 2015
38
74