Page 1 of 1

Generating levels or random mazes with scripting

Posted: Thu Jun 15, 2023 23:00
by TaBaR
been thinking about trying to make an acs script to create a random maze in part of a map. i have a BASIC program(ATARI BASIC) that can make a random maze, but i am having trouble converting it to ACS. the problem is I'm very good at BASIC and not very good at liner programming. not using GOTO. this is the program with some notes.

Re: Generating levels or random mazes with scripting

Posted: Tue Jul 11, 2023 3:20
by TaBaR
even if the concept is not popular, i would still like to know if this program can be converted to ACS.

Re: Generating levels or random mazes with scripting

Posted: Sun Sep 10, 2023 17:27
by Rex Claussen
This is not the same thing as you're requesting, but many years ago LilWhiteMouse made a mod for ZDooM named Star Wars: Chibi Rebellion. Using ACS, it featured a hub of randomly selected maps (which is not the same as random mazes within a map).

In terms of creating a random maze within a map, you can construct your maze, such that the walls are either up or down at map start. The various segments of the walls will need to be assigned sector tags. Then, set up ACS and assign a probability or range of probabilities that each segment (or a group of segments) will rise/lower soon after map start. This will likely achieve the creation of a different/random maze each time the map is started.

One of the things you'll need to do is plan your maze(s) out beforehand, so that there will always be at least one solution to get through.

Re: Generating levels or random mazes with scripting

Posted: Tue Sep 12, 2023 20:35
by Enjay
Although, by coincidence, LilWhiteMouse did also start work (not sure if it got completed) on a map made of lots and lots of square sectors that would be raised/lowered by ACS when the map started in order to create a randomised level similar to what TaBaR is asking about I think.

I don't recall the name of the project, but I think she was using Heretic as the base game.

From memory, it ran quite slowly on the hardware at the time because it was a big room with a very large number of sectors in it. Perhaps there would no longer be performance issues with GZDoom and modern hardware?

Re: Generating levels or random mazes with scripting

Posted: Wed Sep 13, 2023 11:43
by Rachael
Theoretically it is still possible to do this in ZScript in fact it may even be easier. ZScript can track the positions of every line and sector and map them internally without the need to hardcode tags, id's, or ref's. It then can randomly generate a level and set sector heights accordingly; for good measure, to decrease lag, it can also set walls as one-sided to prevent the renderer from going behind them.