Throttle the issuing of orders by the AI.
To prevent the AI generating lag spikes by issuing too many orders in a single tick, it is now limited in how many orders can be issued per tick. Extra orders are queued. This allows the performance hit of issuing multiple orders to be spread out over several ticks.
This commit is contained in:
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.AI
|
||||
{
|
||||
var loc = RandomBuildingLocation(squad);
|
||||
foreach (var a in squad.Units)
|
||||
squad.World.IssueOrder(new Order("Move", a, false) { TargetLocation = loc });
|
||||
squad.Bot.QueueOrder(new Order("Move", a, false) { TargetLocation = loc });
|
||||
}
|
||||
|
||||
protected static CPos RandomBuildingLocation(Squad squad)
|
||||
|
||||
Reference in New Issue
Block a user