twiddles / marioai

Automatically exported from code.google.com/p/marioai
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Running a replay on a file with visibility turned off causes a bug. #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Run Unit Test.
2. "java Replay recorderTest.zip"

What is the expected output? What do you see instead?
You expect to see a replay of the level played with '-vis off' during the 
tests.  Instead you get the following error:

java.lang.NullPointerException
    at ch.idsia.benchmark.mario.environments.MarioEnvironment.tick(MarioEnvironment.java:137)
    at ch.idsia.benchmark.tasks.ReplayTask.playOneFile(ReplayTask.java:48)
    at ch.idsia.benchmark.tasks.ReplayTask.startReplay(ReplayTask.java:97)
    at ch.idsia.scenarios.Replay.main(Replay.java:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)

What version of the product are you using? On what operating system?
Same as always.

Please provide any additional information below.
The patch I proved in issue 5 fixes this issue but is fixes other non broken 
things as well. :)

The problem is that the environment is reset using the options from the replay, 
but because visualization was turned off, the VisualComponent is not 
initialized and thus the error happens.  I've included a small patch which 
fixes just this problem.

Original issue reported on code.google.com by melin...@gmail.com on 27 Oct 2010 at 11:40

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks you so much! I'll fix it in the next commit!

Original comment by Nikolay....@gmail.com on 27 Oct 2010 at 11:45

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r612.

Original comment by Nikolay....@gmail.com on 27 Oct 2010 at 11:56