Jump to content


Photo

AI Code War - An idea in progress..


  • Please log in to reply
20 replies to this topic

#1 tangibleLime

tangibleLime

    Lunatic

  • Global Moderators
  • 2520 posts
  • Version:GM:HTML5

Posted 04 April 2012 - 09:01 PM

I've had this idea floating around in my head for a while, and the recent idea Chronic had has re-sparked my interest. The concept is often called a Code War; in my specific version of this idea, a more suitable name would be "AI Code War". Now, this isn't some arena where we fling for-loops at each other. It would be a very structured, tournament-style competition.

The code war staff (consisting of myself and a few other handpicked people) will create an undisclosed, simple game. On the day of the actual event, we will publicly release the game. Each contestant (or team) would then make an AI to play the game autonomously. After the deadline (something around a day or two), all of the submitted AIs will play each other (1v1, 2v2, 3v3...) in a bracket-style tournament, eventually winding down to one winner. The games will be streamed live so both contestants and the general public can watch the AIs battle.

Some details would have to be worked out, such as how exactly contestants should program their AIs. It may be a good idea to simply encapsulate all coding and functionality to one object that the contestant will submit (this will be their entry). To have two AIs verse, we would then import both objects (both AIs) into an empty game source file, place them both in the game room, and run it.

What do you think? Questions? Comments?

EDIT: Just to note, I got this idea from a recent competition, though I didn't participate.
  • 15

#2 chance

chance

    GMC Member

  • Reviewer
  • 5758 posts
  • Version:GM:Studio

Posted 04 April 2012 - 09:21 PM

Some details would have to be worked out, such as how exactly contestants should program their AIs.

Sounds like a fun idea. +1 But I agree it would need structure/rules to make it fair (and possible to judge).

So for example, you could define a playable character, and the objective. And then competitors would write the code for the STEP event only (except for variable initialization in CREATION event). For more structure, you could even specify specific behaviors, and then let competitors program those.

But you've probably already thought about this. So I'm eager to hear more details.

EDET: tpeyos.

Edited by chance, 04 April 2012 - 09:27 PM.

  • 0

#3 NicroGames

NicroGames

    GMC Member

  • GMC Member
  • 296 posts
  • Version:GM:Studio

Posted 04 April 2012 - 09:25 PM

This sounds like it would be fun.
+1
  • 0

#4 tangibleLime

tangibleLime

    Lunatic

  • Global Moderators
  • 2520 posts
  • Version:GM:HTML5

Posted 04 April 2012 - 09:36 PM


Some details would have to be worked out, such as how exactly contestants should program their AIs.

But I agree it would need structure/rules to make it fair (and possible to judge).

Right, the game would be extremely structured. And just like a regular pre-existing game (chess, for example) the specific rules of that game will have to be followed (rooks move in straight lines, bishops move on diagonals, etc... though the actual game will be more interesting to watch than chess.) Most likely, it would be some sort of turn-based game as well. We'd also have limits on computation time per turn (something like 2,000ms). Thanks for the support!
  • 0

#5 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 04 April 2012 - 10:00 PM

