|
Viewing 1 to 20 (23 Total) Slowdown when moving mouse cursor |
|
|---|---|
JonTotal Posts: 279
Joined: March 08, 2012
|
For the Flash target and no other target, I notice that just moving the mouse around can slow down a game substantially for reasons that escape my grasp. The degradation is from 60 FPS down to 47-48, and I could even reproduce it on a completely blank project with literally... nothing.
Tags:
Posted on June 01, 2012 at 3:04 AM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorBy minimal, I literally mean this. You can grab fermm's stuff from here or ditch and test on your own.
Posted on June 01, 2012 at 3:19 AM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorAny insights on this? This is a showstopper for me.
Posted on June 04, 2012 at 4:22 AM
|
PhilippeTotal Posts: 262
Joined: September 08, 2011
|
Re: Slowdown when moving mouse cursorThat's an old Flash problem:
Posted on June 04, 2012 at 4:41 AM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorThanks for the link, unfortunately, the only solution suggested that's relevant is mouseChildren / mouseEnabled = false, which I've already tried.
Posted on June 04, 2012 at 12:15 PM
|
singmajestyTotal Posts: 2192
Joined: August 25, 2011
|
Re: Slowdown when moving mouse cursorHow does this work for you?
Posted on June 04, 2012 at 12:18 PM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorI'm still in 3.3.0 since I had some issues with the upgrade.
Posted on June 04, 2012 at 12:25 PM
|
singmajestyTotal Posts: 2192
Joined: August 25, 2011
|
Re: Slowdown when moving mouse cursorOkay, does this behave differently?
Posted on June 04, 2012 at 12:27 PM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorHmm, it's good now on that count. (I forgot all about the old FPS counter and equated it to the stats module!)
Posted on June 04, 2012 at 12:39 PM
|
PhilippeTotal Posts: 262
Joined: September 08, 2011
|
Re: Slowdown when moving mouse cursorYou don't need to set mouseChildren on all child, just the container desired - and mouseEnabled on this container if needed.
Posted on June 04, 2012 at 1:48 PM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorI'll try again later today, but I did play around with setting the root container vs. everything.
Posted on June 04, 2012 at 1:55 PM
|
singmajestyTotal Posts: 2192
Joined: August 25, 2011
|
Re: Slowdown when moving mouse cursorYou'll get better performance if you poll the mouse position on Event.ENTER_FRAME rather than listening to MouseEvent.MOUSE_MOVE
Posted on June 04, 2012 at 2:35 PM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorNope, I'm not using the mouse move event - I'm polling on stage.mouseX/Y when I do it need it, and in the test game, I'm not even polling for mouse input at all.
Posted on June 04, 2012 at 3:54 PM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorIt seems that this is a much more difficult problem to solve than originally anticipated.
Posted on June 05, 2012 at 12:54 AM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorHere's the double-kicker - this problem seems to be only for Macs. Inside a Windows VM no less, it has no issues at all with the framerate. :/
Posted on June 05, 2012 at 4:11 AM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorI finally pinned down the cause while doing some optimizations for mobile - though all the reasons above are true, I traced it back to an innocuous function that was polling on stage.mouseX and also doing some checks on a Sprite using its x/y/width/height.
Posted on June 07, 2012 at 2:12 AM
|
PhilippeTotal Posts: 262
Joined: September 08, 2011
|
Re: Slowdown when moving mouse cursorA display object's width isn't a trivial information, it often requires to do complex computations to measure children elements.
Posted on June 07, 2012 at 4:16 AM
|
JonTotal Posts: 279
Joined: March 08, 2012
|
Re: Slowdown when moving mouse cursorCan the same be said for setting the x/y position? I've found another piece of code that's bottlenecking and traced it down to something like
Posted on June 07, 2012 at 12:04 PM
|
PhilippeTotal Posts: 262
Joined: September 08, 2011
|
Re: Slowdown when moving mouse cursorSometimes even reading .x has a little cost yes.
Posted on June 07, 2012 at 12:28 PM
|
singmajestyTotal Posts: 2192
Joined: August 25, 2011
|
Re: Slowdown when moving mouse cursorDo you experience performance hits like this if you use a native C++ desktop target or Neko desktop target rather than Flash Player?
Posted on June 07, 2012 at 12:40 PM
|
