Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
ptoing

Vanilla doom restrictions

Recommended Posts

Does anyone have a list of the exact restrictions of Vanilla Doom? As in how many sectors can a map have in total and other numbers like that.

Share this post


Link to post

You can't simply define a maximum of sectors, you can build a map with only one sector which will crash the engine, when the sector is big enough. There are the visplane overflow, even for this you don't really need so many sectors. On the other hand, you can build a map with much more sectors which will run without any problem.

Share this post


Link to post

Yes I know that. I know about VPO which happens when you see too much shit at once.

But I reckon there need to be some kind of maximum amount of sectors and such, no? Or are you on the safe side as long as you keep the detail sensible and do not use huge sectors?

Share this post


Link to post

Pretty much. You will also run into savegame buffer overrun in large maps, so you can't save the game in vanilla anymore. This happens when there are too many things, segs and sectors. The savegame can't exceed 180,180 bytes iirc.

Share this post


Link to post

Realistically, lump size limits are really hard to hit... and it's usually stuff like VPOs that really hinder you.

The magic number in most cases is < 32768. Stay under that number and you should be good for the most part. When mapping normally, SEGS is usually the first lump to reach it's maximum, and followed by the BLOCKMAP or the SIDEDEFS lump. I'm not completely sure on this, but I think some of the lumps do not have a reasonable size limit, like REJECT. For some reason I keep thinking the BLOCKMAP can be larger than 32768 though... (can someone clarify?)

There are other things to consider too, like not having more than 64 (?) scrolling linedefs in the map, or more that 28 (?) floors moving at once.

It's been a while since I mapped for vanilla, so anyone feel free to correct me if I got any of those numbers wrong. :)

Share this post


Link to post
Super Jamie said:

Doesn't Chocolate have a display mode which lets you see in realtime the limits and what your current count is?

All essel's KDiKDiZD shots seem to have it.


That is a edited chocolate doom exe, that someone (I have forgot who) made for Essel.

Share this post


Link to post
EarthQuake said:

Wasn't it GhostlyDeath?


