Wall Bump Detect

Wall Bump Detect

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Wall Bump Detect

Post 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
Attachments
WallBump.gif
WallBump.gif (133.01 KiB) Viewed 1854 times
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Wall Bump Detect

Post by knorke »

There is callin UnitMoveFailed(unitID, unitDefID, unitTeam)
Idk if it works.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Wall Bump Detect

Post by knorke »

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Wall Bump Detect

Post 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.
Post Reply

Return to “Help & Bugs”