GithubHelp home page GithubHelp logo

synesso / aichallenge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aichallenge/aichallenge

4.0 4.0 1.0 8.71 MB

AI Challenge

Home Page: http://ai-contest.com/

C# 1.20% PHP 23.49% C++ 0.92% C 0.82% OCaml 1.72% Ruby 0.70% D 0.78% Java 19.71% CoffeeScript 0.64% Shell 0.38% Perl 0.93% Scala 0.85% JavaScript 11.36% Common Lisp 1.09% Go 1.61% Python 33.79%

aichallenge's People

Contributors

a1k0n avatar abmatgit avatar aerique avatar aeter avatar amstan avatar captjumper avatar coastwise avatar danielvf avatar dstufft avatar flagcapper avatar garoth avatar hbhasker avatar j3camero avatar janzert avatar jmcarthur avatar lavalamp avatar lundgren avatar matmarex avatar mcleopold avatar mleise avatar naktibalda avatar olexs avatar sarahpid avatar sigh avatar sir-macelon avatar stephen-smith avatar synesso avatar teuneboon avatar tjc avatar zannick avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gersongroth

aichallenge's Issues

A* pathfinding for ants

Ive implemented A* pathfinding before in Java and are thinking to port
to Scala. Hopefully I can do that, or at least start, on Monday
evening.

A* gives high quality pathing at some memory cost
[http://theory.stanford.edu/~amitp/GameProgramming/]. Id be inclined
to try that out and see if the resource demands are a problem. If the
ants are making local moves (to a nearby location), the paths are
short, keeping the CPU & mem costs down.

So maybe think about what a simple pluggable pathfinder interface
might look like, so we can vary the impl easily?

abstract class PathFinder(board: Board) {

def findPath(start: Tile, end: Tile): Seq[Tile]
}

-Ben

Abstract bot behaviours

So, we discussed this a bit last night, but I wanted to get it down on here.
AI bot parts:

  1. General library functions, such as path-finding, find-nearest-X.
    Probably apply to single ants.

  2. Basic strategies for generating orders; eg. explorer, ant-hunter,
    food-hunter, random moves.
    Should probably apply to groups of ants.

  3. Supervisor -- watches the board and picks groups of ants and
    applies strategies to them.
    ie. A simple one might be along these lines:

supervisor(game) :Strategy = game.turn_number match {
   case 0 to 10 => explorer
   _ => game.enemy_ant_count match {
       case many => defensive
       case few => offensive
   }
}

Although I'd rather be using a heuristic than nested match blocks.
I'd then like to be able to adjust the heuristic's parameters via
run-time parameters, so we can try some genetic development.

As discussed, we want to keep things running on the same APIs, so
other supervisors or strategies can be substituted in.

Cheers,
Toby

HunterBot crashes with illegal move on turn 3.

Oh, but note that the Scala bot issues an invalid order on turn 3 that crashes the game.
It moves an ant, but then tries to move the same ant to the same destination again the next turn, and only on the next turn would it recognise that it's now moved.

ie.

o 63 45 n
go
o 63 45 n
go
o 62 45 n
go

I'm pretty sure this is because for some reason we are emitting 'go' twice at the start, instead of just once.. because we don't recognise the initial setup ("ready") phase.

-Toby

HunterBot specs

HunterBot needs specs. It may blow up inside a real aichallenge engine.

Include packages

Put packages in the source. Modify SBT target for ai-submission to flatten out all packages and imports before zipping.

Starter pack should be instantly submittable

Starter pack current is a full SBT project. But actually they expect you to simply upload flattened sources in a zip. They even instruct the contestant to upload the downloaded zip without modification.

cache water tiles

water tiles don't seem to be always updated. cache them when found (they never change)

Cache preferred path for ant between turns.

In the game where I used A_, I cached the
current orders associated with each agent, include paths for move
orders. Each turn, I always evaluated *whether_ the orders need
re-evaluation, but only recomputed the orders & paths themselves if
the current orders were unsatisfactory. This might be because:

  • An enemy ant closer than X units away has moved/appeared/disappeared
  • A nearby item of food has appeared/disappeared

So AI & pathfinding isnt necessarily a per-turn computation.

-Ben

sbt task to run bot

create an sbt task to run the starter bot ala:

./playgame.py -r 1 -j -o viewer -t 100 --seed 42 -m maps/random4.txt "python bots/python/HunterBot.py" "scala -classpath bots/scala/target/scala_2.8.1/classes/ HunterBot" "scala -classpath bots/scala/target/scala_2.8.1/classes/ HunterBot" "scala -classpath bots/scala/target/scala_2.8.1/classes/ HunterBot"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.