A* laggy

Started by
3 comments, last by jefferytitan 11 years, 8 months ago
I have an RTS with 50-128 workers that automatically start moving when you start a building construction. It works fine but then gets laggy as the units bump into each other and have to reroute. As they get closer to the building gets blocked off with no possible path to it. And I disable pathfinding after they're stuck with no way to the building.

But I must be doing something wrong because it's laggy.

I tried doing pathfinding in a separate thread but it crashes.

Any ideas?
Advertisement
I think somewhere it must be searching the whole map for a path to the blocked-off building each frame.
Do all the workers have to work on the building? Do you have to do a repath in A* when they bump into each other? If this isn't grid-based, is local steering an option?

You haven't told us enough about your situation for us to help.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Never mind, I'm just going to mod the Spring RTS engine.
Probably the paper below covers what you want:
http://www.cs.ucl.ac.uk/staff/D.Silver/web/.../coop-path-AIWisdom.pdf

Essentially search from the shared destination back to the individual workers, and book time slices so workers co-operatively avoid each other. Hope that helps!

This topic is closed to new replies.

Advertisement