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

Halo 2 For Windows Vista Issues #291

Open
MrEWhite opened this issue Aug 22, 2024 · 30 comments
Open

Halo 2 For Windows Vista Issues #291

MrEWhite opened this issue Aug 22, 2024 · 30 comments

Comments

@MrEWhite
Copy link

Attempting to play Halo 2 for Windows Vista with dxwrapper and EnableD3d9Wrapper set to 1 crashes the game past the initial "Halo 2" logo that shows upon booting the game. Attached is my dxwrapper log.
dxwrapper-halo2.log

@elishacloud
Copy link
Owner

Can you try with the latest build. Just replace the dxwrapper.dll file with the one in this package: dxwrapper.zip

@MrEWhite
Copy link
Author

Can you try with the latest build. Just replace the dxwrapper.dll file with the one in this package: dxwrapper.zip

Same crash as far as I can tell. Attached is the log generated from that build.
dxwrapper-halo2.log

@elishacloud
Copy link
Owner

Just from the logs it looks like the game is creating a second device before releasing the first. Can you try with the debug log and send the full log back?

Here is the debug log. Just pull the dxwrapper.dll file from this: dxwrapper.zip

@MrEWhite
Copy link
Author

Just from the logs it looks like the game is creating a second device before releasing the first. Can you try with the debug log and send the full log back?

Here is the debug log. Just pull the dxwrapper.dll file from this: dxwrapper.zip

Sure, here ya go.
dxwrapper-halo2.log

elishacloud added a commit that referenced this issue Aug 23, 2024
@MrEWhite
Copy link
Author

Just saw the commit, tried it and it still crashed. Here's the debug log.
dxwrapper-halo2.log

@elishacloud
Copy link
Owner

elishacloud commented Aug 23, 2024

Thanks! I fixed an issue that I found from your logs.

I see what is happening now. The game creates a IID_IDirect3DDevice9Ex interface and then queries for IID_IDirect3DDevice9. I wrote my wrapper never expecting that to happen. Let me see if there is a good way to fix that.

@elishacloud
Copy link
Owner

I don't really have a good way to test this use case but I put a fix (just a hack for now) in for it. Let me know if you still have issues with the latest build.

@MrEWhite
Copy link
Author

That did fix it! The game does start now.

@elishacloud
Copy link
Owner

Ok, great. Thanks for the confirmation.

@elishacloud
Copy link
Owner

I put a proper fix in for this. If you have a chance I would appreciate it if you can test with the latest build to make sure it still works. Thanks!

@MrEWhite
Copy link
Author

MrEWhite commented Aug 23, 2024

I put a proper fix in for this. If you have a chance I would appreciate it if you can test with the latest build to make sure it still works. Thanks!

That seems to crash on my end.
dxwrapper-halo2.log

@elishacloud
Copy link
Owner

That is the same place it crashed before. Let me see what I did wrong here.

@MrEWhite MrEWhite changed the title Halo 2 For Windows Vista crashes with D3d9Wrapper Halo 2 For Windows Vista Issues Aug 23, 2024
@MrEWhite
Copy link
Author

MrEWhite commented Aug 23, 2024

Using the build that was working with the D3d9Wrapper before, I went ahead and tested a few things, and it looks like the game still has the same few issues as I was having natively. On modern Nvidia cards (seemingly a driver related thing), there are two issues with the game visually. First is that anti-aliasing enabled through the game's settings causes seams throughout the map, and secondly, on the singleplayer campaign level Delta Halo, leaves on a few trees near the start of the level don't render at all. Both of these issues seem to be fixed with dgVoodoo2, but that has a fair share of it's own issues with the game. Here are some screenshots showing the issues:

dgVoodoo2:
Halo 2 8_23_2024 6_28_17 PM
Halo 2 8_23_2024 6_27_36 PM

dxwrapper w/ D3d9Wrapper on:
Screenshot 8_23_2024 6_34_05 PM
Halo 2 8_23_2024 6_35_40 PM

elishacloud added a commit that referenced this issue Aug 23, 2024
@elishacloud
Copy link
Owner

First is that anti-aliasing enabled through the game's settings causes seams throughout the map

Yeah. This is an issue with vertices that the game uses. I have been meaning to put a fix in for this but it is lower on my priority. See this thread for a better explanation.

