Computer Revamp

Basically, I am trying to rework computers so that they can be loaded through json. It’s getting fairly close to a releasable condition, so I am submitting it here for everyone to review and tell me what I’m missing. One of my big worries right now is that a lot of this work is in the context of how the current computer system works, so I’m probably missing out on a lot of exciting possibilities without more outside input.

Requesting Input on These Items:

[ol][li]As designed, all failure actions trigger in the event of one security check failure. Should failure actions be associated with a specific check? Further, should there be support for failures as a combination or a distribution, allowing for things like critical failures, etc.?[/li]
[li]Right now this is a ton of json, even without things like distributions and associations, one idea I had was to use templates to simplify a lot of this code. What sort of templates should be supported?[/li]
[li]Did I miss any security check types or action types? Any potential for combination and reducing complexity here?[/li]
[li]Should the computer option prompts include what is necessary for the security checks, or should that be the responsibility of the creator to include?[/li]
[li]LUA. Does anybody use it and want support for it added?[/li][/ol]

Major Changes:

[ul][li]Loadable through json[/li]
[li]Multiple computers per submap (rotation needs work)[/li]
[li]New computer actions (in work)[/li]
[li]Maintain support for hardcoded actions[/li]
[li]Load hardcoded actions through json (in work)[/li]
[li]Various bugfixes[/li][/ul]

How it Works:
New json addition to map code, “place_computers”, takes x,y location, name, prompt, and set of options. Each option contains a prompt, a set of security measures, a set of actions to take on security check pass, and a set of actions to take on a check fail.
When accessing a computer, each option’s prompt is displayed. Selecting a prompt triggers the security checks, which in turn trigger the applicable set of actions.

Security Checks:
Password - Parameters: password - Requires a password to log in. Will have to include the password in an accessible terminal or on an item somewhere to be used.
Item - Parameters: item name, item count, consume - Requires a set amount of items to log in. May consume the items or not.
Hack - Parameters: difficulty - Requires successful computer skill check to log in.
Trait - Parameters: trait name - Requires player to possess a certain trait.
Pass or Hack - Parameters: password, difficulty - Requires either a password or a successful hack attempt.
Trait or Hack - Parameters: trait name, difficulty - Requires player to have the trait or pass a hack attempt.
Item At - Parameters: location, item name - Requires an item to exist at the specific location. May roll this into Item.
Container At - Parameters: location, watertight, software, empty, contents - Requires a container to exist at the specific location. If watertight, requires a liquid container. If software, requires a usb drive (currently, may be adapted to include SD card, PDAs, etc). If empty, requires the container to be empty. If contents are set, require the contents to be in the container. Also may roll this one into item.
Skill Check - Parameters: skill name, difficulty - Require passing a generic roll of a specific skill and difficulty.

Actions:
Change Terrain - Parameters: location, terrain - Changes the terrain at the location to the specified terrain.
Message - Parameters: message - Display a message on the computer display window.
Change Level - Parameters: number of levels - Changes z-level.
Noise - Parameters: volume, description - Makes a sound with given volume and description.
Spawn Monster - Parameters: location, monster - Spawns a monster at given location.
Spawn Item - Parameters: location, item - Spawns an item at given location.
Fill Container - Parameters: location, contents, charges - Places number of charges into container at location with contents.
Reveal Map - Parameters: z level, radius, terrain types (optional) - Reveals circular area of map at z level with given radius, specifically the given terrain types if given.
Add Trap - Parameters: location, trap - Adds the specified trap at the location.
Remove Trap - Parameters: location - Removes trap at location.
Add Field - Parameters: location, field, density - Adds specified field with given density at location.
Remove Field - Parameters: location, field (optional) - Removes all fields at location, or just specified field if given.
Explode - Parameters: location, power, shrapnel, start fire - Creates an explosion at location with specified power and shrapnel levels, and whether it starts a fire or not.
Kill Monsters - Parameters: top left location, bottom right location - Kills all monsters in a rectangular area.
Disease - Parameters: disease name, duration - Adds a disease to the player for a duration.
Pain - Parameters: min, max - Givens player random amount of pain in range.
Event - Parameters: location, event type, when to trigger, faction association - Triggers a given game event centered on location, at the time, and with certain faction association.
Cascade - Parameters: - Trigger resonance cascade. (May be removed)
Nuke - Parameters: - Trigger nuclear missile targeting. (May be removed)

  1. Being able to link specific actions to a specific failed check would be capital, so the deeper you ‘hack’ into a computer, the worse the results of failure could become, which might mean if you mess up bad enough all possible failure states could trigger at once.
  2. I’m not really sure how to answer this one because I’m not sure what you mean by ‘templates’. If it’s a list of .json entries why not just read them as such?
  3. None that I can think of.
  4. I’d leave that up to the creator, as we don’t always go for 100% transparency of system.
  5. I don’t use it or have any real opinion on it, but I’m sure someone here does.

Templates would be like condensed json for commonly used setups, to make the json a lot quicker to write. So a computer that just has a bunch of emails to read might follow a message template, so all you have to specify are the prompts and messages to display, or a computer that locks and unlocks a door would just have the terrain for opened and closed on there.

That sounds super useful!

On the checks:
Non-trait (the absence of a trait/traits) would be helpful for photo ID and such. Mutation should invalidate various biometric identifiers, and ideally be able to capture a particular set during the game. (Mutate your eyes, and can’t pass the eye scan. Hope your tentacles don’t need a fingerprint scanner. That sort of thing.)

Use cases:
Lab–US federal gov’t, milspec–Item (ID card, not consumed) AND (Password OR Hack). Without the card, you’re not getting in, and the hack’s gonna be tricky as it needs to match that ID. Feds encourage writing down your password though (keep the writing safely locked up) so it’s possible you’d find someone’s password along with their ID.

PD–state/municipal gov’t, secure–Password (whether conferred by profession trait or found) or Hack; secure terms such as the bot-control might need an Item (your badge, not consumed) and a Trait-Password (matches your badge; possibly biometrics stored in the badge match yours on a fingerprint scan) or a very difficult Hack.

Hospital–gov’t or private entity, secure–Pass/trait or Hack. Probably won’t need an ID.

Commercial PC–private, working-secure–Password, possibly a trait means you have a password, hacking is reasonable.

Home PC–private, security via physical access-control–Hacking might be needed, but shouldn’t be too tough, and the password is probably written down somewhere nearby (PE roll can bypass the need for a hack)

I’d think specific or partial-sets of failure results would be preferable, yeah. No need to surge the terminal for failing to log in; ideally, there’d be something like a 24-hour lockdown rather than permanent shutoff, too.

Non-trait sounds good, but very difficult to maintain. Like if a json had a computer that precluded people with mutated hands from using a machine and it was currently set to include the various tentacle mutations, if someone came through a week later and added mutations to turn hands into flippers, they would also have to go through and update those jsons. It would be difficult to capture intent with something like that and be able to cross reference it with additions. It might be worthwhile to have members in the player class to represent that their anatomy has been altered to the point where it may not be considered human, whether through mutations or bionics, and then have the computer look for these in its check. If something like that were in it would be fairly easy to add.

That does give me an idea for a bionic check though. A passive bionic could be used for certain high level areas, possibly with some side effects (if you want to work for this secret organization, get this installed in your finger, we promise it doesn’t do anything else than unlock the doors to our facility, promise).

The set combinations I think are worthwhile enough to add, but they inflate the json size so much. If anyone has any ideas how to do something like that efficiently, let me know. https://github.com/vache/Cataclysm-DDA/issues/7 has a lot of my thoughts on the subject so far.

[quote=“vache, post:6, topic:8308”]Non-trait sounds good, but very difficult to maintain. Like if a json had a computer that precluded people with mutated hands from using a machine and it was currently set to include the various tentacle mutations, if someone came through a week later and added mutations to turn hands into flippers, they would also have to go through and update those jsons. It would be difficult to capture intent with something like that and be able to cross reference it with additions. It might be worthwhile to have members in the player class to represent that their anatomy has been altered to the point where it may not be considered human, whether through mutations or bionics, and then have the computer look for these in its check. If something like that were in it would be fairly easy to add.

That does give me an idea for a bionic check though. A passive bionic could be used for certain high level areas, possibly with some side effects (if you want to work for this secret organization, get this installed in your finger, we promise it doesn’t do anything else than unlock the doors to our facility, promise).

The set combinations I think are worthwhile enough to add, but they inflate the json size so much. If anyone has any ideas how to do something like that efficiently, let me know. https://github.com/vache/Cataclysm-DDA/issues/7 has a lot of my thoughts on the subject so far.[/quote]

OK, player could do it but that’d still be a list that needs maintained. Can be done if desired.

Use cases were me speculating about how to model IRL computer security. Sorry I didn’t specify that they’re not expected. ID bionics might be nifty, and cost would keep the cards in use.

In any case, thanks for doing this, vache. :slight_smile:

Any input is appreciated. The uses for the computers are going to be largely up to whoever is designing the structures to use them, but I want to make sure I can support all of those use cases so they have something to work with.