Well, I'm all for this. I'm actually attempting to program an AI for a rather complex (but greatly simplified by me) turn-based board game. Still, it's very challenging..!
(whether or not I'll manage to enter.. is entirely another matter!)

I use to do something like this with AT-robots back even before I knew how to use GML. Although my creations were pretty shonky designed, and relied on a lot of hard-coded guesses, they performed pretty well in the tournaments I use to run them against of the other AI. ^_^
  • 0

#6 ziggler1

ziggler1

    GMC Member

  • GMC Member
  • 350 posts

Posted 04 April 2012 - 10:32 PM

What you could do to ensure none of the AI's perform illegal moves is to provide a list of functions of what the AI can do. Things like move_forward(), fire_weapon(), etc. It is simply up to the programmer to create an AI that uses the functions in an effective manner.

An AI loses automatically if it hangs in a while loop. :happy:
  • 0

#7 orange08

orange08

    Art Game Movement

  • GMC Member
  • 2194 posts
  • Version:GM:HTML5

Posted 04 April 2012 - 11:18 PM

This sounds awesome.

Just make sure both AI's have a lot of health so the fight is long and dirty.

Are coders allowed to make their AI camp?

Edited by orange08, 04 April 2012 - 11:36 PM.

  • 1

#8 tangibleLime

tangibleLime

    Lunatic

  • Global Moderators
  • 2520 posts
  • Version:GM:HTML5

Posted 05 April 2012 - 12:02 AM

What you could do to ensure none of the AI's perform illegal moves is to provide a list of functions of what the AI can do.

Yes, that's what I'm referring to when I talk about how they need to follow a certain set of rules. For each move, there is a set of valid moves that an agent can take. This set of moves can be included in the code of the program as to ensure standardization. Of course, we'll check manually to see if anyone is cheating ;) But in the general case, an object can call something like getLegalMoves() to return some array of moves the agent can take. It's then up to the programmer and his/her skills and knowledge of algorithms to be able to choose which move is best.

I do plan on releasing a few tutorials on this sort of programming (known as adversarial search in AI) before we start this event, if we end up going through with it.

As for camping, we won't disallow any strategy as long as it isn't cheating :) Though note that the game isn't going to be a complicated FPS or anything of the sort - it will most likely be a simple, tile-based, turn-based game, where the bulk of the programming problems are logical and algorithmic (the spirit of the competition).
  • 0

#9 makerofthegames

makerofthegames

    TV's busboy

  • GMC Member
  • 7292 posts
  • Version:GM:Studio

Posted 05 April 2012 - 12:02 AM

I wouldn't participate, but I'd watch the heck out of that. After streaming, straight to youtube. :turned:

On an actual useful note: ....Nah, I got nothin'.
  • 0

#10 Snail_Man

Snail_Man

    Level Builder

  • GMC Member
  • 857 posts
  • Version:GM8.1

Posted 05 April 2012 - 12:25 AM

Depending on what the game is like, I might participate. +1'd
  • 0

#11 JAk HAk

JAk HAk

    sepius fidelis

  • New Member
  • 713 posts
  • Version:GM:HTML5

Posted 05 April 2012 - 04:51 AM

Reminds me of the recent Google ANTS competition (aichallenge.org). Sounds like fun.
  • 1

#12 Swifty

Swifty

    Shadow

  • GMC Member
  • 362 posts
  • Version:GM:Studio

Posted 05 April 2012 - 09:56 AM

@tangibleLime - This sounds like a fantastic idea, I'd definitely be keen on participating. I remember doing something similar at an open day I attended at uni; It involved battle tanks and we had the lesson to figure out how to move/detect/fire etc and then we were pitted against each other. It was a lot of fun I've often thought about making something like it in the past, so the thought of having a community tournament is great.
Have you considered how the fighting would happen? Like shooting projectiles, with a set delay for firing?

Swifty

Edited by Swifty, 05 April 2012 - 10:13 AM.

  • 0

#13 RedOctober

RedOctober

    GMC Member

  • GMC Member
  • 117 posts
  • Version:GM:Studio

Posted 05 April 2012 - 10:07 AM

This reminds of me when I did some scripting on AOE2 AI. It's always fun to watch them kill each other. I'd love to do something along those lines again.
  • 0

#14 Druid TC

Druid TC

    Forever Floyd

  • GMC Member
  • 1578 posts
  • Version:GM8.1

Posted 06 April 2012 - 09:49 AM

Google runs one of these. And as for the idea, I would love to participate; I generally lack the commitment to follow a project through to the end, but I think I could manage if it's only an AI aspect.

Edited by Druid TC, 06 April 2012 - 09:50 AM.

  • 0

#15 chance

chance

    GMC Member

  • Reviewer
  • 5758 posts
  • Version:GM:Studio

Posted 06 April 2012 - 12:23 PM

