jackhumbert / let_there_be_flight

A flight mod for Cyberpunk 2077
MIT License
490 stars 43 forks source link

Problem with inertia #20

Open sphratrioth666 opened 2 years ago

sphratrioth666 commented 2 years ago

Generally, it's very hard controlling the vehicle in tight curves. This inertia gets annoying. I run forward, then want to turn, rotate the vehicle, roll the vehicle etc. but it keeps going forward for some time. I have to literally stop on every tight turn, then rotate, then accelerate while already looking in a direction of my flight. It would be great to turn the inertia completely off. I have tried a driving control mod (a better grip option) - it works better also for flying but still not perfect.

jackhumbert commented 2 years ago

Is there a particular vehicle you're noticing this with? Are you using a keyboard or controller?

jackhumbert commented 2 years ago

Also, if you could take a video of a maneuver you're trying to do, that might be helpful!

sphratrioth666 commented 2 years ago

I am using a keyboard and it is a problem happening with all the vehicles, actually. I mean - when I take a turn, it continues going forward for a second due to a strong inertia force - too strong - like drifting in the air. The back of a car is drifting onto the pavement and then, when acceleration in a new direction overcomes the inertia, the car continues forward as expected. It's visible also on small turns while running forward. I've tested it with different cars, actually no change. I also added the 3rd button of acceleration with x20 value for tests, which allows instantly getting out of inertia after a turn but it sucks in general, haha. Another option would be to add an instant stop (0 mph) button to stop mid-air, then change the direction and then accelerate when it's correctly oriented towards the new road. You know, currently even when I just turn a car to the side, it keeps moving forward vertically to the road line - unless it accelerates for a second in the new direction to overcome that strong inertia.

sphratrioth666 commented 2 years ago

Here a video - as you see - it is very persistent in moving forward towards the current direction. So persistent it makes even following the small curve of a straight road hard. In a plane simulator, you actually move your nose up and then roll to the side to take turns - usually there's a separate acceleration/deacceleration button + 3 directional keys for a nose up/down and roll left/right. You press S to force the nose up, then A/D to roll LEFT/RIGHT + acceleration and the plane takes a turn. Here the roll does not allow pitching the nose up on a keyboard while accelerating so the roll ends up with a nose down all the time making it not usable like in a case with a plane. Thus, when just using the car rotation - the inertia is do strong it makes it go forward even turned on the side with door vertically to the road line - as seen at the end of the video, for instance :-P

https://youtu.be/x7NRiFP64CM

jackhumbert commented 2 years ago

Having inertia in this way is kind of central to the mechanic, but I understand what you're saying. You might have luck adjusting the yawDirectionalityFactor (this will be renamed eventually) with FlightSettings.SetFloat("yawDirectionalityFactor", 50.0) (50.0 is the default) in CET - it controls how much your velocity is adjusted based on the direction your facing.

I'll try to make some adjustments to the hover & fly mode (which is kind of the "arcade"-style flying mode) to make it more friendly to this kind of flying. I can also break out the pitch & roll (and sway) bindings to separate keys to be able to be controlled from this mode as well.

sphratrioth666 commented 2 years ago

Yes - changing it to 200 or 300 solves the problem and flying actually becomes smooth - very enjoyable - but I'd say it is perfect around 700, haha. You have control over sharp turns and it also allows small directional adjustments while going full speed ahead over a straight road. Everything under 200 does not seem to affect inertia too much but hitting 200 changes the whole game. I think it would be best to set it as adjustable through the extended UI mod, if possible? The optimal value for me sits somewhere around 700 but it's still playable around 250-300 minimum.

This is the easiest way since after setting it like that the flight in arcade mode really feels great, I may record how it changes later but at first sight - nothing to improve if you make it like that - at least for keyboard controls or at least adjustable.

jackhumbert commented 2 years ago

Great! Thanks for testing this. I might make an additional mode, and have a bit more of a progression from the arcade flying to full drone control. The case in my head that I could see being fun is being able to drift a little bit in the arcade mode.

If you have the chance, could you take a recording of you flying with your ideal settings? Two other ones you might want to play with are yawCorrectionFactor & pitchAeroCorrectionFactor (only really used in drone mode, I think). All of the settings that you can adjust during runtime via CET are listed here with their defaults - some aren't used anymore.

sphratrioth666 commented 2 years ago

You know, this single change really fixed all the problems with the arcade mode on a keyboard. Actually, you are able to still drift a bit - it's just not as uncontrollable nor too deep like it used to be. Check the video - the last curve of the video turned out as a drift on its own so even at 700 it is still possible. Around 300 it drifts heavily but is at least a bit controllable so I imagine that the balance between grip & drift lies somewhere between 500-700? Maybe 600, it is not fully linear.

https://youtu.be/bSVykaZOKys

sphratrioth666 commented 2 years ago

Great! Thanks for testing this. I might make an additional mode, and have a bit more of a progression from the arcade flying to full drone control. The case in my head that I could see being fun is being able to drift a little bit in the arcade mode.

