Friday 3 May 2013

Smoother FEZ

UPDATE 2:

New 1.04 patch for FEZ includes a new value for time step and a new command line parameter to use variable time steps as a beta test. With 1.04, you can see FRAPS shows now 60 fps instead of 58, but the game has judder anyway. So, for me, this is not the final fix and if you want real smooth, it's better that you  use modified DLL or custom refreshrate discussed below.



UPDATE 1:

CruelToot user in steam community has created a modified DLL that link FEZ framerate to refreshrate. This is his message in steam:

I made a modified MonoGame.Framework.dll that makes the game much smoother for me. It basicaly locks the game logic updates to the the screen updates. I uploaded the modified file here http://pastelink.me/dl/9bc3a2. Just replace the one in your FEZ folder. I have one tested the first few minutes of the game, so I don't know if it breaks any puzzles or anything like that. Vsync needs to be enabled or the game will in way to fast. And if your machine is too slow to do a solid 60 fps I think what will happen is that the game will run in slow motion. Hopefully this will help at least some of you. 

Link of message: FEZ steam discussion
Link of DLL file: CruelToot DLL fix for judder

NOTE: Replace DLL file (make a copy of the original file first) into steam FEZ folder. Some users have detected a higher CPU use with this DLL. In my case the CPU use is 35%. Remember to force Vsync ON for perfect and smooth gameplay. If you don't want to replace the file, you can use the first fix detailed below.


****************************************************



Finally I decided to enter some info about games beyond Crysis series.

I preordered FEZ in steam weeks ago and downloaded few minutes after realease. Inmediatly I notice an annoying judder. Every second the game miss one or two frames producing constant and periodic pauses.

Using FRAPS you can see FEZ is limited to something near 58 fps and you can't fix that.


My first suspicion was that the FixedTimeStep plus an incorrect TimeStep period value into the game are creating this problem (set_IsFixedTimeStep and set_TimeStep are the related variables into FEZ source). I created a program to modify windows timer resolution but I find it's impossible to rise timer period if any other program has set a lower value. This is a normal behaviour for windows timer resolution to avoid a new launched program can set a lower resolution (higher value) that interfere with the proper operation of an application previously launched and still running.

Then I tested ArtMoney to modify variables values into FEZ process while runing, but the blind test was useless. Too many variables with similar values.

Finally I used MSI Afterburner to identify a more precise value of FEZ framerate and then create a custom resolution with that refreshrate. This is my actual solution and provides a perfect smooth framerate.

Maybe you need to use MSI Afterburner to identify the exact FEZ framerate in your computer if it's not the same than in my case.

FEZ framerate in my computer is 57.7 fps. FRAPS shows 58 fps.

Steps to create a custom resolution (this is a step list for nvidia users):

- Open Nvidia control panel
- Go to Screen -> Adjust size and position
- Select Aspect Ratio mode
- Scaling in GPU
- Go to Screen -> Change resolution
- Click in Customize.. button
- Click in New custom resolution button
- Resolution showed must be your native resolution. Don't touch Horizontal pixels
- Reduce vertical lines in 2 units (1200 to 1198, 1080 to 1078, etc depends of your native resolution)
- Set Refreshrate to 57
- Click in Sync/standard -> Manual
- Change the vertical refresh rate in the bottom right to 57.750
- Click "Test"
- After monitor test the new resolution, if all is ok, click Yes button to save the resolution.
- Don't bother is Control Panel shows your custom resolution refreshrate as exact 58 hz, internally will be different because the representation is a rounded integer.


Start FEZ and look the judder during zooming to FEZ letters. Enter into the options menu and select the new resolution (1920x1198, 1920x1078, or whatever). Restart the game and if everything is perfectly fluid, it went well. Good luck and enjoy that awesome game as must be.


