Some eagle eyed people may have noticed the dynamic_spawning branch on the current TC repo. This is a 3.3.5 branch setup to pretty much re-write how creature and game object spawning happens.
How things currently work.
[ul][li]Creatures/game objects are loaded/initially spawned on map/grid load.[/li]
[li]Creature runs around when active or go waits to be used, looks nice or sparkles to be mined/picked.[/li]
[li]Creature dies, becomes a corpse, or go is used, or is consumed and becomes invisible.[/li]
[li]Creature corpse despawns, becomes invisible and is teleported to home position.[/li]
[li]Creature “respawns” (is made alive and visible again). Gameobject is visible again[/li]
[li](some things are a bit different for pooled objects, they actually spawn/despawn)[/li]
[/ul]
Why is this bad?
[ul][li]It’s not how it happens on real servers.[/li]
[li]It limits minimum respawn time to corpse decay time.[/li]
[li]It’s not possible to really dynamically increase spawn times, without shortening corpse despawn.[/li]
[li]It makes the weird levelup effect when the level changes at the “fake” respawn.[/li]
[/ul]
What’s changed (full feature list separate)
[ul][li]Creature/Game Objects are loaded/initially spawns on map/grid load.[/li]
[li]Creature runs around when active or go waits to be used, looks nice or sparkles to be mined/picked.[/li]
[li]Creature dies, becomes a corpse, or go is used, or is consumed and is completely despawned.[/li]
[li]Creature object is despawned fully. Creature/Gameobject respawn time is added to the respawn timers for cell/zone/area, and grid.[/li]
[li]Creature/game object is respawned at the respawn time (or whenever a player is in range to trigger it).[/li]
[/ul]
Other features present
[ul][li]Creature/Gameobject groups. This is just a way to add a group number to a spawnId. It can have some flags, like manual spawn but is mainly used currently to identify types of creature for special treatment. There are SAI and C++ functions to spawn/despawn these groups with various options.[/li]
[li]Dynamic spawning (see the config section on this). It allows creatures/game objects to have the spawn time dynamically changed based on the number of players in the vicinity. Currently the creature groups will be set to only do this for creatures in base maps, that are the subject of a quest, or drop a quest item. For gameobjects, the same quest requirements, and also ore and herbs are included.[/li]
[li]There’s also a special mode for escort quest NPCs that start the quest themselves. When active, they will be included in the dynamic respawn functions, also their respawn time will be started when a player starts the escort. So, if the area is busy you could have a new quest starter respawn as quickly as every 10 seconds. It will detect to ensure that if there is currently an NPC with the same spawn ID that is not currently on escort, it won’t spawn a new one.[/li]
[li]There’s also a system added that will handle automated server restarts (with warnings) if the number of guids for creatures or gameobjects in any map reaches a dangerously high number. The settings are explained in the config file changes.[/li]
[li]The PR made by Treeston, that will only spawn boss’ subordinate trash if the boss is active on map load has been adapted to use the changes made here. Such that the initial spawn handler will skip spawning entirely. However they can still be added to the respawn handler, the respawn handler checks the condition rule. That is, that instead of spawning and hiding the creatures, they’re not spawned at all.[/li]
[li]Compatibility mode (and default creature/go group to set this). This can be used if no easy solution can be found to a problem detected with a creature/go that won’t work properly with the dynamic spawning process. This is automatically set for temp summons/dynamic created spawns, like those in battle grounds/wintergrasp. Since to fix all of these was not practical to keep within the scope of this change. The problems should be fixed at a later date.[/li]
[/ul]
Non related changes
[ul][li]Grid persistence. There’s now a way to register a series of grids to be “non unload”. That is they will not be unloaded. Grids can be added and removed from this list at any time. For example, at the start of a wintergrasp battle, all wintergrasp zone grids could be added, and they would never unload during the battle. Once battle is over, they can be removed and unloads would happen as is normal.[/li]
[li]Some improvements to .go info command, to show current spawn guid info, spawn id and distance from player. Creature/go lists are changes to list current guids of actually spawned instances. Including where possible multiple instances of the same spawnid. [/li]
[/ul]
What has been tested.
[ul][li]I’ve tested solo BG behaviour (there was sometimes an issue where flags in AB wouldn’t spawn for one player, but would for another in the same BG. I’ve not been able to prove if this happens in current core yet). Otherwise with compatible mode objects they seem fine.[/li]
[li]I’ve tested some instances work, but not many at all.[/li]
[li]I’ve tested levelling (as blood elf warlock) from levels 1-15 so far, with no issues found so far.[/li]
[li]Tested in valgrind, no leaks found. Not tested in helgrind much at all, since it really needs more than one person in more than one map.[/li]
[/ul]
Anything else is open season for testing. The ideal result is if alone, nothing should change. MAYBE gameobject spawns will appear faster due to an issue with the way they worked before (indeed it could be the case for any pooled object/creature actually). Otherwise it should be normal, except when multiple players are in the same area.
If you are able to test with many players in the same area, perhaps some feedback on the dynamic spawn configuration values that worked best would be nice.
That’s all for now, ask away any questions.