PDA

View Full Version : Increase download speed COD2 1.0



Ni3ls
24th February 2014, 10:50
Hi all,

Since you managed to hex edit the COD2 binaries, is it possible for you to have a look at COD2 1.0 binaries? Maybe you can crack it so it will have the same download speed as 1.2 and 1.3.

Mitch
24th February 2014, 12:02
Hi all,

Since you managed to hex edit the COD2 binaries, is it possible for you to have a look at COD2 1.0 binaries? Maybe you can crack it so it will have the same download speed as 1.2 and 1.3.

Adding www download to 1.0 is not possible, because it also requires changes in the client.



// based on the rate, how many bytes can we fit in the snapMsec time of the client
// normal rate / snapshotMsec calculation
rate = cl->rate;
if ( sv_maxRate->integer ) {
if ( sv_maxRate->integer < 1000 ) {
Cvar_Set( "sv_MaxRate", "1000" );
}
if ( sv_maxRate->integer < rate ) {
rate = sv_maxRate->integer;
}
}

Ni3ls
24th February 2014, 13:00
But is it possible? For example my server have this fixed binary and I have it. It's not a big deal if not all players have it. It will just save some time for people who have this fixed binary

Mitch
24th February 2014, 13:17
But is it possible? For example my server have this fixed binary and I have it. It's not a big deal if not all players have it. It will just save some time for people who have this fixed binary

I could try to increase the value of sv_maxRate. (like you can change sv_maxClients to 128)

Ni3ls
24th February 2014, 13:18
Could you give it a try please? And how to change to maxclients 128?

Mitch
24th February 2014, 13:24
Could you give it a try please? And how to change to maxclients 128?

You change it by editing the hex 40 (64) to 80 (128) at offset 4BBAE (1.3).

pseudocode:


dword_849F74C = sub_80B403A((int)"sv_maxclients", (char *)20, 1, 64, 4133u);


But the more clients you have the faster you will reach limits. (like visible ents limit according to IzNoGod)

651

Tally
24th February 2014, 13:41
You change it by editing the hex 40 (64) to 80 (128) at offset 4BBAE (1.3).

pseudocode:


dword_849F74C = sub_80B403A((int)"sv_maxclients", (char *)20, 1, 64, 4133u);


But the more clients you have the faster you will reach limits. (like visible ents limit according to IzNoGod)

651


But the more clients you have the faster you will reach limits. (like visible ents limit according to IzNoGod)

That is correct. The engine basically assigns a hunk of memory to each player slot - note that: the player slot, not the player. Even though you may not have a full server (you may only have 1 on), the game still assigns this hunk of memory to the slot when it compiles the game, so that it can cater for all players if and when they actually join. This means that if your player numbers exceed what the game can handle in terms of memory and limits, it will crash the server even though there may be 1 or even no one online at the time. The engine will know it can't handle the full quota of players.

This is why if you have hit a limit, such as max script varibles, or server commands, reducing your player slots can sometimes help. Particularly with COD4, if you keep your player slots down to below 20, you can cram more into your mods. However, if you go over 22 players, a lot of mods around today for COD4 crash servers because of limits. The Openwarfare mod - one that I am actively involved with - is notorious for crashing out at anything above 26 players. Keeping the number down to below 22 or even 20 allows us to put more into the mod.

Ni3ls
24th February 2014, 13:55
Can you make SS of your HEX editor? Because Im very new and Im not sure if I do it correctly :/

Tally
24th February 2014, 14:15
Perhaps Mitch can write an LPatch file to be used with the ever-so easy to use LPatcher program? Then all you would have to do is run the LPatcher program, load-up the file and it will automatically update your executable.

Mitch
24th February 2014, 14:51
I could try to increase the value of sv_maxRate. (like you can change sv_maxClients to 128)



if (!rate) {
blockspersnap = 1;
} else {
blockspersnap = ( (rate * cl->snapshotMsec) / 1000 + MAX_DOWNLOAD_BLKSIZE ) /
MAX_DOWNLOAD_BLKSIZE;
}

if (blockspersnap < 0)
blockspersnap = 1;

while (blockspersnap--) {


Increasing the blocks per snap won't work. It will give this error:



ERROR: Netchan_Transmit: length = 18531


I changed the first MAX_DOWNLOAD_BLKSIZE from 2048 to 36864. (gonna test now if it works on 4096)

Edit: a higher value doesn't improve your download speed.

Ni3ls
24th February 2014, 14:55
You change it by editing the hex 40 (64) to 80 (128) at offset 4BBAE (1.3).


Can you show how to do this with Hex Editor? Some SS would be very helpfull :)

Mitch
24th February 2014, 15:16
Can you show how to do this with Hex Editor? Some SS would be very helpfull :)

