PDA

View Full Version : Error message help


x2495iiii
07-20-2009, 10:29 PM
As much as I hate to admit it, I'm kind of stumped as to how to deal with this error.

Error message:
"Error during simulation.

Alice version: 2.2 9/1/2008
os.name: Windows XP
os.version: 5.1
os.arch: x86
java.vm.name: Java HotSpot(TM) Client VM
java.vm.version: 10.0-b22
user.dir: C:\Documents and Settings\Sims Only\Desktop\Alice and Web\Alice 2.2\Required

Throwable that caused the error:
java.lang.ArrayIndexOutOfBoundsException: 1
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childPrologueIfNecessary(DoInOrder. java:51)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:97)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.ForEachToget her$RuntimeForEachTogether.childUpdate(ForEachToge ther.java:68)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
at edu.cmu.cs.stage3.alice.core.response.DoTogether$R untimeDoTogether.update(DoTogether.java:68)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.upd ate(CallToUserDefinedResponse.java:86)
at edu.cmu.cs.stage3.alice.core.behavior.TriggerBehav ior.internalSchedule(TriggerBehavior.java:69)
at edu.cmu.cs.stage3.alice.core.Behavior.schedule(Beh avior.java:225)
at edu.cmu.cs.stage3.alice.core.Sandbox.scheduleBehav iors(Sandbox.java:70)
at edu.cmu.cs.stage3.alice.core.World.scheduleBehavio rs(World.java:444)
at edu.cmu.cs.stage3.alice.core.World.schedule(World. java:486)
at edu.cmu.cs.stage3.alice.core.clock.DefaultClock.sc hedule(DefaultClock.java:99)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l$9.run(AuthoringTool.java:703)
at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.simulateOnce(DefaultScheduler.java:115)
at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.run(DefaultScheduler.java:76)
at edu.cmu.cs.stage3.scheduler.AbstractScheduler.run( AbstractScheduler.java:45)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at edu.cmu.cs.stage3.swing.DialogManager.showModalDia log(DialogManager.java:60)
at edu.cmu.cs.stage3.swing.DialogManager.showDialog(D ialogManager.java:128)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l.play(AuthoringTool.java:5158)
at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.a ctionPerformed(Actions.java:243)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)"


I think the error was caused by the fact that there are times when more than one ship can be within the distance needed for the collision with the bullet to be registered. However, there are several bugs I've noticed:

-Sometimes, the ship will automatically go to the left or to the right, without any keys pressed
-Bullet collisions go unregistered
-Enemy squadrons fail to regenerate
-Bomb animation loops repeatedly

If you can help with the bugs, go ahead and take a look. I had hoped to get this game up and running without having to post unfinished versions, as I have with ALL of my other projects, but sadly, here it is...

satovey
07-20-2009, 10:55 PM
Throwable that caused the error:
java.lang.ArrayIndexOutOfBoundsException: 1


java is telling you that you are accessing an array beyond it's index.

Lets say that the array has two elements: array[0] and array[1].
If you try to access array[2] you
will get the above diagnostic.

the following messages are pointing you to the location where the error in the code exists.


at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childPrologueIfNecessary(DoInOrder. java:51)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:97)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.ForEachToget her$RuntimeForEachTogether.childUpdate(ForEachToge ther.java:68)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
at edu.cmu.cs.stage3.alice.core.response.DoTogether$R untimeDoTogether.update(DoTogether.java:68)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.upd ate(CallToUserDefinedResponse.java:86)
at edu.cmu.cs.stage3.alice.core.behavior.TriggerBehav ior.internalSchedule(TriggerBehavior.java:69)
at edu.cmu.cs.stage3.alice.core.Behavior.schedule(Beh avior.java:225)
at edu.cmu.cs.stage3.alice.core.Sandbox.scheduleBehav iors(Sandbox.java:70)
at edu.cmu.cs.stage3.alice.core.World.scheduleBehavio rs(World.java:444)
at edu.cmu.cs.stage3.alice.core.World.schedule(World. java:486)
at edu.cmu.cs.stage3.alice.core.clock.DefaultClock.sc hedule(DefaultClock.java:99)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l$9.run(AuthoringTool.java:703)
at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.simulateOnce(DefaultScheduler.java:115)
at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.run(DefaultScheduler.java:76)
at edu.cmu.cs.stage3.scheduler.AbstractScheduler.run( AbstractScheduler.java:45)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at edu.cmu.cs.stage3.swing.DialogManager.showModalDia log(DialogManager.java:60)
at edu.cmu.cs.stage3.swing.DialogManager.showDialog(D ialogManager.java:128)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l.play(AuthoringTool.java:5158)
at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.a ctionPerformed(Actions.java:243)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)"


I think the error was caused by the fact that there are times when more than one ship can be within the distance needed for the collision with the bullet to be registered. However, there are several bugs I've noticed:

-Sometimes, the ship will automatically go to the left or to the right, without any keys pressed
-Bullet collisions go unregistered
-Enemy squadrons fail to regenerate
-Bomb animation loops repeatedly

If you can help with the bugs, go ahead and take a look. I had hoped to get this game up and running without having to post unfinished versions, as I have with ALL of my other projects, but sadly, here it is...


