Freigeben über


Exposed: 5 methods to create game loop: which is the best?

Edit: fixed broken links

What is the best method to create a game loop?

I created a small experiment comparing 5 different animation methods.

The results, along with code samples and test screenshots are summarized in this document:

5 Game Loops in Silverlight: Which is the best? (PDF)

5 Game Loops in Silverlight: Which is the best? (DOCX)

Sample test app (requires reading the document above to understand the setup): https://nokola.com/gamelooptest

This is part of the test app startup screen before measurements begin:

 

Contents of the doc:
Welcome
What Are Some Things Important For A Game?
Why Are We Discussing Game Loops?
Methods
Test Setup
Test Results
MaxFrameRate Unset (Defaults to 60):
Analysis of the 60 FPS default case:
MaxFrameRate=300:
Analysis of the 300 FPS case:
Additional Tips
Quick Comparison Chart
Summary & Conclusion

 

I hope this will shed some light on Silverlight game loop that several people on this blog asked so far!

Please let me know what you think!

gameloop.jpg

Comments

  • Anonymous
    August 23, 2009
    Nikola, I'm anxious to see what you have found, but the links to your document seem to be broken.

  • Anonymous
    August 23, 2009
    Hmm... I get 404 errors when I try to download either version of the documents.

  • Anonymous
    August 23, 2009
    I can't reach livefilestore.com. Can you make the docs available somewhere else?

  • Anonymous
    August 23, 2009
    Thank you all for the note! The broken links are fixed now - please try again! Thanks, Nikola

  • Anonymous
    August 24, 2009
    I have much much lower aveage with CompositionTarget.Rendering than any of the other examples, probably because it runs with a greater framerate for me. But thats the great thing about that loop... you only set the translate when you need to, and as often as you need to; no more, no less. Also I noticed that if I drag the browser window around, the stability of the other methods are all over the place, while CompositionTarget stays constant.

  • Anonymous
    August 24, 2009
    The comment has been removed

  • Anonymous
    December 22, 2009
    Your links are broken... again.  Would really like to have this information.  Is it possible to just cut-and-paste the info straight to the blog and not worry about it?

  • Anonymous
    December 22, 2009
    Hi J, I'm sorry that the links didn't work for you. I just tried them now and they take me to the right .docx/pdf file- what is the error message that you see? I'd like to just be able to copy-paste the info in the blog too, but unfortunately this blog has a restriction - 1 picture per post and some other formatting restictions which makes this very hard... Thanks for the patience and sorry that the links didn't work! Please let me know if they work OK now?