cataclysmbnteam / Cataclysm-BN

Cataclysm: Bright Nights, A fork/variant of Cataclysm:DDA by CleverRaven.
https://docs.cataclysmbn.org
Other
672 stars 265 forks source link

Personal flight proposal #1680

Closed joveeater closed 10 months ago

joveeater commented 2 years ago

Is your feature request related to a problem? Please describe.

No.

Describe the solution you'd like

This is only really plausible with z levels on. With them off I think it's best to leave the mechanics basically as is. I'll still remove ledge traps but falling will happen immediately and flight stats will only amount to fall damage reduction. Removing the z levels option is also a possiblity. I have no idea how much it's used.

This revolves around two stats, upthrust and airspeed. Upthrust is the vertical force you're capable of generating, airspeed is horizontal. Falling is just flying with 0 in both stats, in which case you will descend at a rate of 1 tile per turn and movement will be disabled. Monsters will always fall like this unless they fly then they don't fall at all. Fall damage is calculated similarly to how it is now, creatures keep track of how many consecutive levels they've fallen then take damage when they land. Falling/flying is just a question of being in a tile with no floor, you can't fly if there's ground in your tile and it mostly just uses the normal movement system with < and > to ascend and descend. Running and crouching are disabled in the air.

Upthrust uses your weight as a threshold, if you generate less than your weight in upthrust you will fall at a rate of 1 level per weight/(weight-thrust) turns, capped at 20. If you generate equal or more you aren't forced downwards. If you generate 125% or more you can ascend. The move cost of ascending is 500-(100*thrust/weight) capped at 50, so starts at 375 and goes down by 100 each time you add your weight in upthrust. Reaching the threshold resets fall distance for damage and having upthrust when you hit the ground reduces fall damage. Descending costs a flat 100 and adds to your falling counter if appropriate. Air speed affects horizontal movement speed in the same way upthrust affects ascending, however you need only 25% of the threshold to be allowed to move, so max move cost is 475.

If you don't move, upthrust and airspeed are reset to 0 plus whatever your flight sources provide however, if you move airspeed will be reduced by your weight threshold, then multiplied by 0.25. The same will be done with upthrust but with double the threshold, both of these will cap at 0 and are done per tile moved not per turn, constant sources will be reapplied at this point as well. This allows for jumps as a single big burst of stats. Jumping will be a default action available via <. If you don't manage to reach the upthrust threshold to ascend, which a normal human won't, it just does nothing. If you have god stats you might be able to keep ascending. Running off a ledge will give you the same burst of stats. Maybe crouching off a ledge lets you hanging drop?

The idea with jumps is rather than asking where you'd like to jump to, we just give you temporary air control via a large burst of air speed. You don't have to try to get a good arc, if your landing is on the same/lower z level it's probably best to just move horizontally unless you have something else letting you glide. Note that your time until fall isn't recalculated until you change z levels, so the upthrust on your jump will get you extra hang time.

The two stats are independent from one another and are aggregated from different sources by giving the full effect of the highest source, then half of the next highest, quarter of the next etc. I want to put in a lot of json twiddleables that affect each source independently. So you could maybe build a parachute that only works once you've fallen 2 z levels, gives a little bit of airspeed depending on the wind and can never give more than half your weight threshold in upthrust, but at the end every source just provides some amount of upthrust and airspeed.

Anyway, that's an overview of the core system. There's still a lot that needs considering and all of this will need tweaking. I want to work in climbing somehow, but I haven't looked at it or played with it much, at the least upthrust should give some bonus to it. The system isn't too bad to implement, the real work is going to be in making everything nicely jsonable, making sure it's well integrated, that npcs can use it and edge cases like landing on trees or a room full of zombies are considered and tweaking the numbers so it's all balanced and sensible.

Speaking of, balance wise it's a situational ability, it does nothing anywhere with a ceiling but is very powerful in the right circumstances. I think jumping should get a normal unburdened human across a 1 tile gap, with a bag full of stuff not even, but should scale heavily with stats and abilities and provide a lot more airspeed than upthrust. I think a good mutant/cyborg should have no trouble getting between buildings in a block or onto a 1 tile roof from a tile or two away with a light load, but going much further past that with jumps should be hard.

For constant sources, fall prevention like parachutes should be pretty easy to get. Gliding between buildings should mean mutations/cbms, enough to get you across a street should be post threshold/lab finisher levels. Being able to just go up and reach a nearby roof top is very powerful end game stuff and sustained flight just wins against a lot of the game. I think weight should be a universal concern if you want to fly, but I'd like to give each source drawbacks such that combining them to cover weaknesses pays off. Jumping up+gliding work well together.

With that in mind, to finish this and put it in the game I'd like to rework bird mutations as top tier flight specialists and even then they'll top out at getting you across a street or up a few z levels at the expense of all your stamina. You'll be treated as having no hands while flying with wings. One or two pre threshold mutations will give decent gliding, post threshold a bunch of seperate mutations with improvements like better takeoffs (i.e. jumps), less stamina consumption, a burst of air speed when you descend etc. Past that I could maybe see an anti grav cbm that always gives you hovering but drains a lot of power the more you weigh or a jump pack that gives lots of upthrust but guzzles JP8.

