Posts for nitsuja


Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Seppel wrote:
I'm running the game in windowed mode.
I think it's better to run it in fullscreen mode, since otherwise encodes will be missing some graphical effects, and I can't think of any reason to use windowed mode (both options run inside a window in Hourglass) unless you're affected by some bug that prevents fullscreen mode from working. I tried hex-editing your movie to choose fullscreen mode at the beginning, and it didn't seem to change the sync at all: here's the movie file and here's an encode of it.
Seppel wrote:
I'm running Win7 64bit.
Considering how sensitive this game is to slight timing variations and how different your system is from mine (Windows XP), I was expecting your movie to desync miserably for me, but it managed to sync perfectly fine. Windows 7 64-bit apparently introduces a lot of extra instability to savestate loading compared to Windows XP (except perhaps if you have a certain lucky combination of drivers). So it doesn't surprise me that you're having some problems with savestates. But based on what I've seen the few chances I've had to run Hourglass on a Windows 7 computer, I'm optimistic that this is a fixable issue. (Basically, the "weak points" of savestates appear to be the components that interact with the (mainly video) hardware, but I could replace those components with a little high-level emulation to make the savestates more stable.)
Seppel wrote:
nitsuja wrote:
Maybe it's more complicated than that, since I tried doing a test run where I smashed all the overhead lights, and it seemed like I would sometimes lose a frame and sometimes not, or at least there was some amount of variance.
Oh yeah, his dev log speaks about ceiling issues as well: 14 Nov 2004 "Fixed Iji stopping momentarily while hitting ceiling when jumping." Apparently he didn't, haha.
Well, those probably aren't the same thing, since a ceiling lamp has quite different collision properties from a ceiling. Also, I thought I noticed a slight variance in the time lost by doing regular jumps depending on how long jump was held or something, including the jump that's used to cancel a wallclimb very slightly early. But maybe I'm not remembering that right.
Seppel wrote:
Here's my hourglasslog.txt file: here
I saw some "this should never happen" kind of printouts in that log, and I put in a fix for one of them, so could you try again in r51? I'm also seeing "FAILED TO LOAD THREAD" and "FAILED TO WRITE MEMORY REGION" errors, which would almost certainly cause the game to crash... I'm still looking into fixing those, but at least they're clear errors that I can detect easily rather than mysterious failures.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Seppel wrote:
For some reason, the AVI doesn't start recording until a few seconds into the run.
This doesn't happen for me. What was onscreen when the AVI save dialog popped up? Could it be a problem with the codec or post-processing? If you do "audio only" and "video only" separately, do they start at different times? Can I see your movie file to check whether it syncs?
Seppel wrote:
Savestating twice on the same frame crashes Iji.
This doesn't happen for me either. Can I see the crash log? (should be in hourglasslog.txt) Also, see if any of the following options help: - disable DirectSound creation (sound menu) - disable Pause Helper (runtime menu) - disable multithreading (radio button) - disable storing video memory or guarded memory in savestates (runtime > performance menu) I just remembered I'm using Iji 1.4. I should try 1.6.
Seppel wrote:
Crack and wallclimb can be jump-canceled.
Cracking and upgrading and teleporting and landing from a height can be jump-canceled. I tried the ledge climb jump cancel in 1.4 and it seems to barely exist (maybe saves 1 frame if used with TAS precision?), despite the game's author saying it does and attempting to use it in a real-time speedrun.
Seppel wrote:
Iji stands still for 1 frame after each jump (it was the best way Daniel Remar could work the collision check, iirc), so jumps must be optimized.
Maybe it's more complicated than that, since I tried doing a test run where I smashed all the overhead lights, and it seemed like I would sometimes lose a frame and sometimes not, or at least there was some amount of variance.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Some video drivers apparently force extra threads to spawn in the game process (which causes all sorts of problems), or drop support for certain format conversions, or simply have bugs. I think the only real solution, especially where savestate stability is concerned, is to fully emulate every technology that can interact with the display hardware (I'm already emulating DirectSound, but haven't gotten around to DirectDraw and such yet). Then I can hoist the actual final rendering and audio output into a separate "emulator window" process that's unaffected by Hourglass.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Squ4ll- wrote:
What are the limitations of Hourglass? Does it support games up to for example directX 9, or just any game that is designed for a win32 platform?
These technologies are supported:
  • Direct3D version 9 or earlier
  • DirectDraw
  • GDI rendering
  • DirectSound
  • DirectInput
  • Win32 API
