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

What's the highest -maxdemo can go?

Recommended Posts

I need to know for a project what the highest value the -maxdemo command line parameter will except.

The engines I'm using are:
Original Ultimate Doom executable - size 715493 bytes,
Original Doom 2 executable - 709905 bytes
Original Final Doom executable - 722629 bytes

Thanks.

Share this post


Link to post

The DOS exe won't allocate a zone heap larger than 8 MB, if I remember correctly. This can be expanded via hex hacking up to a bit short of 32 MB (space for the stack has to be left), but you need expert knowledge to do that hack on your own.

So, if assuming the default 8 MB heap, you then need to subtract away the amount of memory that is allocated for everything else in the game and what you're left with is the largest possible demo buffer.

The game usually has somewhere between 2 and 4 MB of non-purgable static allocations to load a small level such as E1M1 or MAP01. That would leave around 4 MB at max for demo buffering. Large levels, especially ones with lots of monsters, will cut this down dramatically.

Share this post


Link to post
Quasar said:

The DOS exe won't allocate a zone heap larger than 8 MB, if I remember correctly. This can be expanded via hex hacking up to a bit short of 32 MB (space for the stack has to be left), but you need expert knowledge to do that hack on your own.

So, if assuming the default 8 MB heap, you then need to subtract away the amount of memory that is allocated for everything else in the game and what you're left with is the largest possible demo buffer.

The game usually has somewhere between 2 and 4 MB of non-purgable static allocations to load a small level such as E1M1 or MAP01. That would leave around 4 MB at max for demo buffering. Large levels, especially ones with lots of monsters, will cut this down dramatically.


Ahh that makes sense, but does that mean that if I do a "-maxdemo 8192" and 4 MB is already allocated, then the game will only record up to 4096 kilobytes? Or does that mean if 4 MB will be allocated, then the -maxdemo parameter will only except a value up to "4096"?

Also, myk, thanks for the hack.

Share this post


Link to post
Archy said:

Ahh that makes sense, but does that mean that if I do a "-maxdemo 8192" and 4 MB is already allocated, then the game will only record up to 4096 kilobytes? Or does that mean if 4 MB will be allocated, then the -maxdemo parameter will only except a value up to "4096"?

Also, myk, thanks for the hack.

Actually it'll Z_Malloc error as soon as you request a buffer that is too large.

So one way to go about it is to start out with a value you know is too much, and then decrease it until you don't get a Z_Malloc error any more. However, then you need to play through the entire level in some test runs and make sure you don't get a Z_Malloc error *while playing* or else your demo run will be aborted :P

Share this post


Link to post

Damn, this is more complicated than I'd like it. Well thanks guys, I now pretty much understand the -maxdemo situation to the max.

Share this post


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