My entry (Video)

66 views
Skip to first unread message

RobinB

unread,
Aug 5, 2009, 12:17:11 PM8/5/09
to Mario Competition
Hey Everyone!

I thought I'd share my current progress with all of you. I've recorded
a particularly good run of my AI and put it on youtube:
http://www.youtube.com/watch?v=0s3d1LfjWCI
The red line is the planned path, runs (almost - still optimizing) in
real-time.

Enjoy :-)

tetha

unread,
Aug 5, 2009, 1:09:02 PM8/5/09
to Mario Competition
Hi,
This looks very impressive :)

Are those lines edited into the video, or are they output inside the
simulation itself? If they are, do you care to point me into the right
direction to draw them? They certainly look helpful for deubgging
purposes :)

Regards,
tetha

Robin Baumgarten

unread,
Aug 5, 2009, 1:23:13 PM8/5/09
to mariocom...@googlegroups.com
Hi tetha,

They've been hacked into the environment by me ;)
If you'd like to replicate a similar behaviour, here's what I did:

In ch.idsia.mario.engine.LevelScene.java, put something like this:

        g.setColor(Color.RED);
        for (int i = 0; i < 399; i+=2)
        {
                g.drawLine(GlobalOptions.Pos[i][0] - xCam, GlobalOptions.Pos[i][1] - yCam,
                    GlobalOptions.Pos[i+1][0] - xCam, GlobalOptions.Pos[i+1][1] - yCam);
        }       

into the render() function. I placed it immediately after this line:

layer.renderExit0(g, tick, paused?0:alpha, mario.winTime==0);

You'll need to define GlobalOptions.Pos yourself, too, eg.: public static int[][] Pos = new int[400][2];
In your code, you put this:

                if (debugPos < 400)
                {
                    GlobalOptions.Pos[debugPos][0] = (int) your-mario-x;
                    GlobalOptions.Pos[debugPos][1] = (int) your-mario-y;
                    debugPos++;
                }
                advanceStep(action);
                if (debugPos < 400)
                {
                    GlobalOptions.Pos[debugPos][0] = (int) your-mario-x;
                    GlobalOptions.Pos[debugPos][1] = (int) your-mario-y;
                    debugPos++;
                }

Note that it's probably not as simple as it looks to implement your simulation function. It might be easier to just write a reactive agent that does not plan ahead at all or more than a couple of ticks (especially with little remaining time). However, as you've written you can use it for any debugging purposes.
Also, don't forget to remove it before you submit your solution, the competition environment will most likely crash your bot otherwise.

hth,
Robin

2009/8/5 tetha <har...@freenet.de>

tetha

unread,
Aug 5, 2009, 2:28:12 PM8/5/09
to Mario Competition
Hi,

thank you. I'll see if I replace my simple console-spam of the world
of my agent with this.

I also decided to hop on the train of doing videos, and here it is:

http://www.youtube.com/watch?v=Ym6Z6zgxhuE

I admit, it is far less impressive than the A*-solution, but I
consider it pretty neat for around 4 hours and around 100-200 lines of
messing around. This guy uses emergent behaviour with two very basic
behaviours (jump over obstacles and jump over gaps) and I'm quite
curious how good this agent can get with a sufficiently large set of
rules :)

Greetings,
tetha

Jesse

unread,
Aug 5, 2009, 3:42:28 PM8/5/09
to Mario Competition
As input for the A* planning do you only use the 22 by 22 grid of
sprites that they provide from the observer object. Those positions
seem too inaccurate to get the level of precision for dodging your AI
seems to have.

It looks sweet, it is more or less what I wanted to do, but I just
started yesterday.

Robin Baumgarten

unread,
Aug 5, 2009, 3:51:41 PM8/5/09
to mariocom...@googlegroups.com
It uses the exact positions of enemies, which I got by hacking the interface (cough), but those values will be made available officially by Julian soon (see the other thread about that).

Robin

2009/8/5 Jesse <jes...@gmail.com>

Jesse

unread,
Aug 5, 2009, 3:54:33 PM8/5/09
to Mario Competition
hehe, yeah it definitely shows. They have 13 days to implement that
and for you to use their legit version for the first competition. I
thought about hacking that together as well, but I figure its more of
the challenge to only use what is given. Again nice job.


On Aug 5, 12:51 pm, Robin Baumgarten <robin.baumgar...@gmail.com>
wrote:
> It uses the exact positions of enemies, which I got by hacking the interface
> (cough), but those values will be made available officially by Julian soon
> (see the other thread about that).
>
> Robin
>
> 2009/8/5 Jesse <jesf...@gmail.com>

Mark Srebro

unread,
Aug 5, 2009, 4:06:55 PM8/5/09
to Mario Competition
Haha ya just a tiny bit obvious ;) but seems required to get that
kinda precision I wish those values were available legit through the
observer. As I'm more inclined like Jesse to keep the code base status
quo rather than expecting them to be there.

Julian Togelius

unread,
Aug 5, 2009, 6:00:00 PM8/5/09
to mariocom...@googlegroups.com
Wow, this looks really impressive!

And it reminds me that I've forgotten to set any time limit (how much
time the agent can take per time step) for competitors. This was a
problem in the first two car racing competitions, when some entries
took ages to evaluate... Now is a bit too late to set a steep limit
for this, but let's say the entry has to run at least in real-time.

