PDA

View Full Version : "Robot" coding game.


Skorche
2006.02.23, 01:23 AM
For my algorithm class, we spent a few weeks programming "robots" to play a simple game. The point of the game was to have your robot capture buildings by tracing a loop around uncaptured buildings. If some of the buildings in the loop were already captured by an enemy, you didn't get any. The catch was that your robot was only told about the the grid squares directly to the sides and front, as well as a "distance sensor" that would tell you about the nearest wall in directly in front of the robot.

My team's robot was the only robot that mapped the area out and did pathfinding. For the second competition we added the ability for the robot to verify what areas it had captured and cull them from it search. As you can imagine, our robot pretty much trounced the competition and all the robots from the last 3 years that they've done this.

Is anyone interested in having a iDG robot competition? I know there are some clever people around here that could make a pretty mean robot.

DoG
2006.02.23, 07:06 AM
It'd be fun, but considering how far spread out people are, there is no chance to survive make your time.

unknown
2006.02.23, 07:53 AM
Yeah I wanna do this, kinda in the style of RoboWar?
It could be good, for great justice.

TomorrowPlusX
2006.02.23, 10:56 AM
This is what I work on, outside of my game:

http://home.earthlink.net/~zakariya/files/Wandering.png
http://home.earthlink.net/~zakariya/files/Quadruped.png

And a screenshot of the app:
http://home.earthlink.net/~zakariya/files/PANSISim.png

It uses an implementation of Rodney Brooks' subsumption architecture as a sort of layered "brain" network for locomotion, force feedback, obstacle detection, and simple path finding. I'm still working on it, and am building a real version (physical hardware) in which the brain, ultimately will run.

Here's a video:
http://home.earthlink.net/~zakariya/files/Clumsy_2.mov

Just wanted to put in my 2 cents. I've put a lot of time into that app/framework.

unknown
2006.02.23, 11:16 AM
Its a shame it's got acceleration spelled wrong :p but otherwise thats incredibly impressive!
It definitly doesn't look like the kind of program someone could knock together in a week or two :)

I think a robot codeing contest could be fun, but someone would need to build a robot arena a robot VM we can program, I'd be happy to make a prototype (simple top down 2d type thing).

Skorche
2006.02.23, 08:00 PM
The one we used for my class was written in Java. That's ready now if not too many people have grumbles about Java. (There's always Jython and JRuby)

If we wanted to write a new one, we could just run the robots as subprocesses and pipe the information to/from them. That way people could write their bots in any language they liked.

What do you guys think?

diordna
2006.02.23, 09:16 PM
I have grumbles about Java.

What if we went harcore RoboWar style and have everyone have limited "funds," and have a scripting language for the coding bit? (Lua, anyone? Blitzmax has a very easy Lua module.)

aarku
2006.02.23, 09:32 PM
If we wanted to write a new one, we could just run the robots as subprocesses and pipe the information to/from them. That way people could write their bots in any language they liked.
That'd be ideal.

-Jon

OneSadCookie
2006.02.23, 09:37 PM
We could even just take the 2005 ICFP contest directly if we want to use pipes:

http://icfpc.plt-scheme.org/

Skorche
2006.02.24, 12:59 AM
We could even just take the 2005 ICFP contest directly if we want to use pipes:

http://icfpc.plt-scheme.org/

Wow, that looks ridiculously complicated.

AnotherJake
2006.02.24, 01:22 AM
Its a shame it's got acceleration spelled wrong but otherwise thats incredibly impressive!
It definitly doesn't look like the kind of program someone could knock together in a week or two

I think a robot codeing contest could be fun, but someone would need to build a robot arena a robot VM we can program, I'd be happy to make a prototype (simple top down 2d type thing).
Well, it's got `codeing' spelled wrong, and a couple of words missing an apostrophe but otherwise it is a very impressive idea! :p

I like the piped environment idea. Against my better judgement I might consider entering a contest like this. But only if TomorrowPlusX isn't allowed to enter. ;) He could provide the host environment though!

unknown
2006.02.24, 09:50 AM
Well, it's got `codeing' spelled wrong, and a couple of words missing an apostrophe but otherwise it is a very impressive idea! :p
:lol: ok, I stand corrected. I've been doing lots of physics experiment reports and not enough coding ;) .

So, anyway I started on this this morning and i've got robots moving (in a straight line). I'm just going to start writing the language, My idea would be to have each robot's think function called in turn, which would execute 16 lines of code (or whatever the current standard for the game is), then they would all move shoot etc..

I'll make a simple asm style language first but if anyone knows of a way to make lua, ruby, Io or some more complete language execute only a set number of lines of code hooking that up to the robots would be interesting.

Edit: http://www.hoult.org/bruce/icfp2005/
ooh, now I see why Keith mentioned the ICFP. :p
Congrat's OneSadCookie.

diordna
2006.02.24, 06:08 PM
Am I the only one who things that writing a special language just for this is kind of silly?

Why limit the lines?

Skorche
2006.02.24, 07:17 PM
Am I the only one who things that writing a special language just for this is kind of silly?

Why limit the lines?

I completely agree. I want to create the best algorithm I can to do this. Not the best one that can be written in 30 lines of made up assembly language. That doesn't sound fun at all. If I were to do this again, I'd want to spend time making the algorithm good, not learning a new language or squeezing memory space.

If you guys want, I could write a dummy bot for the game we used in class that opens a pipe to a subprocess. That probably wouldn't take more than an hour to write. (Ewww, Java IO. *shudders*) Then there would be a runtime environment that is ready to go that could use any language.

