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

[WIP] Update Tacoma ranch missions #55690

Closed
wants to merge 60 commits into from

Conversation

haveric
Copy link
Contributor

@haveric haveric commented Feb 26, 2022

Summary

Bugfixes "Update Tacoma ranch missions"

Purpose of change

At this point, this is just a progress tracker with the initial goals being mostly completed in other PRs.

General Fixes:

Missions: (COMPLETE!)
  • Barber
  • Bartender - (Moved to Tacoma - Bartender improvements #57338)
    • Optimize nested chunks
    • Add a shot glass and have the shots be placed in them onto the counter instead of selling glass bottles for individual shots (I think this was intentionally implemented as a way to get glass bottles, but it makes very little sense)
      • Give the player a drink token that can be traded back with the shot glasses for a merch. (Slight Fallout reference. Feel free to hoard your worthless bottle caps!)
      • Add other spawn locations for shot glasses
      • Add other spawns for drink tokens (probably just on tables in the bar or nearby as these would be fairly new)
    • Add clutter (drinks behind the bar, empty drinks out on tables, something for the racks in the storage room)
    • Add farm plots for the sugar beet seeds?
    • Add end placement after final quest (More clutter items?)
  • Crop Overseer (Moved to Tacoma - Convert crop overseer field planting to json #56510)
    • Jsonify Purchase and Upgrade
    • Create new, bigger field and allow conversion
    • Move plant seeds/harvest plants to the new dialogue and out of companion missions.
    • Handle new farm dialogue variables in code as well as traits
  • Doctor - (Moved to Tacoma - Doctor improvements #57387)
    • Added 3 quests (so far) for office supplies, medical gloves, and anesthetic/medical equipment
    • Move regular aid here and gate it behind quests.
    • Gate bionics behind multi goal questline
      • Acquire 3000 anesthetic
      • Talk to scavengers to send a companion mission to raid a hospital to get parts for an anesthetic machine (and maybe more medical equipment)
      • Talk to scrappers for metal parts (which will send you on a quest for an angle grinder and a hacksaw)
    • Prevent hospital raid from being able to run twice at the same time
    • Fix u_has_item and u_sell_item with anesthetic not being recognized in an anesthetic kit (u_has_items and u_sell_item do not recognize anesthetic in an anesthesia kit #55918)
    • Figure out how to prevent the doctor from dropping the binders (Give them more storage capacity?)
  • Nurse/Clinic (Moved to Tacoma - Convert clinic and nurse to json #56205)
    • Jsonify nurse missions
    • Fix placement of clinic
    • Move aid to doctor. Possibly implement a lesser aid variant to the nurse
    • Fix/Rebalance lesser aid / aid times and currently busy times after.
    • Figure out how to spawn less aspirin after MISSION_RANCH_NURSE_1 (currently spawning 200 per bottle, should be 20)
    • Add end placement after final mission (probably add some medical items/furniture around the clinic)
    • Add the missing entrance from the house to the new buildings.
  • Scavenger (Moved to Tacoma - Convert scavenger to json and update companion missions #56403)
  • Woodcutter 1 (Mostly moved to Tacoma - Convert buying logs to json #56192)

Mission Tree Audit:

  • Barber, Bartender, Carpenter 1, Carpenter 2, Crop Overseer, Doctor, Farmer 1, Farmer 2, Foreman, Nurse, Scavenger, Scrapper, Sickly Laborer

Bonus:

  • Woodcutter 2
    • Replace heavy machinery/old machinery with better/real machines
    • Investigate if the conveyor/sawmill can be made functional with EOCs
  • Expand sickly laborer. (Possibly have the doctor look at them once they arrive? What do they even have? What is their purpose?)
  • Expand scrapper.
  • Add more scavenger quests (More weapons/armor?)
  • Add barber quests (batteries for clippers? scissors? shaving cream? cleaning supplies?) (Gotta try to avoid doing the same thing as the refugee center hair kit)
  • Crop overseer should probably have quests for growing crops (we have fields + greenhouse capacity)
  • Guard is only used in companion missions. Should there be some generated around the commune as well?

Describe the solution

Allow the tacoma ranch to be rotatable and audit everything to make sure it works. Update what doesn't.

Describe alternatives you've considered

None

Testing

In Progress

Additional context

Creating this draft early to get my initial thoughts out and show that this is being worked on.

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 26, 2022
@Maleclypse
Copy link
Member

Figure out a way to move all items from a location to a storage location instead of just leaving them there, such as the initial bed placement on top of items

I think Bombasticslacks added a way for EOCs to delete items from the game.

@Maleclypse Maleclypse added <Bugfix> This is a fix for a bug (or closes open issue) Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions labels Feb 27, 2022
@haveric
Copy link
Contributor Author

haveric commented Feb 27, 2022

@Maleclypse I'd rather not delete the items as there are potentially useful items in the barn or could be player placed items that should not get deleted. For now, I've chosen to allow the items to stay, but I'd much prefer a solution that takes all of the items within an area and puts them on or near a specific tile. Basically, sorting the items out of the way or moving them to a storage shed.

@Maleclypse
Copy link
Member

I’m not sure how his method does it and whether it recognizes what the items are before it deletes them because it’s designed mimic sale of goods. Though if you only want to move things you could possibly use zone creation effects and then setup a fake NPC to complete the move. If I were doing it it would be a specific NPC class that has debug invisibility, and somehow uses eoc commands to get it to sort the zones. But that’s probably pretty hacky.

@haveric
Copy link
Contributor Author

haveric commented Feb 27, 2022

I'd certainly prefer a less hacky implementation and can look into implementing it myself after I've fixed everything else, unless someone wants to volunteer to implement something before then.

@github-actions github-actions bot removed json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 27, 2022
@PatrikLundell
Copy link
Contributor

The handling of dialog missions seems to be more primitive than the camp ones in that the camp missions highlight finished missions, which does not seem to be the case for dialog ones.

The caravan mission seems to be partially broken in that each companion caravan member is brought back individually, and each companion brought back seems to trigger the simulation of a new caravan when it comes to danger, but not when it comes to payment... I believe all remaining caravan members are involved in each fight up until they're recalled.

@haveric
Copy link
Contributor Author

haveric commented Feb 27, 2022

I haven't gotten to the dialog missions yet, so I'm not yet sure on the scope here. Is there any possibility of re-using the faction menu logic here or is this just going to need a complete rewrite?

My next focus is going to be jsonizing the scavenger missions if I can and auditing the other npc missions, so I probably won't get to this for a bit. If you or someone else has some free time between all the other work going on, I wouldn't turn down assistance looking at the menu logic.

@PatrikLundell
Copy link
Contributor

Yes, you've gotten to the dialog missions... It's just that my description is poor. In my eyes there are two types of missions in the game, namely base camp missions, gotten via base camp bulletin board "dialog", and dialog missions, reached by talking to NPCs, and all of the Tacoma missions (such as the scavenger missions) fall into the latter group. Note that the division and naming is mine: I haven't seen anyone describe them in any terms.

Code wise the "top" of the mission logic resides in mission_companion.cpp, where the dialog missions are, and the base camp missions appear in faction_camp.cpp (with glorious C stupidity having the definitions in basecamp.h to confuse the unweary).

I can do the changes, at least for the UI only part, because they're fairly easy (just using a boolean or two to keep track of aggregated state when iterating over NPCs), while the caravan one requires more logic. However, I'm always weary of having multiple people modifying the same files at the same time, especially when the train wreck called git is used, as it will find "conflicts" everywhere, including a way do drop parts that happen to be the same when you actually want to merge things.

@haveric
Copy link
Contributor Author

haveric commented Feb 27, 2022

I'm focusing on converting the regular missions for now which are in mission_start.cpp. If you feel comfortable with the ui work, I'd vote for you to go ahead with it and leave any potential git conflicts to me. (I am comfortable enough with git that it shouldn't be an issue, but may end up splitting this PR into more sizeable chunks anyway for easier review, which would avoid the issue entirely)

@PatrikLundell
Copy link
Contributor

PatrikLundell commented Feb 27, 2022

Ah, OK, a quick look at mission_start.cpp gives me the impression it deals with "normal" missions where the PC is given a mission, not the missions where you send a companion off (base camp and what I call dialog missions, probably better called dialog companion missions).
I'll make a stab at the dialog companion missions (Scavenge raid/patrol, menial/carpentry labor, foraging, caravan) tomorrow, with a reservation for the caravan one. For some reason purchase/upgrade/plant/harvest field is there as well, but I don't see any reason to change those.

Edit: #55746 provides the promised changes. The cause for the caravan issue was actually very easy to find and fix.

@haveric
Copy link
Contributor Author

haveric commented Feb 28, 2022

Thanks for the improvements @PatrikLundell. I think the only major thing left will be figuring out how to jsonify the companion missions map updates, but I'll look into that once I've gotten a few other things updated.

@PatrikLundell
Copy link
Contributor

None of the "actual" companion missions (i.e. those that involves sending off companions) include map updates. The buy/plant/harvest missions don't actually send off any companions anywhere, but it would certainly be good if they could be jsonified. I'd suggest considering (as in carefully weighing it as an option, not as a suggestion to immediately go ahead) moving these missions to the "normal" interaction level where you're currently improving things.
Doing that would require the ripping out of the corresponding enum values and code, but that ought to be it. Since no companions are sent off on these missions, there's no (de)serialization messiness to deal with.

@haveric
Copy link
Contributor Author

haveric commented Feb 28, 2022

That's all good to know. If there's no companion interaction, then they should be easy to move to normal interaction, which solves most of my concern over jsonifying them. I think they are the only blockers for allowing the map to be rotatable as I have done in this branch. I'll take a closer look once your PR gets merged and see what makes the most sense. I can always reconfigure the menus to make it all make sense.

@PatrikLundell
Copy link
Contributor

I would suggest splitting the crop overseer missions into two dialog entries rather than one, as me using them for labor isn't exactly the same as me providing them with labor. Thus, there would be one entry for investing in agriculture (or something along those lines) and one for providing labor (where a standardized phrase is useful to help players recognize what the topic is about).

@haveric
Copy link
Contributor Author

haveric commented Mar 3, 2022

I believe that's what I'm already working towards, but let me know if there's something I'm missing, but do note that it's not in a complete state yet as I still have to figure out how to handle "Plant Field" and "Harvest Crops" from the regular dialogue.

I've already switched the language up so that the companion missions are under I figured you might be looking for some help…, which is the same as the foreman, although I'm open to suggestions on better phrasing here as I think it could be improved. (Any wording is fair game honestly. If you have any suggestions for anything, let me know.)

For all of the field purchase/work, I've set it up so that you see I'm interested in investing in agriculture… if you don't have a purchased field yet and I'd like to discuss my field… once you have purchased it. Both of these take you to a field management dialogue, which lets you:

  • Purchase the new, larger field if you don't have one yet
  • Purchase the legacy fence if you have the legacy construction trait
  • Convert to the new field layout if you have either construction trait
  • Plant Seeds [Currently unimplemented in this dialogue]
  • Harvest Plants [Currently unimplemented in this dialogue]

I still have to figure out how I can make these last two functional in dialogue before I'm going to remove them from the companion one. I don't think these can be entirely done with dialogue though, so I mainly need to figure out how to replace the legacy cash with actual merch in these transactions. I should be able to move the construction check over to the dialogue, but may still need to figure out how to access dialogue variables if we want to keep the "fence provides better yields" effect for the new field layout, which I would.

I've been looking at the crop overseer dialogue/variables for two days already, so I'm going to switch over to the doctor for a bit and see what I can improve there, possibly implementing a new questline and then revisit the crop overseer later.

@PatrikLundell
Copy link
Contributor

My comment was based on seeing that the single dialog was changed, but I'm happy to see we're thinking along the same lines.

I suspect you need code to plant fields with an arbitrary crop, and probably to harvest it as well. It can be noted that both of these actions exist for faction camps, and it might be available as zone activities as well, but I'm not sure about that,.
I haven't had any reason to examine this code, nor compare it to the Tacoma version of it. However, it's no catastrophe if these two actions remain un-JSONized.

Switching to something else for a while and letting this brew in the background is probably a good idea.

If there was functionality to supply a blueprint with either a missing or overriding palette it might be possible to reduce the code part to take the seed provided by the UI and insert it into the overriding palette for use with a planting blueprint.

@github-actions github-actions bot removed json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 20, 2022
@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 Mar 20, 2022
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 4, 2022
@github-actions github-actions bot added the Mods Issues related to mods or modding label Apr 9, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 9, 2022
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 6, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 13, 2022
@Maleclypse
Copy link
Member

@haveric Is this still intended to be in Draft?

@haveric
Copy link
Contributor Author

haveric commented Oct 27, 2022

Is this still intended to be in Draft?

Sorry, didn't think I'd be away from cdda development this long. All development has been done in other PRs for the existing work and this is purely a progress tracker for longer term goals at this point. I think I'm ok with this being closed at this point and I'll create a new issue/PR once I get to the next iteration of updates.

@haveric haveric closed this Oct 27, 2022
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 <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <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 Missions Quests and missions Mods Issues related to mods or modding NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants