A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Application Popup interfering with game?

  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    36

    Application Popup interfering with game?

    Recently created a yeti sports penguin toss clone, and where were getting some anomaly in the scores. About 0.1% of scores people managed to get significantly higher, though they didn't appear to be hacked...

    Someone finally managed to replicated the problem, and apparently a pop-up from "another application" (i dont know if this is in broswer/js or a desktop app) caused the flash to go a bit crazy, and ended up giving the guy a massive score. I need to find some way of stopping this from happening!

    Firstly, this sounds feisable to me, but has anyone else come across it? Would the popup cause the frame rate to drop?

    Also, how can I stop this happening?

    Thanks!

  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    36
    Thinking out loud:

    If I changed the engine from using onEnterFrame to setInterval, would that help. Is setInterval dependent on the root framerate?

  3. #3
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Yes, another application may slow down your framerate because it takes away system resources. Plus you can even find special programs designed to slow down or up your game speed.

    setInterval is of course depending on framerate same way enterFrame function does. Basically, enterFrame function is exactly same as running setInterval with delay set to 1.

    If you want frame-independent movement, you should use Date.getTime function to find actual time between last step and current step and adjust the movement based on time.

  4. #4
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    while i agree that using the date object is a good idea to reduce slowing down game to cheat attempts i don´t agree with this:
    "setInterval is of course depending on framerate same way enterFrame function does. Basically, enterFrame function is exactly same as running setInterval with delay set to 1."

    its of course right that if your machine/flash player can´t keep up with what you want it to do using an interval/date object using solution won´t solve that problem. On the other side using a time based setup is way better than using an enterframe because with an enterframe you get totally varying results on different machines whereas with a time based solution you can at least know that if you set a certain interval the game won´t execute stuff too fast if a user machine is way more powerful than the target machine/browser you made it for.
    (For example with enterframe solutions developers often set the target fps way higher than what they game should run at,just because they know it looses some in the browser, now what if that isn´t the case with the next browser/flash player version or a better machine to run it? the game runs at crazy speed making it not fun/playable anymore (in effect similar to dos games running too fast on win 32 platform ))

  5. #5
    Senior Member
    Join Date
    Sep 2004
    Posts
    633
    For example with enterframe solutions developers often set the target fps way higher
    They should know better than that though.

    They should never set frame rates to more than 5 fps of intended speed, and even that is a last resource.

    The original question: No you can't prevent other apps from opening ( as far as I know ), and maybe look into why slowdown would give someone a higher score. There could be a better way of calculating the score, something more independent from frame rate, hard to say without knowing how the score is calculated.

  6. #6
    Member
    Join Date
    Aug 2006
    Posts
    36
    Thanks for the information guys, good food for thought here...

    MikeMD: "There could be a better way of calculating the score, something more independent from frame rate, hard to say without knowing how the score is calculated."

    The score is calculated by the distance (in pixels) an object travels. When the object is hit, it is given a speed for both X and Y directions, which WAS then decreased onEnterFrame until they both hit zero and the game stops.

    I have rewritten it with setInterval but im not convinced that this will stop this from happening (though i cant seem to replicate the problem). Since there is no set time for this event to happen, im not sure that using the Date class is a good idea?
    --------------

    The original frame rate was set at 20fps, and was maintained by that frameController code that was posted here a while back. I thought that would have been fine for browser delivery, and for 99.9% of the people this is true!

    Any further views? Ideas?

    Thanks so much again guys.

  7. #7
    Member
    Join Date
    Aug 2006
    Posts
    36
    shameless bump. sorry!

  8. #8
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Quote Originally Posted by Steve_B
    The score is calculated by the distance (in pixels) an object travels. When the object is hit, it is given a speed for both X and Y directions, which WAS then decreased onEnterFrame until they both hit zero and the game stops.
    In that case there is no difference how you decrease the speed, both enterFrame and setInterval methods give same results and are not affected by the actual framerate.

    Maybe there is possibility of rare bugs happening (most games do), like division with zero (a/0=NaN) or Flash returning infinitely small number that never reaches zero (trace(1.01 - 1); => 0.010000000000000009).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center