Images in Marioai.zip

53 views
Skip to first unread message

Sander

unread,
Aug 5, 2009, 9:59:18 AM8/5/09
to Mario Competition
I just downloaded the source and followed the instructions on the web
page to start up the Mario AI, using the Play-class. However, it gave
me a "IllegalArgumentException: input == null!" and after a little bit
of digging in the code I realized it was due to that it expected
images to be in "ch\idsia\mario\engine" and not in the img-dir. I
expect that it's some configuration clicking but I can't see how this
would be a specific case for my own setup, so even though it wasnt too
hard to figure it out, I just taught it's a bit unnecessary work for
everyone to do. Maybe an update of the source is needed?

In the rest, I really like the initiative of this competition!

Best /Erik

RobinB

unread,
Aug 5, 2009, 10:04:10 AM8/5/09
to Mario Competition
Hi!

This seems to be a problem related to Windows, I had it myself, as
well and fixed it in the same way (additionally, i think i had to move
tiles.dat into bin\ch\idsia\mario\engine\level ).
I think that problem has been discussed before, but a mention in the
documentation might help people not to stumble over it again.

Robin

Julian Togelius

unread,
Aug 5, 2009, 10:16:02 AM8/5/09
to mariocom...@googlegroups.com
Yes, this one is a recurring problem, and there doesn't seem to be a
"clean" solution. We use three different methods of trying to load
these images, but we still need to keep them in three different places
in order for the code to work on all systems. Still, our experience is
that if you try the code from the command line (not from an IDE, which
tend to mess up the working directory) it should work straight out of
the box. In the distribution from the web page, the images are already
in the ch/idsia/mario/engine directory, but your IDE might mess this
up for you when you recompile the code if you're not careful. I
recommend using IntelliJ IDEA, as we are zip contains a project file
for that IDE with everything set up correctly.

Also, I admit to not having tested the current version on Windows - I
just very rarely see a Windows computer!

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

ferr

unread,
Aug 6, 2009, 2:01:59 AM8/6/09
to Mario Competition
Had the same problem, took me a while to narrow it down to tiles.dat
missing from the src\ch\idsia\mario\engine directory. Works now!

On Aug 5, 10:16 am, Julian Togelius <julian.togel...@gmail.com> wrote:
> Yes, this one is a recurring problem, and there doesn't seem to be a
> "clean" solution. We use three different methods of trying to load
> these images, but we still need to keep them in three different places
> in order for the code to work on all systems. Still, our experience is
> that if you try the code from the command line (not from an IDE, which
> tend to mess up the working directory) it should work straight out of
> the box. In the distribution from the web page, the images are already
> in the ch/idsia/mario/engine directory, but your IDE might mess this
> up for you when you recompile the code if you're not careful. I
> recommend using IntelliJ IDEA, as we are zip contains a project file
> for that IDE with everything set up correctly.
>
> Also, I admit to not having tested the current version on Windows - I
> just very rarely see a Windows computer!
>
> Julian
>
> 2009/8/5 RobinB <robin.baumgar...@gmail.com>:
> +46-705-192088- Hide quoted text -
>
> - Show quoted text -

Jesse

unread,
Aug 6, 2009, 2:13:38 AM8/6/09
to Mario Competition
yes.. the way the code works everything needs to be in the mario
\engine directory. Its all currently in mario\engine\resources but the
code isnt looking there... that should really be fixed. I had the same
problem making it work in eclipse

Julian Togelius

unread,
Aug 6, 2009, 3:44:46 AM8/6/09
to mariocom...@googlegroups.com
This completely depends on how you compile it. The code as you get it
from the website has the images in the classes directory, because
that's where the compiled code is. If you recompile it yourself with
javac from the command line (as you seem to have done), the new
executables will end up in the src tree, and if you use some other IDE
it will likely do something else. The main problem with distributing a
version that works for everybody is that they will use different
compilation methods.

Therefore I suggest using IntelliJ.

Julian

2009/8/6 ferr <ferr...@gmail.com>:

Jesse

unread,
Aug 6, 2009, 3:49:38 AM8/6/09
to Mario Competition
Right... but no where in the code does it ever access anything in the
resources sub-folder. And the resources sub-folder is in the src
director tree. and if you just moved everything out of that folder and
into the engine folder under that same tree it would work with
everything. Alternatively you could add a class to the resources sub-
folder that is just a dummy class specifically for loading resources
from its package with. then you wouldn't have the resource files
copied in 4 different places but.. well 3 instead.. just a suggestion
and help for those wondering what is going on.

On Aug 6, 12:44 am, Julian Togelius <julian.togel...@gmail.com> wrote:
> This completely depends on how you compile it. The code as you get it
> from the website has the images in the classes directory, because
> that's where the compiled code is. If you recompile it yourself with
> javac from the command line (as you seem to have done), the new
> executables will end up in the src tree, and if you use some other IDE
> it will likely do something else. The main problem with distributing a
> version that works for everybody is that they will use different
> compilation methods.
>
> Therefore I suggest using IntelliJ.
>
> Julian
>
> 2009/8/6 ferr <ferr.m...@gmail.com>:

Banaticus

unread,
Aug 6, 2009, 7:52:32 AM8/6/09
to Mario Competition
"Also, I admit to not having tested the current version on Windows - I
just very rarely see a Windows computer!"

Just one of the many reasons why I rarely ever see anyone who doesn't
have a Windows computer:
http://xkcd.com/619/

Honestly, the only advantage that Macs had were that they had awesome
graphics tools... but now all of the former apple-only graphics tools
are also available on Windows, which means there's really jack all
reason to buy a Mac unless you like paying x3 for the same hardware.
Linux has always seemed... half finished.
Reply all
Reply to author
Forward
0 new messages