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

Forbid modification of helicopters #40467

Merged
merged 2 commits into from
May 12, 2020

Conversation

anothersimulacrum
Copy link
Member

@anothersimulacrum anothersimulacrum commented May 12, 2020

Summary

SUMMARY: None

Purpose of change

Players should not be able to retrofit or otherwise modify helicopters, as doing so could either significantly hamper or prevent sustainable flight of the helicopter

Describe the solution

6892e81 - Add a new function, print_message_to(), and use it to clean up various display code in can_install_part() and can_remove_part().
1cb27e9 - Check if the vehicle has the NO_MODIFY_VEHICLE flag, and if it does, forbid modification of it, unless you're installing or removing a part with the SIMPLE_PART flag. This includes installation of parts, removal of parts, and repair of parts.

Describe alternatives you've considered

Many:
Allowing repairing, but not installation or removal.
Allow removal additionally, and only disallow installation.
Don't reuse the ROTOR part flag for this. I chose not to do this, because this solution was easier and covered all existing use cases. If future use cases come up, it can be easily changed.

Testing

image
Removal:
image
Install:
image
Spawn in a helicopter, smash it up a bit, attempt to remove, install, or repair parts.

@rodentman123
Copy link

I believe that a character with sufficiently high mechanical skills should be able to repair helicopter parts.

@ghost
Copy link

ghost commented May 12, 2020

Don't reuse the ROTOR part flag for this. I chose not to do this, because this solution was easier and covered all existing use cases. If future use cases come up, it can be easily changed.

It might be helpful to modders to separate this mechanic from the rotor flag. Not only would it allow adding new flight VPs that can be installed and repaired, but it'd also allow for making use of the "no repair" function for separate uses (deployable vehicle items that aren't meant to be taken apart while deployed come to mind as an example, like say a deployable mounted gun on a turret that needs to be taken down before you can separate it from the tripod).

@Rail-Runner
Copy link
Contributor

Rail-Runner commented May 12, 2020

One more thing to consider here is that currently the helicopter may be smashed up with a sledgehammer or similar to remove parts, and as long as certain key parts aren't broken, it'll keep flying.

@Night-Pryanik
Copy link
Contributor

Adding a simple cloth curtain to the helicopter shouldn't hamper its ability to fly.

@anothersimulacrum
Copy link
Member Author

anothersimulacrum commented May 12, 2020

Added a SIMPLE_PART flag that excludes parts from that restriction. Added it to curtains and seatbelts. Moved the restriction to a separate flag.
@Night-Pryanik
@axema

@nphyx
Copy link
Contributor

nphyx commented May 12, 2020

I understand not being able to modify or extend helicopters as a gamey limitation simply because we can't simulate whether a change would be mechanically viable and we'd rather break immersion and realism this way than by letting people build flying junk houses, but repair of most parts should not be an issue with appropriate tools.

Surely you can repair a seat for example - the helicopter is not going to crash because you patched the pilot's torn seat with duct tape instead of letting the springs stab him in the butt. Likewise, whatever a player normally does with duct tape and superglue to fix a headlight is probably going to work equally well on a helicopter light.

Really almost everything that isn't an integral mechanical component should be repairable to anybody with appropriate skills and tools. At a minimum panels, seats, aisles, lights, dash instruments, and anything else whose function is basically the same as a ground vehicle should be repaired by the same method. I suppose since we don't have systems for dealing with all the mechanical and electrical linkage you could call that part of the "frame" and say the frame is non-repairable.

@Dacendeth
Copy link
Contributor

Dacendeth commented May 12, 2020

Not being able to repair is silly, how does restoring something to how it once was in anyway risk it not functioning properly? Not being able to rip parts off for scrap when you have no intention of using it as a helicopter is also kind of weird.

@RedShakespeare
Copy link
Contributor

RedShakespeare commented May 12, 2020

If it's about vehicle crashes after modifications, players will learn from their failures and understand how to build a helicopter properly and some notes can be added; If it's about real-life aerodynamics, some more vehicle shape limits or rules will work and maybe the currently existing wind/physics mechanisms can contributes to this. Simply forbidding modifications just because they may cause problems is neither elegent in code nor reasonable in game.

