Spider Mastermind
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Doom Speed Demos > What's the highest -maxdemo can go?
 
Author
All times are GMT. The time now is 04:23. Post New Thread    Post A Reply
Archy
Forum Regular


Posts: 672
Registered: 11-09


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.

Old Post 02-03-12 03:33 #
Archy is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5761
Registered: 08-00


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.

Old Post 02-03-12 05:11 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
myk
volveré y seré millones


Posts: 15137
Registered: 04-02


Here's a heapsize 32 hack for Doom2 (the 709905 byte binary).

Attachment: heapsize.zip
This has been downloaded 32 time(s).

Old Post 02-03-12 05:54 #
myk is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Archy
Forum Regular


Posts: 672
Registered: 11-09



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.

Old Post 02-03-12 06:18 #
Archy is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5761
Registered: 08-00



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

Old Post 02-03-12 23:25 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Archy
Forum Regular


Posts: 672
Registered: 11-09


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

Old Post 02-03-12 23:38 #
Archy is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 04:23. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > Doom Speed Demos > What's the highest -maxdemo can go?

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Message Board Statistics