This site requires JavaScript, please enable it in your browser!
Greenfoot back
Transpire
Transpire wrote ...

2011/5/15

Help With Abysmal Performance?

1
2
3
Transpire Transpire

2011/5/24

#
First of all, I still have the issue with them flying up. This is not supposed to happen. I think there might be a Windows XP vs Vista issue. What am I supposed to do: all our school computers are XP, and I can't tell my teacher "Oh, it works at home, but it doesn't at school." Regardless of the fact that it does work at home, and not at school. Thank you for reminding me you can reduce the speed. The issue is that when opened in greenfoot, a max slider setting behaves at a reasonable speed. It does not make sense to me that when it is on an applet, I need to reduce the speed, which also controls the frame rate in my game.
Transpire Transpire

2011/5/25

#
http://www.stellardawncentral.com/forums/index.php?showtopic=17748&st=0&gopid=337076&#entry337076 Is a thread I made to ask my friends to test it. Several have the bug, 1 does not, and several may not understand the instructions.
Transpire Transpire

2011/5/26

#
New test case. Exception occurred during event dispatching: java.lang.NullPointerException at greenfoot.gui.export.ImageEditPanel.setZoomSlider(ImageEditPanel.java:259) at greenfoot.gui.export.ImageEditPanel.enableImageEditPanel(ImageEditPanel.java:267) at greenfoot.gui.export.ExportPublishPane.createScenarioDisplay(ExportPublishPane.java:725) at greenfoot.gui.export.ExportPublishPane.access$400(ExportPublishPane.java:75) at greenfoot.gui.export.ExportPublishPane$3.scenarioExistenceChecked(ExportPublishPane.java:544) at greenfoot.export.mygame.ExistingScenarioChecker.workerFinished(ExistingScenarioChecker.java:220) at greenfoot.export.mygame.ExistingScenarioChecker.access$400(ExistingScenarioChecker.java:39) at greenfoot.export.mygame.ExistingScenarioChecker$ScenarioWorker.finished(ExistingScenarioChecker.java:68) at bluej.utility.SwingWorker$1.run(SwingWorker.java:123) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:603) at java.awt.EventQueue$1.run(EventQueue.java:601) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:612) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178) at java.awt.Dialog$1.run(Dialog.java:1046) at java.awt.Dialog$3.run(Dialog.java:1098) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Dialog.show(Dialog.java:1096) at java.awt.Component.show(Component.java:1585) at java.awt.Component.setVisible(Component.java:1537) at java.awt.Window.setVisible(Window.java:842) at java.awt.Dialog.setVisible(Dialog.java:986) at greenfoot.gui.export.ExportCompileDialog.display(ExportCompileDialog.java:89) at greenfoot.gui.export.ExportDialog.showCompileDialog(ExportDialog.java:390) at greenfoot.gui.export.ExportDialog.display(ExportDialog.java:93) at greenfoot.actions.ExportProjectAction.actionPerformed(ExportProjectAction.java:57) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850) at java.awt.Component.processMouseEvent(Component.java:6289) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6054) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4652) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4482) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4482) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:603) at java.awt.EventQueue$1.run(EventQueue.java:601) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) at java.awt.EventQueue$2.run(EventQueue.java:617) at java.awt.EventQueue$2.run(EventQueue.java:615) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:614) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Exception occurred during event dispatching: java.lang.NullPointerException at greenfoot.gui.export.ImageEditPanel.setZoomSlider(ImageEditPanel.java:259) at greenfoot.gui.export.ImageEditPanel.enableImageEditPanel(ImageEditPanel.java:267) at greenfoot.gui.export.ExportPublishPane.createScenarioDisplay(ExportPublishPane.java:725) at greenfoot.gui.export.ExportPublishPane.access$400(ExportPublishPane.java:75) at greenfoot.gui.export.ExportPublishPane$3.scenarioExistenceChecked(ExportPublishPane.java:544) at greenfoot.export.mygame.ExistingScenarioChecker.workerFinished(ExistingScenarioChecker.java:220) at greenfoot.export.mygame.ExistingScenarioChecker.access$400(ExistingScenarioChecker.java:39) at greenfoot.export.mygame.ExistingScenarioChecker$ScenarioWorker.finished(ExistingScenarioChecker.java:68) at bluej.utility.SwingWorker$1.run(SwingWorker.java:123) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:642) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:603) at java.awt.EventQueue$1.run(EventQueue.java:601) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:612) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178) at java.awt.Dialog$1.run(Dialog.java:1046) at java.awt.Dialog$3.run(Dialog.java:1098) at java.security.AccessController.doPrivileged(Native Method) at java.awt.Dialog.show(Dialog.java:1096) at java.awt.Component.show(Component.java:1585) at java.awt.Component.setVisible(Component.java:1537) at java.awt.Window.setVisible(Window.java:842) at java.awt.Dialog.setVisible(Dialog.java:986) at greenfoot.gui.export.ExportCompileDialog.display(ExportCompileDialog.java:89) at greenfoot.gui.export.ExportDialog.showCompileDialog(ExportDialog.java:390) at greenfoot.gui.export.ExportDialog.display(ExportDialog.java:93) at greenfoot.actions.ExportProjectAction.actionPerformed(ExportProjectAction.java:57) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850) at java.awt.Component.processMouseEvent(Component.java:6289) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6054) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4652) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4482) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4482) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:603) at java.awt.EventQueue$1.run(EventQueue.java:601) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) at java.awt.EventQueue$2.run(EventQueue.java:617) at java.awt.EventQueue$2.run(EventQueue.java:615) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:614) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) A really nice bunch of Greenfoot errors (not mine). I was no longer able to export my project before a restart of Greenfoot
davmac davmac

