ꙮ 🡺 @uxio@cybre.space utilise witches.town. Vous pouvez læ suivre et interagir si vous possédez un compte quelque part dans le "fediverse".

my space ship children are oscillating and I can't get them to stop...

@mickmaus and the trouble with spacedamping is that it evaporates so quickly.

@oneiro they've been painting their ships purple and teal and i dont think they give a fuck about the rules no more witches.town/media/nJfHymI4UE9

@mickmaus are you making a follow controller? i don't have much experience with gamedev, but i know some controls if that'd be useful :p

@oneiro yeah, they're supposed to slow down and stop once they get 'bored' of following, but for some reason they oscillate?

if their current motion vector is > 1 they push controls to the opposite of the vector, so you'd think at some point they'd be moving slower than 1? Their max speed is 2 anyways?

ꙮ 🡺 @uxio@cybre.space @oneiro

@mickmaus hmm, I don't quite understand the framing of your scalar motion vector, but a guaranteed-stable solution is to have them be pushed towards the current position of the target by a PD controller, where the force = Kp * (current distance) + Kd * (change in distance since last frame)

@mickmaus if that's too robotic, adding an integral gain will make it smoother

@oneiro Ack, figured it out. the AI were leaving their control vector on whatever it was the last frame before they decided they were done driving! so they kept accelerating, and would go over the speed limit and try and slow down the opposite direction