-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Overhaul vehicle part installation [RDY] #16280
Conversation
0799db1 provides for two different types of crane, a telescopic (foldable) 500kg variant mounted on a frame and a large rigid boom with 2000kg capacity that must be bolted to the outside of a vehicle that might fall of if driven into something. I'm going to further extend this so that |
int qual_jack = ceil( double( veh->total_mass() * 1000 ) / TOOL_LIFT_FACTOR ); | ||
has_jack = g->u.has_quality( "JACK", qual_jack ) || | ||
map_selector( g->u.pos(), PICKUP_RANGE ).has_quality( "JACK", qual_jack ) || | ||
vehicle_selector( g->u.pos(), 1, *veh ).has_quality( "JACK", qual_jack ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That 1 range is inconsistent with map selector range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deliberately so. Vehicle mounted cranes are somewhat fragile and the heavier variants need to be mounted as external protrusions. Forcing the player to maneuver to the target prevents exploits like hiding the crane in the middle of the vehicle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forcing the player to maneuver to the target prevents exploits like hiding the crane in the middle of the vehicle.
Sounds like it will do the opposite - make it so that big vehicles will always have the cranes inside crafting sections of the vehicle, because pulling out all the tools would be just too annoying to deal with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cranes can't lift themselves (enforced in 4bb4ef8) so by definition you're already stood adjacent to another vehicle your working on. The only requirement is that that crane you want to use is also adjacent to you - your other crafting tools are found from the usual PICKUP_RANGE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cranes can't lift themselves
Then why limit them to 1 tile range?
If you need a separate vehicle to operate on main vehicle, you're going to build the simplest one possible. Protrusion won't make it vulnerable because it will be deconstructed when not used, not driven around.
Having to haul the crane around would be pure annoyance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why limit them to 1 tile range?
Consistent behavior in all circumstances - cranes, forklift trucks and digger buckets should all have similar semantics. I'd like to model a realistic set of construction vehicles for works depots and the like. It doesn't make any sense why most mechanisms would work from 20 tiles away.
Having to haul the crane around would be pure annoyance.
The folding engine crane is sufficient for almost all parts installation tasks. If you're working on a sufficiently large vehicle you're already going to have to haul tools around due to PICKUP_RANGE
.
If you need a separate vehicle to operate on main vehicle, you're going to build the simplest one possible.
Sure, but in another scenario you might also be using your main vehicle to salvage parts from another (much larger) vehicle/wreckage. Further ancillary uses are likely to develop with time.
Protrusion won't make it vulnerable because it will be deconstructed when not used, not driven around.
Adding/removing parts needs to have a non-trivial time penalty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent behavior in all circumstances
Inconsistent with crafting and map uses and annoying, for no good reason.
If you're working on a sufficiently large vehicle you're already going to have to haul tools around due to PICKUP_RANGE.
Nope - you will just need to work on the tiles that are further away. Same with crane - it has the range of an entire vehicle, you just need to stand next to it and the vehicle.
Sure, but in another scenario you might also be using your main vehicle to salvage parts from another (much larger) vehicle/wreckage.
If you're worried about safety, you can still do it with 1 tile range, by installing the crane 1 tile deep into the vehicle and a door next to it. Regardless of the placement, you still need to park pretty exactly next to the vehicle you want to operate on, which is a tile-counting kind of annoyance with no positive effects for the gameplay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having to haul the crane around would be pure annoyance.
Also, once you've backed the crane up to the target vehicle you can work on any of that vehicles tiles without need to further move the crane
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent with crafting and map uses
A lot of stuff uses adjacent tiles and those which don't typically require line-of-sight to the tool, eg. WELDRIG
etc so are in many cases less than PICKUP_RANGE
anyway
Regardless of the placement, you still need to park pretty exactly next to the vehicle you want to operate on
Yes, but this is intentional. I don't want cranes to become another mandatory item you must craft and bolt onto your vehicle then forget about. There's no point in differing types if their placement isn't significant.
If you're worried about safety, you can still do it with 1 tile range, by installing the crane 1 tile deep into the vehicle and a door next to it
That's an interesting tactic but would make maneuvering more difficult. Inside cities space can be especially tight so you'd be passing up on scavenging parts from some military wreckages that you now can't get the angle on.
because pulling out all the tools would be just too annoying to deal with.
The only difference of cranes having radius 1
is that you have to successfully maneuver your vehicle to the target. This is very much a feature. The argument about tools is null in that you already have to move your tools every PICKUP_RANGE
tiles. I can't see any other meaningful differences but I'm open to further discussion.
6f7bddd lets vehicle cranes assist in wheel changes. As the entire vehicle does not need to be lifted lever action results in their rating being increased by a factor of 3 |
I'm not sure how to balance this for huge vehicles. Possibly by capping effective vehicle weight when calculating |
Allow jacks mounted on a single vehicle to stack, but not with handheld ones. |
I'd rather avoid any extra complexity. Supporting arbitrarily large vehicles is a requirement but that support doesn't necessarily have to be balanced (20-tile wide 100-tonne vehicles aren't themselves balanced). A cap would be the simplest option whilst preserving balance for everyone else, I'm just not sure where to set it at, possibly 6000kg? |
In real life, a vehicle huge enough to be unliftable with a crane would probably be parked above a pit before repairs, with the wheel to be replaced hanging in air.
Wheels are the only part that fully utilizes jacks and so values should be centered around them. Instead of multiplying wheel efficiency by 3, multiply everything by 3 and then divide by 3 for non-wheels. |
The current implementation requires scaling by 3 exactly one (in |
"broken_color": "light_blue", | ||
"difficulty": 5, | ||
"durability": 200, | ||
"qualities": [ [ "LIFT", 4 ] ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not specify JACK explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very good point
Segfault when viewing wheel in install menu |
Can you be more specific? I'm guessing you don't have a stack trace? |
No stack trace, I could recompile later as debug but it will take a while. |
What are the exact steps? |
Could be affected by:
|
Is it reproducible without |
Yes. Also, seems to only affect wheels. It's not zero division because it happens at 3 str too. |
How does those steps to examine the car relate to wheels? |
Doesn't seem to crash when I am looking at non-wheel parts. Crashes when a wheel part is selected, regardless of whether I have the wheel I want to install or not. |
The tool requirements are also off, though it may be caused by some earlier PR. I tried to install an aisle light and noticed that it no longer colors the screwdriver/duct tape requirement. This is confusing, as it looks like I have all I need, but pressing enter does nothing. |
Doesn't crash when I'm looking at a wheel to remove. Though the strength requirements are insane - 102 strength for a 1 ton car? |
Let me try it against the current |
This one is probably caused by this PR though: removing some wheels (portable generator has small wheels) doesn't list strength requirements at all, despite still requiring strength. |
Suggests the problem is in |
Have candidate fix for all of the above |
Try with f537def |
Damn that excavator is fucking fast 350 km/h excavator charge, woo |
At some point we really need to get round to properly scaling those units
The original plan was to later extend it so the crane could demolish walls but I suppose ram-raiding is always an option |
That lifting equipment display is kinda confusing. You have to check your individual items to see how much you can actually lift, having less will just color the "lifting equipment" red. Would be cool if it described it as "lifting equipment with quality x" or something like that. |
The algorithm's working correctly (10kg/STR). Whilst I could cap |
That requires a little refactoring to expose |
When starting new projects, it's better to keep the changes low, to avoid ruining saves. That 10kg/str is very low, 50kg/str would be safer. |
Fair enough, c382737 defangs it for now until I implement the next part |
Forgive me if this is the wrong place. But, I think installing the boom crane on an empty space is counter intuitive. Could it be changed so that the boom crane can be installed on a frame like virtually every other part? |
It's unrealistic that you can duct tape a 500kg engine onto a frame and drive away.
This PR adds
JACK
andLIFT
tool qualities and encapsulates the players lifting ability ascan_lift
. Thevisitable
interface is extended so that vehicle parts can provide tool qualities. A folding engine crane is provided as a demonstration item.At present each level of
JACK
orLIFT
has a capacity of1000kg.LIFT
is likely to be extended to require a steel chain and be an acceptable substitute forJACK
. Thismight bereduced to 500kg per unit to improve the granularity noting @Coolthulhu's comments about vehicle jacks.I'm going to extend this further so that players can construct cranes and other such vehicles that might be necessary for those wanting to work on huge vehicles.
Smaller vehicles remain repairable at the side of the road whereas larger vehicles may require workshop facilities for some tasks. This should hopefully balance out the vehicle parts more rather than just going for the biggest baddest engine you can find on day 1.
Comments are sought as to initial balance. The default
STR 8
character can install parts up to 80kg so this is one major balance point.