looking for a guide to coding different kinds/styles of player movement.
so I’ve been trying to make a racing game, and I have tried so many different ways to do the movement, and it just does not seem right, I can tune it all I want, but it just stays wrong.
I have looked into a bunch of things, notably different YouTube videos, that go into ways of doing the movement, but they tend to not make it to clear how it behaves, “does this even do what I want?” is a common question I have, and trying to find the bit I want across all the videos I’ve checked is a pain. also most of those videos go into platformer type movement, not racing movement, which is a tad different.
so now I’m looking for something that goes more into a bunch of different styles of movement that one can go thru and find what they want. an example of what I’m looking for is like the book “Game Programming Patterns” (by Robert Nystrom) it goes into coding patterns, some basics of how to make it, and what you’d want the pattern for. its such a big help, highly recommend, I’m actually using the ‘state’ and ‘component’ patterns for my movement now, having a different script for particular things the character can do is nice, makes them easier to work on and manage.
there’s just so many ways to move the character.
like with force or translation? and do you just keep it as a more constant value (just like multiply it by the input amount) or have an element of acceleration to it? then if there is acceleration, do you bring it quickly up to max, or more slowly? what kind of curve should it have?
and then there’s turning, you could use torque, you could add rotation, you could make a vector from input axes and rotate the player to look towards that, which way will get the effect one wants?
and like a notable thing is drifting, I often run into a thing where you have velocity going one way, and then turn, and keep going that initial way. so say you were going forward which happened to be north, and then you turn to the right (so facing east now), but you keep moving quite a bit to the north (which is now your left) before you really are just going forward. and like I get why its there, I’m using force, and that’s how physics works, but as much as I try to tune it with like drag and such it just doesn’t seem right, so I’m getting the feeling something is wrong with the aproach, and not just that it needs tuning.
and so I really want some kind of resource that goes into the how and why of these things, and shows various options and what they are good/bad at so one can decide which to use. I just get the feeling I’m trying to remake the wheel instead of just building off of an already existing wheel, like it really doesn’t seem right to be making the wheel from scratch when that’s been done already, just need to find a wheel that fits my needs and modify that, ya know? like I’m all for learning how the wheel works and building it, but geez it feels more like I’m pushing different polygons down a hill and watching as they crash and lurch around.
so does anyone know of such a resource, something that goes into coding different kinds of movement based on what you’re trying to achieve?