rlcevg / CircuitAI

Spring RTS local native AI
GNU General Public License v2.0
18 stars 19 forks source link

Circuit AI places three mexes on one spot #106

Closed GoogleFrog closed 4 years ago

GoogleFrog commented 4 years ago

See https://github.com/ZeroK-RTS/Zero-K/issues/3824

rlcevg commented 4 years ago

https://github.com/ZeroK-RTS/Zero-K/issues/2032 Assumption: 1) some cases were solved by Lua, but not all and engine still allows it. 2) Engine IsPossibleToBuildAt() returns true. 3) UnitIdle (builder) and UnitFinished (mex) events were never sent for AI. In-engine CommandQueue repeats itself. 4) few nanoframes created at once (not sequentially)

rlcevg commented 4 years ago

20200310_031419_TitanDuel 2_104.0.1-1435-g79d77ca maintenance.zip chronology: [f=0016794] CBuilderCAI::GiveCommandReal for unitId=13702 - staticmex order at (808, 4456) [f=0016802] CBuilderCAI::GiveCommandReal for unitId=22445 - staticmex order at (808, 4456) [f=0017289] UnitCreated: id=8340 | defId=530 | x=808, z=4456 | builder=22445 - staticmex created [f=0017289] CBuilderCAI::GiveCommandReal for unitId=13702 - staticmex order at (808, 4456) CBuilderCAI::IsBuildPosBlocked == false instead of true as const CSolidObject* s = groundBlockingObjectMap.GroundBlocked(bi.pos); returns movable cloakraid instead of already created in this very frame staticmex [f=0017289] UnitCreated: id=28956 | defId=530 | x=808, z=4456 | builder=13702 - staticmex created [f=0017289] CBuilderCAI::GiveCommandReal for unitId=22445 - staticmex order at (808, 4456) same story again with CBuilderCAI::IsBuildPosBlocked == false: instead of staticmex-nanoframe function tests movable cloakraid [f=0017289] UnitCreated: id=10411 | defId=530 | x=808, z=4456 | builder=22445 - staticmex created

Too many actions for a single frame (from NETMSG_AICOMMAND).

If it's an issue with Build command issued on UnitCreated event then it's already fixed in f2. master: https://github.com/rlcevg/CircuitAI/blob/e00cf22a01de48ee24b4623906e9f35096ad4467/src/circuit/task/builder/BuilderTask.cpp#L332 f2: https://github.com/rlcevg/CircuitAI/blob/927f605632763d400443c52a8753d0a6a8f75349/src/circuit/task/builder/BuilderTask.cpp#L341

rlcevg commented 4 years ago

https://github.com/rlcevg/CircuitAI/commit/a1374fc94d73be83160d5601b7df35d08df852c5

sprunk commented 4 years ago

NB https://github.com/spring/spring/commit/4a97df4f98c3d9afcd9b21d4062e91d96b3a4da8