GamePlay track‎ > ‎

Getting Started

This section describes how to get into:
• play with existing code
• where and how to write you own code
• where to ask question and get support
• how to submit your entry.

Update: the code is now also hosted on GitHub, at https://github.com/maelh/marioai . This is where you are likely to find the most updated version.
2. Play with it to get the feeling and inspiration!

$cd bin java ch.idsia.scenarios.Main and enjoy playing on a simple level with default options! Control keys are: arrows, a and s Remaining in bin directory compare yourself to several controllers coming with the software out of the box:$ java ch.idsia.scenarios.Main -ag ch.idsia.agents.controllers.ForwardAgent

java ch.idsia.scenarios.Main -ag ch.idsia.agents. controllers.ForwardJumpingAgent

Play together with the agents slightly more difficult level (-ld 1) with another seed (-ls 42) and of different length (-ll 256) and of different type (-lt 1)

\$ java ch.idsia.scenarios.Main -ag ch.idsia.agents. controllers.ForwardJumpingAgent -ld 1 -ls 42 -ll 256 -lt 1 & java ch.idsia.scenarios.Main -ag ch.idsia.agents. controllers.ForwardAgent -vlx 330 -ld 1 -ls 42 -ll 256 -lt 1 & java ch.idsia.scenarios.Main -ag ch.idsia.agents. controllers.ScaredAgent -vlx 330 -vly 290 -ld 1 -ls 42 -ll 256 -lt 1 & java ch.idsia.scenarios.Main -vlx 0 -vly 290 -ld 1 -ls 42 -ll 256 -lt 1

Check out for more advanced options available in src/ch/idsia/utils/ParametersContainer.java. Details and usage hints about the options are here.

At this point you are quivering from anticipation and desire to dip in and get closer to the source code and implementation details, right? Here we go!

All the agents referred so far could be found in src/ch/idsia/agents/ai package. Just go there and have a look at the getAction() method. Note! Unlike previous year you have to implement the  boolean[] getAction() method. Observations are provided by integrateObservation(...) of the Agent interface and example implementation of it you can retrieve either by extending the BasicAIAgent or by just copying that method from the latter. Shortly: this would save "couple" of computations ticks each time step for your Agent/Controller algorithm from gathering the observation information during the decision making process. As for clearing reference have a look at this code (taken from ch/idsia/maibe/tasks/BasicTask.java) to get the feeling of how it's inside.

Got a grasp about how it works! Great! When evaluating your agent you might think of speeding up the animation or even getting rid of the visualization at all. Here is our next section:

3. Speeding up the evaluations and visualization hints:

There are several ways to influence the visualization procedure.
Keyboard: during the animation process by pressing +/- increase or decrease the FPS. If the FPS value is > 99, visual component switches to mode with maximum possible FPS and shows FPS: \infty. Press V to stop the visualization, yet keeping the evaluation process alive. This is useful when MarioAI Benchmark is running at maximum possible FPS, you got the behavior of the agent, but you'd like to keep the 'honest' score and do not interrupt him, but just speed up. This approach will give the highest possible evaluation speed.
Command line parameters: -fps <int>, -vis <on|off>
java ch.idsia.scenarios.Main -ag ch.idsia.agents. controllers.ForwardAgent -fps 100

will run at a maximum FPS rate with visualization.

java ch.idsia.scenarios.Main -ag ch.idsia.agents. controllers.ForwardAgent -vis off

will run at highest evaluation speed without visualization and even instantiating the visual component. VisualComponent unlike the previous versions is completely detached from the evaluation procedures.

And here goes the corresponding CmdLineOptions procedures:
CmdLineOptions.setFPS(int), CmdLineOptions.setVisualization(bool)