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

NPC faction camps #73372

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

NPC faction camps #73372

wants to merge 19 commits into from

Conversation

RenechCDDA
Copy link
Contributor

@RenechCDDA RenechCDDA commented Apr 29, 2024

Summary

Content "Static NPC factions have their own camps and food stores"

Purpose of change

(Ruin the game by) Continuing to expand our NPCs and NPC factions

Describe the solution

Add a new camp and camp_name field to map specials which capture the desired OMT placement, faction, and camp name for the resulting camp.

✅ Spawns a camp and assigns those values as expected.

✅ Make sure players and NPCs can't interact improperly with camps they don't own (e.g. can't eat out of their food stores)

✅ Define camps for our existing vanilla and in-repo mods

✅ Define reasonable food stores for our factions that they eat out of

✅ Handle lone wolf factions, somehow. (I have decided this is out of scope)

✅ Handle water needs for camps, by editing existing mapgen and otherwise giving camps access to the water_well provides

✅ Save compatibility by inserting new camps into existing versions of these specials

✅ For the basic implementation, the food stores will regenerate or otherwise gain food over time, and they'll never eat themselves out of a home. But...

(Future PR) Implement refugee center's questline of them actually being starving.

Describe alternatives you've considered

IDK, like ten billion EOCs?

Testing

image

Additional context

Big thanks to @Procyonae for some very good suggestions regarding the save migration issues

See next message for some known issues

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Player Faction Base / Camp All about the player faction base/camp/site labels Apr 29, 2024
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions and removed json-styled JSON lint passed, label assigned by github actions labels Apr 29, 2024
@github-actions github-actions bot added NPC / Factions NPCs, AI, Speech, Factions, Ownership json-styled JSON lint passed, label assigned by github actions and removed json-styled JSON lint passed, label assigned by github actions labels May 9, 2024
@github-actions github-actions bot added Mods Issues related to mods or modding Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) json-styled JSON lint passed, label assigned by github actions labels May 10, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 10, 2024
@RenechCDDA
Copy link
Contributor Author

RenechCDDA commented May 10, 2024

Known issues: Some minor factions (old guard, fisherman family, dinomod's uh... somebody) don't have camps for various reasons, detailed in their comments.

Camp names are probably not extracted for translation, and probably need to be.

Exodii camp is always placed on z=0 though it needs to be on z=1 to be in range of Luliya, so she can eat and drink out of it. I don't know of a solution to that.
https://github.com/CleverRaven/Cataclysm-DDA/pull/73372/files#diff-42c7c4cb29ad3d9e0848d8e28847f1380323375b70a956f674db80954cc2abccR1436

Old wizard has the same problem, they're on Z=3 but the camp will be placed on Z=0, out of food range.

Savegame compatibility (putting camps into old games) is here but boy is it ugly.

@RenechCDDA RenechCDDA marked this pull request as ready for review May 10, 2024 11:33
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-requesting reviews from non-collaborators: @LyleSY

src/map.h Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label May 10, 2024
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 10, 2024
@LyleSY
Copy link
Contributor

LyleSY commented May 10, 2024

Nice! I'm happy to try and fix the issues with DinoMod if you can point me in the right direction. The DinoMod Swamper base has needed work for a long time. I believe that can be addressed by me in a separate PR without blocking this.

@IdleSol
Copy link

IdleSol commented May 10, 2024

What about lumberjacks at the lumber mill and kindred? Are they not considered a faction?

@RenechCDDA
Copy link
Contributor Author

Nice! I'm happy to try and fix the issues with DinoMod if you can point me in the right direction. The DinoMod Swamper base has needed work for a long time. I believe that can be addressed by me in a separate PR without blocking this.

They're spawned as a single OMT building, not as a special, so this implementation doesn't have any way to add a camp to them. Making them a one-tile special(if that's possible?) would be sufficient.

@RenechCDDA
Copy link
Contributor Author

What about lumberjacks at the lumber mill and kindred? Are they not considered a faction?

Huh ok, somehow I missed these. Let me push a fix for that.

@RenechCDDA
Copy link
Contributor Author

I had skipped over most the wasteland_scavengers faction, but I went through and re-checked them all now. The only question mark is that their homeless camp spawn is only a 1/3 chance to actually spawn them.

"place_npcs": [
{ "class": "NPC_homeless_broker", "x": 11, "y": 9 },
{ "class": "NPC_homeless_group_survivor", "x": 2, "y": 13 },
{ "class": "NPC_homeless_group_survivor", "x": 15, "y": 14 },
{ "class": "NPC_homeless_group_survivor", "x": 2, "y": 15 }
],

The other 2/3 of the time it's either empty, or occupied by a single no_faction npc. Therefore I haven't given them a camp on this special, but all their other locations got one.

@Procyonae
Copy link
Contributor

They're spawned as a single OMT building, not as a special

Swamp Shack is a vanilla special DinoMod just adds a variant with an NPC, which doesn't work with this due to it being a % thing but idk how you think it's being placed not as a special that's not how mapgen works

@RenechCDDA
Copy link
Contributor Author

With lots of help from Procyonae (again), we've determined that the church is a special - it spawns as such in vanilla. Dinomod adds a variant church which ends up being a % chance to spawn.

@LyleSY Proc believes they have a better solution in the works at #72529 so no action should be needed by you. But please feel free to comment if you see a mistake or something wrong!

@RenechCDDA
Copy link
Contributor Author

Exodii camp is always placed on z=0 though it needs to be on z=1 to be in range of Luliya, so she can eat and drink out of it. I don't know of a solution to that.

Old wizard has the same problem, they're on Z=3 but the camp will be placed on Z=0, out of food range.

I think the solution here will be to ignore z-level for the purposes of determining if camp is in range. The bubble and camp placement already works this way. I'd still like to be able to place the camp on a different z-level, but that's mostly an aesthetic issue.

...though this means port augustmoon's display is gonna be reeeally weird, it'll still just be aesthetic.

Right now my plan is to bump all that out into a follow-up PR, but mergers if it needs to go into this one please let me know.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 11, 2024
UICA gets INTMAX food
Clang gets silenced
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` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Documentation> Design documents, internal info, guides and help. [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 [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: Magiclysm Anything to do with the Magiclysm mod Mods Issues related to mods or modding NPC / Factions NPCs, AI, Speech, Factions, Ownership Player Faction Base / Camp All about the player faction base/camp/site
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants