On other games you need to check on every frame if an illegal talktexture is being used.
Well, I don't exactly remember if DM servers allow entire skinset change (ex: Raw Steel into Metal Guard), if that's true, then simply remove the second condition on ModifyPlayer and leave it like this:
Code: Select all
if ( Other.Mesh == LodMesh'Botpack.Soldier')
If the watcher corresponding to this player exists, it will be found, otherwise, it will be spawned. (ChildActors iterator finds actors owned by the calle)
The watcher does checks on every single tick, it isn't slow because it doesn't run any iterator at all, it's just updated like any other dynamic actor in the level (must be hundreds of dynamic actors on a simple MH game, just like in any other game that spawns lots of actors).
The goodies of spawning one actor per player (not every player, only Male Soldiers, this is an optimization), is that these actors have the player owner's reference already stored and easily self destruct if the player disconnects.
Also, replication does impact the CPU in a far greater scale than anything else these days:
NewNet ComboGib: 100 tickrate, 12 players = 0.4 ms processing actors, 7 ms processing replication code. (unknown CPU)
ZeroPing Siege: 65 tickrate, 22 players = 1.4 ms processing actors, 9 ms processing replication code. (intel xeon processor > 3.0ghz)
Other tests made by me:
Generation of 1024 MD5 hashes of NexGen keys via brute forcing (Pentium E2180 2.00ghz):
UScript alone: 370 ms.
Native Code: 28 ms.
40 BotZ using load balancing (same E2180): Stable framerate 60.
40 BotZ without load balancing (pre R6) (same E2180): Framerate around 15.
A single botZ can call up to 15 traces and 2 actor list iterators, besides other checks in a single tick.
The only bottlenecks in the engine are file save/loading, this means, AVOID calling SaveConfig() more than once per second, and chained list iterators (NavigationPointList and PawnList) using For to loop on these lists more than 2 or 3 times per frame will make the FPS drop evident.
PD: The goodies of checking every tick is that you don't give a the PRI actor a chance to finish the world update (general tick) before kicking the player and destroying the PRI.
This means, that the very frame the player changes skin, the player and his PRI are gone and therefore, not replicated to clients. 100% safe. (maybe not as safe if the player decides to change face before the actual game starts... lol)
EDIT: Sorry for attacking you on the previous post, I had a long day.