Alice Community  

Go Back   Alice Community > Alice 2 > Bugs and Troubleshooting

Reply
 
Thread Tools Display Modes
Error During Simulation
Old
Whitellama
Guest
 
Status:
Posts: n/a
Question Error During Simulation - 06-30-2009, 11:46 PM

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(Beh avior.java:360)
at edu.cmu.cs.stage3.alice.core.response.LoopNInOrder $RuntimeLoopNInOrder.epilogue(LoopNInOrder.java:10 2)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.epi logue(CallToUserDefinedResponse.java:94)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.LoopNInOrder $RuntimeLoopNInOrder.epilogue(LoopNInOrder.java:99 )
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.DoTogether$R untimeDoTogether.epilogue(DoTogether.java:81)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.childrenEpiloguesIf Necessary(CompositeResponse.java:67)
at edu.cmu.cs.stage3.alice.core.response.CompositeRes ponse$RuntimeCompositeResponse.epilogue(CompositeR esponse.java:73)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.epi logue(CallToUserDefinedResponse.java:94)
at edu.cmu.cs.stage3.alice.core.behavior.AbstractCond itionalBehavior.internalSchedule(AbstractCondition alBehavior.java:112)
at edu.cmu.cs.stage3.alice.core.Behavior.schedule(Beh avior.java:226)
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$7.run(AuthoringTool.java:702)
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.pumpOneEventForHierar chy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(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.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:5159)
at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.a ctionPerformed(Actions.java:168)
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.pumpOneEventForHierar chy(Unknown 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)

Please help with this! I want to make a realistic walk motion without an annoying error.
Attached Files
File Type: a2w Walking.a2w (703.3 KB, 16 views)
   
Reply With Quote
Old
arevira
Guest
 
Status:
Posts: n/a
Default 07-01-2009, 10:53 AM

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 WalkForward and walk for the Travis object. You would need to make similar changes to the WalkBackward method. You also need to tweak the code in walk so Travis ends in a pose ready to start the next step to make it a little more realistic.

Cheers


Cheers.
Attached Files
File Type: a2w Walking2.a2w (702.4 KB, 70 views)

Last edited by arevira; 07-01-2009 at 01:58 PM. Reason: typos...
   
Reply With Quote
Old
Whitellama
Guest
 
Status:
Posts: n/a
Default 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 then the stand is activated? If you could look into this that would be great but if not that's fine too. I already have a great walking animation thanks to you.
   
Reply With Quote
Old
arevira
Guest
 
Status:
Posts: n/a
Default 07-01-2009, 02:01 PM

Quote:
Originally Posted by Whitellama View Post
Great job! Thanks for your help.
No problem. I am glad I could help.

Quote:
Originally Posted by Whitellama View Post
I noticed it's slightly twitchy and I believe that has to do with the stand at the end.
You need to tweak the code in the walk method so Travis ends in a pose ready to start the next step to make it a little more realistic.

Cheers.
   
Reply With Quote
Old
Whitellama
Guest
 
Status:
Posts: n/a
Smile 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.

Last edited by Whitellama; 07-01-2009 at 09:15 PM. Reason: I needed to add something. (Third paragraph)
   
Reply With Quote
Old
Whitellama
Guest
 
Status:
Posts: n/a
Default 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.
   
Reply With Quote
Reply

Tags
arrow, error, release, simulation., walk

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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