61 comments:

  1. I'm Nuninho.

    I tried to apply 58.600 Hz at manual in NVCP but 58.000 due to integer only. :(

    ReplyDelete
    Replies
    1. Don't worry, the number showed is always rounded but internally works with decimals you put.

      Delete
  2. Hey there, developer here :)

    What did you do on the MonoGame DLL code-wise? I'd like to change the code itself because I'm probably going to keep working on changes on MonoGame and can't use a fixed binary like this.

    It's pretty amazing that you got it fixed without the source!

    ReplyDelete
  3. It's just a hack and not a fix.
    It changes the line
    this._accumulatedElapsedTime += this._gameTimer.Elapsed;
    into
    this._accumulatedElapsedTime += this._targetElapsedTime;
    in Tick()

    Which basically simplifies the entire function down to:
    DoUpdate(targetElapsedTime);
    DoDraw();
    With no sleep or anything.

    So the game always runs perfectly in sync with the screen.
    But if the machine is too slow to do a solid 60fps or vsync is off the game will run at the wrong speed.

    ReplyDelete
  4. Some thoughts for a more general solution
    Perhaps one could keep some of the logic and just check if the last frame was longer than 16.6 ms and do an extra DoUpdate() to catch up for slower machines.
    Unfortunately I don't have any machine that can't do 60 fps so I have no way to test it.

    This would still break if the screen is not 60HZ or vsync is off.

    ReplyDelete
  5. Hi, thanks for the response.

    I'll add a CLI flag to do what you hack did, at least people that had success with your hack will be able to use it without replacing the DLL.

    MonoGame already does some of the logic you describe, and it's pretty sensitive stuff, so I'll leave it at that for now. Once the larger issues are resolved I can test with a beta branch on Steam and see what works.

    ReplyDelete
  6. I feel honored for this conversation. Thank you both.

    ReplyDelete
  7. File is missing , please put it somewhere more sensible than a file dump.

    Usenet , torrent etc are options with acceptable longevity without a single point of fuck-it-upitude .

    Thnx in advance for placing it somewhere else.

    Or , if aforementioned command line parameter is already implemented , please specify it.
    (for me starting fez.exe has it complaining I haven't got steam running in the background , which I have.)

    Thnx.

    ReplyDelete
  8. Could you rehost CruelToots dll. The link does not work anymore. :-(

    ReplyDelete
  9. Just wanted to say I love reading through your blog.
    บาคาร่า
    จีคลับ
    gclub

    ReplyDelete
  10. This process is very interesting to me. I would like to study it a lot. For those who want to study this, hurry to read this web too.


    บาคาร่าออนไลน์

    ReplyDelete
  11. ร้อยไหม
    ร้อยไหมปรับรูปหน้า ปรับรูปหน้าที่ไหไนดี ร้อยไหมที่ใด











    ดี? กังนัมสถานพยาบาล



    เป็น



    คำตอบไม่ว่าจะเป็น ร้อยไหมหน้าเรียว เป็นวีไลน์แบบประเทศเกาหลี



    ด้วยไหมก้าง



    ให้ท่าน



    งาม



    แบบประเทศเกาหลี



    ลดอายุ หน้าเด็ก ไม่เจ็บ ไม่บอบช้ำ



    ไม่บวม หน้าเป็นวีเชฟ ลดเหนียง เหนียงกระชับสมปรารถนา






    ร้อยไหม เป็นอย่างไร






    การร้อยไหม เป็น



    เทคโนโลยีที่ช่วยขจัดปัญหา









    ผิวหน้าที่ไม่กระชับ หย่อนยาน



    คล้อย ให้กลับมากระชับ หน้าเรียว เต่งตึง เข้ารูป วีเชฟได้สมใจอยาก




    ร้อยไหม ปรับรูปหน้า
    ร้อยไหม pantip

    ReplyDelete

  12. ผลบอล livescore ตารางบอล lockpol วันพรุ่ง ตารางบอลเมื่อคืนนี้ โปรโมชั่นที่มากที่สุดในไทย!


    เว็บไซต์เช็คผลบอล ผลิดอกออกผลการประลอง เร็วทันใจที่สุด เหมาะกับนักการพนันทุกคน ไม่ว่าจะเป็น ผลบอลสด ผลมวยสด ผลบาสสด แล้วก็กีฬาฯลฯ ด้วยระบบการแสดงผลที่เรียบง่าย และก็เร็วมองง่ายสบายตา ทำให้ 7M เป็นเว็บไซต์เช็คผลที่เกิดขึ้นจากการแข่งขันบอล และก็กีฬาต่างๆยอดนิยมมากมายจนถึงทุกวันนี้ เนื่องจากว่าอัพเดตข้อมูลวงการกีฬาบอลเร็วเยอะที่สุด ให้ข้อมูลแบบถูกเร็วทันใจ ทั้งยังยังรับพนันบอลด้วยบริการที่ปลอดภัยโคนยปัญหาลูกค้าสูงที่สุดเลยก็ว่าได้ หากท่านสมาชิกเป็นแฟนพันธุ์แท้สำหรับเพื่อการพนันบอล แทงมวยแล้วละก็ไม่สมควรพลาดที่กำลังจะได้ยินชื่อเว็บของพวกเรา เป็นอย่างไม่ต้องสงสัย เพราะทางเว็บไซต์มีตารางผลบอลสด ที่อัพเดทแบบวินาทีต่อวินาที

    พอใจติดต่อมาและสอบถามรายละเอียดเพิ่มเติมถึงที่เหมาะไลน์แอด ID: @ufa98v2

    ReplyDelete
  13. I have recently started a web site, the info you provide on this site has helped me greatly. Thanks for all of your time & work. Feel free to visit my website; 야설

    ReplyDelete
  14. That is a very good tip especially to those new to the blogosphere. Short but very accurate info… Appreciate your sharing this one. A must read post. Feel free to visit my website;
    한국야동

    ReplyDelete
  15. Awesome blog!! Thank for providing excellent information. Actually quite helpful data accessible here Feel free to visit my website; 국산야동

    ReplyDelete
  16. I was very pleased to discover this website. I wanted to thank you for your time for this fantastic read!! I definitely liked every part of it and i also have you saved as a favorite to see new stuff on your website. Feel free to visit my website; 일본야동

    ReplyDelete
  17. อยากเลิกใช้ รถมือสอง ต้องเล่น slot pg อยากเลิกใช้รถมือสอง เปลี่ยนเป็นรถมือหนึ่งมีเงินดาวน์รถได้สบายๆต้องมีช่องทางหาเงินเพิ่ม เข้ามาเล่น slot pg เลย มีเงินใช้เเน่นอน

    ReplyDelete
  18. Joker123 ทำให้การเล่นเกมส์ สล็อต ออนไลน์ของท่านง่ายแล้วก็สบายเพิ่มขึ้น ไม่ต้องเสียเวล่ำเวลาเดินทาง ไม่ต้องเสียเวล่ำเวลารอคอยการฝากเงินอีกต่อไปด้วยการให้บริหารผ่านระบบอัตโนมัติ

    ReplyDelete
  19. Anda pada kenyataannya webmaster yang sangat baik. Kecepatan loading website yang menakjubkan. 토토


    ReplyDelete
  20. I am very happy to read this one. This process is very interesting to me. I would like to study it a lot. Thanks for sharing this blog. Now it's time to avail HALFCASTE CREAM SET for more information.

    ReplyDelete
  21. I would like to thank you for this article. It solves my lots of problems. Now its time to avail limo service concord ca for more information.

    ReplyDelete
  22. I like this weblog very much,

    ReplyDelete
  23. Fez is a foreign exchange student. He has a strong accent and lisp. He tries to pick up girls but is not very good at it. He is a big fan of Jackie for more info visit our Shop Referal

    ReplyDelete
  24. Keep it up and best of luck for your future blogs and posts.

    ReplyDelete
  25. Thank you for sharing this useful information, I will regularly follow your blog.

    ReplyDelete
  26. Hope I'll get such posts in future too.

    ReplyDelete
  27. truly appreciate this post. I’ve been looking everywhere for this!

    ReplyDelete
  28. It’s very nice. Congratulations.

    ReplyDelete
  29. it was really great for me – I was looking for such a thing

    ReplyDelete
  30. Thank you for the very useful information.

    ReplyDelete
  31. Discover high-quality Gorman Rupp Pump Parts for optimal performance. Shop our extensive range of Gorman Rupp pump parts to keep your machinery running smoothly and efficiently. Trust in our reliable selection of Gorman Rupp pump parts for durable solutions to your pumping needs. Explore our catalog now!

    ReplyDelete
  32. This article is really helpful for me. This article gives me the confidence and the courage. Keep share your thoughts with us. Now its time to avail Interior Painting Services in Fort Worth Tx for more information.

    ReplyDelete
  33. Thanks for sharing such an informative blog. The author has given absolute justice to the topic and presented in an understandable manner. Keep up the good work.
    Waste management design | Signage design

    ReplyDelete
  34. Informative article you've done. This site is very useful. Thanks

    ReplyDelete
  35. Hi! I like to give you a huge thumbs up for the great info right here

    ReplyDelete
  36. You provide the correct information here I really bookmark it

    ReplyDelete
  37. You make so many great post here that I read this article twice.

    ReplyDelete
  38. This excellent website truly has all of the info I wanted concerning this subject and didn’t know who to ask.

    ReplyDelete
  39. I am satisfied that you simply shared this useful info with us.

    ReplyDelete
  40. There is certainly a great deal to learn about this topic.

    ReplyDelete
  41. Hi, happy that i saw on this in google. Thanks!

    ReplyDelete
  42. I am practically satisfied with your great work.

    ReplyDelete
  43. thank you for sharing such a great bog it is very helpful.

    ReplyDelete
  44. I think the reason reading is fun is because it is a post related.

    ReplyDelete
  45. Wow, amazing blog format! How long have you been blogging for.

    ReplyDelete
  46. “You are so entrancing! I figure I haven’t actually examined anything indistinct at this point.

    ReplyDelete
  47. Thank you for making something worth reading.

    ReplyDelete
  48. This has been a really wonderful post. Thanks for providing this info.

    ReplyDelete
  49. I am realy extremely glad to visit your blog.

    ReplyDelete
  50. Looking to break into the world of Screenwriting? Look no further than The Successful Screenwriter. Unlock the secrets to success in the competitive field of Screenwriting with expert tips and strategies. Master the art of storytelling and create compelling scripts that will captivate audiences. Start your journey to becoming a successful Screenwriter today.

    ReplyDelete