Glad to be of service, heh heh. I think maybe a better (and orthogonal) solution for that pathing issue is to let NPCs push each other aside — just like the player can do now – when the only thing blocking their path is another NPC. I think this would not be hard to do. IIRC the way the NPC update_path function works right now, it has a boolean flag that basically tells the pathfinder algorithm to also consider paths that can be made by smashing through breakable terrain. I bet it wouldn’t be difficult to add another flag for “include paths that are passable except for a player/NPC in the way.” Then the NPC could just push other characters aside while walking.
Of course, this might lead to another problem, since if we let NPCs push players, your buddy might accidentally push you into a lava flow or garbage chute or something. We could exclude pushing players completely or check if a tile is dangerous (don’t know how simple that is) before displacing the player.
I do like the idea of run on sight, although I don’t have a concrete idea of how that would be implemented in a non-annoying way. Right now, NPCs that are told not to engage in combat with a given enemy will just sit there and take a beating from it. I know there’s a command to “only attack enemies that you can kill easily”, so maybe we could use that functionality to let an NPC determine which foes he can’t kill easily, and then avoid them. I think NPCs right now just try to stay within some set distance of the player at all costs, but we could adjust their planning so that they will try to do so but also weight other factors, like fear of strong enemies. That might produce an effect where the player charges into a group of strong zombies but the companion NPC decides he’s too weak to fight them and decides to hang back outside their LOS, then begins following when the player is far from the zombies again.
EDIT: Ooh, just had another idea for the mutant NPCs. I added an option on NPC class templates in the same PR that lets you make an NPC undergo an arbitrary number of rounds of mutations when created, so in literally one line of JSON you can create an NPC who’s already mutated down any mutation line you desire:
{
"type" : "npc_class",
"id": "NC_RAPTOR_MUTANT"
... more fields here ...
"//": "10 rounds of raptor mutations, lol"
"mutation_rounds" : [
[ "MUTCAT_RAPTOR", { "constant" : 10 } ]
]
},