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

[RDY] Workbenches #29434

Merged
merged 8 commits into from
Apr 18, 2019
Merged

[RDY] Workbenches #29434

merged 8 commits into from
Apr 18, 2019

Conversation

ifreund
Copy link
Contributor

@ifreund ifreund commented Apr 9, 2019

Summary

SUMMARY: Content "Add workbench functionality."

Purpose of change

Provide a way to work on very large/heavy in progress crafts.
Provide a convenient place to store long term crafts and return to them later.
Provide a small crafting bonus for a good crafting environment.

Fixes #29500.
Fixes #29442.

Describe the solution

  • Infrastructure: Allow starting and working on crafts from the map.
  • Create a new iexamine for workbenchs.
  • Add the workbench iexamine to tables, lab benchs, and desks
  • Add a new player made work bench furniture.
  • Add a vehicle workbench
  • Make the vehicle workbench function (right now it's basically just a table)
  • Add a small crafting speed bonus for using a workbench
  • Allow setting the workbench quality through json
  • Revise the workbench crafting bonus. Implement some kind of gradual fall off as the allowed mass/volume is exceeded.
  • Greatly improve item handling of in progress crafts.
  • Get feedback on workbench stats. Stats are easy to tweak later as they're all jsonized. They may not be perfect right now, but they are close enough imo and I'd rather get this merged so I can move forward with the next crafting changes

@ifreund ifreund added <Enhancement / Feature> New features, or enhancements on existing Game: Mechanics Change Code that changes how major features work Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. labels Apr 9, 2019
@ifreund ifreund changed the title [WIP] Workbenchs [WIP] Workbenches Apr 9, 2019
src/iexamine.cpp Outdated Show resolved Hide resolved
@ifreund ifreund mentioned this pull request Apr 10, 2019
20 tasks
data/json/furniture.json Show resolved Hide resolved
data/json/items/vehicle_parts.json Outdated Show resolved Hide resolved
src/crafting.cpp Outdated Show resolved Hide resolved
data/json/furniture.json Outdated Show resolved Hide resolved
@kevingranade
Copy link
Member

Re Provide a small crafting bonus for a good crafting environment.
I want to outline what this entails, that might inform what the bonus looks like.

  • Egronomic access to work. Roughly speaking it needs to be at torso height, anything different and you're hampered by either reaching up or reaching down.
  • Fatigue from long work times. This is exacerbated by handling heavy work items or tools and poor egronomics. In addition to not having the work piece at the right height, crafts that require extended standing and walking around may exacerbate fatigue.
  • Quick access to tools and materials. This is where workspace organization comes in. You might be able to just do a check on how far away various tools other than the workpiece are from the player.

@ifreund
Copy link
Contributor Author

ifreund commented Apr 11, 2019

I want to outline what this entails, that might inform what the bonus looks like.

  • Egronomic access to work. Roughly speaking it needs to be at torso height, anything different and you're hampered by either reaching up or reaching down.
  • Fatigue from long work times. This is exacerbated by handling heavy work items or tools and poor egronomics. In addition to not having the work piece at the right height, crafts that require extended standing and walking around may exacerbate fatigue.
  • Quick access to tools and materials. This is where workspace organization comes in. You might be able to just do a check on how far away various tools other than the workpiece are from the player.

I think I'll only get to bullets 1 and part of 2 in this pr, it's already way bigger than I planned. I'll move the rest to #29210.

The changes I just pushed implement a simple bonus based on workbench stats that are now defined in json. The current numbers I put it are really just placeholders, and should not be reviewed yet.

I also plan to replace the flat 10% penalty for exceeding the allowed volume/mass with a linear fall off, or something similar, details tbd.

src/crafting.cpp Outdated Show resolved Hide resolved
src/crafting.cpp Outdated Show resolved Hide resolved
src/crafting.cpp Outdated Show resolved Hide resolved
src/crafting.cpp Outdated Show resolved Hide resolved
src/crafting.cpp Outdated Show resolved Hide resolved
src/crafting.cpp Outdated Show resolved Hide resolved
src/crafting.cpp Outdated Show resolved Hide resolved
src/crafting.cpp Outdated Show resolved Hide resolved
src/iexamine.cpp Outdated Show resolved Hide resolved
src/iexamine.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
src/iuse.cpp Outdated Show resolved Hide resolved
src/vehicle_use.cpp Outdated Show resolved Hide resolved
src/vehicle_use.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@Night-Pryanik Night-Pryanik left a comment

Choose a reason for hiding this comment

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

Workbench functions are basically the same for the furniture and for the vehicle part. I believe it's best to rewrite the function with checks for furniture and for vehicle part.

@ifreund
Copy link
Contributor Author

ifreund commented Apr 12, 2019

Workbench functions are basically the same for the furniture and for the vehicle part. I believe it's best to rewrite the function with checks for furniture and for vehicle part.

Been on my todo for a while, just wanted to get this working before refining it. It's almost to that stage though. Thanks for the reviews!

@ifreund ifreund marked this pull request as ready for review April 13, 2019 00:32
@ifreund ifreund changed the title [WIP] Workbenches Workbenches Apr 13, 2019
@ifreund ifreund changed the title Workbenches [CR] Workbenches Apr 13, 2019
@ifreund
Copy link
Contributor Author

ifreund commented Apr 13, 2019

Alright, the code is done for this, I just want to get some feedback on the (now jsonized) workbench stats before this gets merged.

@hyper2snyper
Copy link
Contributor

Pardon my language, but, FUCK YEAH

@ifreund ifreund added <Bugfix> This is a fix for a bug (or closes open issue) [JSON] Changes (can be) made in JSON labels Apr 14, 2019
ifreund added 8 commits April 17, 2019 12:34
- also fix simple bug with workbench iexamine
- vehicle workbenches currently have no use, will be added in following commits
- Add vehicle examine function
- Add craft from vehicle infrastructure
- Add WORKBENCH1/2/3 flags
- Various small fixes and tweaks
- Add documentation of iexamine and flags
 - Use bounded lerp to calculate multiplier from mass/volume
 - Jsonize workbench stats
 - Numbers still need adjustment, but framework is in place
 - Fix crash on closing out of craft selection without selecting a craft to work on
 - Apply copyedits from code review
 - Remove vehicle::use_workbench and merge with iexamine
 - Remove outdated flags
 - Update documentation
 - Add more sensible workbench stats
 - Apply more copyedits from code review
 - Also fix some odd merge error
 - Astyle
 - add prompt on starting craft
 - must wield or work from workbench/ground
 - Update crafting test to take this into account
 - jsonize empty hands/ground workbench stats
 - Allow selection of adjacent workbench when starting craft
 - Slight refactor of adjacent furn checks in map::
 - Templatize return_true
@ifreund
Copy link
Contributor Author

ifreund commented Apr 17, 2019

Alright I think that's enough tweaking, I'm going to call this ready to go. If the stats need to be tweaked in the future it's all jsonized anyways.

@ifreund ifreund changed the title [CR] Workbenches Workbenches Apr 17, 2019
@ifreund ifreund changed the title Workbenches [RDY] Workbenches Apr 17, 2019
@kevingranade kevingranade merged commit 231b31d into CleverRaven:master Apr 18, 2019
@ifreund ifreund deleted the workbench branch April 18, 2019 08:09
@Yunatan
Copy link
Contributor

Yunatan commented Apr 23, 2019

Is it intended that a tourist table can't be used as a workbench?

@ifreund
Copy link
Contributor Author

ifreund commented Apr 25, 2019

Is it intended that a tourist table can't be used as a workbench?

Seems reasonable that it could function as an OK workbench, feel free to open an issue or pull request for that, all it would take is a few lines of JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling <Enhancement / Feature> New features, or enhancements on existing Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Game: Mechanics Change Code that changes how major features work [JSON] Changes (can be) made in JSON
Projects
None yet
6 participants