davechurchill / commandcenter

Starcraft AI Bot
MIT License
522 stars 112 forks source link

How do I play against my own AI ? #78

Closed mecharos closed 6 years ago

mecharos commented 6 years ago

This is not exactly an issue. I'm finally midway finishing my AI. By somehow follow UAlbertaBot wiki as suggested on the bottom page. And I want to test it, not against SC2 Computer / BOT. but, against a player (Non-AI) or at least I can test the AI my self. So, is there any documentation on what to do? or something to change on the code side. if there is one already and I'm somehow missing it, I'm sorry.

And Thank you in advance.

Archiatrus commented 6 years ago

You do it by adding an empty bot as player 1. You probably already noticed that mouse/keyboard inputs are not disabled while your bot plays. You can see an example here. It is not difficult.

One warning, though. You probably want to play on realtime = true. The problem is that then the bot sometimes behaves unexpected. Actions sometimes get executed late or never. You can try to mitigate this by using realtime = false and a sc2::sleepFor so that each onStep only ends 1/22.4 seconds after the last onStep finished. But then the game feels a bit sluggish for the human.

Other hints you might or might not know: alt+enter for fullscreen. For special hotkeys put the hotkey file in "Documents\StarCraft II\Hotkeys\". For faster question answers join the sc2ai discord ;)

davechurchill commented 6 years ago

Thank you for responding!