Innaccurate fps to FlxG.stage.frameRate
- Haxe version: latest stable
- Flixel version: latest stable
- OpenFL version: latest stable
- Lime version: latest stable
- Affected targets: desktop, others untested.
Take a basic project. Make an openfl.display.FPS and add it in main. In your Starting state, set FlxG.stage.frameRate to your monitors current hz. In your project.xml, make sure vsync="true" for your target. Compile. The FPS display will be accurate to your actual hz, sometimes with a difference of around 1 or 2. In project.xml, change vsync to false. Compile. The FPS display will be inaccurate.
144 stage.frameRate displays ~168, 60 does 64. Test with whatever numbers you'd like. if you're skeptical, try 90 fps and then try 91. The display from 92 to 102. That's definitely not right.
Observed behavior: Setting fps with vsync results in drastically different frame times than with FlxG.drawFrameRate or FlxG.stage.frameRate
144 hz vsync:
frameRate set to 144, no vsync:
Expected behavior:
Fps values maintain consistent and predictable using vsync or in game frameRate.
I don't know how this went unnoticed so long.
this is an openfl/lime problem flixel can't really do anything about it
this is an openfl/lime problem flixel can't really do anything about it
^
This issue can also be produced on a standard openfl create template.
Main.hx:
package;
import openfl.display.Sprite;
class Main extends Sprite
{
public function new()
{
super();
addChild(new openfl.display.FPS());
stage.frameRate = 144;
}
}
Someone wanna raise this up to openfl/lime?
Plz link this issue in there so it connects
https://github.com/openfl/openfl/issues/2710#issue-2328867866