Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-add pre-seeded hordes, make them unconditional, and show up even with wandering hordes disabled #69980

Merged
merged 11 commits into from
Dec 6, 2023

Conversation

esotericist
Copy link
Contributor

Summary

Features "re-add pre-seeded hordes, make them unconditional, and show up even with wandering hordes disabled"

Purpose of change

back in the olden days before #49279, the "wandering hordes" setting (also known as wander_spawns) also pre-seeded cities with zombies, in order to make sure there actually WERE hordes in cities that could wander around and be visible in the distance before the player has actually caused world generation to occur.

while some of the concerns raised in that removal PR had merit (including the implicit balance concerns with that setting causing a large shift in the amount of zombies spawned in the world, with no tunability to speak of), most of the stated methods of getting the zombies back "properly" aren't actually viable without radical overhauls of how world generation and monster spawning actually work.

specifically, without pre-seeded spawns, zombies now only generate hordes after the player has been to a location, caused local map generation to occur, and walked away, and even then only under specific circumstances that allow zombies to form hordes. even with wandering hordes on, without pre-seeded hordes there are none visible in the distance, and they certainly aren't going to be moving around (because they don't exist).

Describe the solution

  1. first i reverted the feature removal, then repaired it to account for loss of infrastructure in the intervening years (dead code gets cleaned up, that's life)
  2. next was adding a bunch of json elements in the form of external options to govern the behavior; almost all of the constants used in the logic are specified in json (should be straightforward for modders), and the logic as a whole should respect monster spawn scaling.
  3. the extra city zombie spawns are completely insensate to the wandering hordes option, so players will get these new zombies whether they can move around or not... but i also changed things so that they're still visible on the overmap as hordes, even with wandering spawns off. (they don't move, though, and they don't re-hordify if the player leaves after they're deposited)
  4. to ease in troubleshooting, i added some debug logic to the tile and non-tile overmap stuff to help see hordes in the distance (currently tied to the debug_clairvoyance mutation)
  5. all of the new spawns ONLY spawn on road tiles, to hopefully prevent them from landing inside buildings inappropriately
  6. added a small tweak to horde rendering in tilesets. this will require tileset changes for best results (see notes below additional context )
  7. tried to concentrate horde spawns closer to city center. this seems to have succeeded, and helps provide a threat gradient between town outskirts and city centers.

the balance implications of this are substantial; it will be a very sharp uptick in the threat levels of city interiors (and exteriors, for smaller cities). should be managable, but a less obvious consequence is that with every additional zombie, there's more opportunities for someone to hit their evolution threshold sooner than expected. this is going to result in increasingly dangerous mobs in city centers, especially the more the player has to travel to reach them, or the more zombies manage to resurrect before the player can pulp/dismember them.

that said, with the current concentration logic, it should still be possible to drive through some lower zombie concentration areas with a vehicle early on. (especially a smaller vehicle, like a bike, although then you'll have to deal with ferals throwing rocks at you. whoops.)

an idiosyncracy of the current use of the horde mechanics for non-wandering-hordes players is that the zombies WILL show up on the map until the player gets close, but once they get deposited as spawns the horde is depleted and gone. this might result in modest confusion. this function can be backed out fairly easily if it's determined undesirable, but i suspect the better long-term call is inching towards better display of mobs on the overmap outside of hordes.

someone more prepared for writing documentation than me might consider updating the in-game help to cover these changes.

Describe alternatives you've considered

having the hordes show up for players with wandering hordes turned off was a bit of a toss-up for me, it can be removed if it confuses people.

i also considered having zombies re-absorb back to the overmap when conditions permit, even with wandering hordes turned off ... this COULD help with keeping distant zombies 'visible' on the overmap, even after the player walks away, but without the wandering logic they can't bunch up and that means they might not be big enough to actually be visible on the overmap with the current rules.

i SERIOUSLY considered upping the range at which zombies can be seen on the overmap, but scope creep was fatiguing me, and there's a lot of bikeshed potential there.

the 'concentrate hordes towards the center' functionality was scope creep, and could be dropped, but i think the effect is worth it

for the record: not getting the hordes back was never really in question as far as i'm concerned; we needed the zombies. cities don't have enough. this is a straightforward way to do it, which ALSO repairs the wandering hordes feature.

Testing

i spent a GREAT DEAL of time creating worlds with and without wander_spawns enabled, teleporting around, hitting 'debug -> map -> reveal', adding the debug_clairvoyance mutation when appropriate... i'm fairly confident at this point hordes are spawning correctly.

what i'm substantially less sure about is if i got all of the infinite loop bugs -- i ran into three distinct ones (one of which was caused by undocumented unintuitive behavior in city::pos_om, which i've adjusted to behave more reasonably). i'd ideally like to hear from testers if running around around massive amounts of mapping can cause any hangs in world generation or the overmap view. cascading mapgen sucks.

