Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
M4ukka

Generating levels with scripting

Recommended Posts

I have brewing this idea of a random level generating mod/wad. I know there is already a separate level maker programs that creates random WADs. But it would be interesting to try make level generation in zdoom scripting.

 

So basically I figured that you can raise and lower sectors and change textures with scripting, and if you have a level with some sort of grid made different sectors and tags, you could make walls by raising the sectors. Couldn't you then make random mazes or predetermined layouts to the grid? Of course the level generation can't be completely random, because then it would be unplayable. I haven't still tried this fully yet and I haven't figured out how weapons and monsters would be placed in.

 

Also what I think cool about this idea, that you could in principle generate new level every time you start a level. You never know what kind of level your stepping in.

 

So has anyone else tried something like this with Doom? I tried to search on the web, but didn't find anything similar. Also like to hear any thoughts about this.

 

By the way, I'm new here in the forums, so hi to every one! :)

Share this post


Link to post

I made a super basic example of the idea. Theres three different layouts and its randomized when you load the level. The WAD requires Doom2 IWAD and GZDoom sourceport.

random.7z

Share this post


Link to post

Good to know that I wasn't the first to come up this. :)

 

I'll try to make a bigger and more varied levels. I think for now, that a grid based level generation has the most potential.

Share this post


Link to post

Have you taken a look at WadC? WadC generates levels with a custom script language designed specifically for level generation. This tool runs outside of the game, so it's different than raising sectors with scripts during gameplay, but this also means that there are no limitations to what it can create. It does take a bit of learning and practice, but it is a novel approach to mapmaking with endless possibilities.

 

You could use the in-game scripting variety, and, yes, you could make some rudimentary mazes and corridors, and some interesting puzzles could come out of that. But, it's always going to look like a grid, and it's going to be limited in size and complexity. Keeping performance up in such a map might become a real challenge. But, it might be fun to build.

Share this post


Link to post

If you made a metric shit ton of dummy sectors you could probably make a huge grid of squares and do a sort of Minecraft style terrain generation assuming it is possible to change some properties of 3d floors like visibility and collision during runtime. It would probably be waaaaay too laggy though given how slow 3d floors can be even in normal mapping situations

Share this post


Link to post

You could, in theory, set up all kinds of grids and such, doesn't even have to be just squares. As far as I'm concerned, and assuming you get it working in the sense that it generates something playable that resembles a functional map, you're probably going to end up with rather small maps just to get "something" done. People already did some randomization in doom for parts of maps, so I would like to think it possible somehow. But something tells me you're going to end up with a LOT of code just to make sure the maps "work" to begin with, and as others have mentioned already, you may encounter performance issues if your map becomes too "large" (relatively speaking). I must admit, though, that I'd actually like to see something small, like "Doom 2 map01 small" (maybe even smaller) generated in such a way, kind of like as proof of concept.

 

14 hours ago, Collegia Titanica said:

Ever heard of Oblidge ? It's a doom map wad generator, set up some prefabs and click generate ...

In the OP it literally says: "I know there is already a separate level maker programs that creates random WADs."

Share this post


Link to post

@M4ukka Li’lWhiteMouse had created a mapset for ZDooM named Chibi Rebellion, a mission-based game. One of the features is that, upon completing a map you get sent to a randomly-selected map based on some internally-defined scripted rules. I know this is not the same as having randomly-generated maps on the fly, but the scripted rules she set up might be instructive.

 

Also, I’m pretty sure she created some maps that meet the criteria in your original post, although I don’t remember which ones. I’ll dig up a link if I have the chance.

 

Regardless, LWM was one of the all-time great innovators for ZDooM, and I encourage you to examine her work.

Share this post


Link to post

In the thread I linked above, he used DECORATE exclusively because he didn't know how to use ACS. It was pointed out that it could have been done better in ACS with loops. Maybe you could improve on what he did by using ACS.

Share this post


Link to post
12 hours ago, Nine Inch Heels said:

You could, in theory, set up all kinds of grids and such, doesn't even have to be just squares. As far as I'm concerned, and assuming you get it working in the sense that it generates something playable that resembles a functional map, you're probably going to end up with rather small maps just to get "something" done. People already did some randomization in doom for parts of maps, so I would like to think it possible somehow. But something tells me you're going to end up with a LOT of code just to make sure the maps "work" to begin with, and as others have mentioned already, you may encounter performance issues if your map becomes too "large" (relatively speaking). I must admit, though, that I'd actually like to see something small, like "Doom 2 map01 small" (maybe even smaller) generated in such a way, kind of like as proof of concept.

Maybe a hybrid approach: You could build a bunch of "hard-coded" maps, essentially on top of each other, sharing sections, like corridors. Then, the scripting could be used to block off corridors and parts of the common rooms. This method would work, performance-wise, and still be very dynamic, if done carefully. Monsters would be in "closets" which would open conditionally, based on which "map" you were currently playing. Texture changers would help the illusion. This could also let you build oddly-shaped sections vs. piles of similar grid sections. It'd be a bitch to set up, but could be very cool.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×