Closed pandaro closed 8 years ago
it has been driving me insane.
it could be some kind of duplication, like two ShardSpringUnit assigned to one unitID, or two behaviours assigned to one unit
this bug don't exist in the non shardSpringLuaAi version? maybe the insane target problem have the same origin?
i doubt it's the same origin, because the targetting problem has to do with two ShardSpringLua teams in the same game. this issue with abandoning construction happens regardless of enemy teams. but yes, they are both bugs only with the Lua AI
or two behaviours assigned to one unit
two time the same bhaviour? or two different behaviour that work at same time?
i cant understand how to self.constructing is not true... and in where is called taskqueuebehaviour:constructionBegun() that i cant see
two different behaviours working at the same time. actually i don't think this is happening, but i should test to rule it out. would just need to print to the console every time the behaviour inits, with its associated unitID.
yeah. the timing seems like constructionBegun()
is never called, so the unit just moves on to the next thing. but i see that buildsitehandler is removing the build plan rectangles and replacing them with "don't build here" rectangles, just like it should be doing.
i'm making some progress. constructionBegun() isn't being called because buildsitehandler doesn't recognize that it was planned by anyone. haven't found out why yet. i'm guessing it will be some decimal or rounding mismatches in coordinates
nope, it's a timing problem:
[f=0026089] unplanned building creation armmakr 4179 424, 296
[f=0026089] armcv 25378 successful build command for armmakr
[f=0026089] BuildSiteHandler Plans: armcv plans to build armmakr at 424, 296
somehow unit creation happens in the same frame as the build command, and before the build command is even issued? how is this possible?
okay this is bizarre to me. i had the AILoader gadget print when it received a build command and when a unit was created, and here are the results:
[f=0009370] armcv, 28129, received command to build, tawf001
[f=0009370] tawf001, 30635, created
[f=0009370] unplanned building creation tawf001 30635 224, 1712
[f=0009370] armcv 28129 successful build command for tawf001
[f=0009370] BuildSiteHandler Plans: armcv plans to build tawf001 at 224, 1712
how is the command received by the gadget before taskqueuebehaviour prints to the console that it sent the command?
i guess the whole thing is more real-time than i had imagined. i thought that in a lua gadget/widget, one callin was completed before another. apparently not. the solution is: taskqueuebehaviour needs to send buildsitehandler planned construction information before the build command is actually issued.
https://github.com/eronoobos/BABAR-The-Shardifant/commit/97faac4c8f860f309bb1816dd39e04f05e427827
(obviously reopen if this doesn't fix it)
so sorry, this commit don't fix. I try to help you but i must raise my level and search in the shard lua ai config,very complicated..
reopen please
what are the new circumstances for this bug happening in your tests? i can't reproduce the bug with the above commit
sailawai map air builders are urggggggggg
what are they doing? i'm trying sailaway, and the air builders seem to be fine? it's strange that taskqueuebehaviour starts progressing through the queue before the builder is out of the factory, but it doesn't matter
edit: it does matter, but it doesn't affect this issue
no wait, i just rebuild shardluaai by fallow the instructions and the error is alive, on sailaway the builders abbandoning build or a'm stupid, if you want, cause sometimes i'm dummyUnitMan you can suspend to work on this but leave the issues open, if im sure be close or open i update the issues
ok i have understand why your fix wont work for me: i rebuild all shard but your commit is not on my local if i use the guide here if i just paste copy from my local repo it work :+1: so close this one and open issues to fix 'guide dont work correctly?'
the guide probably doesn't work because https://github.com/eronoobos/BAR-Shard-LuaAI doesn't have an up-to-date submodule. in development it would be best to just pull in the new changes, or since you have a fork, https://help.github.com/articles/configuring-a-remote-for-a-fork/ https://help.github.com/articles/syncing-a-fork/
i noticed that some level 1 builders(specially lv1 air) abandon to build things after few moment, try with the sailaway map