Currently there are a few unusable custom npcs that will never spawn due to the normal terraria spawn logic has no idea how to spawn them correctly.
Problems of the current spawn system
Spawning is slow or non-existent in tight spaces where the player can see.
the math often picks locations with no exit path for the monsters (sealed rooms)
terraria seems to spawn multi able monsters at once while custom npcs 2 only spawns one at a time.
Plant npc's do not work at all.. (special conditions needed)
So, here is a plan for a custom spawn system
[ ] option to disable terraria spawning logic... and use the custom spawning system scripting instead..
Problems, light radius is mostly client side, so we can't really detect that..
However the work around this is taking the radius values from the spread sheet and doing math on the maximum possible radius of each torch and if a player is in that area.
some torches such as the water candle increase spawn rates, this special case torch should be ignored as non-player torches, where it benefits the dungeon to have them.
ability to add and sort torches to the ignored list / remove them.
if the npc has special flags activated
check npc for special flags, such as no collide if this flag is activated we should allow spawning inside sealed rooms / tiles.
option to disable if we care if the player sees the spawn per npc?
[ ] add in optional visual effects such as spawning from a portal for when we can't find a good spawning location
[ ] add spawning support for plant npcs
plant npcs require to be attached to the surface tiles of the game, however the way the terraria spawns them instantly kills them usually. (not properly attached)
Currently there are a few unusable custom npcs that will never spawn due to the normal terraria spawn logic has no idea how to spawn them correctly.
Problems of the current spawn system
So, here is a plan for a custom spawn system
if the npc has special flags activated
check npc for special flags, such as no collide if this flag is activated we should allow spawning inside sealed rooms / tiles.
option to disable if we care if the player sees the spawn per npc?
[ ] add in optional visual effects such as spawning from a portal for when we can't find a good spawning location
[ ] add spawning support for plant npcs
plant npcs require to be attached to the surface tiles of the game, however the way the terraria spawns them instantly kills them usually. (not properly attached)
Add OnStartInvasion, OnWaveProgress, OnEndInvasion Hooks