Hacker News new | ask | show | jobs
by jbert 4459 days ago
Would it work to have a different response to collision, namely to apply a reverse of your last step? (A full reverse or partial).

There might still be corner cases, but it would seem to resolve the described issue, since irrespective of where you think the other player is, if you both reverse your motion you should disengage.

I can see 3-body problems being more problematic, but that's probably also the case with the original code.

1 comments

With their example code if lonestar is walking to the right and froggy precives that they land on the right side of lonestar, but lonestar precives that they landed on the left of them, then they would both slide to the left if they just undid their last step.
Yes, and that would make it so they would not collide anymore, so I'd be interested to know why they did not use that solution. Probably it would also give a wrong feel in gameplay.
If they both slide to the left then they would still be in a collision.
Okay, because of lag they might have to retrace more than one step. But eventually, they would have gone "back in time" enough to disentangle, regardless of their direction.