Search In
• More options...
Find results that contain...
Find results in...

# Doom math

## Recommended Posts

What are some circumstances in doom mapping where you use (or can use) math to assist you on your mapping? Whether it be offsetting textures or adjusting floor/ceiling heights

I've made a formula for myself when using the gradient floor heights tool in doombuilder:

higher floor height subtracted by lower floor height divided by the desired step height minus one equals the number of step sectors needed to get to the next level.

(hF - lF)/sH-1 = # of sectors

And plums once made a detailed explanation on how to align textures with the curve linedef tool.

Any other situations where you get the calculator out to assist you with your mapping?

Sorry, I'm all logical reasoning and art, no math can use for me.

@40oz: Hey that's pretty good stuff, especially plums post.

Also, I have not seen plums in a little while.

Yes, where is that Doom guru? :-)

I use Pythagorean theorem when creating alignment-friendly geometry. But I do it either intuitively, or using trial and error. Definitely not with a calculator.

Similarly the stairs trick described by 40oz, I do this math so intuitively that I almost don't realize it.

The Plums's trick is interesting. Now this time, it might be worth to try a calculator while mapping.

When I draw a pentagram and some other circle-based things too.

I found the tan function useful for finding whole number ratios that approximate specific angles:

For constructing Hexagons:

tan 60 = 1.732
tan 30 = 0.577

7/4 = 1.750
4/7 = 0.571

For constructing Octagons:

tan 22.5 = 0.414

2/5 = 0.400

Urthar said:

7/4
4/7

I admit, I like to use linedefs angled under this ratio, either for triangles / hexagons, or just angled crates or columns.

For nostril.wad I used the n(n+1)/2 formula to figure out how many monsters I could use before my computer would lag too much (there are 16 hallways, each with 16 rooms that keep getting bigger, one monster type per hallway).

I keep intellectual stuff out of fun and games. I'm here to rot my brain and degrade!

Length of rainbow / 96 = Average length of individual sector.
Inevitably there's very few integer solutions, so adjustments are always involved, but that's basically the only calculation I make.

There's some kind of formula that "wadwhat" uses to determine the difficulty of a map, but I never much cared about that. My only use for math was to align textures in DEU-based editors, or sometimes increment/decrement light levels by steps of 16.

hex11 said:

My only use for math was to align textures in DEU-based editors,

How do you align textures that way if you don't mind me asking? When I started mapping I had the privilege of using doombuilders 3D mode and autoalign. I've never really keyed in actual offsets.

40oz said:

How do you align textures that way if you don't mind me asking? When I started mapping I had the privilege of using doombuilders 3D mode and autoalign. I've never really keyed in actual offsets.

Every sidedef has X and Y offsets for texture alignment, and these can be positive or negative numbers. The useful range is typically between -127 to 128 (assuming a 128 wide/high texture). Using too big or small a number is pointless because the texture just "repeats" X number of times, depending on how many multiples of the original texture size you exceeded. Anyway that's not the hard part, which is actually figuring out in which direction the texture gets drawn by the engine. And that depends on whether you're editing a lower, upper, or middle texture, and if it's unpegged, and also if it's part of a one or two-sided linedef. Doom just draws things differently based on different combinations of those factors. This book explains it really well:

With DEU, it really helps to keep the length of your linedefs in multiples of the texture size, because then there's basically no alignment needed. Second best case is to use linedefs that are multiples of 32 or 16 long (or maybe even 8) because that keeps the math relatively simple. But it can get hairy if you start using lots of lines of arbitrary size everywhere in your map. Well, DEU does in fact have a texture-alignment menu function, but it doesn't seem to work in all cases. I had some transparent midtextures in a circle pattern that this tool did nothing useful with, and they were too much trouble to align manually, so I just took them out of that map.

Not mapping-related, but here's a goodly piece of DOOM math for everyday use:
When to pick up the green armour by RjY