I see this with a number of games, including Knight Rider 2 and Star Trek: Armada 1. Older games, but the same issue. Keep in mind that the MSAA uses edge aliasing which can make the edges semi or full transparent, thus showing this issue. A better solution is to use SSAA, but I have not built an engine for that here. I did build one for Silent Hill 2 Enhanced Edition.

secondly, on the singleplayer campaign level Delta Halo, leaves on a few trees near the start of the level don't render at all.

My D3d9Wrapper does not have too many fixes in it for Direct3D9. Most of the fixes I have are for older games Direct3D8 and older. I would need to figure out what is causing this and then put a fix in. I am just wrapping the dll and then calling the native APIs with not many changes.

dgVoodoo2 is actually converting all the functions to Direct3D11/12. It is closed source so I cannot really see what is happening and I am not good at debugging compiled code to check it out. However, this is not really needed as there is a way to cover them all to Direct3D12, built into Windows. See here. I added support for this in dxwrapper already.

However, I do want to fix the crash in my wrapper. Can you try with this debug version. I added extra logging to try and see what is going on: dxwrapper.zip

@MrEWhite
Copy link
Author

First is that anti-aliasing enabled through the game's settings causes seams throughout the map

Yeah. This is an issue with vertices that the game uses. I have been meaning to put a fix in for this but it is lower on my priority. See this thread for a better explanation.

I see this with a number of games, including Knight Rider 2 and Star Trek: Armada 1. Older games, but the same issue. Keep in mind that the MSAA uses edge aliasing which can make the edges semi or full transparent, thus showing this issue. A better solution is to use SSAA, but I have not built an engine for that here. I did build one for Silent Hill 2 Enhanced Edition.

secondly, on the singleplayer campaign level Delta Halo, leaves on a few trees near the start of the level don't render at all.

My D3d9Wrapper does not have too many fixes in it for Direct3D9. Most of the fixes I have are for older games Direct3D8 and older. I would need to figure out what is causing this and then put a fix in. I am just wrapping the dll and then calling the native APIs with not many changes.

dgVoodoo2 is actually converting all the functions to Direct3D11/12. It is closed source so I cannot really see what is happening and I am not good at debugging compiled code to check it out. However, this is not really needed as there is a way to cover them all to Direct3D12, built into Windows. See here. I added support for this in dxwrapper already.

However, I do want to fix the crash in my wrapper. Can you try with this debug version. I added extra logging to try and see what is going on: dxwrapper.zip

Here's the crash log you requested.
dxwrapper-halo2.log

I understand you on the other two bits, but quick note on those two issues if it changes anything, I'm pretty sure they both only happen on Nvidia, and work fine on AMD, can't test that myself with an Nvidia card though.

@MrEWhite
Copy link
Author

Tried the latest commit, still crashes.
dxwrapper-halo2.log

@elishacloud
Copy link
Owner

Can you send me a debug log from one that does not crash?

@MrEWhite
Copy link
Author

Can you send me a debug log from one that does not crash?

For some reason, with the debug build, I can't get in game, but with the release one, I can. I'll attach both logs to see if that'll help.
dxwrapper-halo2-debug.log
dxwrapper-halo2.log

@elishacloud
Copy link
Owner

I am not sure I understand what the game is trying to do here. It is switching between the IDirect3DDevice9 and the IDirect3DDevice9Ex interfaces. Anyways, I reverted most of the recent changes to try and put it back to the working condition and added the code to that. My other ways of trying to fix this did not work.

For some reason, with the debug build, I can't get in game

Yeah, I had a bug in the debug build then. It has been fixed.

I'm pretty sure they both only happen on Nvidia, and work fine on AMD, can't test that myself with an Nvidia card though.

Yes, I have seen a number of these. In the Silent Hill 2 Enhanced Edition project we put a number of fixes in specific to Nvidia. Maybe Nvidia is more struct with the interpretation of how things should work, whereas some of these older games are more loose about it.

I will look into these other issues at some point, but I cannot promise when. I am currently really focused on the dd7to9 feature. I am actually trying to clean up some code and get ready for another release.

@elishacloud
Copy link
Owner

BTW: if you get a chance please test the latest build to make sure that works. I just want to make sure I fully fix this.

@MrEWhite
Copy link
Author

BTW: if you get a chance please test the latest build to make sure that works. I just want to make sure I fully fix this.