These things might work in certain cases but are problematic:
  • OpenGL (it's only fully supported if the game doesn't use any shaders or extensions or line rendering)
  • DirectMusic
  • DirectShow Audio
  • rendering without a backbuffer
  • using the registry or writing files
  • launching other executables
  • using multiple threads for resource loading or audio streaming
These things are not supported yet:
  • Direct3D version 10 or later
  • Mouse input
  • Joypad input (though you can map joypad buttons to keys for TASing)
  • Raw Input (e.g. double-mouse support)
  • DrawDib
  • DirectShow Video
  • waveOut
  • midiOut
  • XInput
  • XAudio2
  • WASAPI
  • Direct2D
  • networking
  • rendering of or interaction with native GUI elements (buttons, menus, dialogs, windows)
  • using multiple threads for game logic or rendering
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
I'm not sure how TAS-worthy this game is, but it's now "officially supported" in the latest version of Hourglass. In particular, that means you shouldn't need to use external video capture programs anymore to make AVIs of it.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
In the newest version of Hourglass this should be fixed. We should both be able to play back either version of the movie no matter what our keyboard language is set to. About the actual movie: It syncs great for me all the way to the ending, even if I fast-forward it. Compared with the ones on nicovideo, I think yours is a little slower, especially near the beginning of the run, but I guess that difference can be seen in the rerecord count too, and you said yours wasn't a serious TAS. But it's possible that certain parts of your movie are faster anyway (I didn't compare them that carefully).
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
MikeRS wrote:
I tried to do an audio-only dump at high speed, but only the sound effects came out; no music. Not sure why :|
It works fine for me every time, although I do get that effect if I disable either DirectSound creation or multithreading, which shouldn't happen for one of those cases, so I guess there's at least one bug here. (EDIT: in case anyone else reads this, the solution was "don't disable multithreading while capturing audio", so you can ignore this paragraph of guesswork.) For now, you'll probably have to try it a few times with different options, such as not using fast-forward but still doing audio-only, or encoding the audio directly to 56kBit/s MP3 instead of PCM, or waiting until it gets past the title screen to turn on the fast-forward, or simply trying again with the same settings. If you listen to it while it's encoding and you don't hear any music then you can already stop it right away instead of waiting until you play back the AVI.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Ah, okay, so you're using a German keyboard and I apparently have a bug with handling that. If I convert your movie to use a US keyboard like this, it plays back fine for me. Can you clarify something for me? You were pressing the Y key at the bottom-left of your keyboard to jump? And if you go into the in-game options > key config menu, does it say Z or Y next to Jump? (If the menu is all empty, try again with AppLocale, or the app locale setting in Hourglass.)
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Note that there are some existing runs of the game already (one full-game TAS for each playable character, I think). I couldn't get this game to run in Hourglass before, but with your settings it does run. (I'm just surprised it doesn't desync like crazy with wait sync set to asynchronous.) I would add "Runtime > App Locale > Force Japanese Locale" to those settings, even though it works without it, since some text might be invisible if it's not used. I was not able to get your run to play back, because I think you aren't using the default configuration of Z to jump and X to attack (and the movie doesn't save the game's files in it, of course, so I don't have your modified config.dat). What controls were you using? The movie can probably easily be hex-edited to work with the default controls, which you can set by simply deleting your config.dat file. Controls should be configured in Hourglass's Input menu instead.
Post subject: Re: Rockman 7 "Famicom"
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
This synced for me with your config. The music crackling in AVI issue is because this game's music does that if the framerate gets too low, like Perfect Cherry Blossom. There's an easy workaround for it: Select "Capture Audio Only" and check the "Fast-Forward" box to make sure it runs at a high framerate while it's dumping the audio so that there isn't any clicking. Then you can play the movie again and capture only the video this time, then combine the audio and video into one AVI in something like virtualdub. EDIT: Also, it would be better if other people don't need to edit their config file to play you movie. Is there some special reason you couldn't use the default config?
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
turbofa wrote:
This version work (without the sounds and music), but doesn't start with hourglass even if I use those settings.
Works for me (besides the sound/music, although they work too in this version). Can I see your hourglasslog file of when it fails? Also, if you're not using Windows XP, have you tried enabling the options in the DLL loading menu in addition to the app locale setting?
turbofa wrote:
I don't think is incompatible, because there is a TAS of this (if you have a nicovideo account, see the video in my post above)
By the way, no account is needed to watch that video (here).
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Hourglass might be able to support such executables in the future, but they don't appear to work at all in it for now. I suspect that Flash uses multiple threads in a problematic way. I was able to get VVVVVV to run in Hourglass after disabling many features, which would be no good for TASing but at least it establishes that the exe doesn't seem to be actively defending against what Hourglass does.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
turbofa wrote:
EDIT I can't find a good version of this. Every time I download the second, when i open the exe it play the first without music. And doesn't open with hourglass
I don't know about the music in Syobon Action 2 (maybe not supported yet?) but this seems to be a good download, and it contains the levels from the first game too so it makes sense that you'd see them (you can skip them by pressing 5 at the title screen before pressing enter). And in Hourglass you can choose "Runtime > App Locale > Force Japanese locale" to allow the game to start up.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Hmm, there's no alternative to GetThreadSelectorEntry that I know of, so I'm not sure how to work around it being broken in Wine. Maybe I should create a tiny test case and submit a bug report to them (EDIT: like this), but I wouldn't expect it to be dealt with quickly.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Savestates seem to have more problems on Windows 7 than on Windows XP, although that might have more to do with the graphics card or graphics drivers. I think more things will have to be truly emulated before savestates can be really stable for many games on non-XP systems.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Are you setting multithreading to "Disable" before starting the game? (Or at least disable DirectSound.) That helps reduce the crashes. Also, if possible, avoid loading savestates across boundaries where the game loads new graphics.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
ZidaneTribal wrote:
Mine is Ark from Terrangima. Awesome game by the way.
Mine happens to be that too.
Randil wrote:
I guess most of you know, mine is Squall from Final Fantasy 8. The image is from the ending sequence of the game.
Wow, I've played FF8 but I thought your avatar was some masked shinobi dude.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
YoungJ1997lol wrote:
Yo, i wanna try out Super Mario Bros X (invasion 2), but HourGlass is too complicated. Just wondering how to record and play and all that.
To get started, you click the "Browse..." button at the bottom and browse to wherever you installed the game exe, then click "Run and Record New Movie" (or "Run and Play Existing Movie" if you already started recording it). After that it's standard re-recording emulator controls from there (for example, you can press backslash to frame advance), and you can see and configure those controls by choosing "Input > Configure Hotkeys..." from the menu. Maybe I'll make a proper instructions page at some point, but it should all be pretty familiar to someone who's used re-recording emulators before, and the Hourglass-specific problems to watch out for are hopefully only temporary. But... this particular game doesn't work at all in Hourglass yet, so you might want to try some game that's known to work instead, and if you can it's best to use a computer that has Windows XP, for now.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Dada wrote:
How mature is Windows TASing? Is it acceptable for the site yet? Is it good enough for making decent movies that aren't acceptable for the site for whatever reason?
That's slightly off-topic here, but: I'd say it's not mature at all, but for certain games such as this one it already works almost as well as a mature re-recording emulator, and it's good enough for making decent movies (you can find various examples already with a search like this), and the current site administration seems (as far as I can tell) willing to give it a shot.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
upthorn wrote:
Highness wrote:
Failed to inject DLL "Z:\home\highness\Downloads\hglass\hourglass-r39\wintasee.dll" into process id 0x2D IAT: Error while translating FS selector to virtual address, system error was: 5
According to MSDN, this error means that access was denied, which probably means that wine isn't properly handling THREAD_QUERY_INFORMATION access rights, which, unfortunately, is a wine problem that hourglass probably can't do anything about.
This error means that a call to GetThreadSelectorEntry failed, following a call to GetThreadContext (with CONTEXT_SEGMENTS) that succeeded, which means that either there's a bug in Wine's GetThreadContext implementation that's returning an invalid selector value, or there's a bug in its GetThreadSelectorEntry function. Looking at the Wine source, I think that access denied error is coming from the ThreadDescriptorTableEntry case in NtQueryInformationThread, which says "it has to be one of the system GDT selectors" and sets the status to ERROR_ACCESS_DENIED if it gets a selector value it didn't expect. I think it shouldn't even be in that branch of code, because it should need to get the information from the server since the thread it's being asked for information about belongs to a different process.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Ferret Warlord wrote:
I'm kinda inclined to agree with him. Good game and all, but like IWBTG it seems rather plodding as a TAS.
I don't know if you're taking into account that the character can get upgrades throughout the game (unlike IWBTG). Like Metroid games, there's a speed booster item partway through that makes the character much faster, and before that point, like Mario games there are TAS-only tricks to go faster by taking advantage of oscillating speed values. And there are plenty of boss fights and opportunity for killing lots of enemies without slowing down, and overall good audio and visual presentation, so... it seems like a better game choice than many of the games with published movies on the site, actually. Sure, it's missing heavy glitching opportunities (as far as I know), but we don't need that in everything.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
upthorn wrote:
Unfortunately, TlsAlloc and FlsAlloc appear not to actually initialize (or allocate) the local storage when they're called, so if we hook only the Allocs, we would then have to wait x milliseconds (causing a race condition) for the program to subsequently initialize a tiddata struct and assign its non-null pointer to the local storage index.
Maybe I'll make a "hook nothing" version later, but to get the addresses without hooking F/TlsAlloc or F/TlsGetValue, try:
// in moduletramps.h