2011/5/26

#
That's not a test case... it's an exception trace? Looks like a problem which has already been fixed in our repository - shouldn't happen any more after the next Greenfoot release.
Transpire Transpire

2011/5/26

#
I was referring to http://greenfootgallery.org/scenarios/2960.
davmac davmac

2011/5/28

#
The slider merely limits the speed (or "frame rate", if you prefer, though that's not really the right term). In the IDE, the maximum speed can be much reduced from when a scenario is exported and runs standalone (although the speed in the IDE should be improved significantly with the next release). So, once the slider reaches a certain point, it has no effect, because the simulation is already naturally running slower than the requested speed. Once you export, the maximum speed greatly increases, and so the only thing limiting the speed is the slider. With the slider at the maximum setting, it has no effect - the scenario runs at full speed. So, if you were to run your scenario on a faster computer, it would go faster (even in the IDE), which is surely not what you want. If you don't want the scenario to run at an out-of-control speed, you should set the speed slider to an appropriate level. By setting the speed slider to maximum you're saying that you want the scenario to run as fast as possible.
Transpire Transpire

2011/5/28

#
Every act method, my scenario gets the elapsed time in milliseconds, and calculates position from there. Therefore, in effect the, act method does, in my case, become a "frame rate" counter. Therefore, I could be on a supercomputer, and due to my scenario design, my scenario would not run faster. Moving the slider around the middle shows this. If act gets called twice in 10 ms, the same position is calculated as if act was only called once at the end of the interval. I discovered (well, I think I did) that the issue had to do with a loss of precision. On fast computers, each tick is so small that the change in position is too small for a double to account for. This is possible because I first convert the elapsed time to seconds, then square it. Then, it spuriously equals the current position, causing my program to think a collision occurred. Because position is always being calculated from the initial position, errors do not accumulate, which made this bug hard to stop. On my computer, it just happened that the bug could not occur in the IDE because it simply could not run fast enough. However, on a jar file, it was fast enough, and the bug could occur. Finally, IE9 appears to not work with the scenario.
davmac davmac

2011/5/29

#
Finally, IE9 appears to not work with the scenario.
What do you mean by "appears not to work"? It would be good if you could send a screenshot to gallery@greenfoot.org (along with a brief message describing the circumstances/problem).
Transpire Transpire

2011/5/29

#
Ok, I sent an email. By the way, you are right about the horizontal movement being tied to how fast act was called. I need to change that; I was talking about vertical movement when I said that it calculated the interval.
You need to login to post a reply.
1
2
3