Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoo Tycoon Complete Collection crashes/don't work (D3D7) #305

Open
LuKeSt0rm opened this issue Oct 13, 2024 · 25 comments
Open

Zoo Tycoon Complete Collection crashes/don't work (D3D7) #305

LuKeSt0rm opened this issue Oct 13, 2024 · 25 comments

Comments

@LuKeSt0rm
Copy link

LuKeSt0rm commented Oct 13, 2024

Game no longer responds after alt+tab and crashes. (Dd7to9)

  • Dd7to9=1
  • DdrawWriteToGDI=1 (0=freezes in loading screen)
  • FullscreenWindowMode=1 (0=game window will be displayed in the top left in it's original game resolution and will freeze in loading screen)

I have also tried several other options. Game works with DDrawCompat.

dxwrapper-zoo.log

@elishacloud
Copy link
Owner

I am not quite sure what is causing the issue. The logs don't have any useful data and I may need to try and reproduce this issue

I did put a couple recent fixes that might resolve the issue. You may want to check with the latest build and let me know if there is still an issue.

@LuKeSt0rm
Copy link
Author

Nothing changed

@elishacloud
Copy link
Owner

Instead of using FullscreenWindowMode try setting SetSwapEffectShim or DisableMaxWindowedMode. There are a couple of games, namely Command & Conquer games, that will not show anything and appear to freeze without enabling SetSwapEffectShim.

@LuKeSt0rm
Copy link
Author

I tried the options SetSwapEffectShim and DisableMaxWindowedMode = stuck in the loading screen

@LuKeSt0rm
Copy link
Author

Here the demo of zoo tycoon (in case you need it)
https://archive.org/download/zootycoondemo/ZooTycoon.exe

@elishacloud
Copy link
Owner

Here the demo of zoo tycoon (in case you need it) https://archive.org/download/zootycoondemo/ZooTycoon.exe

Thanks! I will take a look at it when I get a chance.

@elishacloud
Copy link
Owner

I believe this is the issue:

7180 14:24:30.696 m_IDirectDrawSurfaceX::UpdateOverlay Error: Not Implemented

I have not added support for the Overlay yet. In fact, this is one of the first games I have seen that use it.

@elishacloud
Copy link
Owner

Ok, I was able to get the game working by:

  1. Enabling only LockEmulation and EnableOverlays
  2. Running the game as an Admin

image

Here is the build with the correct settings: dxwrapper.zip

Later I will add support for the UpdateOverlay() fucntion and get this game working with dd7to9.

@elishacloud
Copy link
Owner

Ok, I figured out the issue. The game is set to run in exclusive fullscreen mode. In this mode the game hangs when Windows tries to send certain messages to the game. I added code to filter out those messages in this case.

Here is the updated fixed build: dxwrapper.zip

Note: I still need to figure out why the game does not work without enabling DdrawWriteToGDI and FullscreenWindowMode. But I will work on that later.

@elishacloud
Copy link
Owner

The latest build should work without enabling FullscreenWindowMode. This will allow you to switch between fullscreen and windowed mode in-game. The game may be using a combination of GDI and DirectDraw, which may be why DdrawWriteToGDI is required.

Here is the latest build: dxwrapper.zip

This build should work with only dd7to9 and DdrawWriteToGDI enabled.

@LuKeSt0rm
Copy link
Author

Thanks awesome, now works without FullscreenWindowMode

There's just one more issue:
If you use "Immediate" option at "Terrain Blending" under Game options -> "Sound & Video", certain textures are just black. As you can see on the screenshot. It also requires DdrawEmulateSurface so that the game doesn't crash when loading savegame, for example.

DdrawEmulateSurface option disabled - log:

m_IDirectDrawSurfaceX::Lock2 Error: failed to lock surface. Is Texture. Size: 64x64 Format: D3DFMT_A8R8G8B8 Flags: 0x810 Locked: 0 DC: 0 Blt: 0 hr: D3DERR_INVALIDCALL

textureissue

@elishacloud
Copy link
Owner

If you use "Immediate" option at "Terrain Blending" under Game options -> "Sound & Video", certain textures are just black.

I cannot reproduce this issue. The demo version does not have this issue. But this may be related to another issue I have seen where some textures stay black on certain texture. I have seen this with several other games so far. Not sure what is happening though. You could try enabling DdrawForceMipMapAutoGen. In some cases this helps with missing textures.

It also requires DdrawEmulateSurface so that the game doesn't crash when loading savegame, for example.

I put a change in to try and prevent the game from crashing when the Lock fails. Not sure if this will fix the issue, but you shouldn't need to have DdrawEmulateSurface enabled with this update: dxwrapper.zip

@LuKeSt0rm
Copy link
Author

I cannot reproduce this issue. The demo version does not have this issue. But this may be related to another issue I have seen where some textures stay black on certain texture. I have seen this with several other games so far. Not sure what is happening though. You could try enabling DdrawForceMipMapAutoGen. In some cases this helps with missing textures.

DdrawForceMipMapAutoGen doesn't help in this case

I put a change in to try and prevent the game from crashing when the Lock fails. Not sure if this will fix the issue, but you shouldn't need to have DdrawEmulateSurface enabled with this update: dxwrapper.zip

DdrawEmulateSurface still needed

@elishacloud
Copy link
Owner

I was able to reproduce the game crash on load. It's not actually a crash. The game exits when the Lock() function returns anything but OK. Anyways, I found the issue. Try this build: dxwrapper.zip

As far as the black textures, for me the whole screen turns black. However, if I Alt+Tab out of the game and then click to restore the game window then the textures reappear. I will look into this issue soon.

@LuKeSt0rm
Copy link
Author

LuKeSt0rm commented Nov 10, 2024

I was able to reproduce the game crash on load. It's not actually a crash. The game exits when the Lock() function returns anything but OK.

works now, thanks :)