If you have the chance, could you take a recording of you flying with your ideal settings? Two other ones you might want to play with are yawCorrectionFactor & pitchAeroCorrectionFactor (only really used in drone mode, I think). All of the settings that you can adjust during runtime via CET are listed here with their defaults - some aren't used anymore.

I figured out that the new command is FlightSettings.SetFloat("yawDirectionalityFactor", 700.0) so with "" and it still works but would it be possible to make it adjustable in a way? Native UI seems like a really convenient solution. I would be also happy even if you make an INI file where I can set it once and for all. Thanks in advance for a response. Great work with a new version anyway.

Thortok commented 2 years ago

I tried the mod for a little bit and had the exact same issue. Handling is way too drifty, turns are almost impossible to make accurately at any level of speed, crashing into everything right and left as a result. Using mouse and keyboard.

I didn't want to mess with the variables on my own because I was really just trying out the mod for fun to see how it worked.

sphratrioth666 commented 2 years ago

Basically, for now you have to just copy-paste this command into CET (cyberconsole tweaks) and it totally changes the experience from unusable to one of the most fun mods ever.

jackhumbert commented 2 years ago

For the most part, this sort of inertia is kind of how flight and the physics around it work, and can take some getting used to. It really is a different mechanic than driving. Oversteering (so that your vehicle faces in the opposite direction) and drifting is one method to take turns like this.

Another is to strafe while turning (these will eventually be bindable controls) - this is basically what the yaw directionality factor is doing for you. It's really only meant to simulate the aerodynamics of the vehicle, though - one also exists for pitch.

I can take a video of how I take corners/hover through the city if it would be helpful to see what it looks like. I think it's pretty fun, even on a keyboard.

All that being said, I am definitely interested in introducing a mode with more arcade-style controls that behave more like the game's driving system (it'd probably make sense as the default/initial one).

I'm not sure how noticeable it is, but there's a brief recovery period whenever you have a collision - I'd like for this to be more apparent in the arcade-style modes, where the flight ai/computer is assisting your flying, and less in the advanced modes, where you presumably have full control of the system. This fits in with some other ideas I have around the flight ai malfunctioning in other vehicles in interesting ways.

sphratrioth666 commented 2 years ago

Honestly, it would be just best to have an INI file or a slider to set this value on your own - if people want a precise, easy system, which gives fun - let us have it :-P If someone prefers the way you say - no problem :-P Why not both to choose whichever you want when fixing the mod from unplayable at all to super fun requires just a single value change? Honestly, I can't play it at all without setting jaw directionality to 700 right now. It's really only pain, no fun. With this small change, it becomes my favorite mod for a whole game since I lack the Bladerunner flying vehicles a lot.

Thortok commented 2 years ago

I've played a lot of video games in my life all the way back to pong, lol.

This inertia is not intuitive. When I press W and go forward, I hear the engine, see the wheels tilt in that direction, and I go. When I let go of W, the engine sound stops, the wheels tilt back, and there should not be any force sending me forward. I should switch to 'hover in place' because that matches the audial/visual cues. There might be a little drift but it shouldn't be like 3-5 times the length of the car.

What's expected is that if I am pressing the accelerator and pushing the car in a specific direction opposite the direction I'm currently drifting, that force should overcome the drift. If you are on the ground and you take a sharp turn, you might fishtail a little, but ultimately the force that's pushing the vehicle is now going in a different direction and inertia has to give way to the power that is propelling the vehicle in a different way.

Instead, I keep sliding in the direction I was originally traveling instead of the direction I am now pointed. This means I have to oversteer: Instead of just pointing where I want to go, I have to cross-reference my original motion of travel and turn past the point of where I'm headed, making a 135° turn to the right instead of just 90 degree. Then after a couple moments to halt my original inertia, I have to steer back to the new direction of travel, and if I overcorrect, it becomes excessively hard to change direction again. And also given how slow the car turns, getting all the way to 135° is usually not possible to do in quick maneuvers.

Basically the 'old direction' sticks around too long and the 'new direction' doesn't erase the old inertia at all. So if I make a right turn, I literally have to come to a complete stop on my original line of travel before starting a new line of travel. This makes every turn one that requires a complete stop. And this is even for slight angles like 15°. Or I'll slam into a building. I have to manually brake and stop the line of travel I was going in every single time I want to change direction.

There's a car chase in the quest 'Dream On' and it's practically impossible to keep up with the car you're chasing without wrecking yourself across several buildings.

Have you ever flown a drone in real life? Or a model helicopter? Anything that has a hover mode? If I'm flying a drone by remote and I push for it to go in a certain direction and then let go, the computer is going to adjust and counter inertia automatically and return it to 'hover' as immediately as possible. It's not going to just drift across the sky like it's on a frictionless ice surface or something, waiting until I tell it to go the opposite way in order to counter that inertia. People who use camera drones don't have to constantly fight inertia to hold a camera steady. They just position the drone and if they let go of all controls, it defaults to hover.

This mod's 'default to hover' is broken. That's the issue.

sphratrioth666 commented 2 years ago

Calm down, guys :-D Actually, to be precise about physics - there're different types of flight.

Planes use the inertia of a movement to keep up their lift power. They turn by rolling to the side and lifting/pitching the nose up. This way - you can take even the sharpest turns with a jet-fighter easily and precisely. The good, intuitive mechanism for that was implemented in the old, arcady game H.A.W.K.X.

Another style of flight bases on directional thrusters/rotors like drones - where a CONTROLLER takes care of all the necessary power/direction compensations so if you stop pushing a flight control stick - it auto-compensates for you to stop and hover in place. While turning - it also takes care of all the vectors by controlling the thrusters direction/power through out the whole curve - so it prevents the exact problem this mod has.

The current flying cars utilize a drone thrusters technology to do exactly that. A helicopter technique would be very inefficient due to the similarities with a nose roll/bow mechanics while taking turns. A chopper has to always keep a nose down to move forward + roll to the side and bring the nose up to take turns because the rotor is fixed - not movable itself like thrusters/drone rotors technologies.

In the end - after we set up the jaw directionality factor to 700, we are able to control where we go. It works exactly like a controller in any drone-based vehicle. When you forcefully push a drone hovering in the air to the side - there is inertia and it moves in a direction you push - of course - but a controller is there to compensate that during an actually controlled flight while using the flight controls - especially on curves.

As I suggested - the easiest way would be to have a slider for changing inertia value or a simple INI file/SCRIPT responsible for that. Every person may like different style of flight, it might be totally different on a pad and on a keyboard but being able to precisely fly over the streets, lanes, between the lanterns, torii gates etc. would be crucial for such a flying car in real life as well as in a game. Parking, maneuvers, precise movements.

As long as I understand fun in drifting and sliding, the mod is currently 100% unplayable. I also understand you do not want to have it another mod dependent like a native UI or cyberconsole or whatever. However, this way it becomes unplayable or brings more pain than fun. I made a video of me flying with a directionality factor set up to 700. I can't imagine a different way of using this mod that such type of flying and it becomes one of the best experiences in this game - from an unplayable one. I am fluing up highter between the buildings too and the inertia is equally problematic. After loading a save-file, I instantly set up the directionality to 700 every single time I run the game and then I am able to use a mod. If I can't do that, I will surely uninstall it and get depressed because the idea behind it solves one of the biggest drawbacks of the vanilla game and it might be really the best mod out there.

You're working on a great, great thing, it's in the final stages of development after all the hard work you did, we all appreciate it so really - why not just make it fully customizable?

A mod changing damage done to NPCs as well as a DMG done to you by NPCs has easy sliders. You are able to set up anything from 1% up to 500% of the vanilla game. There're auto-presets with 0,25x, 0,5x, 1x, 1,5x, 2x etc. but you can do whatever you want for every enemy imagineable with just a simple slider.

The equally simple solution is an INI file or the GUI integrated slider with the same option. Even if it has presets like the default 50, then 300, then 500, then 700. It would solve all the problems. You are even able to call it the ESP MODES like all the assisting systems for real life cars. I do not remember a name for that in a drone controller but it already exists.

BTW - a differential in a car does the job we're discussing here perfectly so a controller in a drone replicates what a differential does with wheels but for a flying vehicle :-)

Thortok commented 2 years ago

Another style of flight bases on directional thrusters like drones - where a CONTROLLER takes care of all the necessary power/direction so if you stop pushing a flight control stick - it auto-compensates for you to hover in place. While turning - it also takes care of all the vectors by controlling the thrusters direction/power through out the whole curve - so it prevents the exact problem this mod has.

And considering this is flying using thrusters for wheels, that's exactly the flight pattern that's intuitively expected.

Thortok commented 2 years ago

https://youtu.be/07rtb12p32c

This is with me trying to steer with S to slow me down for turns, and sucking at it (causing me to back into walls a few times)

sphratrioth666 commented 2 years ago

https://youtu.be/07rtb12p32c

This is with me trying to steer with S to slow me down for turns, and sucking at it (causing me to back into walls a few times)

I can't open your video, it's private but look at mine - how great it feels and works with a directionality factor set up to 700.

https://youtu.be/bSVykaZOKys?t=29

Thortok commented 2 years ago

It should be 'unlisted' but I just uploaded it, give it a few mins

Thortok commented 2 years ago

AutoSave-9.zip Here's a save right before the car chase if you want to practice and demonstrate doing the car chase without hitting anything

jackhumbert commented 2 years ago

When I get the arcade-style mode implemented, I'll ping you both for feedback on it. I plan to expose all variables and parameters I can in an advanced configuration menu for each of the modes, along with some outline on how to add your own (this part requires coding, whereas the options won't).