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

Random encounter 1 #56629

Merged
merged 24 commits into from
Apr 18, 2022
Merged

Conversation

I-am-Erk
Copy link
Member

@I-am-Erk I-am-Erk commented Apr 6, 2022

Summary

Content "Adds a prototypic random encounter with free merchants at a public washroom"

Purpose of change

The world feels more dead than it should: although we can run into vague wandering NPCs, there is a demand for more organized stabilized NPC travel. The classic example is that free merchant caravans, bandit gangs, and various sorts of scouts and scavengers from the faction should show up at various times.

This adds a prototype example, a handful of merchants and guards in a pickup truck.

Describe the solution

Adds two merchant guards and a trader that spawn with a pickup truck at roadside public washrooms, starting a week after the game starts. They won't spawn at night or in winter, and you can only run into them once per day. After an hour or so, they despawn once you're outside the reality bubble.

Adds a script by @mylie to remove NPCs from the map. This script only works when the player is outside the reality bubble. Closes #56601.

Things I would like to add in this PR or a followup:

  • inventory adjustments. The trader has almost nothing worth trading right now and no weapons.
  • custom classes for the guards, again making them more durable to reduce the chance of the caravan getting wiped out by random zombies.

Describe alternatives you've considered

I considered adding persistent NPCs that remember you, but that seems like a next step.
I considered adding a free merchant scout instead, and that should still be a thing.

Testing

merchants spawn as advertised and despawn as advertised. Dialogue and directions run without errors

There is a likely bug: if the despawn timer hits while you're nearby, the pickup truck may despawn before the NPCs do. We will probably need to refine the conditionals around despawning for this to make sure they run synced. That's beyond my skill and could be considered a block to merging this. Or, someone who knows stuff could expand the remove_npc script to also work inside the bubble.

Additional context

This framework could trivially be used to add some great stuff:

  • We should add similar caravaners and mercenaries to the back room of the refugee center, showing up sometimes and leaving. Likewise the same framework can be used to have the Arsonist and Merc persistent characters, and Yusuke the beggar, be around sometimes but gone scavenging/running jobs others.
  • We should add scavengers that are sometimes found trading in the front room of the center.
  • Other factions should have moving random encounters and caravans should have a chance of showing up in other places. Once we do that, the chance of running into this specific encounter at the rest stop should drop.
  • With a bit more infrastructure we could add a "trade depot" base structure for player bases and dialogue with the free merchant teamster to arrange caravans to come to your base sometimes.

In the future we might add one or two "upgraded" versions of the caravan, with a reinforced truck and maybe a gun turret, better gear on the guards, and some later-cataclysm dialogue.

@I-am-Erk I-am-Erk added [JSON] Changes (can be) made in JSON Missions Quests and missions [C++] Changes (can be) made in C++. Previously named `Code` Lore Game lore, in-game communication. Also the Lore tab. labels Apr 6, 2022
@github-actions github-actions bot added Map / Mapgen Overmap, Mapgen, Map extras, Map display NPC / Factions NPCs, AI, Speech, Factions, Ownership labels Apr 6, 2022
@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Apr 6, 2022
@andrei8l
Copy link
Contributor

andrei8l commented Apr 6, 2022

I don't think spawning ephemeral NPCs is a good mechanic, unless it's justified by lore somehow (ex: dimensional travelers). If there's no valid place to send them, can't they be sent to the nearest uninitialized overmap?

Prevents player from forcing a respawn by constantly coming and going from the map.
@I-am-Erk
Copy link
Member Author

I-am-Erk commented Apr 6, 2022

I don't think spawning ephemeral NPCs is a good mechanic, unless it's justified by lore somehow (ex: dimensional travelers). If there's no valid place to send them, can't they be sent to the nearest uninitialized overmap?

Once NPCs have the ability to drive, it would be nice to replace 'despawn' with 'get in the truck and drive a few OMT away from the player' before despawning', but since that's a feature we want anyway, I don't see this blocking it.

Eventually I would like to see more persistent trader NPCs that remember you, but adding the requirements for that will take longer, and we'll still need the random ones as a potential fallback and to fill out the ranks.

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 7, 2022
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 9, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 13, 2022
@kevingranade
Copy link
Member

I don't think spawning ephemeral NPCs is a good mechanic

This is definitely not the desired long-term way for this to work, but resolving this "properly" is really far over the horizon right now, so I'm loath to block content that is at least representative of how it's supposed to work.

@kevingranade kevingranade merged commit c52e17b into CleverRaven:master Apr 18, 2022
@I-am-Erk I-am-Erk deleted the random-encounter-1 branch April 18, 2022 23:54
@I-am-Erk
Copy link
Member Author

The key thing I hope to add to the encounter framework pretty soon is a kind of "population" variable that downticks if you kill faction members. So, the more random free merchants you murder, the fewer random free merchants you'll encounter for example. I'll probably put that in fairly soon. That will keep us from needing to model movements of merchants, but still allow them to be wiped out.

@LucasBurrns
Copy link

Is it planned to track those encounters on the overmap? Roughly saying to be able to intercept the travelling entity if the path is known, or encounter of entities on the overmap. I'm not talking about any precise pathfinding though, at most - travel by road if possible.

@I-am-Erk
Copy link
Member Author

Probably not any time soon.

@LyleSY LyleSY mentioned this pull request Apr 23, 2022
@LyleSY LyleSY mentioned this pull request Apr 8, 2023
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` [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Lore Game lore, in-game communication. Also the Lore tab. Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I still can't remove NPCs from the map
6 participants