I am attempting to make a idle game but am having issues with framerate. How do I identity where the issue is. My current guess is actually with a spinning gear that spins every frame based on the speed of the crank. I have no evidence for this however. How do I identify where lag is coming from?
It would be very hard to help you given this little details you've provided. You may:
- provide the source code (all or an MRE)
- try an elimination method: removing parts of functionality to pin a bottle neck
- but best of all: profile your code. The emulator already has a few very good tools for that built in.
Sample() works but I'm not quite sure how many ms is evidence of an issue.
If you're rotating an image every frame (a very expensive process) it's quite likely that.
The solution is to pre-rotate images and store them as an image table that can be loaded at startup.
Basically, you want to avoid doing anything repeatedly that you can do once before hand or on initialization.
You can use the Sampler window to see where in your code the problem is.