Menu

Home

Home Help (1)
adepoch

Introduction
Yes, I know it’s a tacky name, it’s all I could come up with that wouldn’t be steeling some else’s potential ideas.

This app is released as open-source software under the GNU General Public Licence, which can be found at https://www.gnu.org/licenses/ . The intent is to enable other people to freely enjoy playing a game that can be different every time. The Doom series of games by Id Software is an absolute classic in the field of first-person shooters. But eventually you get to the end of all the levels the game has, and you can become so good at them because you know what is around each corner that they lose their challenge. From what I’ve been able to piece together Id Software released the source code for Doom back in the 1990’s, and from that time many people started making add-ons and patches, including their own source ports of the app itself. If you’ve been playing Doom since the 90’s as I have, and love the classic gameplay, but want more levels you’ve got some options. You can download extra levels that others have made (a good place to start looking is on the Doom Wiki). You can make your own with a level editor such as Doom Builder. Or, now, you can get auto generated levels. Now I’m not saying this is the only auto Doom level generator around. There are others. But I like a programming challenge, and that how this one started out.

It started like this, I wanted to build a dungeon crawl game that was random, so you couldn’t get used to what was coming around each bend. I made the maze generation and started to make the user interface. It was then that I realised I suck at making user interfaces. I then thought to myself, “Hey, Doom has a good interface. Maybe I can extend it to make Doom levels?”. This turned out to be a bigger challenge than I realised, as I didn’t want to be using anyone else’s BSP tree compiler if I could help it. After wrestling with BSP trees for ages I came up with something that worked, and I’d love to have made it able to build BSP’s for any level, but in the end I had to tailor it for the layout of the mazes.

So, what have I ended up with? This app will make a random maze in grid format. It then throws into that maze a bunch of Doom objects and traps to help make it a challenge to navigate. Sometimes it gives you a randomly easy level, sometimes a randomly hard one. The ambience is dark to stick with the original idea of a dungeon crawl. I may extend this in future to also make light outdoor styled hedge mazes, but haven’t done that yet. I wanted to get it out so people could enjoy playing it.

So I hope you enjoy it. I know it’s far from perfect. And being built in Python it’s as slow as a wet week. But I just want people to have fun, and not need to pay a fortune to do it. I’ve got to the age where I often wonder what I’m going to leave the world. And let’s face it, others are leaving some bad things. I want to make people smile and enjoy what they can out of it.

What you will need
This is not a game in and of itself. What it gives you is the ability to make something called a Patch WAD file or PWAD. PWAD’s are patched on the original game data that can add extra functionality or replacement maps. The original data in the game is held in another WAD file called an IWAD. The IWAD has everything the game needs, sprites, maps, music, sounds etc. So what you need to play a game is as follows:

  1. A game engine that reads Doom 2 styled PWAD maps (here’s a difference between how Doom 1 and Doom 2 label their maps. I’ve chosen to use the Doom 2 style). You can either buy Doom 2 from a vendor or find one of the many source ports that have been built. I personally use Chocolate Doom and Crisp Doom, because their game play is the classic style, and I’m old school when it comes to keyboard layouts. But there are others, and you can find a good list on the Doom Wiki. I failed to get it working on the original Doom 2 exectable, but that was because it was requiring DosBox to be running, and I was impatient and knew other source ports were available and didn’t require special setups, so I suspect it’s an easy thing to get it working, but I wouldn’t swear to it.

  2. An IWAD file. The original that came with Doom 2 was called DOOM2.WAD. This is proprietary data and is still sold in places where Doom 2 is sold for PC. Please don’t steal it by copying it from somewhere you shouldn’t, Id Software deserve what they get for it as it’s their intellectual property. But don’t worry if you can’t afford it. This will also work on some other IWAD’s and you can pick up a totally free IWAD from the Freedoom project. This free version is very different from the proprietary and comes with completely different sprites, maps, and sounds. Depending on how I feel sometimes I prefer to play in this style. It looks a little basic, but it’s different enough to make it feel like a different game completely. I’ve tested this on both the original DOOM2.WAD and Freedoom’s freedoom1.wad and it worked on both.

  3. This app. You can use it to produce a single random level, or even an entire random campaign where all 32 levels of the original are replaced with random mazes. If you’re using the Python files themselves then you will need to have a copy of the latest Python 3 installed. Windows executable should run as is though.

