Remove order latency checks from BaseBuilderQueueManager.

This commit is contained in:
Paul Chote
2021-08-24 14:03:35 +01:00
committed by teinarss
parent 8a587ddeab
commit 52b597d5d2
2 changed files with 3 additions and 4 deletions

View File

@@ -78,8 +78,8 @@ namespace OpenRA.Mods.Common.Traits
public readonly int StructureProductionInactiveDelay = 125; public readonly int StructureProductionInactiveDelay = 125;
[Desc("Additional delay (in ticks) added between structure production checks when actively building things.", [Desc("Additional delay (in ticks) added between structure production checks when actively building things.",
"Note: The total delay is gamespeed OrderLatency x 4 + this + StructureProductionRandomBonusDelay.")] "Note: this should be at least as large as the typical order latency to avoid duplicated build choices.")]
public readonly int StructureProductionActiveDelay = 0; public readonly int StructureProductionActiveDelay = 25;
[Desc("A random delay (in ticks) of up to this is added to active/inactive production delays.")] [Desc("A random delay (in ticks) of up to this is added to active/inactive production delays.")]
public readonly int StructureProductionRandomBonusDelay = 10; public readonly int StructureProductionRandomBonusDelay = 10;

View File

@@ -111,8 +111,7 @@ namespace OpenRA.Mods.Common.Traits
// Minimum should not be negative as delays in HackyAI could be zero. // Minimum should not be negative as delays in HackyAI could be zero.
var randomFactor = world.LocalRandom.Next(0, baseBuilder.Info.StructureProductionRandomBonusDelay); var randomFactor = world.LocalRandom.Next(0, baseBuilder.Info.StructureProductionRandomBonusDelay);
// Needs to be at least 4 * OrderLatency because otherwise the AI frequently duplicates build orders (i.e. makes the same build decision twice) waitTicks = active ? baseBuilder.Info.StructureProductionActiveDelay + randomFactor
waitTicks = active ? 4 * world.OrderLatency + baseBuilder.Info.StructureProductionActiveDelay + randomFactor
: baseBuilder.Info.StructureProductionInactiveDelay + randomFactor; : baseBuilder.Info.StructureProductionInactiveDelay + randomFactor;
} }