Robot player tournament framework

Place all meeting requests / announcements here...
Post Reply
Pac-Man
Private First Class
Private First Class
Posts: 15
Joined: Sat Apr 26, 2008 7:49 am

Robot player tournament framework

Post by Pac-Man » Fri Jun 14, 2013 8:43 am

Short version
I made a ServerSidePlayer framework which means you can compile some robots then load and unload them on the map dynamically in a plugin. No support for map objects, but basically for the first time in years it is viable to run a lagless easy-to-program robot tournament for a simple map e.g. 2-shot default variables with all players inside a ring (with ricochet). See live demonstration of my optimal-shooter-training-bot project at 205.185.126.195:5154 (private server) which uses the API.

Useless example (see attached API which is Public Domain):

Code: Select all

void ServerSidePlayer::frameUpdate(double /*dt*/) {
  static bool forward = false;
  if (forward)
    in.tryMove(1, 1);
  else
    in.tryMove(-1, 1);
  float r = (float) rand() / RAND_MAX;
  if (r < 0.05) {
    forward = !forward;
    in.tryShoot(); // API won't actually let you shoot as many bullets as you want
  }
}
To my knowledge, less than 10 people have ever been interested in having a robot tournament. If you are genuinely interested and have at least two of the necessary (sufficient time, some ability in C or C++, math) then contact me and we can discuss. Personally I'm pretty sure no one that I don't already know of (which is only 1 other person who is busy) has a qualified interest, but if someone does front up I'm even willing to help them because it is a lot of work to get anything clever working. That said, this opportunity is about implementing nice ideas and writing a kick-ass robot, not "learning by example".

Or if you know anyone who might be interested please ask them.

Aside: I guess you could propose other crazy ideas if you're interested in making them happen. For example I imagine it's quite achievable to write a parser that generates a robot using a simple language, like:

Code: Select all

Start:
Forward 3 25.0 # 3 seconds at full speed 25 units per second
Delay 1 # Pause 1 second
Turn 1 90.0 # Turn 90 degrees over 1 second
If random < 0.4
  Goto Start
Else
  Teleport 0 0 0
  Shoot 0 90 180 270 # Shoot in 4 directions
...
I made this up randomly but the point is you could have a simple language that map-makers can grasp and use it to generate robots that have some predefined behaviour on a map (for the purpose of acting as targets or obstacles or Ghosts on a Pacman map etc). Obviously if you want it to react to players as well, that's a different story.
Attachments
api_data-1.h
Public Domain: Available data for robot
(1.34 KiB) Downloaded 123 times
ServerSideBotApi-1.h
Public Domain: The robot class
(1.04 KiB) Downloaded 132 times
Last edited by Pac-Man on Sat Jun 15, 2013 3:06 am, edited 2 times in total.

User avatar
blast
General
General
Posts: 4732
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Robot player tournament framework

Post by blast » Fri Jun 14, 2013 11:11 am

What license are these files released under?
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

mr64bit
Private First Class
Private First Class
Posts: 89
Joined: Fri May 06, 2011 4:58 pm
Location: Hang on, let me get a map...
Contact:

Re: Robot player tournament framework

Post by mr64bit » Fri Jun 14, 2013 2:59 pm

Wow, the bot must he a hero, it can't even die!
---mr64bit

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Re: Robot player tournament framework

Post by JeffM » Sat Jun 15, 2013 3:41 am

actually bz robots is used in schools to teach AI so this is not a new concept

the files you have posted are somewhat useless ( they include headers you did not provide).

How much work did you do to complete the server side bot API in bzfs?

Pac-Man
Private First Class
Private First Class
Posts: 15
Joined: Sat Apr 26, 2008 7:49 am

Re: Robot player tournament framework

Post by Pac-Man » Sat Jun 15, 2013 5:40 am

I'm aware of that bzrobots and other projects, unfortunately they can't really be used.

The files are useless, it's just to show someone what it's like in case they're not sure whether anything is achievable. My post is about finding interested persons, which I doubt will happen which is why this isn't a "tutorial". Also because I'm not intending to release anything if no one wants to use it.
JeffM wrote:How much work did you do to complete the server side bot API in bzfs?
I wrote it over one or two weeks. In terms of work, more than half of it is copying/pasting the network protocol actions. The other part is writing physics simulation (incomplete - I didn't do collision detection yet because I didn't need it for my project) and a world event manager that updates bzfs' data.

So basically I used a hacky approach because I knew it'd be doable and I'd actually get a result. Alternative seemed to be to massive refactoring like in bzflag 3.0's clientBase. Personally I didn't think it was possible.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Re: Robot player tournament framework

Post by JeffM » Sat Jun 15, 2013 6:10 am

you do know we actually have a server side bot API already right? it just doesn't do driving, shooting, and dying. Our goal was to do no networking code for bots at all and just let them update the server state.

Pac-Man
Private First Class
Private First Class
Posts: 15
Joined: Sat Apr 26, 2008 7:49 am

Re: Robot player tournament framework

Post by Pac-Man » Sat Jun 15, 2013 6:51 am

JeffM wrote:you do know we actually have a server side bot API already right? it just doesn't do driving, shooting, and dying. Our goal was to do no networking code for bots at all and just let them update the server state.
I was aware of it and I couldn't see what the incomplete code was getting at.

From your comment it is starting to make sense - the bots can do whatever a plugin tells them to do (which makes sense in terms of flexibility). But if you want a bot that conforms to the physics the burden is on the plugin. If you wanted object awareness like with autopilot...

User avatar
blast
General
General
Posts: 4732
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Robot player tournament framework

Post by blast » Sat Jun 15, 2013 11:24 am

Pac-Man wrote:But if you want a bot that conforms to the physics the burden is on the plugin. If you wanted object awareness like with autopilot...
The goal was to have a client logic library that both the client and the server shared. The 2.99.x codebase had the start of such a thing.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Re: Robot player tournament framework

Post by JeffM » Sat Jun 15, 2013 6:22 pm

I would like to see your code to see how you implemented it again.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests