Page 1 of 1

Wall Bump Detect

Posted: 14 Jun 2013, 05:39
by zwzsg
Sometimes, units bump into walls and don't realize it.

I used to detect this situation in KP's Lua AI via Spring.GetUnitVelocity being zeroes.

However, recently, Spring behavior changed, and units bumping into walls now wriggle in place, with an instant velocity that can sometimes be as high as the top speed.

This is annoying, because it prevents AI from detecting that the units are not doing anything and should be given a new order.

How to fix?

I thought about checking that a rounded sliding mean value of position remains constant, but that would be overly complicated.

Image

Re: Wall Bump Detect

Posted: 25 Jun 2013, 17:04
by knorke
There is callin UnitMoveFailed(unitID, unitDefID, unitTeam)
Idk if it works.

Re: Wall Bump Detect

Posted: 25 Oct 2013, 18:18
by knorke

Re: Wall Bump Detect

Posted: 25 Oct 2013, 20:14
by zwzsg
Now, instead of vibrating on the spot, they move back and forth with a much wider amplitude (like a hundred pixels) along the cliff edge.