Nifflas' Support Forum

Released Games => NightSky => Topic started by: phnord on January 11, 2011, 03:01:38

Title: Dependent Libraries And Such?
Post by: phnord on January 11, 2011, 03:01:38
This is a tech-heavy question that I'm mainly asking Nifflas here - but maybe someone else knows something that may help?

I have been experimenting with WINE lately and have had mixed results getting the games here to run on Mac.  Knytt, Knytt Stories and Within A Deep Forest run perfectly after installing the Microsoft Visual C++ runtime libraries to the WINE environment.  However, I can't seem to get any of the Saira, NightSky or NightSky's Setting's exes to work.  They all load, and will even play music - but the window never draws anything to it, rendering them useless.

They all have the same set of errors generated in the WINE log, and I'm trying to narrow down what the problem is exactly so that I can explain it on the WINE boards and such.  It seems to do with the Direct 3D drawing system... but that's as far as I've gotten so far.

I *have* found a series of patterns in the error logs, however - and was wondering if anyone could provide some insight as to what is new in Saira / NightSky that could be causing them.

So, here we go...



First, the log spits out:

Code: [Select]
fixme:win:EnumDisplayDevicesW ((null),0,0x33f68c,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x33f7ac,0x00000000), stub!

Then it goes into a loop which has something to do with failing to create draw contexts.  Each iteration of the loop varies.  First there is an error that looks like:
Code: [Select]
wine[99527] <Error>: unknown error code: invalid drawable
The *first* iteration of this loop is accompanied by:
Code: [Select]
wine[99527] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Then the loop goes on...
Code: [Select]
set off screen: invalid drawable
err:d3d:context_set_current Failed to make GL context *CONTEXTADDR* current on device context 0x6bc, last error 0.
err:d3d:context_create Cannot activate context to set up defaults
Where "CONTEXTADDR" changes with each iteration.

If this is not the first iteration of the loop, this is followed by:
Code: [Select]
err:d3d:context_release Failed to restore GL context *PREVCONTEXTADDR* on device context 0x6bc, last error 0x7d0.Where "PREVCONTEXTADDR" is the context address used in the *last* iteration of the loop.



Then the loop branches into one of four directions.  Sometimes it just continues past this point, but the other times one of the following sets of errors is generated:
Code: [Select]
fixme:d3d:getFormatDescEntry Can't find format WINED3DFMT_R24_UNORM_X8_TYPELESS(73) in the format lookup table
fixme:d3d:getDepthStencilBits Unsupported stencil format: WINED3DFMT_UNKNOWN

Or
Code: [Select]
err:d3d:WineD3D_ChoosePixelFormat Can't find a suitable iPixelFormat
Or, if it is the last time going through the loop:
Code: [Select]
err:d3d:WineD3D_ChoosePixelFormat Can't find a suitable iPixelFormat


This is always followed by the following log:
Code: [Select]
path: *SEQUENTIALADDR*Where "SEQUENTIALADDR" goes up by an arbitrary amount with each loop



Finally, the loop again branches - this time in three directions.  Sometimes it just continues past this point, but roughly half the time the following error is generated:
Code: [Select]
err:d3d:context_create wglShareLists(0x0, *NEXTCONTEXTADDR*) failed, last error 0.Where "NEXTCONTEXTADDR" is the context address used in the next iteration of the loop.

If it happens to be the *last* iteration of the loop, this branch instead produces:
Code: [Select]
fixme:msvcr90:__clean_type_info_names_internal (0x3d89a0) stub
fixme:msvcr90:__clean_type_info_names_internal (0x78507750) stub



In practice, this looks like this (NightSky used in example):

