AI start position broken
ZK denies attempts of ai to choose its position (via Game::SendStartPosition) and throws them all in one spot (middle of startbox). start_boxes.lua to blame?
Yes, see https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaRules/Gadgets/start_boxes.lua#L96
The AllowStartPosition call-in only receives a player ID to identify a team and gives all bots ID == 255 so it is impossible to discern which team the bot is from (and thus which box it belongs to).
As an alternative, bots could be allowed to place anywhere. The main downside is that bots would be allowed to cheat this way. Bots already can cheat so I guess that's alright, and the change would also benefit ones that play fair.
Ok, thanks. I think solution #906 is the best atm.
Probably proper engine-side solution would be to pass teamID in every lua-callin where playerID present (breaks backward compatibility), or refactor AI handling so it will have playerID (amount of work and new bugs unidentified).
#906 awaits its hero who'll lift his mighty finger without a shadow of regret and push the damn merge button! Or is there another opinion on the topic?
I think this can be closed now :)
Tested single-player - works. Thanks.
I'll expose the boxes to GameRulesParams and hopefully add an IsPosInBox call-in.
Does this now work since the start box changes?
I have no idea how to test it atm. Tried on BETA TEST / Iridium / 100.0 Terra 1 Zero-K test-10483-95040dd But had issues with UI (no UI on start, but only after /luaui reload) and 9/10 Circuits were dead (probably new-modular-commander related)
Works for me