Yes. (See Essel's post for download)

I find it very helpful as I mostly map for vanilla.

Share this post


Link to post

If you want a quick reference of Doom's more problematic limits, you can take a look at what limits were raised for Doom+.

Excerpted from here:


MAXVISPLANES 128
MAXVISSPRITE 128
MAXDRAWSEGS 256
MAXPLATS 30
SAVEGAMESIZE 180224
MAXLINEANIMS 64
MAXOPENINGS 16384

I'll explain these limits and their consequences in a bit more depth:

MAXVISPLANES - this one is complicated, but essentially, if too many sectors with different properties (ie. different heights, brightnesses or flats) are visible in the same screen, the game will crash. This is probably the main obstacle for vanilla Doom mappers.

MAXVISSPRITE - Only 128 sprites can be rendered at once. Extra objects will be invisible, but the game will not crash.

MAXDRAWSEGS - again, what constitutes a "seg" is something more complex than I will explain here, but I will note that every sidedef contains a minimum of one seg, sometimes more. If more than 256 segs are in view, extras are not drawn and HOM remains in their place. The game will not crash if this limit is exceeded.

MAXPLATS - If more than 30 sectors have a moving floor or ceiling in one moment, the game will crash.

SAVEGAMESIZE - If the level has too many things, the restricted save file size cannot contain all the information it needs to and attempting to save will crash the game, I think.

MAXLINEANIMS - If the level has more than 64 "scroll texture left" lines, then the game crashes when you attempt to load the level, I believe.

MAXOPENINGS - I'm fuzzier on this one. All I understand about it is that you're almost guaranteed to exceed MAXVISPLANES or MAXDRAWSEGS before you exceed this one, so don't worry about it.

Other important limits you should know about, not increased by Doom+

The BLOCKMAP lump cannot exceed 64k, which essentially limits the maximum amount of ground that your level can cover. Exceeding this limit will cause glitches and memory corruption when your level is played. If you hit this limit, find a way to put your level into a smaller square or rectangle (don't worry, you can make very big levels without hitting this limit).

Your map cannot have more than 32768 SEGS in total. Again, every sidedef contains at least one seg. Most maps will have 10-20% more segs than sidedefs. This limit is another problem for vanilla Doom mappers, and for all mappers, really, because even in more advanced Doom ports, this limit is only doubled to roughly 65000. To escape this limit entirely you must map with the UDMF format. Exceeding this limit causes engines to crash when attempting to load your level, I believe.


How did I memorize all that?

Share this post


Link to post
Creaphis said:

MAXPLATS - If more than 30 sectors have a moving floor or ceiling in one moment, the game will crash.

0 tag triggers work in vanilla Doom, unlike in most ports, heh. They don't crash. Also, can stairs be longer than 30 steps? I know that the lifts, possibly the perpetual ones too, are affected by that limit.


The BLOCKMAP lump cannot exceed 64k, which essentially limits the maximum amount of ground that your level can cover. Exceeding this limit will cause glitches and memory corruption when your level is played. If you hit this limit, find a way to put your level into a smaller square or rectangle (don't worry, you can make very big levels without hitting this limit).

Sounds creepy. So it doesn't crash outright, but waits to do the wrong step to crash?

Share this post


Link to post
Creaphis said:

MAXPLATS - If more than 30 sectors have a moving floor or ceiling in one moment, the game will crash.

Nixot said:

I TRIED TO GET YOUR MUM TO STAND UP BUT I GOT A P_ADDACTIVE PLAT NO MORE PLATS ERROR LOLOLOLOLOLOL

Share this post


Link to post

Thank you Creaphis.

Also, in regards to SEGS, since it is the most common map format limit encountered, when the nodes to a level are built, sectors are split into concave polygons (called sub sectors). Where linedefs are split by these concave polygons, SEGS or linedef segments are created. This is why a single line can result in multiple SEGS per line, so the number of linedefs will never exceed the number of line segments. You can take advantage of the way nodebuilders split sectors, by making large complex sectors split in certain ways depending on how the linedefs are arranged. You have to sort of visualize how the sectors are split into sub sectors (SSECTORS) and plan out your lindef placement. Most nodebuilders that I know of have a "vertical" or "horizontal" option which determines the preference of how sectors may be split. There are also splitting factor options, which can be adjusted, to reduce the number of splits that occur on a sector per sector basis.

While this is much more trouble than it's worth most of the time, saving a few SEGS here and there can be quite beneficial, especially when you are really pushing the limits of the map format.

If I'm wrong about any of that, please feel free to correct me. I only have so much understanding about how the Doom engine specifically works.

Share this post


Link to post
printz said:

Also, can stairs be longer than 30 steps?

Yes, they can. You can have thousands of steps. The usual limits you would encounter on excessive big stairs is visplane overflows or sectors becoming too high.

Share this post


Link to post

Very awesome posts everyone :D

EarthQuake: You sure it makes concave and not convex polygons?

Share this post


Link to post

Yeah, sorry, I meant convex.

Super Jamie said:

It would be so helpful if there was something that let you see subsectors and segs in a map editor.


The problem with doing this, is that it all depends on the nodebuilder used. SEGS and SSECTORS aren't generated by the map editor, therefor it can't display them because there are outside factors that could influence how the SEGS or SSECTORS will actually be constructed (e.g. nodebuilder options). It would make more sense in a map editor like Deepsea where the nodebuilder is more or less integrated into the editor.

Share this post


Link to post
LogicDeLuxe said:

Yes, they can. You can have thousands of steps. The usual limits you would encounter on excessive big stairs is visplane overflows or sectors becoming too high.

Did you read the context? I meant activateable stairs.

Share this post


Link to post

Ptoing said:
Does anyone have a list of the exact restrictions of Vanilla Doom?

In addition to the limits people listed, keep in mind the Doom+ patches, which will raise many of them. Since the patches are for the vanilla executables, they technically support the extended limits in the same way they support DeHackEd changes.

Not mentioned above is the INTERCEPTS limit of 128. This is used when a hitscan attack (firearms and BFG tracers) is used. If a shot goes over more than 128 potential obstructions (things or lines), there's a memory overflow that may cause errors, weird behavior or a crash.

There's also a maximum of 16 switch effects. This may be exceeded if you fire an SSG shot (20 pellets) at a bunch of short shootable switch lines, or more easily in multiplayer.

Another limit is in the music, due to the simplistic MIDI (type 1) clone format it relies on. A MUS lump may have a maximum size of 64 KB, and Doom will also play any MIDI file that converts to such a MUS file. Bigger MIDIs will not be played, and some complex ones may cause errors.

Creaphis said:
The BLOCKMAP lump cannot exceed 64k, which essentially limits the maximum amount of ground that your level can cover. Exceeding this limit will cause glitches and memory corruption when your level is played. If you hit this limit, find a way to put your level into a smaller square or rectangle (don't worry, you can make very big levels without hitting this limit).

Your map cannot have more than 32768 SEGS in total. Again, every sidedef contains at least one seg. Most maps will have 10-20% more segs than sidedefs. This limit is another problem for vanilla Doom mappers, and for all mappers, really, because even in more advanced Doom ports, this limit is only doubled to roughly 65000. To escape this limit entirely you must map with the UDMF format. Exceeding this limit causes engines to crash when attempting to load your level, I believe.

From what I've seen, you usually hit the BLOCKMAP limit well before the SEGS limit. The VPO limit probably makes it nearly impossible, as you'd have to cram lots of details to manage many SEGS but a smaller area, but even among Doom+ compatible levels the BLOCKMAP limit seems to come in first. A 65 KB+ BLOCKMAP will practically always crash the engine at one point. The SEGS limit is more likely when creating levels with Boom-level limit removing, where it remains while the BLOCKMAP limit is gone.

Share this post


Link to post

myk: The BLOCKMAP limit becomes significantly less limiting when using the blockmap compression ability of some nodebuilders, like ZenNode, so I'm not sure if you'd always reach that before exceeding SEGS.

Also, regarding what you said about midi and mus lumps, is the limit that it has to convert to a 64kb or less mus lump, or that it has to be a 64kb or less midi to begin with? I'm assuming that mus is smaller, so I'm now wondering how large the actual midis could be, if anyone knows. o_o

Share this post


Link to post

The size of the MUS lump is limited. MIDIs can't be much larger, but they could be, a bit, as MUS is generally somewhat smaller than MIDI. I think I recall having a 76 KB MIDI that translated well to MUS, for example.

EDIT: Actually, checking some converted files I have, MUS files seem to be about 1/3 smaller, though how much exactly varies from one track to another.

As for the BLOCKMAP issue, yeah, ZenNode is essential when Doom/+ maps get big. I recall two or three levels (one in PL2, one in Scythe2, for certain) which exceeded the BLOCKMAP limit unless ZenNode was used, but their SEGS were well below the limit. Check out DV levels 1-4, for instance. Their BLOCKMAPs aren't that far from the limit (mostly about 50 KB), while their SEGS are less than half way there (15k tops). Most other maps that made me think "this isn't for Doom+" tended to exceed the BLOCKMAP limit first, too. OGRE Labs has a 124 KB BLOCKMAP (I think it's not compressed, but compressing it won't help enough) while it has less than 20k SEGS entries. Maybe some cases of maps with more detail in less space may cause the SEGS to be a problem first, but I don't recall any examples.

Share this post


Link to post
EarthQuake said:

The problem with doing this, is that it all depends on the nodebuilder used. SEGS and SSECTORS aren't generated by the map editor, therefor it can't display them because there are outside factors that could influence how the SEGS or SSECTORS will actually be constructed (e.g. nodebuilder options). It would make more sense in a map editor like Deepsea where the nodebuilder is more or less integrated into the editor.

True, but surely an editor (or editor plugin) could be written to read back the nodes from the map (if present) and present the SEGS and SSECTORS in a graphical way?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×