-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improving faction camp maps #18
Comments
I've got a script that spits out the differences between camps:
still need to figure out how acidia was doing stuff, but hopefully I can replace his overmap gen with tailored stuff. |
With this method you could also have buildings smaller than an entire overmap tile and thus having a more compact base. |
However, how would this recognise terrain partially built by the player? Would the resource cost be itemized on a per tile basis as opposed to being summed up for the entire upgrade recipie? |
Right, resources are consumed on a per tile basis as the work is performed. When you requested an upgrade, the camp manager would give you an estimate of the time to complete and material cost based on the upgrade plan. Each time you bring the NPC (or possibly overmap tile) into the reality bubble, the NPC would calculate the elapsed time since he last performed work. Then he'd look through the upgrade plan, find the first piece of work that needed to be done that can be done with the available materials, and perform that work. He subtract the time taken from the elapsed time, consume the materials, and if there was elapsed time remaining, move on to the next tile. When the relevant tiles match the upgrade plan, he reports to the camp manager that the job is complete. So if you're upgrading to camp3, the upgrade plan is essentially 4x $. If you build the first one, the NPC will build the second instead. If while the NPC is building the second one, you destroy the first one, when the NPC goes looking for the next piece of work, he'll go back and rebuild the first one. The NPC camp manager would also be able to detect/report that you're out of materials before an upgrade plan is complete, or if there's some obstruction/obstacle that prevents completing the upgrade plan: your truck is in the way, or you're trying to build on lava or whatever. I'd really like for work to be performed on an hourly basis, whether or not you're in the reality bubble, but I don't know if that's currently feasible. It would great if NPCs did stuff outside the reality bubble, though. |
While working through the npctalk refactor, I noticed that the refugee ranch upgrades are already handled something like this, though it's all hard-coded and instant. |
Figured out why acidia used overmap tiles: so he could check the number of the overmap tile name as a way to determine what level of faction camp you'd built. That's going to break if we start doing flexible upgrades, plus it leads to wackiness like the player deconstructing buildings for parts but still getting the benefits of the buildings. So let's make some use of out basecamps. They're already written to the save file, we just need to expand the definition. They're currently associated with bulletin boards but they don't (as far as I can tell) depend on them. So expand the basecamp definition to include feature flags and terrain locations. As you upgrade, you get flags. Dialogue options are controlled by flags. If the code can "watch" individual pieces of terrain or trigger callbacks when terrain is changed, it would be easy to detect if a piece of furniture was destroyed or in use. |
Add JSON support for defining an upgrade.
Instead of replacing the maps wholesale (why why why what a non-great idea), create an upgrade template, something like this:
which would be a 6x6 roofless brick building, starting at offset 3, 3 on the map, with a single door and bed inside.
The building algorithm would proc every hour inside the reality bubble and would check to see how much stuff the NPC could have built in the hour, then look at the terrain/furniture at a location and either add a change or if that change is already there, skip to the next one. Construction outside the reality bubble wouldn't happen but would be caught up when the reality bubble is loaded. Supplies would be consumed piecemeal. Work would break if the NPC can't change the terrain because of a vehicle in the way.
Lot of work, but the advantages:
The text was updated successfully, but these errors were encountered: