Skip to content

yueyoum/codebattle-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeBattle Server

ShowCase youtube, youku

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.

clientstart

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

  1. git clone & cd project folder
  2. git submodule init
  3. git submodule update
  4. copy submodule/proto/*.proto src/
  5. ./rebar get-deps
  6. ./rebar compile
  7. modify server.config if necessary
  8. ./start.sh

Server Application Schema

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.

About

codebattle server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages