Author |
Message |
zylum
![](http://compsci.ca/v3/uploads/user_avatars/1689129126468091c334ee0.gif)
|
Posted: Tue Apr 11, 2006 12:09 am Post subject: 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.
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
engine.t |
Filesize: |
6.2 KB |
Downloaded: |
347 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
MysticVegeta
![](http://www.geocities.com/ohsoinsane/my_avatar.JPG)
|
Posted: Tue Apr 11, 2006 9:15 am Post subject: (No subject) |
|
|
too bad I sux0rz at trig, I would certainly try, the deadline is?
|
|
|
|
|
![](images/spacer.gif) |
Andy
|
Posted: Tue Apr 11, 2006 9:25 am Post subject: (No subject) |
|
|
why didnt we just do a robocode one for java? it's much easier.. and i have my bots already made
|
|
|
|
|
![](images/spacer.gif) |
codemage
![](http://usera.imagecave.com/codemage/codemage-small.gif)
|
Posted: Tue Apr 11, 2006 9:47 am Post subject: (No subject) |
|
|
If the AI routines are pulled into a procedure like so
code: | 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.
code: | loop
cls
update
draw
exit when upper (players) <= 1
delay (100)
playerai (1)
for i : 2 .. upper (players)
brownianAI (i)
end for
end loop | [/quote]
|
|
|
|
|
![](images/spacer.gif) |
beard0
![](http://ugray.be/compsci/silly.gif)
|
Posted: Wed Apr 12, 2006 12:36 pm Post subject: (No subject) |
|
|
May I suggest this change to the engine? What I've done is to save the procedure being used to control each bot as part of the player data. It should make it much easier to incorporate separate bot code for each bot.
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
engine.t |
Filesize: |
6.45 KB |
Downloaded: |
381 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
zylum
![](http://compsci.ca/v3/uploads/user_avatars/1689129126468091c334ee0.gif)
|
Posted: Wed Apr 12, 2006 9:23 pm Post subject: (No subject) |
|
|
yeah i admit its pretty shitty code ATM. i jsut wanted to know what you guys thought about the contest? how many people would be interested in doing it? if no one wants to do it then i dont want to waste my time coding up the actual game engine...
|
|
|
|
|
![](images/spacer.gif) |
beard0
![](http://ugray.be/compsci/silly.gif)
|
Posted: Wed Apr 12, 2006 10:52 pm Post subject: (No subject) |
|
|
I'd be willing to put in some time working on a bot. As MysticVegeta says, we'd need some kind of time-frame.
|
|
|
|
|
![](images/spacer.gif) |
zylum
![](http://compsci.ca/v3/uploads/user_avatars/1689129126468091c334ee0.gif)
|
Posted: Wed Apr 12, 2006 11:01 pm Post subject: (No subject) |
|
|
sounds cool. ill set a deadline as soon as i finish the interface... how about making it so that there are walls and stuff with a level editor so that each user can submit a level tailor made to their AI. or maybe that would be too complex for beginners..
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
[Gandalf]
![](http://compsci.ca/v3/uploads/user_avatars/189297994e4c716fec7f1.png)
|
Posted: Wed Apr 12, 2006 11:15 pm Post subject: (No subject) |
|
|
I'll participate, though I've been avoiding Turing for the past days I'm not completely reformed.
How exactly would the competition part work though?
|
|
|
|
|
![](images/spacer.gif) |
zylum
![](http://compsci.ca/v3/uploads/user_avatars/1689129126468091c334ee0.gif)
|
Posted: Wed Apr 12, 2006 11:25 pm Post subject: (No subject) |
|
|
we would simulate a bunch of battles. we'd have to decide how many people would be in each round... it could be a tournament style contest.. i dunno what do you guys think? im thinking i could get the engine done either tomorrow or friday... hopefully we could get a few trial submissions by saturday to test out the interface.
|
|
|
|
|
![](images/spacer.gif) |
beard0
![](http://ugray.be/compsci/silly.gif)
|
Posted: Thu Apr 13, 2006 12:43 am Post subject: (No subject) |
|
|
If you want to get some submissions for Saturday, I would definately suggest that the competition take place in one large "room" - without any walls. Also, you really need to have the competition interface down: what is allowed to be read; what actions can be taken; and how is each done, before we can start developping bots. Since you are talking about developping one aspect while we develop another, you need to layout the specifications.
Edit: Also, making a procedure leaves room for someone to make multiple moves in one turn - why not have each person make a function which returns an integer: 0 for shoot, 1 for move forward, 2 to turn clockwise, and 3 to turn couterclockwise for example
|
|
|
|
|
![](images/spacer.gif) |
zylum
![](http://compsci.ca/v3/uploads/user_avatars/1689129126468091c334ee0.gif)
|
Posted: Thu Apr 13, 2006 12:56 am Post subject: (No subject) |
|
|
thats a great idea! yes a function would be best. i'll keep that in mind when creating the interface
|
|
|
|
|
![](images/spacer.gif) |
ZeroPaladn
|
Posted: Thu Apr 13, 2006 9:15 am Post subject: (No subject) |
|
|
I would be willing to attempt to make a bot for the contest, just what are the parameters, and are there any restrictions to code size?
|
|
|
|
|
![](images/spacer.gif) |
alpe
|
Posted: Thu Apr 13, 2006 12:18 pm Post subject: (No subject) |
|
|
I would participate in this.
|
|
|
|
|
![](images/spacer.gif) |
zylum
![](http://compsci.ca/v3/uploads/user_avatars/1689129126468091c334ee0.gif)
|
Posted: Fri Apr 14, 2006 2:42 pm Post subject: (No subject) |
|
|
ok here is the engine...
your task will be to implement a procedure which alters a global variable command. you are to assign command a value between 1 and 4 inclusive.
1: shoots a bullet in the current direction you are facing at a velocity BULLET_SPEED
2: moves your bot forward PLAYER_SPEED units
3: turns your bot right ROTATION_SPEED degrees
4: turns your bot left ROTATION_SPEED degrees
to prevent users code from calling the update, initialize or makeCommad method, these methods have a password parameter which must match the code in the class. i will change this code before the contest so no one will have access to these methods. if anyone has a better solution to this problem please let me know.
the methods you do get access to are:
getPlayerData(i : int):Player -> 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!!!
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
engine2.t |
Filesize: |
6.9 KB |
Downloaded: |
329 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
|