@Solusphere
Copy link

So....I get that helicopters are intended to be a rare, lategame, rather impractical thing.

But currently:
90% of the time, a helicopter spawns damaged
Said damage can't ever be repaired.
They only spawn infrequently in very rare locations.
They outright require you to have created a character with the express intention of flying them to be usable (helicopter pilot).

The odds of anyone ever experiencing this "flying helicopters" mechanic legitimately seem so vanishingly low. I'm genuinely curious if anyone has ever managed to pull it off without mods and/or debug commands, and if so, how?

@MikuMiddo
Copy link
Contributor

It's very realistic that the man who can install 3 reactor in car but can't change a seat in the helicopter beacause it may prevent sustainable flight of the helicopter,isn't it?

@kevingranade kevingranade merged commit 702b0b4 into CleverRaven:master May 12, 2020
@Zireael07
Copy link
Contributor

Why was it merged? Many people correctly pointed out that repairing helicopter parts should be possible...

@anothersimulacrum anothersimulacrum deleted the heli branch May 12, 2020 14:35
@anothersimulacrum
Copy link
Member Author

WTF dude, now I can't remove frame, roof, nothing "not simple" from crashed helicopter!

You can smash the blades. I thought we had some way to 'remove' parts and it would give something other than the part installed, but apparently not. I will look into adding that to improve this situation.

@AncientSion
Copy link

Interesting. I put 10 engines into my car and i can pump advanced mutations serums in droves into my body, no problems whatssoever.

But i cant fix or a mod a helicopter ?

I would wager its easier to slighly modify a helicopter than to build a tank with laser guns running on a zillion solar panels.

This a) should not have been suggested to merge and b) should not have been merged

@ZhilkinSerg
Copy link
Contributor

Interesting. I put 10 engines into my car and i can pump advanced mutations serums in droves into my body, no problems whatssoever.

But i cant fix or a mod a helicopter ?

I would wager its easier to slighly modify a helicopter than to build a tank with laser guns running on a zillion solar panels.

This a) should not have been suggested to merge and b) should not have been merged

Both of your assumptions are incorrect.

@anothersimulacrum
Copy link
Member Author

I put 10 engines into my car

This is false

I would wager its easier to slighly modify a helicopter than to build a tank with laser guns running on a zillion solar panels.

I would disagree, and also say that you shouldn't be able to build that tank.

And overall:

"Player can craft a X, so they should also be able to craft a Y"

This kind of argument is invalid for several reasons.
Just because there’s a contradiction i.e. “cordless drills and gunsmithing tools are equally hard to make, but we can only make cordless drills” doesn’t imply that the correct action is allowing crafting of gunsmithing tools, it’s equally likely that craftable cordless drills were a mistake.
This argument generally has a tenuous or non-existent relationship between the items in question. Frequently it’s an assertion that X is “complicated” and Y is either “simple” or “also complicated”, this is not sufficient for craftability of X to imply craftability of Y.

   Hoisted from a topic where it came up again: https://discourse.cataclysmdda.org/t/i-cant-see-the-difference-between-firearm-and-gunsmith-repair-kits

@Kenshkrix
Copy link
Contributor

This is an extremely strange place to implement this, and flies against the general policy of letting the player fail at things.
If you want flight-worthy vehicles to be hard to make, implement it in the actual functionality of being flight worthy.
Somebody should be allowed to create and modify a helicopter: If they lack the knowledge and skill to make it work then the helicopter should simply crash or be incapable of lifting off.

@ZhilkinSerg
Copy link
Contributor

Somebody should be allowed to create and modify a helicopter: If they lack the knowledge and skill to make it work then the helicopter should simply crash or be incapable of lifting off.

They simply failed at creating a helicopter design.

@Kenshkrix
Copy link
Contributor

Kenshkrix commented May 12, 2020

Somebody should be allowed to create and modify a helicopter: If they lack the knowledge and skill to make it work then the helicopter should simply crash or be incapable of lifting off.

They simply failed at creating a helicopter design.

I'm not sure I understand your point.
If you want a modified helicopter to be incapable of flying and for the player to never be able to craft a flyable helicopter; Just slap a tag on it and make it incapable of flying.

My point was that locking the entire vehicle so they can't touch anything is just a really weird way to implement this kind of limitation and makes no sense on top of it.
I could absolutely dismantle a helicopter without knowing a thing about how to fly one.
Don't merge arbitrary limitations into a customization interface, implement limitations where they actually make sense.

@ZhilkinSerg
Copy link
Contributor

Somebody should be allowed to create and modify a helicopter: If they lack the knowledge and skill to make it work then the helicopter should simply crash or be incapable of lifting off.

They simply failed at creating a helicopter design.

I'm not sure I understand your point.
If you want a modified helicopter to be incapable of flying and for the player to never be able to craft a flyable helicopter; Just slap a tag on it and make it incapable of flying.

My point was that locking the entire vehicle so they can't touch anything is just a really weird way to implement this kind of limitation and makes no sense on top of it.
I could absolutely dismantle a helicopter without knowing a thing about how to fly one.
Don't merge arbitrary limitations into a customization interface, implement limitations where they actually make sense.

Dismantling is not linked to a piloting trait.

@kevingranade
Copy link
Member

flies against the general policy of letting the player fail at things.

I'm not sure what you're basing this on. We do not have a general policy of letting the player fail at things that are nearly impossible. This is the same policy that leads to modern gunpowder being uncraftable and nuclear launch being simply disabled and any number of other things in the game where allowing it but with an incredibly high failure chance is simply disallowed.

If you want flight-worthy vehicles to be hard to make, implement it in the actual functionality of being flight worthy.

What you're describing is a complicated and rather difficult to implement system no one has shown any immediate interest in implementing.

What we're doing right now is getting this part of the system wrapped up in a reasonably consistent way and that includes things like preventing arbitrary extensions to working aircraft and it's going to stay that way until someone feels like implementing a system that meets my criteria for inclusion.

Just slap a tag on it and make it incapable of flying.

This is a viable option.

@Kenshkrix
Copy link
Contributor

Just slap a tag on it and make it incapable of flying.

This is a viable option.

Sorry about the tangents.
My point is that making a functional limitation in the interface is strange, make functional limitations in the functionality instead.
Even if it's just a tag that says "This cannot fly", it's better than messing with the interface.

@anothersimulacrum
Copy link
Member Author

I think the tag's a good idea, someone else suggested it earlier and I will look into doing something similar. I'm sympathetic to the interface woes this could cause.

@jwgrawe
Copy link

jwgrawe commented May 18, 2020

I believe that a character with sufficiently high mechanical skills should be able to repair helicopter parts.

Hmm, I agree.

