Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6663841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:32:38+00:00 2026-05-26T02:32:38+00:00

Im creating a simple vehicle and projectile simulation game in WPF using C#. I

  • 0

Im creating a simple vehicle and projectile simulation game in WPF using C#. I need to have a constant frame rate (i.e. i need to know how much to move an object with a certain velocity in each frame). This way I could subscribe an event which calculates and updates positions according to the game’s physics to the CompositionTarget.Rendering event.

CompositionTarget.Rendering += UpdatePositions;

I googled it a while, and found no answer. The fps in WPF seem to be arbitrary, and using a Stopwatch to know how much time elapsed between a frame and the previous one wouldn’t be clean at all.

I thought also of creating my own frame rate, by calling UpdatePositions every some amount of milliseconds and hoping for the Rendering to occur accordingly and have a smooth animation. This seems like reinventing the wheel, and I cant think of a way of implementing this in a clean and simple manner.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:32:38+00:00Added an answer on May 26, 2026 at 2:32 am

    It is impossible to get a constant framerate in WPF. WPF is based on the idea of dynamic frame rates and this makes it near useless for any game development.

    Some related information:

    Why is Frame Rate in WPF Irregular and Not Limited To Monitor Refresh?

    http://rhnatiuk.wordpress.com/2008/12/21/wpf-video-playback-problems/

    As others have pointed out the solution is, unfortunately, not to use WPF for game development.

    I have worked with WPF animations extensively and it is an absolute pain to get anything to smoothly animate in WPF (if you do want to do this I’ve written down a few best practices here).

    I am sure there are many other reasons why WPF is not good for game development. One example is that you cannot create a full screen application in WPF as WPF apps are always windowed. This means that you could not change the resolution for your game to make it smooth in full screen which effectively means that you could not create a full screen game in WPF and expect good results.

    If you are serious about your game or game development in general and this is not just a prototype or just-for-fun then I recommend that you ditch WPF and use something else, otherwise you just set yourself up for disappointment and sub-par quality.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a simple game using HTML and CSS. I have a background image
I have seen several methods for creating simple fixed width single column layout using
I am creating a simple application using the MVC design pattern where my model
I have made a program in Flex for creating simple schedules, similar to MS
I'm creating a simple WP7 app, to have all network settings in one place,
I am creating a simple Jigsaw puzzle. In order to do this, I need
I am creating simple console application where I need to load RTF file to
I'm looking for help/advice with creating simple JSP website using equivalent of PHP include+switch
Im creating a simple Rails 2.3.8 gem and need a migration file inside it.
I was creating a simple command line utility and using a dictionary as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.