Code: [Select]
Monday, January 10, 2011 8:02:03 PM America/New_York
fixme:win:EnumDisplayDevicesW ((null),0,0x33f68c,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x33f7ac,0x00000000), stub!
path: 62387_0x400129
Mon Jan 10 20:02:26 new-host.home wine[99527] <Error>: unknown error code: invalid drawable
Mon Jan 10 20:02:26 new-host.home wine[99527] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
set off screen: invalid drawable
err:d3d:context_set_current Failed to make GL context 0x1e4b08 current on device context 0x6bc, last error 0.
err:d3d:context_create Cannot activate context to set up defaults
path: 62387_0x40012a
Mon Jan 10 20:02:26 new-host.home wine[99527] <Error>: unknown error code: invalid drawable
set off screen: invalid drawable
err:d3d:context_set_current Failed to make GL context 0x1e4ba8 current on device context 0x6bc, last error 0.
err:d3d:context_create Cannot activate context to set up defaults
err:d3d:context_release Failed to restore GL context 0x1e4b08 on device context 0x6bc, last error 0x7d0.
fixme:d3d:getFormatDescEntry Can't find format WINED3DFMT_R24_UNORM_X8_TYPELESS(73) in the format lookup table
fixme:d3d:getDepthStencilBits Unsupported stencil format: WINED3DFMT_UNKNOWN
path: 62387_0x40012b
err:d3d:context_create wglShareLists(0x0, 0x1e4c30) failed, last error 0.
Mon Jan 10 20:02:26 new-host.home wine[99527] <Error>: unknown error code: invalid drawable
set off screen: invalid drawable
err:d3d:context_set_current Failed to make GL context 0x1e4c30 current on device context 0x6bc, last error 0.
err:d3d:context_create Cannot activate context to set up defaults
err:d3d:context_release Failed to restore GL context 0x1e4ba8 on device context 0x6bc, last error 0x7d0.
path: 62387_0x40012c
Mon Jan 10 20:02:26 new-host.home wine[99527] <Error>: unknown error code: invalid drawable
set off screen: invalid drawable
err:d3d:context_set_current Failed to make GL context 0x1e4cb8 current on device context 0x6bc, last error 0.
err:d3d:context_create Cannot activate context to set up defaults
err:d3d:context_release Failed to restore GL context 0x1e4c30 on device context 0x6bc, last error 0x7d0.
err:d3d:WineD3D_ChoosePixelFormat Can't find a suitable iPixelFormat
path: 62387_0x40012d
err:d3d:context_create wglShareLists(0x0, 0x1de4e8) failed, last error 0.
Mon Jan 10 20:02:26 new-host.home wine[99527] <Error>: unknown error code: invalid drawable
set off screen: invalid drawable
err:d3d:context_set_current Failed to make GL context 0x1de4e8 current on device context 0x6bc, last error 0.
err:d3d:context_create Cannot activate context to set up defaults
err:d3d:context_release Failed to restore GL context 0x1e4cb8 on device context 0x6bc, last error 0x7d0.
err:d3d9:device_parent_CreateSwapChain (0x16ecec) CreateAdditionalSwapChain failed, returning 0x8876086a
err:d3d:IWineD3DDeviceImpl_Release Context array not freed!
path: 62387_0x40012e
fixme:msvcr90:__clean_type_info_names_internal (0x3f89a0) stub
fixme:msvcr90:__clean_type_info_names_internal (0x78507750) stub



Any ideas, anyone?
Title: Re: Dependent Libraries And Such?
Post by: LPChip on January 11, 2011, 09:33:29
As far as I know Both Saira and NightSky cannot work under WINE due to certain extensions that are being used. Some people have investigated into getting Saira to work, and it may possibly work somewhat. For NightSky I can safely say that sooner or later this problem will be fixed by the release of a newer version built entirely in C++ which can work under Linux, MacOS and other systems.
Title: Re: Dependent Libraries And Such?
Post by: phnord on January 12, 2011, 23:40:41
I get that; but generally speaking when something doesn't work on WINE do to missing extensions / libraries and whatnot, importing the correct ones and tweaking things can potentially fix it.

For instance, Knytt, Knytt Stories and Within A Deep Forest generate an error at first, along the lines of "DirectoryPacker.mfx" failing to load.  After searching a bit deeper, it becomes apparent that the *reason* the .mfx failed to load is because it's dependent on certain Visual C++ runtime libraries.  Installing those into the WINE prefix fixes the situation and allows them to work perfectly.

I've heard of people getting Saira to work on WINE in Linux; but not yet on Mac.  I think this may have something to do with WINE for Mac's issues with Mac's X11 drawing system, although I'm not entirely sure.

Whatever the case, I wanted to see if either Nifflas or anyone else here could extrapolate some insight from the error messages, and from knowledge of the differences between the K/KS/WaDF engines and the Saira / NightSky engines.

 - Andy

P.S.  Interestingly, while the NightSky "Settings.exe" file generates these errors, the Saira "Settings.exe" does not.
Title: Re: Dependent Libraries And Such?
Post by: AA on January 13, 2011, 08:38:18
I don't know how Wine's currently doing in terms of DirectX compatibility, but it certainly was its weakest point. Saira and NightSky are the only two Nifflas games that use DirectX, byt the way: they use some extra MMF2 extensions (NightSky probably uses additional ones compared to Saira because of the physics, but I'm not sure).

P.S.  Interestingly, while the NightSky "Settings.exe" file generates these errors, the Saira "Settings.exe" does not.

That's probably because the Settings.exe for NightSky uses DirectX (or at least I suppose so, since it has that background animation and transparency), whereas in Saira I'm pretty sure it doesn't.

I don't know if anyone here can offer you such technical insight on the matter. I see you've already posted on the Wine Forums, but since the game is new and not very popular, it's unlikely you'll get a reply anytime soon.

Some random things you might try are installing some native libraries, like those for DirectX (run 'winetricks d3dx9') and some msvcs files (like 'msvcr90.dll', which appears in your error logs).
Title: Re: Dependent Libraries And Such?
Post by: Marudororu on January 13, 2011, 15:04:27
I can run Night Game in WINE, but I don't know why.
Try to install last development version of WINE. And, as mentioned above, you can try to install DirectX (I have it installed).
Then it looks this way:
Title: Re: Dependent Libraries And Such?
Post by: phnord on January 13, 2011, 16:26:10
Are you running it on Linux or Mac?  I think that, as I mentioned, it could be a problem with Mac's X11 Windowing system.  I know that WINE sometimes has issues with it.
Title: Re: Dependent Libraries And Such?
Post by: Marudororu on January 13, 2011, 22:28:00
Sorry, I skipped your second message, and I thought WINE runs the same on Linux and Mac.
Really, I'm runnung Ubuntu Studio 10.10, not Mac.