#define TlsSetValue TrampTlsSetValue
TRAMPFUNC BOOL WINAPI TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) TRAMPOLINE_DEF
#define FlsSetValue TrampFlsSetValue
TRAMPFUNC BOOL WINAPI FlsSetValue(DWORD dwFlsIndex, LPVOID lpFlsData) TRAMPOLINE_DEF

// in modulehooks.cpp

HOOKFUNC BOOL WINAPI MyTlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue)
{
	// don't put any code before the call to TlsSetValue, since there's a danger of recursion
	BOOL rv = TlsSetValue(dwTlsIndex, lpTlsValue);
	if(lpTlsValue)
		debugprintf(__FUNCTION__ " called. thread=0x%X, index=%d, address=0x%X.\n", GetCurrentThreadId(), dwTlsIndex, lpTlsValue);
	return rv;
}

HOOKFUNC BOOL WINAPI MyFlsSetValue(DWORD dwFlsIndex, LPVOID lpFlsData)
{
	// don't put any code before the call to FlsSetValue, since there's a danger of recursion
	BOOL rv = FlsSetValue(dwFlsIndex, lpFlsData);
	if(lpFlsData)
		debugprintf(__FUNCTION__ " called. thread=0x%X, index=%d, address=0x%X.\n", GetCurrentThreadId(), dwFlsIndex, lpFlsData);
	return rv;
}

