Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Bugs and Troubleshooting (http://www.alice.org/community/forumdisplay.php?f=18)
-   -   Error During Simulation (http://www.alice.org/community/showthread.php?t=2829)

Whitellama 06-30-2009 11:46 PM

Error During Simulation
 
1 Attachment(s)
I have an error that's driving my crazy. I have attempted to attach the file so others may try it and see if the same happens for them. Though I have had problems in the past with attaching Alice files so it might not work entirely correctly.

I have something set up so when I press the up arrow my character will move forward while performing the walk animation to make it look more realistic. When I let go of the up arrow key the simulation closes and I get something like this:

Error during simulation.


Alice version: 2.2 6/10/2009

Throwable that caused the error:
java.lang.NullPointerException
at edu.cmu.cs.stage3.alice.core.Behavior$RuntimeStack.pop(Behavior.java:49)
at edu.cmu.cs.stage3.alice.core.Behavior.popStack(Behavior.java:360)
at edu.cmu.cs.stage3.alice.core.response.LoopNInOrder$RuntimeLoopNInOrder.epilogue(LoopNInOrder.java:102)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.childrenEpiloguesIfNecessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.epilogue(CompositeResponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.childrenEpiloguesIfNecessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.epilogue(CompositeResponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDefinedResponse$RuntimeCallToUserDefinedResponse.epilogue(CallToUserDefinedResponse.java:94)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.childrenEpiloguesIfNecessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.epilogue(CompositeResponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.LoopNInOrder$RuntimeLoopNInOrder.epilogue(LoopNInOrder.java:99)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.childrenEpiloguesIfNecessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.epilogue(CompositeResponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.DoTogether$RuntimeDoTogether.epilogue(DoTogether.java:81)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.childrenEpiloguesIfNecessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.epilogue(CompositeResponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.childrenEpiloguesIfNecessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeResponse$RuntimeCompositeResponse.epilogue(CompositeResponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDefinedResponse$RuntimeCallToUserDefinedResponse.epilogue(CallToUserDefinedResponse.java:94)
at edu.cmu.cs.stage3.alice.core.behavior.AbstractConditionalBehavior.internalSchedule(AbstractConditionalBehavior.java:112)
at edu.cmu.cs.stage3.alice.core.Behavior.schedule(Behavior.java:226)
at edu.cmu.cs.stage3.alice.core.Sandbox.scheduleBehaviors(Sandbox.java:70)
at edu.cmu.cs.stage3.alice.core.World.scheduleBehaviors(World.java:444)
at edu.cmu.cs.stage3.alice.core.World.schedule(World.java:486)
at edu.cmu.cs.stage3.alice.core.clock.DefaultClock.schedule(DefaultClock.java:99)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringTool$7.run(AuthoringTool.java:702)
at edu.cmu.cs.stage3.alice.authoringtool.util.DefaultScheduler.simulateOnce(DefaultScheduler.java:115)
at edu.cmu.cs.stage3.alice.authoringtool.util.DefaultScheduler.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.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$2.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 edu.cmu.cs.stage3.swing.DialogManager.showModalDialog(DialogManager.java:60)
at edu.cmu.cs.stage3.swing.DialogManager.showDialog(DialogManager.java:128)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringTool.play(AuthoringTool.java:5159)
at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.actionPerformed(Actions.java:168)
at javax.swing.AbstractButton.fireActionPerformed(Unknown 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.mouseReleased(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(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown 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.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Please help with this! I want to make a realistic walk motion without an annoying error.:(

arevira 07-01-2009 10:53 AM

1 Attachment(s)
Hi Whitellama,

Before anything, nice job with the walking cycle animation!

The problem is because of the way the "while a key is pressed" event work. As soon as you release the key, whatever you have in the "During" section is terminated/aborted without letting it to complete. This has many advantages, but when during complex animations (like the one you have), Alice seems to sometimes loose track of the animation sequence. On the other hand, you also have an interesting combination of infinite loops and do-together's for which the termination mechanism seems to be the only way to stop the animation sequence.

Anyways...I think what you want is for Travis to walk while the key is pressed, and stop walking when released. Look at the attached file for my (crude) solution. I made changes to the methods [b]WalkForward[/b] and [b]walk[/b] for the Travis object. You would need to make similar changes to the [b]WalkBackward[/b] method. You also need to tweak the code in [b]walk[/b] so Travis ends in a pose ready to start the next step to make it a little more realistic.

Cheers


Cheers.

Whitellama 07-01-2009 01:17 PM

:) Great job! Thanks for your help. The events in your version were slightly confusing but the teacher/counselor here helped me understand some of it.

I noticed it's slightly twitchy and I believe that has to do with the stand at the end. I'm not sure how to fix that but I am wondering if there is a way to fix that with an infinite loop. Would it be possible to make it so that after the button is let go [I]then[/I] the stand is activated? If you could look into this that would be [B]great[/B] but if not that's fine too. I already have a great walking animation thanks to you.

arevira 07-01-2009 02:01 PM

[QUOTE=Whitellama;10881]:) Great job! Thanks for your help. [/quote]
No problem. I am glad I could help.

[QUOTE=Whitellama;10881] I noticed it's slightly twitchy and I believe that has to do with the stand at the end. [/quote]

You need to tweak the code in the [b]walk[/b] method so Travis [u]ends in a pose ready to start the next step[/u] to make it a little more realistic.

Cheers.

Whitellama 07-01-2009 09:10 PM

You say I need to tweak the code in the walk method so do you mean my WalkForward method I made or the walk method that comes with characters made in the hebuilder and shebuilder?

I believe you mean the method actually called [B]walk[B] since that's what you said. I will try to figure it out but I'm not the entirely sure if I can. Thanks for your help so far.:)

I'm going to be fiddling with it but if you have the time or if you're just bored you can attach the changed file. Or you can just explain what to do. That's only if you feel like it because I think I can even though the walk script is pretty complex when I look at it.

Whitellama 07-01-2009 09:32 PM

ok I've fiddled enough. I can't figure it out. Now I'm actually asking you to help.:) Please? It's time again for you to work your genius.

roadchicken 07-02-2009 01:08 PM

Same Problem
 
I am Whitellama's brother and I have the same walking script as him, I also have the same problem. I understand that walking is a difficult animation but It must have been designed before, and if you have a decent walking animation then I would be very grateful and give you all the credit.;)


All times are GMT -5. The time now is 04:58 AM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.