Additional context

screenies!

image
image
image

a city center minimap full of zombies
image

outskirt streets can be pretty empty
image

extreme case: very wide city, very few hordes out into the distance. with the city-center focused placement, it might be worth increasing the default radius spread. i'll leave that bikeshedding to other people.
image

some nice easterly things at overmap coordinates 5, 0, 0 (playing with @I-am-Erk 's new stuff)
image
image

overmap coordinates 10, 0, 0
image

i want to draw specific attention to the lower left:
image

this showcases consequences of a) overlapping cities, b) small cities. it gets weird.
also you can't tell but a lot of those tiles have 3 hordes in them for a total size of 30... and with our spawning rules, that can be potentially 90 zombies. (it almost certainly won't be, though, that would require it to consistently pick 'zombie' then the upper scale of 3 per pack)

horde tileset notes

pinging @Fris0uman per request.

not all of the tilesets were consistently rendering hordes, nor were they consistent in the ways they failed to render hordes, and it turns out this is because there's no guaranteed "this will be picked if all else fails" tile option for hordes due to the logic used.

in order to get the larwick overmap tileset to consistently display hordes, i adjusted the overmap tileset rendering to cap effective horde size (for the purposes of zombie horde rendering) to a size of 10 (the size i currently use to deposit pre-seed

because i didn't have it in me to go through composing tilesets, i manually edited tile_config.json to add the additional ids to overmap_horde_6:

"id": [ "overmap_horde_6", "overmap_horde_7", "overmap_horde_8", "overmap_horde_9", "overmap_horde_10"  ]

any tilesets that can be used for the overmap are going to want to have overmap_horde_3 through overmap_horde_10 represented in their id lists. that said, it isn't actually necessary to have all of them distinct; you can get away with just size 3-5 and size 6-10; the non-tiles horde rendering only has two states (z and Z) right now, so it would be feature parity.

having sizes 1 and 2 defined won't hurt in case of future changes, but as of right now won't do anything.

on the whole, i don't recommend putting too much effort into all of these tiles, it's very likely horde scaling and the thresholds for changing hordes (not to mention considerations for alternative horde types) will change at some point.

for further errorproofing, it would also be good to ensure the following tiles are defined even for overmap-specific tilesets, just in case (the overmap tileset rendering will sometimes fall back to these, even if the horde tiles exist):

mon_zombie
mon_zombie_tough
mon_zombie_brute
mon_zombie_hulk
mon_zombie_necro
mon_zombie_master

everything above would even apply to ascii tiles as an overmap tileset. worth checking.

@esotericist esotericist added Game: Balance Balancing of (existing) in-game features. Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding Map / Mapgen Overmap, Mapgen, Map extras, Map display Spawn Creatures, items, vehicles, locations appearing on map [C++] Changes (can be) made in C++. Previously named `Code` labels Dec 4, 2023
@github-actions github-actions bot added <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Dec 4, 2023
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 4, 2023
@worm-girl
Copy link
Contributor

I for one welcome our new zombie overlords.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Game: Balance Balancing of (existing) in-game features. Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display Mods Issues related to mods or modding Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants