Post subject: Different System timer
Skilled player (1195)
Joined: 11/13/2011
Posts: 87
Location: Celestial Empire
I worked on Win 7 with a VM, when I finished a WIP and playback, it desynced because System timer is different. I playbacked again but the system timer changed again, what's happened? There are the info twice I playbacked with the same movie:
The king is always lucky.
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
Hard to know exactly what went wrong. I am assuming some hook for time-keeping is not accurate enough for this game. Delete the hourglasslog.txt in question. In Hourglass, choose Runtime -> Debug Logging -> Print Categories, select "all" (it's almost at the bottom). Abort playback when the desync warning comes up. Upload the log somewhere and link it back. Maybe the error will show itself.
Skilled player (1195)
Joined: 11/13/2011
Posts: 87
Location: Celestial Empire
I can’t get any log because hourglass didn’t create the log file when I playbacked. But I found other way to run the game with hourglass.I tried on other computer and hourglass can load the game successfully, I think my system is something go wrong, will fix it.
The king is always lucky.
Joined: 7/16/2009
Posts: 39
I experience the exact same thing with another game, Ys II Complete. Even if I attempt to create the movie file with a different starting system timer value (usually, I just go with the default 6000), it desyncs very quickly. As Bernka noted, it's not always at the same spot; quite the opposite in fact, and so it's pretty much impossible to play back the movie correctly. Incidentally, this is not an issue in the prior release of the game, Ys II Eternal, even though the two versions appear to be almost 100% identical to one another gameplay-wise, excepting a couple bug fixes and other small updates. Even so, both versions appear to have another bug in Hourglass, in that neither of them will allow the game to be sped up whatsoever (none of these issues are present in Ys I, but then again, it is my understanding that Ys I is very different code-wise from Ys II). So, I've got logs for both the Eternal and Complete versions, if you need to compare them. Hourglass settings are at the default values for r81, and the OS is Windows XP, SP3: Complete - https://www.mediafire.com/?ocwdndvcodq0bk8 Eternal - https://www.mediafire.com/?9vfdxqd57ghuya9
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
Thanks, I will look over these and see if I can figure out why the timer desync.
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
I have looked over the logs, and it's nothing at all that could cause this as far as I can see. Which means the error lays deeper than what the logs can show. It's unfortunate as the fix will not be easy, nor attempted now. I have been tracking a VERY similar issue on IRC with another member. We believe it may have something to do with threads not being run deterministically enough. But it's hard to say what is really the problem.
Joined: 7/16/2009
Posts: 39
Hmm, well, thanks for taking a look at it. Any idea why the games are ignoring the fast-forward command in Hourglass? That's something I can live with, but it's still a bit annoying.
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
I am sorry about the timing issue, when I am done with my current project, I am going to attempt to get threading more stable in wrap-mode as well trying to fix the timing so that it will be stable. Fast-forward isn't like in emulators, and only works under certain conditions, in your case the games probably aren't using the required functions to make those conditions possible, or they are using so much CPU time in their game-loop that your hardware isn't powerful enough to fast-forward. What fast-forward does (in a simplified explanation, because I myself don't know everything behind it yet) is that it ignores Sleep and SleepEx, and similar functions.
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
I just submitted an internal patch for initial testing, realized a possible cause of this and wrote up a quick hacky solution to test my theory. If initial testing seems fine, I MIGHT publish a test-binary here for testing with Ys etc.. Note that the possible binary isn't fit for TASing if you want to submit the result, it would ONLY be for testing.
Skilled player (1743)
Joined: 9/17/2009
Posts: 4986
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
Warepire wrote:
What fast-forward does (in a simplified explanation, because I myself don't know everything behind it yet) is that it ignores Sleep and SleepEx, and similar functions.
Is that what Cheat Engine do for their speedhack function as well? OR is it different for that program?
Warepire
He/Him
Editor
Joined: 3/2/2010
Posts: 2178
Location: A little to the left of nowhere (Sweden)
I have no idea what Cheat Engine does, I never looked at their code, not to mention that Cheat Engine is written in Delphi which is a language I am not familiar with.