Julian

2009/8/5 RobinB <robin.ba...@gmail.com>:
--
Julian Togelius
Assistant Professor
IT University of Copenhagen
Rued Langgaards Vej 7
2300 Copenhagen S
Denmark
jul...@togelius.com
http://julian.togelius.com
+46-705-192088

Henrique Vilela

unread,
Aug 5, 2009, 6:34:11 PM8/5/09
to mariocom...@googlegroups.com
I just started with this (I downloaded it like a hour ago), but now that I saw this movie
I just quit the competition :)
I didn't imagine that someone already had a so advanced AI.

Henrique de Souza Vilela
http://hvilela.com/

Einar Lielmanis

unread,
Aug 6, 2009, 4:50:12 AM8/6/09
to mariocom...@googlegroups.com
> I've recorded a particularly good run of my AI and put it on
> youtube...

Wow, your long run on the youtube blows the socks off me — all the ego
stroking you receive about this run is well deserved (though, a valid
question probably is, how many competition newcomers you managed to
scare off with it :)

Anyways, speaking about the competition, is there a chance that you'd
run and share the ch.idsia.scenarios.Stats competition score of your
Mario? It'd be cool to know where our little penny-pinching weirdly
jumping frequently-dying plumbers stand in comparison.

For the reference, my humanish mario, who plays almost as bad as me
myself, currently achieves 18155 points, which is just a little bit
more than twice as much as the braindeadest gap-avoiding stock
ForwardAgent.

Cheers,

Einar

Julian Togelius

unread,
Aug 6, 2009, 6:29:25 AM8/6/09
to mariocom...@googlegroups.com
Hi everybody,

Much as I think Robin has done a good job, I would advise the rest of
you not to be dissuaded from taking part in the competition.

First of all, his contribution does not run in real-time yet, and it
has to do to be able to win. Originally I had thought of setting a
stricter time limit for the competition, to allow the Stats command to
be run in a reasonable amount of time, but I forgot. I won't introduce
a requirement to run faster than real-time for the ICE-GIC phase, but
might do for the CIG phase, biasing the competition towards
controllers that use less computational resources.

Second, the video obviously only shows what Mario does on a particular
stretch of level. It might not work that well on other levels.

Third, Robin's controller uses information that's not actually there
in the current interface. In the final scoring, you need to work with
the limitations of the software.

This is not in any way an attack on Robin - it's just my way of saying
that there's still plenty of room for other solutions and other
contributions, and nobody should avoid entering the competition.

Best of luck to all of you,

Julian




2009/8/6 Einar Lielmanis <ein...@gmail.com>:

Banaticus

unread,
Aug 6, 2009, 7:37:23 AM8/6/09
to Mario Competition
"Robin's controller uses information that's not actually there in the
current interface. In the final scoring, you need to work with the
limitations of the software." True, but in
http://groups.google.com/group/mariocompetition/msg/37ae693883b8e81c
you said that the information that he works with will be made
available soon, before the competition.

You mentioned that his version doesn't run in real time yet and that
versions do have to run in real time -- what sort of resources are we
talking about for running in real time? How good is the processor
that we have to run on, how much RAM is available? What are the
limitations that we have to work with so that we can see whether a
specific version runs in "real time" for you? I'm reminded of this
Mandelbrot program that my dad wrote years ago. Each screen took
about four minutes on our 486 with a math coprocessor, but on my
grandma's 386 one screen took almost a full day. Of course, math
coprocessors have been "standard" for over a decade now, but you get
my point -- what's real time on my machine may not necessarily be real
time on your machine (although maybe yours is faster, I don't know).

Sergey Karakovskiy

unread,
Aug 11, 2009, 10:20:55 AM8/11/09
to mariocom...@googlegroups.com
Good day, Henrique

Come on! 
Fight till the end of the story and you'll obtain your prize. 
Competition is not just several days in London. It's now and then, and demonstrating the power of your controller for the other competitors is just the part of the pre-competition which in some cases is even more exciting! 
I strongly encourage you to fight till the end!

Cheers,
Sergey
--
Kind Regards
Sergey Karakovskiy



Yaltar

unread,
Aug 13, 2009, 10:23:54 AM8/13/09
to Mario Competition
Hi,
First i want to apologize for my bad english (i'm french).

So, your video was impressive.
You say you "hack" the environnement to draw red line, but i've a
little question,

how did your agent predict mario path ? we don't have access to any
information aboute speed, or anything, did you just inspect code to
determine it ?

If the speed if mario, the jump high change , your agent will fail ?

Thanks a lot for your response :)

And again, really gret and impressive work

Robin Baumgarten

unread,
Aug 13, 2009, 11:08:19 AM8/13/09
to mariocom...@googlegroups.com
Hi Yaltar!

The only visible information is the position, however it is possible (for example) to get the speed by comparing successive positions of Mario and the Enemies. Then, you need a working physics simulation that mimics the internal behaviour of Mario (i.e., friction, maximum acceleration, etc).
If you would alter the game, for example by changing how the enemies behave, then the agent would get into trouble, yes. That is where learning algorithms excel (mine doesn't learn).

Robin

2009/8/13 Yaltar <vincen...@gmail.com>
Reply all
Reply to author
Forward
0 new messages