But that's all a long way off. There are a lot of limitations, you can jump around corners, fall damage only cares about how far you fell and your upthrust when you actually hit the ground, a bunch of "super great late game stuff" is actually terrible with z levels off etc, but I'm hoping to hack together the core system and then slow down and make sure it's well integrated, that mid air actions make sense and things like damaged limbs are taken into account when appropriate.

So yeah, main reason for this wall of text is to collect comments, suggestions and criticisms. Hopefully I'll be able to follow this up with a proof of concept some time next week but a new mechanic like this is always a big job that needs careful thought with regard to how it's actually going to be used and how it interacts with other things. As such I'll probably put it on the back burner for a bit after that and try to build a task list of use cases such as items or abilities and what they would do alongside a list of ways it could interact with other systems. So anything goes with ideas.

Describe alternatives you've considered

Following the instructions and writing a clear and concise description of what I want to happen.

Additional context

Rocket pants

Coolthulhu commented 2 years ago

Sounds too focused on forces. I'd rather see something based more directly on gameplay effects:

The important parts are to:

The only new variable to store would be fractional altitude. Effects like diving to gain a burst of move speed can be implemented as explicit on-move effects.

DrPariah commented 2 years ago

So in this system, modeling non-wing based flight (fly spells, personal TK flight, power armor jump jets and other equipment) would simply be higher end of the flight performance?

Coolthulhu commented 2 years ago

Yes, at least at first. Later we could add some extra flight mechanics, like momentum, falling after taking a hit, moving fast in exchange for more altitude loss etc., but it's best to start with simple implementation that does the job and is easy to understand.

I bet that there will be a ton of problems with how ledges are handled right now. Even the simplest "walk but on air" flight will have to deal with ceilings, "vertical" diagonals, vehicle roofs, landing on creature's head, falling onto a creature's head, falling onto a flying creature's head and so on.

joveeater commented 2 years ago

The idea with the stats is less to model forces and more to provide an aggregation point across various sources. The formulas are just the simplest thing that goes in the right general direction. The hope is the final formulas will let you easily build abilities like gliding in isolation with a clear, consistent system of what will happen when you combine it with other sources.

I think you're right about weight. I was thinking of it as a global flight concern but it's probably better to consider it per source. Make movement impact constant and have weight sensitive sources like wings explicitly take it into account rather than things like the anti-grav giving you stats per weight to cancel it out. It's clearer. Maybe do a set of thresholds or something for weight as well so all sources that do care about it are simple and consistent.

I'm not happy about the acceleration. The idea was flight would fundamentally be speed rather than acceleration as force over weight. The intent of carrying momentum over was to allow jumping as a single huge burst. I was even going to say you need to ascend to maintain upthrust, but I felt it was weird you had to jump all the way up before starting to move across. I was thinking the carry over from constant sources would be small enough to be negligible in most cases (or else you're close to capped anyway), but it occurs to me there's cases where it's deciding if you can ascend or not. That wasn't considered and I really don't like it. It might be better to just spit flight and jump into two separate factors where only jump decays.

Modelling any form of flight is less about picking the right values for stats and more about how those stats are being calculated. Wings might consume more stamina while hovering but boosters use less fuel and gliders give no stats if you try. What makes a parachute a parachute is mostly that it doesn't work until you've fallen some distance. That said I was thinking of wings as the best source and probably the only well rounded one, just on the basis that bird mutants should be the best at flying.

As much as I'm not precious about the specifics, I have to argue for anything that lets you walk on air somehow reducing to a handful of flight stats that have a clear effect on where you can move and how long it will take and consistent aggregation rules when you have multiple abilities going, especially with consideration to jumping as well as flying. It means flight will always interact with itself well and it gives an interface for other systems to interact. Pit traps, climbing etc can just use your stats rather than having to account for individual abilities. That said, within flying, the stats should just control basic movement, everything else about flying should be a special ability that usually only applies to the source that grants it.

Flight is somewhat fundamentally split into tiers of ascending>hovering>gliding, but note they're defined by their vertical movement abilities. The main reason I like splitting vertical and horizontal movement is because vertical is generally much stronger but then they're both much better if you have a lot of the other and they're nearly worthless if you have absolutely none of the other. This means you can make sources that are heavily skewed to one side like jump packs or gliders, that are useful by themselves but get a lot better when combined. That was the intention with putting the tiers at thresholds too but I think you're right it might be too fiddly. Better to keep the tiers explicit but we do need to think of if/how they'll combine with each other.

I think making flight fun is going to be about making sure sources have meaningful drawbacks and ways to play around them. Even a full bird mutant can't use their hands. Most other sources should be low tier and preferably have their own unique drawbacks, such that effective reliable flight means combining sources.

Falling is currently a real hack with every air tile having a fake trap in it, so there's maybe some argument that this could be a two part falling fix followed by flying feature, but as a feature and more than that a new system, it needs all of the bells and whistles before it's a net gain. Whoops that guy just flew through the ceiling or with all their limbs broken ruins immersion and it's better to just not. Even worse if there's crashes/debug messages.

UI wise I think keep it simple, disallow vertical diagonals, use the normal movement keys and put any displayed stats somewhere in '@'. I think it's important every flight source be disableable but that should be done with the normal item/mutation/cbm menus.

For the POC I'm just gonna do gravity for all critters as falling at a fixed 1 tile per second and setting your own air walking properties directly via debug. Then I can start slowly integrating it while we plan how it will actually work and be available in the game. It'll probably take months at the least just for that groundwork.