CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.29k stars 4.12k forks source link

[RFC] NPCs and CBMs: upgrading your allies #24474

Closed mlangsdorf closed 6 years ago

mlangsdorf commented 6 years ago

The autodoc should have an option to install or remove CBMs from an NPC ally. install_bionics is a member of the player class, so it should apply to NPCs already.

The iexamine::autodoc function would need to detect additional friendly NPCs in the vicinity, and if there are any, query whether to install the CBMs on the player or one of the NPCs. I think most of the rest of the logic flows pretty much unchanged, replacing player &p with &player selected_NPC in a couple of instances.

Obviously, NPCs won't have the AI to use active CBMs, but the passive stat boosters and armor could be applied to them right now. And a future revision of the NPC AI code could let them take advantage of some of the active defense CBMs like dielectric capacitance or active utility CBMs like aero-evaporator.

I intend to implement this sometime in the next two weeks unless someone tells me not to or wants to take it over themselves.

DracoGriffin commented 6 years ago

I intend to implement this sometime in the next two weeks unless someone tells me not to or wants to take it over themselves.

Done. Extremely looking forward to this. Appreciate your hard work.

kevingranade commented 6 years ago

If there are CBMs the NPC can't use, they need to be blacklisted. Otherwise, no objection, ideally the NPC will only allow this if they trust you a LOT, but that's a preexisting issue that I'm not going to treat as a blocker for adding this.

mlangsdorf commented 6 years ago

I think it's going to be easier to whitelist the CBMs that an NPC can use.

Immediately useful passive ones:

Power Storage Joint Torsion Ratchet Air Filter Alloy Playing Electroshock Submdermal Carbon Cerebral Booster, Diamond Cornea, Muscle Augmentation, Synaptic Accelerator, Targeting Sytem, (Nictating Membrane, Oxygenator - why bother?) Anti-Glare Integrated Toolset (maybe?) Internal Storage Recycler Unit (I hope) Fingertip Razors

Activated CBMs that can hopefully be whitelisted after relatively easy changes to NPC AI

Offensive Defensive System Active Defense System Dielectric Capacitance System Thermal Dissipiation Repair Nanobots Bionic Claws / Molecular Blade The various implanted guns Aero-Evaporator Ethanol Burner, Internal Furnace, Metabolic Interchange, Microreactors Cranial Flashlight Implanted Night Vision / Infrared Vision Implant UPS Uncanny Dodge Power Armor Interface Radiation Scrubber System

You probably can't get enough trust to give an NPC a Fusion Blaster Arm, and it's certainly a bad idea, but Chain Lightning or Finger Laser is possibly safe.

CBMs that might get whitelisted after someone smarter than me works on the AI

Teleportation Unit Time Dilation Probability Travel Plutionium Filter / Purger Hydraulic Muscles

I forsee a mod that spawns NPCs with CBMs in the future.

Permanent blacklist CBMs (some of these may move off the blacklist if NPC code changes such as NPCs caring about temperature)

Faulty CBMs Blood Analysis Clock Facial Distortion Fingerhack Fingerpick Climate Control Leukocyte Breeder Olfactory Mask Scent Vision Terranian Sonar Water Extraction Unit Blood Filter Cable Charger Dosimeter

DracoGriffin commented 6 years ago

Permanent blacklist CBMs (some of these may move off the blacklist if NPC code changes such as NPCs caring about temperature)

Just to Devil's Advocate for some of these, although how "useful" I don't know:

Faulty CBMs --- could make an interesting dynamic NPC quest or static NPC quest to help them get those removed (would result in super high trust).

Clock --- increases complaints of eating/sleeping "Hey partner, when we sleepin'? It's [current time]!" or "Jeez, it's been [hours since NPC slept], I need to rest!" Or even simply, "Almost supper time, I wonder what they're servin' for dinner?" --- I guess more for emergent dialogue.

Cable Charger --- human powered vehicles or bases. Evil.

Dosimeter --- good for more emergent dialogue, "Hey [character name], I'm pickin' up radiation 'round here. Are we sure about this?" etc

Night-Pryanik commented 6 years ago

I forsee a mod that spawns NPCs with CBMs in the future.

Why a mod? We already some mod content that should be in mainline imo (NPC traits), and NPC with CBMs should be definitely mainlined too.

mlangsdorf commented 6 years ago

I was planning to have two whitelist flags: NPC_INSTALL and NPC_START. All NPC_INSTALL CBMs would be ones that NPCs could start with and would consent to letting you install, while NPC_START would be faulty CBMs that NPCs might start with but wouldn't let you install. Clock or dosimeter would be interesting emergent dialogue, but I don't have time to get my NPCs to tell me when they're going to sleep in the middle of the zombie infested city, and that's a higher priority task than checking a dosimeter. But sure, as a long term plan.

mlangsdorf commented 6 years ago

iexamine changes are (hopefully) complete and I can make a friendly NPC into a patient: screenshot_2018-07-26_22-01-38

something isn't working in install_bionics but progress is progress.

mlangsdorf commented 6 years ago

First pass of the code is https://github.com/CleverRaven/Cataclysm-DDA/pull/24503