{"action":"created","issue":{"url":"https://api.github.com/repos/mono/MonoGame/issues/4804","repository_url":"https://api.github.com/repos/mono/MonoGame","labels_url":"https://api.github.com/repos/mono/MonoGame/issues/4804/labels{/name}","comments_url":"https://api.github.com/repos/mono/MonoGame/issues/4804/comments","events_url":"https://api.github.com/repos/mono/MonoGame/issues/4804/events","html_url":"https://github.com/mono/MonoGame/issues/4804","id":151131498,"number":4804,"title":"PresentInterval and IsFixTimeStep are bugged","user":{"login":"willmotil","id":7495196,"avatar_url":"https://avatars.githubusercontent.com/u/7495196?v=3","gravatar_id":"","url":"https://api.github.com/users/willmotil","html_url":"https://github.com/willmotil","followers_url":"https://api.github.com/users/willmotil/followers","following_url":"https://api.github.com/users/willmotil/following{/other_user}","gists_url":"https://api.github.com/users/willmotil/gists{/gist_id}","starred_url":"https://api.github.com/users/willmotil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmotil/subscriptions","organizations_url":"https://api.github.com/users/willmotil/orgs","repos_url":"https://api.github.com/users/willmotil/repos","events_url":"https://api.github.com/users/willmotil/events{/privacy}","received_events_url":"https://api.github.com/users/willmotil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-26T13:13:24Z","updated_at":"2016-04-27T06:44:26Z","closed_at":null,"body":"RE: RE:\r\n\r\nSorry. This turns out to be a effect of the card settings.\r\nThis entire behavior is the result of turning on vsync to half adaptive on the card in both cases. By which the card overrides monogame and this is the strange behavior you get.\r\nSee the bottom post weird.\r\n\r\nRE:\r\n\r\nPresent interval One and Default is performing two Updates per One draw.\r\nThis is extremely buggy consider if you cant get two updates done in one time slice.\r\nIn Xna you would skip a draw it would all work out. With this if you skip a draw your doing 4 updates to get one draw out. **I tested this with a empty project in just game1.**\r\n\r\nIn the top image you can see that when is FixedTimeStep is off, im getting 30fps or doing 60 updates and draws at a 1 to 1 ratio. Update Draw took 2 seconds to execute 60 times. in other words my TargetElapsedTime has been halfed. I should be getting like 120 or more as fast as my system can go.\r\n\r\n```\r\nthis.IsFixedTimeStep = false;\r\nthis.TargetElapsedTime = TimeSpan.FromSeconds((double)(1.0d / 60d));\r\ngraphics.SynchronizeWithVerticalRetrace = true;\r\ngraphics.GraphicsDevice.PresentationParameters.PresentationInterval = PresentInterval.One;\r\n\r\n```\r\n<img src=\"http://community.monogame.net/uploads/default/optimized/2X/c/cbc52f1b2c80631e3a1681b6ac7053fb015584f0_1_625x500.png\">\r\nIn the lower test same image.\r\nWith it FixedTimeStep on im getting a double update per draw. \r\nWhich helps the cpu about minus 100%\r\nYou can see i verified this by using the console to confirm it was actually happening.\r\nUpdate Update Draw.\r\n\r\n\r\ncode to reproduce this test\r\n```\r\n\r\n    public class Game1 : Game\r\n    {\r\n        #region initial variable and object declarations\r\n\r\n        GraphicsDeviceManager graphics;\r\n        SpriteBatch spriteBatch;\r\n        SpriteFont MgGeneratedFont001;\r\n\r\n        private static string msgformat = \"+##.###;-##.###;#------\";\r\n\r\n        double desiredframerate = 60d;\r\n        double secs = .08d;\r\n\r\n        bool hascycled = false;\r\n        int updates = 1;\r\n        int frames = 1;\r\n        StringBuilder sb_targettime = new StringBuilder(\"  TargetElapsedTime (in seconds): \");\r\n        StringBuilder sb_drawupdateratio = new StringBuilder(\"\\n  Draw To Update Ratio: \");\r\n        StringBuilder sb_updates = new StringBuilder(\"\\n  Updates: \");\r\n        StringBuilder sb_draws = new StringBuilder(\"  Draws: \");\r\n        double timelast = 0d;\r\n        double timenow = 1d;\r\n        double fps = 1f;\r\n        StringBuilder sb_time_last = new StringBuilder(\"\\n  Time Last: \");\r\n        StringBuilder sb_time_now = new StringBuilder(\"  Time Now: \");\r\n        StringBuilder sb_time_elapsed = new StringBuilder(\"\\n  Elapsed Interval: \");\r\n        StringBuilder sb_time_fps = new StringBuilder(\"\\n  Fps: \");\r\n        StringBuilder sb_perf_msg = new StringBuilder(128);\r\n        long gcnow = 0;\r\n        long gclast = 0;\r\n        long gclost = 0;\r\n        StringBuilder sb_gc_now = new StringBuilder(\"\\n  GC Memory(kb) Now: \");\r\n        StringBuilder sb_gc_lost = new StringBuilder(\"  GC Memory(kb) Lost: \");\r\n\r\n        bool consoleran = false;\r\n\r\n        #endregion\r\n\r\n        public Game1()\r\n        {\r\n            graphics = new GraphicsDeviceManager(this);\r\n            Content.RootDirectory = \"Content\";\r\n        }\r\n\r\n        protected override void Initialize()\r\n        {\r\n            base.Initialize();\r\n        }\r\n\r\n        protected override void LoadContent()\r\n        {\r\n            spriteBatch = new SpriteBatch(GraphicsDevice);\r\n            MgGeneratedFont001 = Content.Load<SpriteFont>(\"MgGeneratedFont001\");\r\n\r\n            this.IsFixedTimeStep = false;\r\n            secs = TimeSpan.FromSeconds((double)(1.0d / desiredframerate)).TotalSeconds;\r\n            this.TargetElapsedTime = TimeSpan.FromSeconds((double)(1.0d / desiredframerate));\r\n            graphics.SynchronizeWithVerticalRetrace = false;\r\n            graphics.GraphicsDevice.PresentationParameters.PresentationInterval = PresentInterval.Default;\r\n        }\r\n\r\n        protected override void UnloadContent()\r\n        {\r\n        }\r\n\r\n        protected override void Update(GameTime gameTime)\r\n        {\r\n            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))\r\n                Exit();\r\n\r\n\r\n            if (updates >= 60)\r\n            {\r\n                consoleran = true;\r\n                //timenow = TimeSpan.FromSeconds((double)(1.0d / 60d)).TotalSeconds;\r\n                timenow = gameTime.TotalGameTime.TotalSeconds;\r\n                double dif = (timenow - timelast);\r\n                fps = frames / dif;\r\n                sb_perf_msg.Length = 0;\r\n                sb_perf_msg.Append(sb_targettime);\r\n                sb_perf_msg.Append(secs);\r\n                sb_perf_msg.Append(sb_time_last);\r\n                sb_perf_msg.Append(timelast);\r\n                sb_perf_msg.Append(sb_time_now);\r\n                sb_perf_msg.Append(timenow);\r\n                sb_perf_msg.Append(sb_time_elapsed);\r\n                sb_perf_msg.Append(dif.ToString(msgformat));\r\n                sb_perf_msg.Append(sb_time_fps);\r\n                sb_perf_msg.Append(fps.ToString(msgformat));\r\n                sb_perf_msg.Append(sb_drawupdateratio);\r\n                float ratio = (float)frames / (float)updates;\r\n                sb_perf_msg.Append(ratio.ToString(msgformat));\r\n                sb_perf_msg.Append(sb_updates);\r\n                sb_perf_msg.Append(updates.ToString(msgformat));\r\n                sb_perf_msg.Append(sb_draws);\r\n                sb_perf_msg.Append(frames.ToString(msgformat));\r\n                timelast = timenow;\r\n                frames = 1;\r\n                updates = 1;\r\n                gclast = gcnow;\r\n                gcnow = GC.GetTotalMemory(false);\r\n                gcnow = (long)(gcnow / 1000);\r\n                sb_perf_msg.Append(sb_gc_now);\r\n                sb_perf_msg.Append(gcnow);\r\n                gclost = gcnow - gclast;\r\n                if (gclost < 0)\r\n                {\r\n                    sb_perf_msg.Append(sb_gc_lost);\r\n                    sb_perf_msg.Append(gclost);\r\n                }\r\n            }\r\n            if (!consoleran) { Console.WriteLine(\"update\"); }\r\n            //\r\n            updates++;\r\n            base.Update(gameTime);\r\n        }\r\n\r\n        protected override void Draw(GameTime gameTime)\r\n        {\r\n            GraphicsDevice.Clear(Color.Wheat);\r\n\r\n            spriteBatch.Begin();\r\n\r\n            spriteBatch.DrawString(MgGeneratedFont001, sb_perf_msg, new Vector2(10f, 10f), Color.MonoGameOrange);\r\n\r\n            spriteBatch.End();\r\n\r\n            if (!consoleran) { Console.WriteLine(\"draw\"); }\r\n\r\n            hascycled = true;\r\n            //\r\n            frames++;\r\n            base.Draw(gameTime);\r\n        }\r\n\r\n    }\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/mono/MonoGame/issues/comments/214986194","html_url":"https://github.com/mono/MonoGame/issues/4804#issuecomment-214986194","issue_url":"https://api.github.com/repos/mono/MonoGame/issues/4804","id":214986194,"user":{"login":"willmotil","id":7495196,"avatar_url":"https://avatars.githubusercontent.com/u/7495196?v=3","gravatar_id":"","url":"https://api.github.com/users/willmotil","html_url":"https://github.com/willmotil","followers_url":"https://api.github.com/users/willmotil/followers","following_url":"https://api.github.com/users/willmotil/following{/other_user}","gists_url":"https://api.github.com/users/willmotil/gists{/gist_id}","starred_url":"https://api.github.com/users/willmotil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmotil/subscriptions","organizations_url":"https://api.github.com/users/willmotil/orgs","repos_url":"https://api.github.com/users/willmotil/repos","events_url":"https://api.github.com/users/willmotil/events{/privacy}","received_events_url":"https://api.github.com/users/willmotil/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T06:44:26Z","updated_at":"2016-04-27T06:44:26Z","body":"Well thinking about it now, I wonder if there is a way to query if the card is overriding the applications settings, it would be nice.\r\n\r\nHow can one make the user or user of the api or framework who encounters this problem.\r\nAware that his video card settings may affect fixed timestep, draw interval and ignore what he sets vsync to as well ? I mean i guess you could put a comment in the vertical retrace property. That's about all i can think of.and still it can affect the other things as well."}}