Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The optimization #115
The issue of the frame rate drop is actually down to the CPU usage usually, and not the GPU usage.
Though judging by the images above it looks like it could be GPU related, though its more commonly the processor for most as that causes the "Drain" on frame rate.
The game has a few optimizations needed in the main update loop, it runs a lot of its update code on a single core. This would normally perform alright but the game does have a few areas to optimize.
The reason for the frame rate drops is how Monogame's timing works, if the update loop takes too long it begins skipping draw calls, the further behind it gets the more this compounds in an effort to catch up. draw calls don't really take almost any amount of cpu however but this behaviour isn't something I think can be overridden with any ease.
eventually it reaches a minimum draws / second, which is your lowest FPS you will reach.
Once it has fallen behind it takes time to "Catch back up" so the FPS loss feels like a wind-up and unwind. you can look up XNA or Monogame timing on how this really works if you wish.
Last time I examined performance, it was a lot of ray casting and map entity updates, Beyond this I don't really know much more.