in IDA you search for sv_maxRate. When the search is done you will find something like this:
654
The 40h says that the max value of sv_maxclients is 64.

Now switch to hex view and click on the 40. Now you will see the offset at the left bottom in IDA:
655

In your hex editor go to the offset and change the 40 into 80.
652
653
(the offset in the screenshots is for 1.0)

Ni3ls
24th February 2014, 18:27
And for Windows version?

RobsoN
24th February 2014, 18:29
And for Windows version?
It is a Windows version.

Ni3ls
24th February 2014, 18:47
With Windows I cant find it:/

filthy_freak_
19th July 2014, 16:36
Moving on from sv_maxclients...

I'v noticed on some 1.0 servers the download speed is 20kbps (Highest I'v ever seen my server go is 12kbps).

Could anyone shed any light on how this was done?

I'm pretty sure its not lag-related because the server which gives me 20kbps has 350 ping yet local servers with 50 ping will only do 12kbps.

Downloading almost twice as fast can make a big difference.

kung foo man
19th July 2014, 17:07
Never tried it, but I would play around with the network cvars of client/server like sv_maxRate and cl_maxPackets etc.

filthy_freak_
19th July 2014, 17:29
Never tried it, but I would play around with the network cvars of client/server like sv_maxRate and cl_maxPackets etc.

Yeah I'v fiddled with sv_maxRate & cl_maxPackets both client & server without noticing any difference (cl_maxPackets = 100 & sv_maxRate = 25000).

php
20th July 2014, 11:07
Keep in mind that the reason these rates are so low is because it could lagg your server / ingame players when some player is downloading a file.

Mitch
20th July 2014, 11:13
What have you set in your client as connection under multiplayer options?
It should say LAN/Cable/DSL. This means that the dvar 'rate' is set to 25000 instead of 5000.

Information about how to calculate your required sv_maxRate: http://www.fpsadmin.com/forum/showthread.php?t=9016

Example: 1 * 25000 * 8 = 200000 = 200 kbps = 20 kilobytes/s

m4ki
29th April 2015, 13:52
How to change the maximum number of players in 1.3 v (linux)?

Tally
29th April 2015, 13:55
How to change the maximum number of players in 1.3 v (linux)?

Topic title: increase download speed COD2 1.0

Actual question: how to change max number of players COD2 1.3

How different can you get?

In answer to your question: in your server config file, set this dvar:


set sv_maxclients "32"

m4ki
30th April 2015, 18:01
128 max slots ?

Tally
30th April 2015, 18:03
128 max slots ?

64 is the maximum.

m4ki
30th April 2015, 19:27
http://killtube.org/attachment.php?attachmentid=651&d=1393248321

Mitch
30th April 2015, 19:42
http://killtube.org/attachment.php?attachmentid=651&d=1393248321

You should read this post by Tally:
http://killtube.org/showthread.php?1835-Increase-download-speed-COD2-1-0&p=9210&viewfull=1#post9210

COD2 isn't build for having more than 64 players. Running a server with 65 or more players will be very laggy and buggy or will just crash.

voron00
1st January 2016, 21:55
Hi, sry for the late post but i wasn't sure if its stable enough. I was able to push the download speed to 19 kb/s by reversing the entire download function and forcing some values in it. I tried everything but it seems like having the download above 19 kb/s is not possible.
It's in my libcod repo, there's been 4 commits so far related to this function:
https://github.com/voron00/libcod/commit/8b9615e43388b5ad008de70066234fd7f6c997d5
https://github.com/voron00/libcod/commit/fb25fe58e5db50e4c852b4a0a4cb8f3baf5100b9
https://github.com/voron00/libcod/commit/300029088e4e86e5889e55897f2ee8ea3f6fcedf
https://github.com/voron00/libcod/commit/d113f9b909756a874b1e678dc48f3d5bacd2b329
I've been running this for nearly 3 mouths and it seems fine. :) GL.

CaptainSlow
19th April 2020, 22:52
Hi, sry for the late post but i wasn't sure if its stable enough. I was able to push the download speed to 19 kb/s by reversing the entire download function and forcing some values in it. I tried everything but it seems like having the download above 19 kb/s is not possible.
It's in my libcod repo, there's been 4 commits so far related to this function:
https://github.com/voron00/libcod/commit/8b9615e43388b5ad008de70066234fd7f6c997d5
https://github.com/voron00/libcod/commit/fb25fe58e5db50e4c852b4a0a4cb8f3baf5100b9
https://github.com/voron00/libcod/commit/300029088e4e86e5889e55897f2ee8ea3f6fcedf
https://github.com/voron00/libcod/commit/d113f9b909756a874b1e678dc48f3d5bacd2b329
I've been running this for nearly 3 mouths and it seems fine. :) GL.

Is there anything you need to do/set in the server config in order to get the 19 kb/s download speed when using your version?

Thanks!