It appears that the array is being called
within a loop and that loop continues to iterate even though the index to the array is out of bounds.

You might want to add the following:
If it is a while loop then the loop
should test the size of the array.

while(index !> array.length)

In this way, the loop will exit once
index is greater than the length of
the array.

Hope that helps. I'll check back tomorrow and see.

x2495iiii
07-20-2009, 11:08 PM
There aren't any methods like that in my world, though. The only array (list, actually) referenced is the enemies list, which doesn't have any index references, it has a

For all items from world.enemies together
if item_from_world.enemies(the list) is within x width of bump(bullet)
then (explosion, ship and bullet disappear, enemies left decremented)
else
(do nothing)

satovey
07-20-2009, 11:10 PM
I didn't get the error message that you posted. What did you do to get it?

satovey
07-20-2009, 11:14 PM
There aren't any methods like that in my world, though. The only array (list, actually) referenced is the enemies list, which doesn't have any index references, it has a

For all items from world.enemies together
if item_from_world.enemies(the list) is within x width of bump(bullet)
then (explosion, ship and bullet disappear, enemies left decremented)
else
(do nothing)

Your error may be coming from the Alice source itself. This would indicate a bug, especially since I didn't have the error come up on my system.

Here is what is in my error councole.

Alice version: 2.2 6/10/2009

*****Running World*****
*****Stopping World*****
*****Running World*****
*****Stopping World*****
*****Running World*****
*****Stopping World*****
*****Running World*****
*****Stopping World*****

If your using Alice 3, then I'd say it's a bug.

x2495iiii
07-21-2009, 12:13 AM
Nope. I'm using 2.2, same as you. I'll try it in Alice 2.0, though.

Oh, to trigger the error, I simply pressed the Fire button (Space Bar) to fire at some of the ships, while using the Arrow Keys to make the ship dodge the incoming enemy fire.

What SHOULD happen is whenever the bullet touches one of the ships, it blows up. This should happen until the squadron of enemies is completely destroyed. Then, when 10 have been eliminated, the boss ship should come in, cloak, then basically behave the same as an enemy, but with the ability to endure 20 shots before exploding.

Veryuhbull
07-21-2009, 11:42 AM
Nope. I'm using 2.2, same as you. I'll try it in Alice 2.0, though.

Oh, to trigger the error, I simply pressed the Fire button (Space Bar) to fire at some of the ships, while using the Arrow Keys to make the ship dodge the incoming enemy fire.

What SHOULD happen is whenever the bullet touches one of the ships, it blows up. This should happen until the squadron of enemies is completely destroyed. Then, when 10 have been eliminated, the boss ship should come in, cloak, then basically behave the same as an enemy, but with the ability to endure 20 shots before exploding.

Maybe the error has to do with when you are pressing two key commands at once while the game is trying to process varibles as well. I have had the same problem before and I fixed it by adjusting the controls to a point where the error went away.
I don't see how to fix it in this case.

By the way brilliant idea for a game.:)

x2495iiii
07-22-2009, 01:39 AM
The program didn't work in any of the versions of Alice, so I'll try muddling with the controls next. The problem is that I'm in the same boat as you: no idea how to solve the problem. The movement and attack methods are already in two completely different methods and called by two completely different events, so there should be no conflict.

Glad you like it. Did you get to the boss fight? I worked very hard on that part. The evasive patterns, the attacks, the way the shield flickers, even the explosion at the end.

x2495iiii
07-23-2009, 12:04 PM
I haven't gotten any results yet as far as altering the controls go. Does anyone have any ideas or suggestions?

Veryuhbull
07-23-2009, 01:23 PM
further review of your game:
the whole thing moves way to fast for me. I slowed it down and played it. The enemies wouldn't die when i shot them after an amount of time. I could never finish a level because of this. Are the patterns supposed to be random? (one pattern becomes impossible after the things go underground.) Some shots from the enemies became unavoidable on occasion because they came from the side. I only had an error several times and it happened when I smashed the fire button a ton. (this may have no connection)

x2495iiii
07-24-2009, 05:38 PM
-The patterns are supposed to be random

-I'm not sure why some of the enemy bullet collisions don't register

-The unaviodable shots are supposed to be a small part of the game, they can only be blocked by putting up your shield (which I have yet to program)

-The pattern I think you're talking about is supposed to either be destroyed before they get too close, or collide with you and cause the pattern to be restarted (another feature I haven't put in yet, remember this is only the test version).

-If you have trouble with a certain pattern, there is a sort of 'level skip' in the form of a smart bomb which I've already programmed in. Press Enter to activate it (at the moment, they can be used infinitely many times, so that I could test to see if all of the formations worked)

Finally:

-I haven't been able to solve the error message generator yet. That is the problem I'd like to fix first, so if you or anyone else finds out exactly what the cause of the error is (or, better yet, how to fix it while keeping the rest of the game intact), please let me know.

EDIT: I fixed part of the bullet collision error by moving the space invader's ships directly above the fighter and the bullets. However,t here is still something wrong, which I'll have to work on. I also found out that the error isn't generated by controls overlapping, but by something in the firing/bullet collision detection methods, since the error can be triggered by simply firing at the enemies which pass over the fighters.