codebattle-server
codebattle-server copied to clipboard
codebattle server
CodeBattle Server
CodeBattle designs for AI Battle. Like Google AI Challenge, Or Python VS Ruby.
You write your own AI (any language), connect to server, and battle with other AI.
There is an official server running at:
IP: 106.186.21.40
obPort: 11011
aiPort: 11012
What is obPort and aiPort?
The client as observer, to display the battle scene.
AI cannot createroom. createroom action is done by client.
In client start interface, Ip is the server Ip, Port is the obPort. obPort just used for the GUI Client.
Then GUI client create room, if everything goes well, you will see the roomid at the top of the battle scene.
Your AI will using this roomid to identify which room will join in. Two AI join the same room, then they can battle each other.
AI join in a room, send command to Server. So there should be a socket connection between AI and the server.
aiPort is used for AI connect to the server.
NOTE
you can check out the code to you local computer, and modify code, test functions, or do anything else.
And I will be happy if you send pull request to improve the Server.
Deploy
- git clone & cd project folder
- git submodule init
- git submodule update
- copy submodule/proto/*.proto src/
- ./rebar get-deps
- ./rebar compile
- modify server.config if necessary
- ./start.sh
Server Application Schema
-
cb_observer_sup
create observer for GUI clients -
cb_player_sup
create player for AI -
cb_room_sup
create room when GUI client ask for createrooom, and manager/transform data between observers and players
How to write AI
AI & Server communicate via google protobuf .
This project's proto files and details see here.
Also, there are some Explain & AI examples.
Client
Codebattle client is an Unity3d project. You can found it here. checkout it, and compile by yourself.
Or, Download the Windows Executable Files.