[gameprogrammer] Re: random speed up

Solved!

Thanks Robert, Richard and Tim.

It turned out to be my dumb mistake (of course) but the symptoms threw
me off thinking it was something else as i wasn't using timers or
seperate threads or even frame rate control logic :P

What happened is I have a UI stack and the main menu pushes a new UI
sheet on top of the stack w/ buttons on it.

When you enter the game, it pops the stack, then pushes the "game
sheet" on.  The game logic is actually called from the rendering
function of this sheet.

When the player was going back to the main menu, it wasn't popping the
sheet off the stack like it should have been which meant when you
re-enterd, the game was being rendered twice per frame which equated
to 2 logic cycles per frame as well.

If you left the game and then re-entered it again, youd have 3 logic
cycles per frame etc.

It pops the stack like it should and now everything is happy again.

Thanks for your help (:


On Fri, Feb 15, 2008 at 8:31 AM, Robbert de Groot <zekaric@xxxxxxxx> wrote:
> Do you launch a timer after you exit the main menu?
>
> Do you stop the timer when you go back to the main menu?
>
> I'm thinking you may have two timers firing off when only one of them
> is really wanted.  And every time you go back and forth you add
> another time to the mix making it appear that the game is speeding
> up.  Just a thought.
>
> I am doubting you are looking in the right place for your speed up
> issue.
>
> --- Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:
>
> > Wow you hit the nail on the head, that does indeed happen - each
> > time
> > i go to the main menu then back into the game it goes faster and
> > faster.
> >
> > It's strange because i'm not messing with the CPU priority or
> > anything...as far as i can tell the only thing that is happening
> > (apart from what say...fmod might be doing) is just loading and
> > unloading some textures, and allocating/deallocating some memory.
> >
> > Do you think fmod could be causing this?  Having never hit this
> > problem before, how do you release the cpu back to the os, just set
> > the priority to a lesser value?
> >
> > Thanks a lot for your help!
>
>
> Robbert de Groot
>
>
>      Be smarter than spam. See how smart SpamGuard is at giving junk email 
> the boot with the All-new Yahoo! Mail.  Click on Options in Mail and switch 
> to New Mail today or register for free at http://mail.yahoo.ca
>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: