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

Hacking stuff prerequisite - install software #39454

Closed
wants to merge 17 commits into from

Conversation

nphyx
Copy link
Contributor

@nphyx nphyx commented Apr 10, 2020

Summary

SUMMARY: Infrastructure "support installing software on working computers"

Purpose of change

A needed prerequisite/infrastructure for #39289

Software allows working personal computers to gain properties (via flags and qualities) and functionality (via use actions) necessary for programming tasks (e.g. IDEs, SDKs), and generally makes them useful for non-computer-skilled-characters (allowing install of games, music players and document viewers).

Describe the solution

  • created a couple new types of working laptop that support installing software
    • added a short list of new tool qualities that PCs and software can have
      • PROCESSOR is the quality of being able to compute, and enables a tool to install software
        • but note it still has to have the INSTALL_SOFTWARE use action
        • may factor into future computer tasks
      • others don't do anything yet but will be needed for computer crafts in upcoming PR
  • made new kinds of functioning software
    • uses the toolmod itype
    • denoted by flag SOFTWARE
    • like non-functional software, spawns inside a USB drive
  • add the ability for toolmods to have use_actions, and for tool items to add an installed toolmod's use_actions to its own action menu
    • limited for now to software, but could lift this restriction if it makes sense for other toolmods
  • create a new iuse::install_software action
    • action consumes some time and transfers software to a PC when complete
    • software "securely erases from its install medium" when installed
      • could have open source variants that allow multiple installs, but this is not implemented yet (or support cracking proprietary software as a computers task)
  • gave a few electronics new specs (weight, power draw, volume) based on real-world devices
    • model devices are noted in relevant JSON entries

Also encountered some old/odd behavior that required a number of fixes, and suggests some more work that I'll tackle soon (discussed this stuff on discord).

  • fixed some funkiness with the way tools were processed each tick
  • enabled power_draw to inter-operate with battery charges (both passive and active/one-off actions)
    • power draw is rated in mW, but batteries are gamey "charges"; looks like there's WIP to make batteries use kJ units, but meanwhile I did some math based on RL batteries with the assumption that "disposable light battery" ~= AA battery (could use prior math found in process_tool, which was close but arbitrary)
  • fixed handheld game devices not using power when "play any game for a while" was selected
    • I may have introduced this problem, but either way I made a somewhat more robust way to deal with this
  • documented some non-obvious behavior and mystery parameters

Describe alternatives you've considered

  • make an entirely new islot for software: it did not seem justified to do this since it would duplicate a lot of toolmod code (which already duplicates a lot of gunmod code), and conceptually they're similar enough
  • make PCs an entirely new item type: also not justified - the tool type + qualities and flags already satisfied 90% of what I needed them to do and a new islot would result in a lot of duplicate/parallel code
  • sticking with toolmods, but not supporting active software (vs only passive quality/flag): relegates software and PCs to passive crafting assists/requirements. falls short of the goal

Testing

  • exhaustive testing of installing & using software on PCs - both passive softwares and active ones
    • test softwares included a game emulator (replicating handheld gaming device), productivity software (replicates eink tablet pc), mp3 player (replicates the mp3 player device - however this does not actually play music yet)
  • due to some changes to how tool ticks and power consumption are handled, tested with a range of other electronic devices to make sure they weren't broken
  • tested that the new power_draw -> battery charges math works out, both via gdb inspection and by ensuring that in-game device battery lives matched real-world expected battery life on model devices (after giving them RW-referenced properties)

Known Issues

  • Handling of message log could be better
    • reports "the <software name's> batteries died" when a laptop runs out of batteries while software is in use; this will be fixable with upcoming item inventory changes
  • can't install battery mods on PCs
    • for now this is OK but needs to be thought about WRT any other toolmods that might come along and make sense for PCs

Additional context

#39406 may support better handling of software installing - I'll update when it's ready.

Future possible todos (will file issues on further consideration):

  • separate charge consumption & other housekeeping from functionality for software-installable use actions to avoid special casing.
  • break einktabletpc into separate actions for each function so they can be mixed and matched as software, and also not replicate any camera / mp3 player code

Filed as a draft - some merge conflicts in relevant parts of the code require retesting which I haven't got to yet.

@nphyx nphyx changed the title Hacking stuff install software Hacking stuff prerequisite - install software Apr 10, 2020
@ghost
Copy link

ghost commented Apr 11, 2020

Regarding lore: what ARE the "broken consoles" you occasionally see in-game? Are they home computers, or something akin to these kiosks you use to place an order at a restaurant? The use of them everywhere regardless of actual item seems to indicate they are a catch-all for things like cash registers/home PCs/lab workstations.

@nphyx
Copy link
Contributor Author

nphyx commented Apr 11, 2020

I don't know, the non-broken ones present terminal interfaces but you'd expect that in a text game. It's just hard to parse whether the text represents a text interface, or is a stand-in for a modern GUI.

@nphyx
Copy link
Contributor Author

nphyx commented Apr 11, 2020

This should remove the blockers to fixing #39246, #29447 & #26534 as it addresses the underlying problem of active triggering the first use_action on an item automatically each tick - which was causing problems for software install.

Once it gets through review & merges I'll do the fixes in a separate PR (note to self).

@wapcaplet
Copy link
Contributor

Looks great, and well thought out. The game has been sorely lacking in computers and software, so I'm looking forward to seeing what this and your other PRs will bring.

@kwl01skz
Copy link
Contributor

Very good, maybe in the near future, we can install CDDA in CDDA.

"copy-from": "software_tool",
"type": "TOOLMOD",
"name": { "str": "music player software", "str_pl": "music player software" },
"description": "A simple music app. You could use it to listen to mp3s.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about flac, ogg, and any other music file types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, right? I stuck with mp3 since most of the game text refers to mp3s, but it could be changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nitpick, don't pay much attention to me.

@mlangsdorf
Copy link
Contributor

This will be an excellent platform for adding high end, home computer flight simulation programs that will be useful for gaining the ability to fly helicopters.

@mlangsdorf mlangsdorf added the Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons label Apr 30, 2020
@stale
Copy link

stale bot commented May 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label May 30, 2020
@stale
Copy link

stale bot commented Jun 30, 2020

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it

@stale stale bot closed this Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Items: Gunmod / Toolmod Weapon and tool attachments, and add-ons stale Closed for lack of activity, but still valid.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants