zm-reborn / zmr-game

Zombie Master, an RTS/FPS game on the Source 2013 engine.
https://zombiemaster.dev
Other
38 stars 12 forks source link

Strange interactions between navmeshes and npc_enemyfinders #322

Open DevilMudger opened 4 years ago

DevilMudger commented 4 years ago

crazy

I swear to god I’m not crazy.

Navmeshes and npc_enemyfinders seems to have really strange and inconsistent interactions with each other. Depending on what map you use to test it, whether it’s a local or a dedicated server, and if the nav mesh is present or not, the enemyfinder will either work or not work.

The three maps I can think of off the top of my head that use enemy finders are zm_deep_b5, zm_frozenfinale_b4, and zmr_shadow-over-innsmouth_a4. The results of my testing to try and consistently reproduce this are below. I’d be interesting to see if anyone else gets the same results or if I really am crazy.

zm_deep_b5 Creating a local server starting on zm_deep_b5 with the navmesh present causes the camera trap to not follow the player. Creating a local server starting on zm_deep_b5 with the navmesh NOT present causes the camera trap to follow the player correctly. Running a dedicated server on zm_deep_b5 with the navmesh present causes the camera trap to follow the player correctly. Running a dedicated server on zm_deep_b5 with the navmesh NOT present causes the camera trap to follow the player correctly.

zm_frozenfinale_b4 Creating a local server starting on zm_frozenfinale_b4 with the navmesh present causes the final boss to not follow the player. Creating a local server starting on zm_frozenfinale_b4 with the navmesh NOT present causes the final boss to follow the player correctly. Running a dedicated server on zm_frozenfinale_b4 with the navmesh present causes the final boss to not follow the player. Running a dedicated server starting on zm_frozenfinale_b4 with the navmesh NOT present causes the final boss to follow the player correctly.

zmr_shadow-over-innsmouth_a4 Creating a local server starting on zmr_shadow-over-innsmouth_a4 with the navmesh present causes the final boss to not follow the player. Creating a local server starting on zmr_shadow-over-innsmouth_a4 with the navmesh NOT present causes the final boss to follow the player correctly. Creating a local server starting on zmr_shadow-over-innsmouth_a4 with the navmesh present AFTER having loaded the map at least once with the navmesh not present causes the final boss to follow the player correctly. Running a dedicated server on zmr_shadow-over-innsmouth_a4 with the navmesh present causes the final boss to not follow the player. Running a dedicated server starting on zmr_shadow-over-innsmouth_a4 with the navmesh NOT present causes the final boss to follow the player correctly. Running a dedicated server on zmr_shadow-over-innsmouth_a4 with the navmesh present AFTER having loaded the map at least once with the navmesh not present causes the final boss to follow the player correctly.

So on a local server the behaviours of deep and frozenfinale are consistent with eachother but not with innsmouth. On a dedicated server all three maps show different behaviour. Frozenfinale and innsmouth have the same behaviour on local and dedicated. Deep shows different behaviour on local and dedicated.

Here is a handy table summarising the npc_enemyfinder behaviour described above:

Local Server
Without navmesh

Local Server
With navmesh

Dedicated Server
Without navmesh

Dedicated Server
With navmesh

zm_deep_b5 Works Broken Works Works
zm_frozenfinale_b4 Works Broken Works Broken
zm_shadow-over-innmouth_a4 Works Works only if the map has been loaded at least once without a navmesh. Otherwise broken. Works Works only if the map has been loaded at least once without a navmesh. Otherwise broken.

It’s the behaviour of innsmouth that’s really fucking with my head.

Any explanation of how this is happening would be appreciated, along with either a fix to the mod to produce consistent (working) behaviour, or advice for mappers on how the avoid the problem.

DoofusCockslap commented 4 years ago

I remember seeing something like that with npc_antlion. On some maps it will work, walk around (using npc_select/npc_go commands), play idle sounds etc, but on some maps it just plain refuses to work, not moving, not playing any idle sounds, and doesn't even play its idle animation, just standing completely motionless (it still dies and plays death sound if you damage it).

TotallyMehis commented 4 years ago

The npc_antlion one (at least) is caused by a missing AI nodegraph. All traditional NPCs seem to require them. npc_enemyfinder is also one of these NPCs. I had assumed it still worked without nodegraph, since I presumably tested it on a map that had already generated a nodegraph.

But yea, nodegraph generation was disabled in Beta 5 because it takes a really long time to generate one.

https://github.com/zm-reborn/zmr-game/blob/1a545d466cfa7ac623e66daf83dc62f0c5690b60/mp/src/game/server/ai_networkmanager.cpp#L1061-L1067

TotallyMehis commented 3 years ago

I tested 3da623f on zm_frozenfinale_b4 WITHOUT an AI graph and the func_tank follows the player fine, so I'm assuming this is fixed now.