CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.62k stars 4.17k forks source link

Faction meta tools: Monster exclusion zones #61767

Open I-am-Erk opened 2 years ago

I-am-Erk commented 2 years ago

Is your feature request related to a problem? Please describe.

We have a number of elements of faction and monster behaviour that are extremely hard to code solutions to and that are holding up other aspects of the game.

One such issue is that monsters of various sorts can storm faction bases and cause all sorts of havoc, from pulling shopkeepers out of their rooms to killing plot critical NPCs. There are several solutions to these, the foremost of which is "make NPCs less dumb", but that will take several more years. In the meantime, it would be helpful to have some meta tools with other uses that can also serve to reduce the impact of missing NPC AI.

Solution you would like.

This is one of several solutions.

We should be able to define zones which prevent the spawning and movement of monsters belonging to a particular faction, allowing either a blacklist or a whitelist. These are roughly analogous to NPC ignore zones, and serve a similar purpose. We'd then put an exclusion zone around, for example, the near perimeter of the refugee center, except for the back bay (and when the back bay is cleared, add one there too).

These are probably best implemented as two differnet, complementary zones: no monster spawning and no monster pathfinding. The pathfinding one should also probably cause everything in the zone to become undetectable to the monster, so that monsters on the edge of the zone just wander off instead of standing gathered at the gate forever, but again - those could be separate zones as well.

Aside from preventing zombies, fungals, and portal monsters from wiping out quest NPCs, we could also use this tool to allow player faction camps to create spawn exclusion zones within buildings and later within a defensive perimeter. This would solve the issue of hordes popping into the base, but since pathfinding would still be allowed, zombies that spawn outside the base can walk in if there's a route.

Describe alternatives you have considered.

Other things I'd like to post issues for if I have time:

Additional context

We already have issues noted around portal storms to keep the center NPCs from having so much trouble with those as well.

jfferson commented 2 years ago

at least for some classes of monsters such as fungals and others related to plague or mutations, the basecamp expansion of exclusion zones could be an interesting permanent feature

ashGlaw commented 2 years ago

I'm for the idea. I've had too many saves rendered too frustrating to continue because, for instance, there's an ant hill right next to the evacuation center.

I agree with your concerns regarding invulnerable npcs. I'm also concerned that factions ignoring each other could be damaging to the suspension of disbelief

PatrikLundell commented 2 years ago

I'd suggest protection of map locations would require world tile level exclusion radii for "enemy" faction map features, so e.g. an ant hill may not spawn close enough to such a facility as to cover any part of it with its area of control. The exclusion distance would depend on the effect radius of the facility. The mycus is a special problem in that its area isn't fixed in the same sense, but the current starting area of the "main" infestations is huge.

There may be a need for something like zones for more local threats, such as wasp nests, but threats such as web and funnel spiders would additionally require something that return them to their "base" after investigating targets, rather than free them to wander the map and cause havoc.

I-am-Erk commented 2 years ago

That's a longer term goal, but in general, I'd like faction bases to appear in somewhat special overmaps that have prescribed, less randomized contents. So the refugee center would be kind of in the middle of nowhere, in a map without much in the way of cities or other specials, for example. We need to improve mapgen for that, and for a lot of things.

PatrikLundell commented 2 years ago

An overmap tile is huge (180 180, according to OVERMAP.md), so we'd probably need to subdivide it into something like 4 4 sub overmaps of 45 * 45 world tiles each to provide suitable protection for "ordinary" facilities, while allowing for extra special ones such as the refugee center to be surrounded by a "ring" of additional "empty" zones, if desired.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

JonathanLochridge commented 1 year ago

I'd suggest protection of map locations would require world tile level exclusion radii for "enemy" faction map features, so e.g. an ant hill may not spawn close enough to such a facility as to cover any part of it with its area of control. The exclusion distance would depend on the effect radius of the facility. The mycus is a special problem in that its area isn't fixed in the same sense, but the current starting area of the "main" infestations is huge.

There may be a need for something like zones for more local threats, such as wasp nests, but threats such as web and funnel spiders would additionally require something that return them to their "base" after investigating targets, rather than free them to wander the map and cause havoc.

I agree with you.

I think this solution is preferable to an "exclusion zone" that blocks pathfinding. Outside of a limited implementation like blocking horde path-finding. I think that if the player leads a bunch of enemies to the faction base they should keep pathing towards it even if there are bad effects. Although, it is a little unfair if they just happen to spawn by some other bad structure and now the players can't do the quests.

Although, I do agree with I-am-Erk when it comes to preventing spawns within a certain radius of the center.