PDA

View Full Version : [reference] CoD2 engine limits



IzNoGoD
16th February 2014, 18:46
Back in the days there was a thread on modsonline about limits of the CoD2 engine.

I thought it would be nice to make a similar thread here.

Currently:

General:
Gamestate: 16k (1.0/1.2) or 128k (1.3) (serthy)
weapons: 64 or 128, but bugs out after approximately 48 (izno)
Max string length: 1024 (for cvars and in script)(serthy), 256 (for iprintln and probably iprintlnbold too)(izno)
Max client cvars: 1000 minus the default ones (serthy)

Menus:
Max precached: 64 (serthy)
Max actions in a menu (OnOpen etc): 42ish (serthy)

Players:
headicons: 16 (serthy)
statusicon: 8 (serthy)

Any other limits you want to have listed here, any ?? you want to have filled with your value or spotted an error? Reply :)

serthy
16th February 2014, 18:57
I remebered those:

General gamestate:
1.0 16k
1.2 16k
1.3 128k

app. max actions in menu event (a la onOpen): 42

max precached menus: 64
max precached statusicon: 8
max precached headicon: 16

max cvar string length: 1024
max count client cvar: << 1000

filthy_freak_
16th February 2014, 21:18
Max "newHudElem()" is 32 I believe.

Probably the same with "newClientHudElem()" but haven't tested.

I wish there was a way to increase the limit D=

RobsoN
16th February 2014, 22:13
Selbie told me there is 32 limit of newHudElem and 32 of newClientHudElem.

And why 64 menus? On 1.0:


******* script runtime error *******
Too many menus precached. Max allowed menus is 32

Tally
22nd February 2014, 12:39
Anyone know what the max number of script variables is? I've not hit it yet (because I haven't had a hard server crash), but I suspect I must be near it, because the game looses track of players leaving and returns an "undefined is not an array, string or vector" to prefect code in callback_playerDisconnect(). This tells me there is something wrong and I must be borderline with some ceiling limit. I just can't figure out what it is.

IzNoGoD
22nd February 2014, 12:40
I thought max vars were approx 65k, but dont quote me on that

Mitch
22nd February 2014, 13:04
I had this error yesterday.



ERROR: G_FindConfigstringIndex: overflow (846): 'fx/un/20mm_tracer.efx'


I had probably too many loadfx.

You can also have max 64 map name in one or more .arena files. (above 64 it shows just the default mp_***)

Edit: when i don't load the shoot through wall script from IzNoGod then the overflow is gone. (it has 23 loadfx)

randall
24th February 2014, 19:10
Max array size: ~4096

kung foo man
24th February 2014, 22:18
script_brushmodel 256 or so (soft limit should be around 200, since at some point nades are invisible etc.)

Mitch
16th September 2014, 13:08
objective_add is limited to 16 objectives. (0 until 15)



if ( *(_DWORD *)v7 < 0 || *(_DWORD *)v7 > 15 )
{
v0 = sub_80B7FA6("index %i is an illegal objective index. Valid indexes are 0 to %i\n", *(_DWORD *)v7, 15);


Also compared to cod4 the states are limited to 3 (empty, invisible, current).

php
16th September 2014, 19:33
objective_add is limited to 16 objectives. (0 until 15)



if ( *(_DWORD *)v7 < 0 || *(_DWORD *)v7 > 15 )
{
v0 = sub_80B7FA6("index %i is an illegal objective index. Valid indexes are 0 to %i\n", *(_DWORD *)v7, 15);


Also compared to cod4 the states are limited to 3 (empty, invisible, current).

v36

jk;
good job

Mitch
29th January 2015, 16:08
Xmodel limit: 255 unique xmodels or 1024 xmodel in total (G_ModelIndex: overflow)

Client commands for outputting entities (to server console): printentities, entitycount (this one requires cheats).

filthy_freak_
10th August 2015, 03:59
Max menuDef is 128


UI_AddMenu: Maximum number of menus 128 exceeded.

Maximum number models you can attach to an entity is 8.
Maximum number of turrets you can spawn is 32.


Also not sure if this should be classed as an engine limit or bug, but character animations do not get reloaded if you have previously joined a server. You are required to restart cod2.

maxdamage99
10th August 2015, 17:39
Сan "raise" limits? Change the game engine?

IzNoGoD
10th August 2015, 20:10
The amount of objectives is hardcoded clientside last time i tried anything with it, so thats a no-no.
Amount of menus is probably overrideable, but you would have to alter other configstring indices to get it to work properly
xmodels can be shown unprecached using configstring alteration already, so no need to up that limit anyway
turrets: i dont see how anyone would need more than 32 turrets on a map, will lagg the server anyway if all those are in use. If you need more turrets, just add them to the map itself maybe?
attach: im not gonna burn my fingers on such delicate (shit) code
g_modelindex overflow is also triggered by too many trigger_use_touch, so limit those in your .map (all trigger_use_touch objects ++ the modelindex counter)
gamestate: hell no (however you can add tricks like sending precaches AFTER the client connects. Is quite hard and requires some custom coding so could be doable)
weapons: they bug out after approx 48, so increasing the limit from 64 or 128 to a higher number is useless. Just modify the weapon's parameters using the libcod functions or write some of those yourself
string length has been patched (non-libcod patch), but only internally. Still, getting to over 1024 chars and you're doing something wrong imo
cvars cause a clientside crash, so thats clientside hardcoded
headicons: hardcoded clientside (spent waaaay too long figuring that out)
statusicons: see headicons
hud elems: using over 32 hud elems is generally ill advised, but might be patchable to a higher number. havent tried.
script vars: 65k is 16bit unsigned integer, so changing that will require a MAJOR overhaul of the ENTIRE engine, so dont even go there
entity limit is 1024, but ents become invisible after 256 ents are shown (so you can add a ton of script_origins on top of visible ents), but i'd assume this is limited clientside

maxdamage99
10th August 2015, 23:34
And if you imagine it is that all the players on my server will pump not only fashion, but also all the files are in a directory "Call Of Duty2" Full game (Server launcher)

IzNoGoD
11th August 2015, 00:41
And if you imagine it is that all the players on my server will pump not only fashion, but also all the files are in a directory "Call Of Duty2" Full game (Server launcher)

Again, like in the other thread, this sentence makes no sense at all. Please learn how to form proper english sentences before you speak

maxdamage99
11th August 2015, 10:34
This you need to learn how to use translate.google like this I use, and learn how to talk to people, respectively not be bastards!

IzNoGoD
11th August 2015, 13:14
I do not need to learn how to decode your google translate mess as this is an english forum, so you should at least make yourself understandable in english. If you fail at that, you can try google translate, but that is not a guarantee that the result will even form any kind of logical sentence (protip: YOUR SENTENCE MAKES NO SENSE)

kung foo man
10th July 2021, 08:32
What's the xmodel triangle/face limit?