
-----------------------------------
zylum
Tue Apr 11, 2006 12:09 am

Turing bot contest!
-----------------------------------
this is sort of similar to all those other robot contests but cheaper and in turing. i have created a rough engine to demonstrate the basic structure of the contest. basically you can have a number of robots playing at a time. you are to code a procedure which controls your bot to destroy the enemies. the last bot standing wins.

at the moment that are three commands that you can use. these include:

shoot(p : int) which shoots a bullet in the current direction you are facing. 

move(p : int) which moves you PLAYER_SPEED units forward in the direction you are facing.

rotate(p, d : int) which rotates your bot d degrees. 

in each case p represents the player number.


you also have access to a number of constants which include:

const SHOOT_DELAY := 20
const DAMAGE := 20
const PLAYER_SPEED := 2
const PLAYER_ROTATION := 10
const PLAYER_RADIUS := 12
const BULLET_SPEED := 3
const BORDER := 20

these are all fairly self explanitory.

also you have read only access to bullet and player data.

well thats basically it... here is a demo with 5 bots which are quite dumb.. they use random brownian motion and shoot whenever they can..

so what do you guys think? for the future i was think of adding levels with walls and such and maybe even team play.

-----------------------------------
MysticVegeta
Tue Apr 11, 2006 9:15 am


-----------------------------------
too bad I sux0rz at trig, I would certainly try, the deadline is?

-----------------------------------
Andy
Tue Apr 11, 2006 9:25 am


-----------------------------------
why didnt we just do a robocode one for java? it's much easier.. and i have my bots already made

-----------------------------------
codemage
Tue Apr 11, 2006 9:47 am


-----------------------------------
If the AI routines are pulled into a procedure like so

proc brownianAI (p : int)
    if players (p)._shootDelay = 0 then
        shoot (p)
    elsif Rand.Int (0, 1) = 0 then
        move (p)
    else
        rotate (p, (Rand.Int (0, 1) * 2 - 1) * PLAYER_ROTATION)
    end if
end brownianAI

...the player routines can be inserted a little easier.  ie, here I've substituted my own proc for player 1 in the main loop.

loop
    cls
    update
    draw
    exit when upper (players)   returns the data for player 'i' of type Player
getBulletData(i : int):Bullet  ->  returns the data for bullet 'i' of type Bullet
numAlive:int  -> returns the number of bots which are still alive
getNumPlayers  ->  returns how many players there are in the battle (both alive and dead)
getNumBullets  ->  returns how many bullets there are on the screen (only alive)

where i have comments, just replace them with the appropriate code... you can declare your own variables and such, just dont mess with the other vars... if anyone has any better idea how to make this more secure let me know...

well thats pretty much it. lets see some submissions!!!

-----------------------------------
zylum
Fri Apr 14, 2006 7:54 pm


-----------------------------------
wait... forget that engine.. i have an idea for a better way of implementing it. the basic idea will be the same so if you want to test your AI you can still do so with engine2

-----------------------------------
alpe
Sat Apr 15, 2006 2:28 pm


-----------------------------------
Is there a way to access which player number one's procedure is acting on behalf of?  Maybe that could be inputted as a parameter. 

Hopefully I'm not missing something obvious in your game engine code.

-----------------------------------
zylum
Sat Apr 15, 2006 3:23 pm


-----------------------------------
i dont quite understand what you mean... can you elaborate?

also, my new idea isnt working out so well so engine2 is what we will use for now unless someone comes up with a better idea to implement it...

-----------------------------------
alpe
Sun Apr 16, 2006 12:39 am


-----------------------------------
How would you know which player's data is your own?  Like if I'm looping through each player's set of info, how would a bot determine if the info was its own?

(I hope that makes more sense?)

-----------------------------------
zylum
Sun Apr 16, 2006 12:59 am


-----------------------------------
oh yes.. perhaps i should have mentioned that  :oops:  your proc should have one parameter of type int. when your proc is called, it will be passed your bots number.

-----------------------------------
[Gandalf]
Fri Apr 21, 2006 4:01 am


-----------------------------------
Are we giving up on this contest (like usual :(), or is it still going to happen?  It looked very promising...  I can say I'll enter for sure since I've already created a fairly crappy AI.

-----------------------------------
zylum
Fri Apr 21, 2006 1:08 pm


-----------------------------------
im still not satisfied with the contest engine... but if you guys dont have a problem with it then its fine with me..

-----------------------------------
ZeroPaladn
Fri Apr 21, 2006 1:22 pm


-----------------------------------
ARGH! damnit im completely clueless on how to make a bot. sorry, but untill i can get better, im out.  :cry:
