Zero-K icon indicating copy to clipboard operation
Zero-K copied to clipboard

AI start position broken

Open rlcevg opened this issue 11 years ago • 9 comments

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?

rlcevg avatar Jul 04 '15 22:07 rlcevg

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.

sprunk avatar Jul 05 '15 10:07 sprunk

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).

rlcevg avatar Jul 06 '15 09:07 rlcevg

#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?

rlcevg avatar Aug 06 '15 13:08 rlcevg

I think this can be closed now :)

Anarchid avatar Aug 06 '15 14:08 Anarchid

Tested single-player - works. Thanks.

rlcevg avatar Aug 06 '15 15:08 rlcevg

I'll expose the boxes to GameRulesParams and hopefully add an IsPosInBox call-in.

sprunk avatar Dec 18 '15 21:12 sprunk

Does this now work since the start box changes?

GoogleFrog avatar Jan 19 '16 14:01 GoogleFrog

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)

rlcevg avatar Jan 19 '16 15:01 rlcevg

Works for me

rlcevg avatar Feb 01 '16 10:02 rlcevg