Though I agree that there should be measures to make it less accessible (for realism's sake), there shouldn't be any hard qualitative reason for this not being possible. There are aircraft engineers that by far have the necessary skill to repair nearly any system in an aircraft, or modify the aircraft in ways that still will keep it operable (despite being less efficient/safe than in the original condition).
The restrictions should be quantitative, I think: It should require high levels of skills, and likely multiple skills. Moreover, repairs/modifications should often require parts, and these parts should be very hard to manufacture (i.e. require high levels of skills, and rare and expensive machinery).

That being said, maybe "locking" modifications like this is a decent temporary measure for now?

Would it be possible to consider a solution where either specialized flags or very high levels of skill would "unlock" this?

@DrPariah
Copy link

So....I get that helicopters are intended to be a rare, lategame, rather impractical thing.

But currently:
90% of the time, a helicopter spawns damaged
Said damage can't ever be repaired.
They only spawn infrequently in very rare locations.
They outright require you to have created a character with the express intention of flying them to be usable (helicopter pilot).

The odds of anyone ever experiencing this "flying helicopters" mechanic legitimately seem so vanishingly low. I'm genuinely curious if anyone has ever managed to pull it off without mods and/or debug commands, and if so, how?

You put this into words better than I could. About the only use this system seems to have right now is as a framework or stepping off point for modding (which I hope someone is doing to enable players to actually use the fun, complex, interesting system that has been implemented).

@anothersimulacrum
Copy link
Member Author

anothersimulacrum commented May 20, 2020

Though I agree that there should be measures to make it less accessible (for realism's sake), there shouldn't be any hard qualitative reason for this not being possible. There are aircraft engineers that by far have the necessary skill to repair nearly any system in an aircraft, or modify the aircraft in ways that still will keep it operable (despite being less efficient/safe than in the original condition).
The restrictions should be quantitative, I think: It should require high levels of skills, and likely multiple skills. Moreover, repairs/modifications should often require parts, and these parts should be very hard to manufacture (i.e. require high levels of skills, and rare and expensive machinery).

That being said, maybe "locking" modifications like this is a decent temporary measure for now?

Would it be possible to consider a solution where either specialized flags or very high levels of skill would "unlock" this?

Sorry, I missed your comment earlier, @jwgrawe .

Possibly, from conversations I've had in the past, I believe that either you starting as a helicopter mechanic, or finding a helicopter mechanic, along with appropriate manuals would be acceptable as a solution for some level of modification on these helicopters. I'm not sure on all the specific of what the restrictions there would have to be for it to be merged. So yes, this is a temporary thing until such a system is put in place, but I don't know what all that system looks like.

What I think is more interesting and far more permissive on the modification front is ultra-light helicopter-type vehicles such as gyrocopters.

DrPariah's comments

I found this exchange on the matter to be enlightening. Helicopters are here now, but that doesn't mean we shouldn't put limits in place to make them more accessible, because they shouldn't be very accessible, or even a thing most people see.

@jwgrawe
Copy link

jwgrawe commented May 22, 2020

Sorry, I missed your comment earlier, @jwgrawe .

Thank you for the wonderful reply.

I completely agree. I was somewhat premature in writing and sending my ramblings/musings, sorry.
I also had a post-reply epiphany where I realized that repairing an aircraft is probably an order of magnitude simpler than arbitrarily modifying/redesigning it, oof.
Implementing a system for checking "flight-readiness" or somesuch is also likely to be difficult.
(Looks like enormous flying death-fortresses will be someways off yet!)

I think this is a great placeholder system, really, and I agree with you on the light-frame small helicopter/gyrocopter point.

Thank you for all your hard work, Anothersimulacrum!

@SirScarfalot
Copy link

It really shouldn't be that difficult to check if something is flight-ready, should it? There's already naval vehicles implemented which use the concept of displacement to ensure that they're water-ready, and we've long had land vehicles use their center of mass to determine if their wheelbase is sufficient to permit rolling.

Therefore, I would suggest that helicopter rotors be given their own "buoyancy", taken from the boat hulls, which we compare to the weight of the vehicle. If it's too heavy, it won't fly. Similarly, we could ensure that, at least in terms of single-rotor helis, the rotor is directly on the center of mass. If it isn't there, it isn't balanced and is not going to fly... or, worse, it might fly for a little bit before it crashes >:)

Multi-rotor helis arguably should be more forgiving in terms of center-of-mass; I'd suggest that we could just use the existing system of wheels to check center-of-mass in that case. Though that might be OP as all heck.

Unfortunately I don't have the slightest idea how to even begin to attempt the above.

As for ultra-light gyrocopters, maybe we could just use the foldable bicycle system to build a "gyrocopter kit" which then unfolds, permanently, into a single-seat and extremely minimalist helicopter? Gated behind extreme skill requirements and resources of course, at least mechanics and fabrication, but then we'd have a craftable helicopter. Still unrepairable and impossible to modify, but at least aftershock users or helipilot starts have something to look forward to.

I'm actually going to start work on the latter myself. Turns out adding recipes isn't too difficult at all. Lemme just... make a mod...

@ZhilkinSerg
Copy link
Contributor

Unfortunately I don't have the slightest idea how to even begin to attempt the above.

Just as an average survivor, so it works as intended.

@anothersimulacrum
Copy link
Member Author

It really shouldn't be that difficult to check if something is flight-ready, should it? There's already naval vehicles implemented which use the concept of displacement to ensure that they're water-ready, and we've long had land vehicles use their center of mass to determine if their wheelbase is sufficient to permit rolling.

It's not particularly technical or extremely expansive, but it's definitely much more than either of the solutions that I have made. The modifications I have made in this area are explicitly simple solutions to this problem, which will be relaxed and expanded on into better systems when someone has time.

Therefore, I would suggest that helicopter rotors be given their own "buoyancy", taken from the boat hulls, which we compare to the weight of the vehicle. If it's too heavy, it won't fly.

This already occurs:

Cataclysm-DDA/src/vehicle.cpp

Lines 4136 to 4146 in 963edfd

bool vehicle::has_sufficient_rotorlift() const
{
// comparison of newton to newton - convert kg to newton.
return lift_thrust_of_rotorcraft( true ) > to_kilogram( total_mass() ) * 9.8;
}
bool vehicle::is_rotorcraft() const
{
return ( has_part( "ROTOR" ) || has_part( "ROTOR_SIMPLE" ) ) && has_sufficient_rotorlift() &&
player_in_control( get_player_character() );
}

Similarly, we could ensure that, at least in terms of single-rotor helis, the rotor is directly on the center of mass. If it isn't there, it isn't balanced and is not going to fly... or, worse, it might fly for a little bit before it crashes >:)