On the day of the actual event, we will publicly release the game. Each contestant (or team) would then make an AI to play the game autonomously. After the deadline (something around a day or two), all of the submitted AIs will play each other (1v1, 2v2, 3v3...) in a bracket-style tournament, eventually winding down to one winner.

1-2 days is a pretty short submission period -- even compared to the 3-day Jam. I'm OK with it, but just wondering if there's a particular reason for keeping it so short.
  • 0

#16 Furritus

Furritus

    Just another Ferret

  • GMC Member
  • 272 posts
  • Version:GM8

Posted 06 April 2012 - 02:13 PM

it MUST be something simple like the ant thing. OR you can have an all you can eat glitch fest
  • 0

#17 YellowAfterlife

YellowAfterlife

    GMC Member

  • Global Moderators
  • 3490 posts
  • Version:GM:Studio

Posted 06 April 2012 - 04:17 PM

Didn't we have a similar event some years ago? Though I think that did not add development time constraints.
Can assume that it'll work this time too. Perhaps could be interesting to restrict 'access' of AI's on code level, meaning that it would not be possible 'cheat out of limit' even if trying (i.e. changes to X\Y position are overriden by movement to offset location).
  • 0

#18 tangibleLime

tangibleLime

    Lunatic

  • Global Moderators
  • 2520 posts
  • Version:GM:HTML5

Posted 06 April 2012 - 04:40 PM


On the day of the actual event, we will publicly release the game. Each contestant (or team) would then make an AI to play the game autonomously. After the deadline (something around a day or two), all of the submitted AIs will play each other (1v1, 2v2, 3v3...) in a bracket-style tournament, eventually winding down to one winner.

1-2 days is a pretty short submission period -- even compared to the 3-day Jam. I'm OK with it, but just wondering if there's a particular reason for keeping it so short.

We could make it longer. Though I'd still rather keep it somewhat short, just so people don't have all the time in the world to sit and brew on the subject and code.
  • 0

#19 Me the III

Me the III

    ...No.

  • New Member
  • 859 posts
  • Version:GM8

Posted 12 April 2012 - 02:39 PM

Didn't we have a similar event some years ago? Though I think that did not add development time constraints.
Can assume that it'll work this time too. Perhaps could be interesting to restrict 'access' of AI's on code level, meaning that it would not be possible 'cheat out of limit' even if trying (i.e. changes to X\Y position are overriden by movement to offset location).


Yeah, we did. It died before I actually had the chance to submit anything :P

That was a TDS environment, where it did indeed have strict restrictions on the bullets that could be fired (had to use the same image), health amount, etc. Really, I think that came down to feeling like a movement-optimization script more than anything else because it was rather strict.

Perhaps you could implement (this is just an idea) a system where you can "buy" the right to break certain rules, perhaps by bartering off other stats in return, like movement speed, defense, health points, etc. This would shake things up greatly, I feel. Instead of having a set amount of health and damage I could do, give the player a set amount of points they could point toward leveling up any stat, with some super-stat options, like the ability to fly or have more freedom with bullet design itself. The programmer would have to include what points they spent where when they present their creation.

  • 0

#20 tangibleLime

tangibleLime

    Lunatic

  • Global Moderators
  • 2520 posts
  • Version:GM:HTML5

Posted 12 April 2012 - 04:18 PM

Perhaps you could implement (this is just an idea) a system where you can "buy" the right to break certain rules, perhaps by bartering off other stats in return, like movement speed, defense, health points, etc. This would shake things up greatly, I feel. Instead of having a set amount of health and damage I could do, give the player a set amount of points they could point toward leveling up any stat, with some super-stat options, like the ability to fly or have more freedom with bullet design itself. The programmer would have to include what points they spent where when they present their creation.

Good idea! I haven't thought of that. It would certainly add a new dimension to the competition. It would also pave the way for more defined strategies. An easy relation I can make here is in Age of Empires II (and other RTS games, I'm sure) different civilizations have different bonuses which make different strategies more effective for different civilizations.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users