BeyondCloister
2006.02.25, 05:54 AM
I completely agree. I want to create the best algorithm I can to do this. Not the best one that can be written in 30 lines of made up assembly language. That doesn't sound fun at all. If I were to do this again, I'd want to spend time making the algorithm good, not learning a new language or squeezing memory space.

It depends on what the aim of the contest is. If it is to simulate the programming of a robot with a very simple processor and limited memory then the code limits are entirely justifiable.

The sense of achievement at getting something like this working within such constraints is much greater then doing the same with unlimited resources.

whogben
2006.02.25, 01:51 PM
Id rather do a contest where the goal was to make the most human-like AI, as opposed to the most capable. IT would be judged by what percentage of people thought your bot was a human player in game, and what percentage thought it was a bot.

AnotherJake
2006.02.25, 02:43 PM
There is already a well-known [Carlos needs to change the forum color so you can see this link->]contest (http://www.loebner.net/Prizef/loebner-prize.html) for that.

Human ai is really hard to do. I've tried it using some genetic algorithms and artificial neural networks. That kind of contest is too tough for this crowd I suspect. But hey, that's just me. Maybe it'd work. I wouldn't enter that one though, because I've already tried and failed in my own endeavor (what would be the point of *proving* I can't do it?).

I'm still with the piped sub-process idea where you can write whatever program you want to control a robot in a given environment. Maybe the contest needs two stages: One where contestants compete to create the host environment with the graphics and everything, and the other where the contestants do the ai programming in the forked sub-process launched from the winner of the previous `host' contest.

unknown
2006.02.26, 06:38 PM
Maybe the contest needs two stages: One where contestants compete to create the host environment with the graphics and everything, and the other where the contestants do the ai programming in the forked sub-process launched from the winner of the previous `host' contest.

Sounds fun, I already have a head start but It doesn't mean I would win :p
Is anyone else thinking of doing this?

If the robots are all based on pipe's it wouldn't be too hard to have a player controlled over a network, its a possiblity for whogbens idea.

Skorche
2006.02.27, 12:10 AM
It depends on what the aim of the contest is. If it is to simulate the programming of a robot with a very simple processor and limited memory then the code limits are entirely justifiable.

The sense of achievement at getting something like this working within such constraints is much greater then doing the same with unlimited resources.

Maybe, but what's a "limited processor?" Even something "simple" like the Lego Mindstorms can run Java code. While 64k might be a tiny amount of memory, It's still enough to hold a couple thousand lines of java code and still have a couple Kb's left for data space.

The problem that I see with this is that no one will agree on how limited it should be. (doesn't that sound familiar...) A couple of years ago I might have agreed that it would be more fun to program a robot in 6502 assembly, but my tastes have changed since then. While interesting, I have no want to program at such a low level anymore.

My issue is that programming pretty much anything at such a low level is a challenge all its own that has nothing to do with AI programming. I want to try my hand at programming more AI, and I might want to try to write a minimalist implementation of an algorithm in assembly, but not at the same time.

kelvin
2006.02.27, 07:31 AM
This is what I work on, outside of my game:
Sweet! Takes me back to 1998 (http://www.macaddict.com/issues/1998/3/reviews/galapagos).
I need to get around to working on something like that.

PowerMacX
2006.02.27, 11:54 PM
This is what I work on, outside of my game:
Sweet! Takes me back to 1998 (http://www.macaddict.com/issues/1998/3/reviews/galapagos).
I need to get around to working on something like that.

You guys don't stand a chance against my army of Genetic Algorithm-Evolved Cybernetic Bugs From Hell (tm) (http://www.bugsimevo.glwb.info/bug20060227.jpg).

Or at least you won't, once they learn to walk properly :p

kelvin
2006.02.28, 03:50 AM
You guys don't stand a chance against my army of Genetic Algorithm-Evolved Cybernetic Bugs From Hell (tm) (http://www.bugsimevo.glwb.info/bug20060227.jpg).

Or at least you won't, once they learn to walk properly :p
Yeah, but if you keep the physics based on the framerate, eventually your gfx card will be so powerful it won't matter how slow they crawl!

Greywhind
2006.06.12, 01:21 PM
I realize this topic is out of date - but, as an alternate robot contest suggestion, I am a big fan of Robocode (www.robowiki.net). It's Java, and there's an active community for it, so any robot coding contest could potentially use Robocode.

Probably a useless reply, since this discussion died, but I thought I'd mention it.

ravuya
2006.06.12, 02:19 PM
Robocode is indeed totally awesome. :) We wrote a knock-off of it for one of my university CS courses that loaded custom assembly language.

Najdorf
2006.06.12, 03:00 PM
If you can find a cool, simple game to have robots play (possibly something original) I'd love to have an AI tournament.

I say everyone must produce a function that given the "state variables" outputs an action for the robot or soething. I say C as a language would make everyone happy.

EDIT: I never played robocode but guess it could be fun! though i guess many people have already kickass AI ready for it...

ravuya
2006.06.12, 03:35 PM
My AI is two steps below "short bus"; it just finds a corner and spins around in it, firing madly until someone gets in the way.

Bjoernke
2006.06.16, 08:35 PM
Hmm, i don't like c like languages :P

I wanted people to make a robot coding game in a contest last year (in RunRev), but the community is ridiculous small, so nothing ever came of it.
Then i tried to make my own, but like all projects i do, that died quickly.
I am more interested in how to make a robot coding game, then to code the robots, but maybe a code limit would allow me to finish something for a change...