Okay, please bear with me as this takes some explaining.
In a particular game I have (platformer using my own behavior), when I press a direction (left or right) I accelerate my character in that direction, but not exceeding its max speed. It is okay for the character to be above max speed, but not as a result of acceleration due to input (this allows for boosting, getting knocked back at expeditious speeds, etc) .
the result of input is handled along this sort of idea:
if speed.x > maxspeed.x then do nothing.
else if speed.x + acceleration.x > maxspeed.x then speed.x = maxspeed.x
else speed.x += acceleration.x
Now, this all works fine in this game. X and Y are handled independently, essentially making this a 1 dimensional problem.
In the game I am currently working on (top-down adventure), The problem is now 2d. If I handle the Axis seperatly, then I get a greater diagonal speed than either left or right so I need to handle them together.
Solving the problem with a hard "max speed" and a constant deceleration against the current angle of travel and speed works fine and is an easy solution, but again, I would prefer to be able to implement a sort of "soft" max speed. But I really can't figure out how I go about this. I thought about having an acceleration to change angle of travel after getting input, but this sort of results in a race car like behavior and not something on foot.
Any ideas how I can cort of check speed and then figure out how to change angle and resolve input?