Pages: 1
Author Topic: room_speed  (40,308 Views)
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Posted on: February 28, 2011, 08:03:22 AM
What's with the room_speed? Setting to 30, it certainly looks to be running a lot more than 30 steps every second.


Tracker Reference:
http://enigma-dev.org/tracker/ticket.php?id=86
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #1 Posted on: February 28, 2011, 02:30:11 PM
room_speed doesn't work. The speed is constant to your refresh rate (you can't turn that off as well). So we need to wait until this is implemented or even benchmarks are impossible.
Post made March 01, 2011, 02:48:31 PM was deleted at the author's request.
Offline (Unknown gender) RetroX

Master of all things Linux
Contributor
Joined: Apr 2008
Posts: 1,055
View profile
Reply #3 Posted on: March 02, 2011, 03:52:37 AM
It works, I believe, but it doesn't change after the game has started.
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #4 Posted on: March 03, 2011, 02:16:56 AM
It works sometimes. I can't seem to make it play nice on all computers. *shrug*
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #5 Posted on: March 04, 2011, 06:14:14 PM
edit: nevermind
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #6 Posted on: March 04, 2011, 07:21:16 PM
rs = room_speed, polygone.

Sleep(1000/room_speed) assumes ideal framerate; it pretends that no time at all was consumed between the end of that frame and the frame before.

I realize now that it should be handled instead by a timer, at the beginning of the frame. Should the frame take longer than 1/room_speed seconds, the timer would fire before its completion, harmlessly posting an event in the queue to be handled. Upon completing that frame, the event code will be received, and the next frame will fire, immediately setting the timer to 1/room_speed again. I may need to use a thread for it on Linux, but on Windows, it's simple and the best way. Meaning I'm going to make someone else do it. Maybe.
Offline (Unknown gender) polygone

Contributor
Joined: Mar 2009
Posts: 794
View profile
Reply #7 Posted on: March 04, 2011, 07:52:46 PM
Oh I see what it's doing now, I misunderstood it's purpose.
Pages: 1