WadC

WadC is a programming language (formally, a normal-order evaluated functional language1) for the construction of Doom maps. Think of it like Logo on steroids, with demons and shotguns.

The current version of WadC is 2.1. (Here's a zip). You can get the WadC source code from github.

Getting started

WadC session running [pipeloop.wl](https://github.com/jmtd/wadc/blob/master/examples/beta/pipeloop.wl)

WadC session running pipeloop.wl

WadC requires Java and several Doom prerequisites to use. See setup to get WadC's and its pre-requisites set up.

Check out the gallery of examples to see the kind of things you can do. The gallery includes in-game pictures, top-down map renderings and links to ready-to-play WADs.

Try hacking an existing example or writing your own: see the introductory tutorial and the language reference.

If you want some ideas for things to do, take a look at the WadC HACKING guide.

New in 2.1

An old WadC session

An old WadC session

Version 2.1 of WadC is dedicated to the memory of Professor Seymour Papert (1928-2016), co-inventor of the LOGO programming language.

Check the release notes for the full details.

Contribute!

the resulting map

the resulting map

Have you made a cool WadC level? Let's put it in WadC! The easiest way to collaborate is to send a pull request on github. Feel free to make suggestions or report bugs via github issues.

You can also just email me if you don't like GitHub, or leave a comment on this page.

See also

WadC was originally written by Wouter van Oortmerssen (Aardappel). Aardappel's historic WadC web page and version 1.1 are available at http://strlen.com/wadc/.

Bird Cage, a WadC-generated map for Heretic
Bird Cage map

Comments

comment 1

Hi Jon,

Been playing with WadC the last week and have made some functions that (if they appear to work) you might want to put into the standard.h? The reason I looked to make them was to try and see if WadC could make random layouts.

greaterthaneq(a, b) {
  lessthaneq(add(b, 1), a)
}

roundup(val, step) {
  add(mul(div(val, step), step), step)
}

rounddown(val, step) {
  mul(div(val, step), step)
}

-- Random function: Call random(min, max)
-- random2 is a helper function to get "unique-ish" jump values
-- with each loop
random2(range) {
  set("randVal", add(get("randVal"), div(range, 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15)))
  get("randVal")
  }

random(min, max) {
  set("randVal", min)
  for(1, 10 | 20 | 30 | 40, greaterthaneq(random2(add(abs(min),abs(max))), max) ? set("randVal", add(sub(get("randVal"), max), min)) : 0)
  get("randVal")
}

-- Square root function: Call sqrt(x)
-- sqrt2 & sqrt3 are helper macros to test upward and then
-- down if we go over the target value.
sqrt3(_val, _exp) {
  lessthaneq(div(_val, _exp), _exp) ? sqrt3(_val, sub(_exp, 1)): add(_exp, 1)
}

sqrt2(_val, _exp, _step) {
  lessthaneq(div(_val, _exp), _exp) ? sqrt3(_val, _exp) : sqrt2(_val, add(_exp, _step), _step)
}

sqrt(_val) {
  lessthaneq(_val, 0) ? 0 : { greaterthaneq(_val, 100) ? sqrt2(_val, 1, 50) : sqrt2(_val, 1, 5)}
}

-- I also changed the existing for(x, y, z) function to use the "_" notion
-- as explained in your readme as I was coming across the "lazyness" in
-- the loops for random and sqrt functions. I think it still works as intended?
for(_from, _to, body) {
  lessthaneq(_from, _to) ? body for(add(_from, 1), _to, body) : 0
}

All the best, Travers

Comment by traversd
comment 2

Hello,

This seems like an interesting concept.

Too bad it requires Java. I hate using Java apps, because it requires the presence of Java, something I'd rather keep as far away as possible from my machine.

Please consider porting it to C++, shouldn't be too much work, given the similarity of languages.

Comment by PooshhMao
comment 3

Hi,

Please consider porting it to C++, shouldn't be too much work, given the similarity of languages.

Thanks for your comment. There's basically no chance of me porting this to C++. I've tried to resist the effort to do much clean-up or other yak-shaving and focus any effort I put into WadC on adding something useful. I want to try and keep a very high effort:gain ratio as I don't have much time to put into it.

I can appreciate that some people are not happy to install a JRE. It is likely quite possible for WadC to be compiled in some alternative way to result in something other than java classes/JAR. I imagine that the CLI at least will work fine if compiled to a native EXE via GCC. It might also be posslble to do something interesting with IKVM to run it on a .NET platform. However, I will leave these investigations to others. I'd be happy to hear how people got on - it's just not my itch to scratch.

(I might at least give a native build a quick look when I do the Debian package in the near future.)

The reason I'm reluctant to wander too far "off reservation" is if I did have more time to dedicate to this, I'd basically like to rewrite/redesign it from the ground up on top of something like Haskell, most likely as an EDSL, and therefore harness much of the power of an existing, mature functional language, rather than have to implement that all again.

jmtd
comment 4

Hi

We've added a link to WadC to LinuxLinks.com

Regards, Steve

Comment by Steve Emms
comment 5
What is the benefit of this over existing wad/map creation programs?
Comment by Anonymous
comment 6

@Anonymous: I've answered this many times over the years, but your question makes me think perhaps I should explain this more prominently in this page / the docs.

Basically, it's completely different to a traditional editor. So, it does some things better and some things worse. It makes it much, much easier to do complex, detailed or repeating patterns, if you can express those patterns in an algorithm: so, fractals, etc. It also makes doing things which are repetitive like complicated Boom conveyor-belt or control sector related things much easier. A concrete example of that: my in-progress test map is a bunch of sewer tunnels which are partially flooded with water (via Boom's 242 line type and control sectors). At the moment, the map is two partial "loops" of sewer tunnels at different vertical heights that intersect in two places (like a figure of 8). It has 680 control sectors, which would be a huge pain in the arse to try and do by hand in a traditional editor.

However, the problem with doing repeating patterns is they look repeating. So it's harder (much harder) to make natural patterns that don't look like repeating things. So e.g. you might have some repeating architecture in a map, and in a normal editor, you would vary it a bit by hand, which would make it more interesting to play; in WadC, it's trickier to vary things in that way.

It is not meant to compete with or replace a traditional editor, but it is an interesting (to me anyway) tool that can do things that you can't do in a traditional editor that not many people have tried doing yet, and that's something I'm still interested in exploring.

Some people (cybermind with "The Last Sanctuary" is the best example) have successfully used WadC to do some complex boom stuff, then imported that into a map made in a traditional editor.

jon