Skip to end of metadata
Go to start of metadata

This page is list of notes I took for myself while trying to debug the G_FindConfigstringIndex(): overflow error for UGX Mod v1.1. I tried to figure out what things cause the error and also wrote myself a proposed solution (which worked). Read through the page to develop an understanding of the ConfigString system, which is an indexed engine array of string assets. Then try to apply as many of the solutions as you can to both your own scripts and Treyarch's default scripts to minimize the chance of the error. ~treminaor

How to view current Configstring array

Console command: "configstrings"

> Check Console for output.

Alleged Causes of/Contributors to the Error

playsound()

Creates 1 configString if sound name is unique - if sound is not unique then the same configString is reused.

  • Configstrings: 1998 to 2189. If more unique sounds are played, the index will overflow and start overwriting the oldest sound indexes from 1998 onward.

playloopsound()

Creates 1 configString if sound name is unique - if sound is not unique then the same configString is reused.

  • Configstrings: shared with playsound()

playsoundatposition()

Creates 1 configString if sound name is unique - if sound is not unique then the same configString is reused.

  • Configstrings: shared with playsound()

playing the same sound 3000 times in a loop with a 0.1 delay did not cause this error.

playing the same sound 3000 times in a loop (19 times per frame) with a 0.1 delay did not cause this error

playing the same sound 3000 times in a loop with a 0.000001 delay did not cause this error

playing 3 sounds simultaneously 3000 times in a loop with a 0.000001 delay did not cause this error. Also combined with 128 unqiue fx on "tag_origin" using PlayFXOnTag, one per loop.

could not play 2000 sounds in a loop due to a string memory alloc limit (see http://ugx-mods.com/wiki/index.php?title=MT_AllocIndex:_failed_memory_allocation)

registerClientSys()

  • Configstrings: 1404 to 1413 - these will not overwrite themselves, there is an engine limit of 10 clientsys channels.

setText()

  • Configstrings: counts as a localized string, shared with PrecacheString()

LoadFX()

Creates 1 configString index for the path of the FX. If FX path is already in the configString array then no new index will be created. Reusing the same FX path with a different array name will increase the overall FX index and cause 400 FX Exceeded error.

  • FX configstrings: 2191 to 2386

PlayFXOnTag()

Creates 1 configString index for a unique tag used - if tag has already been used for any other tag-related function, it will be reused and no new configString index will be created.

  • Tag configstrings: 2851 to 2881

PlayFXOnTag() seems to generate some number prefixes on the tags used: http://i.imgur.com/mmbw8qC.png

playing the same fxID on the same tag ("tag_origin") on the same ent 3000 times in a loop with a 0.1 delay did not cause this error.

playing the same fxID on 3000 different (fictitious) tag names ("tag_origin_xxx") on the same ent in a loop with a 0.1 delay did not cause this error. same fx name with different (nonexistent) tag names = no crash

playing 125 unique (real) fxIDs on the same tag ("tag_origin") on the same ent 3000 times in a loop with a 0.1 delay did not cause this error.

getTagOrigin()?

Creates 1 configString index for a unique tag used - if tag has already been used for any other tag-related function, it will be reused and no new configString index will be created.

  • Configstrings: shared with PlayFXOnTag()

getTagAngles()?

Creates 1 configString index for a unique tag used - if tag has already been used for any other tag-related function, it will be reused and no new configString index will be created.

  • Configstrings: shared with PlayFXOnTag()

LinkTo(ent, tag_name)?

Creates 1 configString index for a unique tag used - if tag has already been used for any other tag-related function, it will be reused and no new configString index will be created.

  • Configstrings: shared with PlayFXOnTag()

PrecacheString(), PrecacheModel(), PrecacheItem(), PrecacheShellshock(), PrecacheMenu(), PrecacheShader(), PrecacheHeadIcon, PrecacheVehicle()

Creates 1 configString index for the name of the precached item, even if it does not exist and the precache fails. If the item has already been preacached then no new configString index will be created.

  • String configstrings: 333 to 1403?
  • Model configstrings: 1423 to 1934
  • Item Configstrings: 2826 (stored in one index)
  • Shellshock configstrings: 2643 to 2657
  • Menu configstrings: 2658 to 2691
  • Shader configstrings: 2691 to 2825
  • HeadIcon configstrings: 2835 to 2850
  • Vehicle configstrings: 2882 to 2978

#using_animtree()

Solution - merge all animations into a single animtree.

animtree configstrings: 2979 to 2990

Proposed Solution

Change use of playsoundatposition(<alias>, <ent.origin>) to <ent> playsound(<alias>) wherever possible.

Additional

  • Convert all uses of add_zombie_hint() to use hardcoded script strings instead of precached localized strings.
  • Convert all uses of &"" localized strings to use hardcoded script strings.
  • Remove all unnecessary SP localizedStrings which are still being precached.
  • Remove all unnecessary PrecacheShellshock()'s which are still being precached.
  • Remove all unnecessary PrecacheShader()'s which are still being precached.
  • Remove all unnecessary PrecacheMenu()'s which are still being precached.
  • Remove all unnecessary csc channels
  • Remove all unnecessary model precaches
  • Merge all custom animtrees into a single custom animtree file.
    • Also there's one called 'animated_props' that is loaded but not used - and '_jukebox' is not currently being used - also 'dog' and 'multiplayer'?