Also I just got the most deliciously evil idea for the ID bionic. Assuming it allows access to super secret areas, the people in charge of those areas would want to make sure all the people with bionic cameras in their eyes don’t record any of their super secret ideas, right? So every time you use it to enter an area, it temporarily locks down all of your bionics until you check in at the computer again when you leave. Could be a good way to handicap the player a bit for some areas.

[quote=“vache, post:8, topic:8308”]Any input is appreciated. The uses for the computers are going to be largely up to whoever is designing the structures to use them, but I want to make sure I can support all of those use cases so they have something to work with.

Also I just got the most deliciously evil idea for the ID bionic. Assuming it allows access to super secret areas, the people in charge of those areas would want to make sure all the people with bionic cameras in their eyes don’t record any of their super secret ideas, right? So every time you use it to enter an area, it temporarily locks down all of your bionics until you check in at the computer again when you leave. Could be a good way to handicap the player a bit for some areas.[/quote]

We don’t actually have such cameras, but apart from that, sure, makes sense. Bionic check, just needs to be able to recognize the aug again when you leave. (Whether some other terminal can reactivate you is another question, in case you take a back exit or “somehow” lose the bionic.)

Forgot a use case: nuke silo–two-person simultaneous, requires two Items and Passwords, along with either tentacles or a third item and some hacking to handle simultaneous entry of the firing command.

Extra bonus WTFery: specify that you’re aiming the nuke at North Korea, China, etc as in-lore those places are suspected of doing the bombing, etc during the actual Cataclysm.
No noticeable effect…maybe.

Maybe you’ll start a rousing game of Global Thermonuclear War. Maybe you just opened portals there too. Maybe it starts a shooting war where once there was (finally) cooperation in the face of Cataclysmic adversity. Maybe it breaks the enemy coordination and lets US and South Korean troops WIN THE WAR!!1!, only to have the cataclysm back home. Maybe you just glassed a thriving community of survivors.

It’d be nice to have the ability to train skills and learn recipes like books as well. I was hoping to revamp the arcades with some minor skill training machines that work when hooked up to a battery and paid for. Recipes would be something like the proprietary RivTech design binder, but locked in a secure access computer you can’t get data off of.

Great idea though, I’d love to see hacking have more use.

About actions:

Remove Monster - top left location, bottom right location, monster - removes all monsters same to the one specified in a retangular area.(Useful to send robots back to their storage areas, as manhacks, that are squirrel sized, so, such areas are embedded in the walls, ceilings…)

Set Monster Aggressiveness - top left location, bottom right location, monster, new value - sets the aggressiveness of all monsters same to the one specified in a retangular area to the new value. (For massive hacking using protocols of a local security network to change robots programming. Could also be used for custom systems to stop zombies: liquid pheromone sprinklers?)

Set Monster Morale - top left location, bottom right location, monster, new value - sets the morale of all monsters same to the one specified in a retangular area to the new value. (Motivational music, fear gas, scare tactics…)

New computer action ideas:
Learn recipe (random, random within skill, min/max difficulty, min/max count)
Remove monster (without kill)
Remove diseases (targeted or general)
Elapse time (for things like the training below, and maybe a short time for each action taken as part of accessing computer in general)
Train skill/remove rust (practice/sim type stuff only?)
Deactivate bionics
Reactivate bionics
Install bionics (maybe)
Toggle hostility (for robots and stuff)
Remove disease (maybe?)
Heal (body part or all, min/max amount)
Reduce pain
Translate terrain (old terrain -> new terrain)
Set furniture (may try to integrate with terrain)
Translate furniture (may try to integrate with terrain)
Trigger cooldown
Add/remove morale
Diagnosis (sort of like blood analysis cbm)

New computer security ideas:
Has bionic
Does not have excessive mutations (needs more framework to support this)
Charge card with $x
Check cooldown
Does not have disease

If you do the backend code for Bionic installation, I’d be happy to write the front end. I might even try to give the backend a crack when the PR goes public. Bionic installing computers is something a number of people have mentioned, and I believe Kevin has expressed interest in. I’ll try to dig up that topic later.

Thanks for considering recipes and training btw.

I like what I see. PM me the mutation issues; in general passing the (non-Alpha) threshold is a quick & dirty “too mutated” check.

Learn specific recipe might be handy, but I recall that being beyond my abilities when I was writing the recipe debug line so meh.

Thanks much.

This is really good, keep it up, vache!

I’d also like to see more uses for credit cards, as those are currently kinda limited to vending machines.

Buying other stuff, or as someone mentioned training skills for a certain amount of cash input is neat.