samboy / ObHack

A random map generator for Doom engine games
https://samiam.org/slump
Other
33 stars 1 forks source link
doom generating-doom-levels map-generation oblige procedural-generation procedural-level-generation

What is here

There are several things in this GitHub package:

ObHack: A random map generator for Doom

ObHack is a random map generator for Doom. This was the state of the art in random Doom map generation back in 2007; these days, newer generators are available here:

The home page for this generator is here:

I should, of course, mention SLIGE, the very first random map generator for Doom:

How to get this code

This code is available at https://samiam.org/slump and is also available as a Git checkout at GitHub, GitLab, Bitbucket, SourceForge, and SourceHut.

Why this code is here

The reason for this branch is to make a small, compact random map generator for Doom which I can put on a tiny 50-megabyte hockey-rink shaped business card CD. This allows me to have consistent a 32-map megawad without taking up too much space, and to generate other maps as desired.

Running this code

On Windows systems, one can run this code by simply entering the ObHack-engine-697 directory and running the supplied ObHack.exe file.

On other operating systems, read the section “How to compile” below.

What this is

ObHack is my name for some modifications Fritz and myself have made to Oblige, a random map generator for the original Doom, Doom 2, and Heretic. It is name thusly because it is a hacked Oblige, and as a tribute to the ObHacks posted to the once-great Usenet newsgroup alt.hackers.

ObHack is a fork of version 2 of Oblige (Oblige 0.81-0.97). It has the following features that Oblige2 does not have:

The options

Once the ObHack program is open, a window with various options appears.

Random seed

This determines how the maps look and are layed out. In theory, a given random seed generates the same maps. In practice, about 5% of the maps are non-deterministic and will slightly vary, even when generated with the same seed. The seed always defaults to 1FreeDoom1, a seed which does generate 100% deterministic maps; it can be changed by clicking on “New Seed”, or by typing in a new seed in the “Random seed” box.

Game

The game determines which particular game we make random maps for:

Note that Hexen is not available. It is available in Oblige 0.97.

Note that Doom 1 and Heretic are not available. They are available in the ObHack-8-Final version of this code.

Port

This pull down does not have any options.

Length

Mode

Note that the Capture the Flag mode is no longer available. For people who want CTF support, use the ObHack-8-Final version of ObHack.

Adjustments

The other buttons.

“Build” will build the map. “About” describes the game. “Quit” causes the ObHack level generator window to close.

The ObHack 8 branch

From 2009 until 2017, a lot of work was done on ObHack, including monster traps, variable room sizes, boss arenas, Blasphemer support, basic Capture the Flag support, etc.

The ObHack 8 code is still here, in the Git tag ObHack-8-final.
To get this code, go to this URL:

https://github.com/samboy/ObHack/releases/tag/ObHack-8-final

Or, if using Git, type in git checkout ObHack-8-final

Determinism: About 95% there

ObHack, has, until recently, had issues with making completely different maps when given the same parameters. I have updated the code to remove about 95% of the problems.

If I run the ObHack program with the same seed and parameters, I will sometimes get a given .wad file; multiple invocations will sometimes give me a file with the same size and exact same contents.

The code which makes the binary .wad file from a given generated map is non-deterministic; I have verified this by having the code instead generate .txt files (some old debug code which Andrew put there) and verify that all of the files are the same with a given seed.

In about 5% of the generated maps, some non-deterministic code is run. It is too deep of a “rabbit hole” for me to figure out exactly why this happens, so I have instead set it up so that, for MAP06, we change the numbers generated by the random number generator (by adding 1234 “empty” runs of the generator) so that the 32-map megawads generated for Doom2 (actually, FreeDoom) maps are the same if the seed is either 1FreeDoom1 or 2FreeDoom1 and the default ObHack parameters are used.

How to compile

These are the files needed to make the Win32 binary of ObHack. To compile, you will need to install both MinGW-3.1.0-1 and MSYS-1.0.10. Once you do that, do something like this:

export FLAGS=-Os
export CFLAGS=-Os
cd fltk-1.1.9
./configure
make
cd ..
cd zlib-1.2.3
./configure
make
cd ..
cd glbsp-2.24-source
# You may have to edit the makefile
make
cd ..
cd ObHack-engine-*
cd gui
# You may have to edit the Makefile
make

MinGW and MSYS install directions are here:

http://samiam.org/blog/old-200903-mingw-310-1-last-real-mingw-release.html

Note that that version of MinGW does not run in Windows 10.