// in ApplyModuleIntercepts table

		MAKE_INTERCEPT(1, KERNEL32, TlsSetValue),
		MAKE_INTERCEPT(1, KERNEL32, FlsSetValue),
(To actually pass the data up, I'd use cmdprintf instead of debugprintf, with some new command prefix.)
upthorn wrote:
On my Windows 7, hooking TlsAlloc causes all sorts of weird issues, like the game immediately crashing the first time it's run, and sound failing to play, while FlsAlloc works with no trouble at all.
I'm guessing this is because the Tls or Fls functions might not exist in kernel32.dll depending on the OS version, so if you try to call them anywhere (even if the code won't run and you don't actually hook anything) it will cause the game to crash on startup. For example, on XP, if I try to hook FlsAlloc and call FlsGetValue from inside MyFlsAlloc, it always crashes the game on startup because FlsGetValue doesn't exist, but if I hook FlsGetValue also then it won't crash because my call to it becomes a call to the trampoline, which always exists (even if I disable the hook by using 0 instead of 1 in its MAKE_INTERCEPT). Of course if the trampoline to a non-existent function actually gets called then it won't work but that's not usually a problem, for example in this case FlsGetValue won't really get called on XP because FlsAlloc doesn't exist either and thus MyFlsAlloc won't get called in the first place.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
ALAKTORN wrote:
I couldn't get the game's window to appear foremost
Same issue as Ninja Senki. The temporary workaround is to check the "Topmost" box in Hourglass (and unpause the game) if you lose the window behind something.
gocha wrote:
I tried to run Metroid Confrontation V2.5 with Hourglass but it didn't startup.
I'll try running it later and see if I find anything.
gocha wrote:
I tried to learn why from Hourglass source code, but I couldn't understand at all.
If you have any questions about the source code, even questions about how things work in general, feel free to ask them.
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Maybe this is a difference from XP, since FlsAlloc doesn't seem to exist on XP, and I see TlsAlloc is easily hooked and gets called by doukutsu.exe on my system. Ideally, a feature like this could be implemented without any hooking at all (using only calls to ReadProcessMemory and GetThreadSelectorEntry running outside of the game). Failing that, hopefully there's a way to only hook TlsAlloc/FlsAlloc, since I'd expect TlsGetValue/FlsGetValue to get called often enough that hooking them should at least be optional.
Post subject: Re: Noitu Love
Emulator Coder, Experienced Forum User, Published Author, Skilled player (1301)
Joined: 12/21/2004
Posts: 2687
Twisted Eye wrote:
Active Multithreading (for the music)
This will probably cause lots of desyncs if you clicked the "Allow" button, unless you also set the Wait Sync mode to "Synchronous Skip" in the menu.
Twisted Eye wrote:
NO software mixing (for the music)
This will make capturing the sound to AVI pretty much impossible (although if it doesn't affect the sync, that wouldn't matter as much, since in that case it could be changed later).