I do the following for testing black textures:
build atleast two different terrain types (textures) and save. Make sure that "Texture Blending" is set to "Immediate" and then load the savegame.

@elishacloud
Copy link
Owner

Ok, I think I figured out the black screen issue. Here is the latest build, I am hoping this fixes all the issues with the game: dxwrapper.zip

Note: you still need to have DdrawWriteToGDI to see the menu because it appears the the menu is made via GDI. I don't think there is much I can do about that.

@LuKeSt0rm
Copy link
Author

Ok, I think I figured out the black screen issue. Here is the latest build, I am hoping this fixes all the issues with the game:

With DdrawForceMipMapAutoGen and FullscreenWindowMode option enabled it works now.

Note: you still need to have DdrawWriteToGDI to see the menu because it appears the the menu is made via GDI. I don't think there is much I can do about that.

No problem at all, it works.

Thanks!

@elishacloud
Copy link
Owner

With DdrawForceMipMapAutoGen and FullscreenWindowMode option enabled it works now.

That is weird. I am using the demo version but I don't need to have either of those options enabled. Everything works fine if I just enable DdrawWriteToGDI. What are all of the options you have enabled and what are each of the options required for?

@LuKeSt0rm
Copy link
Author

LuKeSt0rm commented Nov 15, 2024

Found way to reproduce: zoodemo.ini -> playMovie to 0 or delete movie files.
Now you should have black textures if you load a savegame and have "Terrain Blending" set to "Immediate" or "Balanced".

elishacloud added a commit that referenced this issue Nov 16, 2024
@elishacloud
Copy link
Owner

Found way to reproduce: zoodemo.ini -> playMovie to 0 or delete movie files.

Thanks for the steps to reproduce the issue. I think I fixed it. Try this one: dxwrapper.zip

@elishacloud
Copy link
Owner

While the latest build (here's an update: dxwrapper.zip) fixes the missing textures in most cases, I found one case where there are still missing textures:

Steps:

  1. Start the game.
  2. Switch modes from fullscreen to windowed, or vice versa.
  3. After switching modes rotating the game map, and missing textures will appear.

Note: a work around is to rotate the game map all the way around (4 times) before switching modes and the textures will not disappear.

@LuKeSt0rm
Copy link
Author

LuKeSt0rm commented Nov 16, 2024

Thanks, it now works without FullscreenWindowMode and without black textures
Found something else strange:
if you set current desktop resolution (e.g. 1920x1080) in game ini (screenwidth, screenheight), black textures are back. (works without wrapper)

Btw: Do I see correctly loading the d3d8.dll via loadlibrary of the game is actually unnecessary?

@elishacloud
Copy link
Owner

Btw: Do I see correctly loading the d3d8.dll via loadlibrary of the game is actually unnecessary?

Correct, you shouldn't need to load any extra dlls. I checked and the game doesn't use Direct3D8 so you shouldn't need to load d3d8.dll.

if you set current desktop resolution (e.g. 1920x1080) in game ini (screenwidth, screenheight), black textures are back.

Ok, I put in a fix for this. Here is the fix for this issue: dxwrapper.zip

Note: There is still an issue if you change resolutions in game or change modes (windowed vs. fullscreen) and then rotate the map. I will try and fix that later.

@LuKeSt0rm
Copy link
Author

It works perfectly fine now, thank you very much!

@elishacloud
Copy link
Owner

Very good. I will fix the rest later. That will require a bit more work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants