Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
CtrlAltDestroy

What the heck is a Save Buffer Overrun?

Recommended Posts

I'm working on a level, it's pretty huge. I'm using Doom95 for testing it. I'm sure I haven't hit any limits. But one time I tried to save after adding a few rooms, and it gave me "I_Error says: Savegame Buffer Overrun" My guess is that this has to do with Things. I know that the Doom engine can handle a freaking lot of things, but I didn't know that there was a limit for how many can be saved.

Will I have to go delete some of the unnecessary monsters and dead bodies? Or does this not happen in Zdoom and other ports? I have exactly 900 things in my level, so what's the limit anyway?

Share this post


Link to post

Note that some projects (e.g. Alien Vendetta) have kept playability in Doom2.exe, but not bothered with savability (i.e. no problems running it in Doom2.exe as long as you don't try to use savegames).

Of course, those who wish to use savegames can use a port (including Doom2.exe-compatibles such as prboom and eternity - that might be useful for testing purposes if you want your wad to play correctly in Doom.exe).

Share this post


Link to post

Thanks a lot. I'll just go crazy with the Things then. Although I cannot save, I'm the only one in the world who doesn't need to, and I trust anyone else who plays my wad to use some other port that doesn't have this error.

Share this post


Link to post

The original engine used a static array to write the savegame data into -- if the total size of all data saved into the buffer (this includes things, active sector data, some fields off of sectors and lines, etc) was more than that amount, it would just quit.

This was just poorly coded, and clearly didn't have much effort put into it, since it was very simple to make the buffer expandable after the source release. DOOM had a lot of stuff like this -- the fundamental engine technology was wonderful, but the surrounding support code was barely sufficient in most cases.

Share this post


Link to post
Quasar said:

but the surrounding support code was barely sufficient in most cases.




I think that's still a euphemism for 'cheaply hacked together'. The amount of sloppy solutions, shortcuts, inefficient code and just plain bugs in the code is simply unbelievable and even now the occasional bug is found that hasn't been discovered in the last 6 years...

(I can understand that the limits didn't matter in the first few versions but by v1.9 id should have realized that most of their hard coded limits were far too small for user maps...)

Share this post


Link to post

The game engine features stopped being developed in '94, when hardly any wads exceeded the savegame buffer... maybe quite less than 1% of them? So no one must have complained enough or sent enough feedback for the id team to give a rat's ass. Post '94 releases weren't headed by Carmack anymore and were done just to ensure the new releases worked as intended.

The engine limits are sufficient for the game itself. In the "add-ons" department DOOM was a big step ahead from Wolf3D, but still experimental, and id left it mostly to users' devices to work from what the game itself, as is, offered. It wasn't, like later FPS games, highly add-on geared and open-ended in design. That would have been out of place back then.

And the idea was fitting too, really; the limitations allowed the game to thrive for a long time without its add-ons becoming a morass of odd variations. Of course, only a really good game can manage that.

Thinking that they should have spent more time and effort than they did on how they implemented those limits, which were made for a closed source engine made as quickly and effectively as possible in the context of a competitive gaming industry in 1993 shows a definite lack of insight. If out of generosity you're offered the source code later, is it so that you can make nit-picky remarks out of context? Okay then.

By the way, I believe the overflow generally starts to show up when you have like 600 things on the map, though this naturally varies due to other factors, as noted.

Share this post


Link to post
myk said:

The game engine features stopped being developed in '94, when hardly any wads exceeded the savegame buffer... maybe quite less than 1% of them? So no one must have complained enough or sent enough feedback for the id team to give a rat's ass. Post '94 releases weren't headed by Carmack anymore and were done just to ensure the new releases worked as intended.

The engine limits are sufficient for the game itself. In the "add-ons" department DOOM was a big step ahead from Wolf3D, but still experimental, and id left it mostly to users' devices to work from what the game itself, as is, offered. It wasn't, like later FPS games, highly add-on geared and open-ended in design. That would have been out of place back then.

And the idea was fitting too, really; the limitations allowed the game to thrive for a long time without its add-ons becoming a morass of odd variations. Of course, only a really good game can manage that.

Thinking that they should have spent more time and effort than they did on how they implemented those limits, which were made for a closed source engine made as quickly and effectively as possible in the context of a competitive gaming industry in 1993 shows a definite lack of insight. If out of generosity you're offered the source code later, is it so that you can make nit-picky remarks out of context? Okay then.

By the way, I believe the overflow generally starts to show up when you have like 600 things on the map, though this naturally varies due to other factors, as noted.


When 1.9 was released id knew perfectly well how popular Doom mapping has become. The v1.9 version I have is dated 5/25/1995 so it's obvious that development did NOT stop in 1994. 1 1/2 years later the system specs were already a lot higher so it wouldn't have hurt anybody to double the size of some of these fixed arrays.
BTW, I wasn't mainly talking about the fixed arrays. Those were mostly perfectly valid (although too small) but some of the horrendously obvoious bugs that were in the game and never fixed, even though there were numerous patches:

-Wallrunning
-Clipping errors resulting in the ability to pick some things through solid walls and projectiles occasionally moving through walls.
-The map traversal code occasionally lost a trace. Instead of fixing it they just aborted when the code seemed to loop endlessly.
-Movement clipping against two-sided blocking lines was incomplete!
-Bad error checking. Array overflows were checked much too late so that in most fatal cases the game crashed instead of printing an error.

(Sadly, some of these bugs haven't even be fixed by many source ports. ZDoom is the only one I know of that removed them all.)

This list could go on and on but my biggest problem with Doom.exe was not a bug. No, it was the incredibly stupid decision to quit the game without warning at the slightest hint of a minor problem (like an invalid sector special.)
There was one version that reproducable trashed the sector special of one sector in E3M1 so if you had not been extremely careful - Game over!

Share this post


Link to post
myk said:

By the way, I believe the overflow generally starts to show up when you have like 600 things on the map, though this naturally varies due to other factors, as noted.


I usually find it to be a combination of sector and thing counts, as I've had a map with about 650 of each, and a map with 1000 sectors and only 250 things crash. Basically, if your map is <500 sectors you should be ok as long as you don't go overkill on the things, but once you hit 500 sectors you need to think more about it.

Share this post


Link to post

I've found that making a lot of the enemies deaf also helps a bit. I once was working on a map where you could save in the beginning, but as soon as you moved around or alerted some of the enemies, attempting to save the game only resulted in a crash (that was since fixed anyway).

Share this post


Link to post

I guess I'll make two versions of the map: One that's savable on the retail Doom engines, and a 'full version' that's complete with all the dead bodies and extra monsters. I'll pack them together in the same wad.

As of now, the full version has about 700 sectors and about 1300 things. I think I'm going to stop there actually. I'm just running out of creativity. And my game crashes even if you try to save it at the very beginning.

Thanks for all the information!

Share this post


Link to post

The game is most likely to crash in the beginning in most cases. Midway through the level, when you have killed half of monsters, the game may be saved succesfully (depends on monstercount etc).

For example, when I was first playing Hell Revealed Map26, the game used to crash in the beginning but after killing some baddies, especially pain elementals and their spawned souls, I could save the game.

Share this post


Link to post

That's because pain elementals leave no body behind when you kill them, therefore it's one less thing on the map - other monsters leave a dead body, so the number of things on the map doesn't go down. Picking up items is the best way to make saving possible on a map that isn't at the start.

Share this post


Link to post
Graf Zahl said:

(I can understand that the limits didn't matter in the first few versions but by v1.9 id should have realized that most of their hard coded limits were far too small for user maps...)


Actually, I think I've heard one or two of the DOOM II maps can cause a buffer overflow when saved in Ultra Violence, but I'm not sure.

MAP30 certainly would have, if the boss brain bug hadn't kept save games from loading on that map in the first place ;)

Share this post


Link to post

in zdoom it shouldn't be a problem...i tested this out with a map that had 13,000 formerhumans in it, and it still saved, with no errors

Edit: make that, lost souls

Share this post


Link to post
READ THE FAQ said:

in zdoom it shouldn't be a problem...i tested this out with a map that had 13,000 formerhumans in it, and it still saved, with no errors

Edit: make that, lost souls



Wow, you found out yourself that most source ports have completely removed the savegame buffer limit? Amazing! :-D

Share this post


Link to post
Guest
This topic is now closed to further replies.
×