Multi-rotor helis arguably should be more forgiving in terms of center-of-mass; I'd suggest that we could just use the existing system of wheels to check center-of-mass in that case. Though that might be OP as all heck.

Some sort of rotor balancing is a good idea. (We should also have tail rotors, probably)

As for ultra-light gyrocopters, maybe we could just use the foldable bicycle system to build a "gyrocopter kit" which then unfolds, permanently, into a single-seat and extremely minimalist helicopter? Gated behind extreme skill requirements and resources of course, at least mechanics and fabrication, but then we'd have a craftable helicopter. Still unrepairable and impossible to modify, but at least aftershock users or helipilot starts have something to look forward to.

I'm not sure about helicopter fabrication, but the big advantage of these small gyrocopters and similar vehicles is that they are much simpler to repair and modify (and fly also, but I no way currently exists to do that). The way I'd implement them is to add small gyrocopter rotors which cannot be installed, but allow modifications of vehicles with them, though have limited thrust so liit what you can lift into the air naturally. I'd do it this way, because as described so far, other than allowing less skilled flight, this is an entirely JSON change.

I'm actually going to start work on the latter myself. Turns out adding recipes isn't too difficult at all. Lemme just... make a mod...

@SirScarfalot
Copy link

SirScarfalot commented Sep 12, 2020

Unfortunately I don't have the slightest idea how to even begin to attempt the above.

Just as an average survivor, so it works as intended.

...r00d q-q

Anyway, I've now made my mod that permits construction of an ultralight gyrocopter... now I just need to test it. Since the damn thing takes an in-game week to build, I'm basically gonna have to let it run overnight and we'll see if it's functional in the morning 😅
(I am not good at game design apparently)

@SirScarfalot
Copy link

Ok, fascinating results. I set it up so that it uses the "helicopter pilot" proficiency in building my gyrocopter, and... it gets stuck at 100%. Without actually giving me the proficiency.

Also, the foldable gyrocopter transmogrifies into a perfectly functional folding bicycle when it folds back up. I can't actually see any way to prevent that, nor any way to prevent it from being re-foldable either.

So... yeah, I'm rather stuck. The restrictions you've placed are too heavy, I can't work around them :/

@anothersimulacrum
Copy link
Member Author

That's because you cannot learn the proficiency. I should check that recipes only use proficiencies that you can learn.

Also, the foldable gyrocopter transmogrifies into a perfectly functional folding bicycle when it folds back up. I can't actually see any way to prevent that, nor any way to prevent it from being re-foldable either.

I don't know anything about folding bicycles, but they're probably more hardcoded than they need to be, and could be JSONized.

@SirScarfalot
Copy link

That's because you cannot learn the proficiency. I should check that recipes only use proficiencies that you can learn.

Yeah, I changed that in my mod so that it's indistinguishable from blacksmithing. "can_learn": true.

@anothersimulacrum
Copy link
Member Author

You gave it a time to learn, too, right?

@SirScarfalot
Copy link

SirScarfalot commented Sep 13, 2020

You gave it a time to learn, too, right?

Yep, had it set to 24 hours. And then when that didn't work, I changed it to 12 hours for another test, and it got stuck at 100% again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.