Debug build still crashes, but release works. I'll still include both logs though. Issue with release that I noticed though is that I need to start up my desktop with the resolution set higher than 1080p, the limit for the game, or else the game will crash, even with release. The game auto switches to 1080p and if it crashes, the desktop resolution will stick at 1080p. Including a 1080p release log (crashes) and one with my desktop set to 4k (works), as well as a debug build log (crashes no matter what).

dxwrapper-halo2-1080p.log
dxwrapper-halo2-debug.log
dxwrapper-halo2-4k.log

@elishacloud
Copy link
Owner

Thanks for all your testing. This is kind of frustrating because I don't quite understand how Direct3D9 works when a game switches between the two interfaces like this game does. And Microsoft does not have good documentation on this. Anyways, I appreciate all your testing. I will review this and see if I can figure out what is happening.

Issue with release that I noticed though is that I need to start up my desktop with the resolution set higher than 1080p

Does this happen even with the very first build that worked?

@MrEWhite
Copy link
Author

Does this happen even with the very first build that worked?

Yes.

@elishacloud
Copy link
Owner

I think maybe the crash in the debug build is happening because of imgui. I disabled that in the latest build. Hopefully this will work in the debug build.

The game auto switches to 1080p and if it crashes, the desktop resolution will stick at 1080p.

This happens because either the game or Windows does not reset the screen after the game crashes because the code is bypassed from the crash. I added a feature to solve this issue. If you add the below line to the ini file it should fix this issue.

ResetScreenRes             = 1

@MrEWhite
Copy link
Author

MrEWhite commented Aug 24, 2024

So, the new build works fine as far as I can tell! I did notice an issue with it is that it doesn't play the intro video correctly, still just showing the Halo 2 boot logo while the Bungie logo audio plays in the background, and it'll also just skip to the menu part way through said intro.

Was going to upload the log here for this issue, but it actually made a 135 MB log! Here's that uploaded to Mega.
https://mega.nz/file/EW9USLCQ#VjZpEPycBEamwqqIplnbcYQ_Q9yWkuuvixEQ0NRhKfc

@elishacloud
Copy link
Owner

I found a copy of Halo 2 and installed it. There appears to be three issues with this game. I am working on a fix.

  1. The game did switching between the IDirect3DDevice9 and the IDirect3DDevice9Ex interfaces, which I never implemented and had no way of testing before.
  2. The game queries for some device class I have never seen and seems to cause an issue.
  3. The Microsoft documentation on CreateAdditionalSwapChain() is wrong.

Issue 1 caused the first crash, which I fixed several times in different ways.
Issue 2 caused the the other crashes that I thought was caused by issue 1.
Issue 3 caused the intro video to disappear.

@elishacloud
Copy link
Owner

I just checked in the fixes for the wrapper for this game. Note: there is no need to use the ResetScreenRes option. It does not work with this game anyways.

@MrEWhite
Copy link
Author

New fixes seem to work good! One thing I noticed is that the intro is pretty pixelated compared to native
Native:
Screenshot 8_24_2024 8_03_03 PM

dxwrapper:
Screenshot 2024-08-24 200229

@elishacloud
Copy link
Owner

From looking at the picture it appears that what is happening is that the video was record at a lower resolution and then stretched to fit a larger window size. In the native case it uses linear scaling. In the dxwrapper case it uses point (or nearest neighbor) scaling. Frankly, from the pictures in GitHub the native one looks more bleary to me. I am not sire what could cause this. Let me look into it.

@Squall-Leonhart
Copy link

Squall-Leonhart commented Dec 15, 2024

Thanks! I fixed an issue that I found from your logs.

I see what is happening now. The game creates a IID_IDirect3DDevice9Ex interface and then queries for IID_IDirect3DDevice9. I wrote my wrapper never expecting that to happen. Let me see if there is a good way to fix that.

They actually did this as an XP blocker, to sell the whole "for Vista", nonsense, the game was made to work on XP within days of launch because it was a simple matter of stubbing the interface out :D

I understand you on the other two bits, but quick note on those two issues if it changes anything, I'm pretty sure they both only happen on Nvidia, and work fine on AMD, can't test that myself with an Nvidia card though.

The addition of bitmap alpha_white to text_bump_alpha_single_pass when porting H2X to PC introduced this, Project Cartographer has long since resolved it. (and 343 for MCC)

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

3 participants