So that is it really, you can find a combination of requirements that are completely free of charge, depending on where you source them. Or you can buy the original DOOM2.WAD and make random levels based on the sprites, sound, and music of the original game.

The layout
If you’ve downloaded the Python files you need to run the doomstarter.pyw file. If you’ve downloaded the executable (.exe) version then you just need to execute that on a windows machine. I haven’t tried it on any other operating system as I’m not an IOS or Linux user, so I wouldn’t guarantee it would work on anything other than MS Windows 11. Once you’ run the application you will find the following:

· At the top of the window is a common area holding

o The path and name of the Doom executable that you are using. This will likely be the source port executable that you’ve chosen to use.

o The path and name of the IWAD file that you are using. This can the original DOOM2.WAD or some other IWAD such as Freedoom’s version.

· A “Single Level” tab.

o This holds various adjustable options in creating a random level.

o If you see a field in red it means that there is a validation issue with that field. You will need to fix that before generating a level. If you see a green field then that field is fine.

o Note that you can’t nominate a percentage of either monsters or items without actually adding some from the list. You can add then more than once as you may want more chances of a given item appearing than the other items. Multiple additions increase the likelihood of this.

o You need a valid output WAD file path and name at the bottom.

o You can’t play unless you’ve first generated a map.

· A “Campaign” tab.

o This is a simpler form and is populated from option held in the defaults of the application. When exiting a JSON file with these options is written to the same location as the application. You can tailor that if you want to make changes from the default settings.

o You need to generate the campaign file before you can play it. But be warned, this takes a long time. A process is started up in the background that works on the campaign generation, and the progress bar will indicate how far through it is in the process. As the levels get larger and more complicated this will show that it is going slower. And yes, if I’d used C++ this would probably go faster. I may rebuild it in the future if needed. But as a campaign will take days to play, I think waiting for 15 or more minutes for the generation isn’t too bad.

Caveats
· When executing the Doom source port or engine it assumes the command line arguments that the original engine used. Your engine may be different and if you can’t get it to run directly from this app then you may have to work out the command line arguments that fit your chosen Doom engine or source port, and then execute it manually.

· This has only been tested on Windows 11 with Python 3.9.5. I can say it works on that. I won’t guarantee it works on any other combination of windows or Python 3, but it might. It definitely won’t work on Python 2 or lower.

· The ambient light level is quite dark. I may make this changeable in future but wanted it to be a dungeon crawl… and dungeons are dark.

Customising
Customising the app would generally only be available to a programmer who can work through the code. But there is one way you can do it as a non-programmer (currently), as long as you’re willing to learn a bit of JSON. When you exit the app initially a JSON file is saved out in the app’s directory that holds all the information required to make the campaign settings that help generate random campaigns. If you edit this file and it becomes unreadable to a JSON parsing engine then the app can’t load it in. But if you stuff something up you can simply delete the file and a new copy will be saved out next time you exit the app. You can also edit campaign level settings from the Single Level tab with the button ‘Save as campaign setting’. This button will overwrite the default campaign for the map number that you’re editing with the form settings, the save over the JSON file so it retains. You can always delete the JSON file to go back to the app defaults if you want.

Note that many things in this file have requirements that are expected. For example, a map name can only follow the Doom 2 styled map naming, for example MAP01 through to MAP32. Many fields have a lower and upper amount that the randomiser will generate a number between, for example the setting dimx and dimy might have [10, 15] indicating a random length to the dimension of between 10 and 15 inclusive. Others can have multiple and variable values that are chosen from such as monsters, which could have [3004, 3004, 3005] which are codes for Zombieman (twice) and Cacodemon (once). When it comes to placing a monster or other item in the map it selects a code at random from the list. To make something more likely to be selected just add it multiple times in the list. You can see more codes available at the Doom Wiki (https://doomwiki.org/wiki/Thing_types). Just be aware that the monsters setting is linked to the monsterspc setting, in that the number of monsters placed into the map from the latter will be from the types listed in the former.

Although not perfect the default settings were designed to gradually add more complexity and difficulty to the campaign as you go through the maps. But this is customisable from either a text editor outside the app, or a saving over a level’s settings from inside the app.

Project Members:


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.