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

Allow bird wings to glide #70443

Closed
wants to merge 6 commits into from
Closed

Allow bird wings to glide #70443

wants to merge 6 commits into from

Conversation

worm-girl
Copy link
Contributor

@worm-girl worm-girl commented Dec 25, 2023

Summary

Features "Allow bird wings to glide"

Purpose of change

We have bird mutants. The bird mutants have wings. We have Z levels. The wings should, logically, have some interesting interaction with this feature.

There are a number of factors standing in the way of self-powered flight for a mutant survivor, the main one being that keeping a human body in the air would require something like a seven meter wingspan, to say nothing of other physiological changes involved, and at the very least would completely cost you the use of your arms. Playing a survivor with no arms would at present lock you out of most of the content in the game, so it doesn't seem worth implementing. On top of that it would be pretty difficult (for me) to code realistic flight as opposed to just walking around in the sky.

Bird wings already allowed players to negate all fall damage, but they were doing so by falling down in a straight line. This is not how wings work. This PR addresses both issues by instead making wings into a tool for gliding, which will allow unburdened survivors with free hands to glide forward a short distance as they fall.

Describe the solution

THE BIRD WINGS MUTATION

  • Bird Wings now replace your arms, rather than being a new set of limbs growing out of your back. Real-life birds' wings are their arms, they don't have six limbs
  • Bird Wings are now described as a halfway point between arms and wings, something akin to microraptor with nearly vestigial fingers so they can still craft, hold items, shoot guns, and whatnot at a hefty penalty
  • This means they'll be made into new limb types as was done with Gastropod Foot. This will allow us to call them wings in the UI and more finely control what kinds of gear can fit over them
  • Bird Wings have lost Wing Stubs as a prerequisite, and instead have Feathered Arms
  • Feathered Arms has had its penalties reduced slightly. It was wildly overtuned before, considering how it's described

GLIDING

  • Gliding is done by attempting to move off a ledge. You will be prompted to climb down, jump, or whatever else as normal, but a new option appears, glide
  • Gliding requires you be carrying less than half your weight. This is based on bald eagles weighing around 6 kg and being able to easily carry about 3kg in flight (they can carry more if they're moving quickly, but you are not a bald eagle). It also requires that your hands are free, that you have more than 4 strength, and that you have two unbroken arms which are not covered by any equipment
  • Gliding moves you at a base rate of five tiles forward, then one tile down
  • Headwinds will reduce your forward distance, tailwinds will increase it
  • Colliding with an obstacle, such as a wall, will terminate your glide, causing you to fall the remaining distance
  • Colliding with a corporeal enemy of medium size or larger will cause a dodge check. Should you fail, you will be knocked out of the air. If the enemy is the same size as you, it will fall too. If you happen to be large or huge and you fail your dodge check, you will knock enemies smaller than you out of the air without interrupting your glide, though they may be able to attack you as you go by. Enemies which fly via unconventional means (levitating nether bullshit) will not fall to the ground
  • Being grabbed or slammed will terminate your glide. Be careful up there!
  • Bird Wings will require the Light Bones mutation. Thanks @Vaskritaya

FALL DAMAGE

  • Wings used to negate all fall damage. This is going away. Instead, they'll treat you as having fallen two Z levels less than you have, so long as they're not broken or covered and you're not carrying more than half your weight limit. This also won't work if you're stunned, grabbed, being flung, or anything else I can think of
  • Feathered arms will reduce fall damage by 1 Z level's worth so long as you satisfy the above conditions

THE INSECT WINGS MUTATION

  • These have been broken for a very long time now, they always give you a bonus even when not activated. I'll fix that while I'm here
  • Insect wings won't be able to glide, but they don't rob you of a decent pair of arms either. They will reduce your fall damage as bird wings if the proper conditions are met
  • They need a bunch of other work - they should be damageable, they should require specialized gear, etc. - that's a job for another PR

Describe alternatives you've considered

I have plans for bat wings which are beyond the scope of this PR. That being the case, they'll be left as-is for now.

I'm wondering if we can apply this code to implement parachutes. My thinking is that a parachute would require a very high altitude to work, maybe our maximum z level and one or two below that, and you'd move forward a lot less and get blown around by the wind quite a bit more.

Testing

Ongoing

Additional context

Here's a brief demo of it being run on a custom mutant type. Pretend this dude is a bird:
https://www.youtube.com/watch?v=3_5ygmuel9A

I'm interested in hearing from modders about anything you might want out of the core gliding framework. I'd like it to be something that could easily be carried over to MoM or Magiclysm so you can have levitation and flight spells, and I'll try to make sure that functionality is available to you in the most open-ended way I can manage.

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing labels Dec 25, 2023
@Vaskritaya
Copy link
Contributor

This sounds extremely cool. I will note this should probably have some sort of interaction with the light/hollow bones mutations. Maybe a prerequisite to gliding, and otherwise you just get fall damage reduction? Less distance traveled per level dropped?

@worm-girl
Copy link
Contributor Author

This sounds extremely cool. I will note this should probably have some sort of interaction with the light/hollow bones mutations. Maybe a prerequisite to gliding, and otherwise you just get fall damage reduction? Less distance traveled per level dropped?

Hollow bones will definitely be a prerequisite.

@Standing-Storm
Copy link
Contributor

I'm interested in hearing from modders about anything you might want out of the core gliding framework. I'd like it to be something that could easily be carried over to MoM or Magiclysm so you can have levitation and flight spells, and I'll try to make sure that functionality is available to you in the most open-ended way I can manage.

There's currently a telekinetic power called Slowfall that would be the most obvious beneficiary of these changes. The thing I can think of are that it would be nice to have the ability to either glide or retain the old behavior of falling straight down (depending on how the psion wants to control their descent). Flight (horizontally) is already handled through the LEVITATION flag, and there are various ways to make sure powers cause lower or no damage on falls already.

@worm-girl
Copy link
Contributor Author

There's currently a telekinetic power called Slowfall that would be the most obvious beneficiary of these changes. The thing I can think of are that it would be nice to have the ability to either glide or retain the old behavior of falling straight down (depending on how the psion wants to control their descent). Flight (horizontally) is already handled through the LEVITATION flag, and there are various ways to make sure powers cause lower or no damage on falls already.

Cool cool. I'll check out Levitation and make sure gliding feels distinct enough from it. As for falling straight down, you can choose to do that just like before when you examine the ledge. I'll leave functionality for 0 damage falls in so the mods can continue to work as before even if the base game mutations work differently.

src/activity_actor.cpp Outdated Show resolved Hide resolved
@Terrorforge
Copy link
Contributor

Levitation behaves a bit strangely at the moment. You may want to look at #70207 for some pitfalls to avoid - for example, I don't think we want gliding through the air to become super slow if you try to do it with broken legs or while crouching.

My immediate thought for additional use cases were hang gliders and wingsuits, but after a modicum of research I have discovered that hang gliders are huge and that you can't actually land in a wingsuit (they have parachutes), so I don't think they're real candidates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants