XWA Custom & Widescreen Resolutions
Re: XWA Custom & Widescreen Resolutions
- JeremyaFr
- Posts: 3843
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Yes, it is normal.
If you have already set the game resolution to the screen resolution, then the new values will be the same. So no change will be noticeable.
If you have already set the game resolution to the screen resolution, then the new values will be the same. So no change will be noticeable.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Thank, I'll have to remove the Res to test further, just so I know which slot does the Hook alter?
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3843
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
EDIT: link removed
I've added these settings:
EDIT: link removed
I've added these settings:
Code: Select all
; Auto set the game resolution
; 1 to enable the feature
; 0 to disable the feature
IsAutoResolutionEnabled = 1
; Define the resolution width
; When set to 0, the screen width is used
ResolutionWidth = 0
; Define the resolution height
; When set to 0, the screen height is used
ResolutionHeight = 0
Last edited by JeremyaFr on Sun Apr 12, 2020 2:01 pm, edited 1 time in total.
- m0rgg
- Posts: 259
- Joined: Wed Apr 01, 2020 10:33 pm
Hi JeremyaFr,
Could you push the source code for this to github? Last update is from some time ago.
I would like to understand how the injection of the resolution value works. I'm trying to mod blue_max DLL to use the recommended resolution, aspect and FOV from steamvr for rendering. Would this override the hook or create a conflict? Which patch is applied before?
Finally, where in your DLL do you determine the final D3D resolution?
Thanks!
Could you push the source code for this to github? Last update is from some time ago.
I would like to understand how the injection of the resolution value works. I'm trying to mod blue_max DLL to use the recommended resolution, aspect and FOV from steamvr for rendering. Would this override the hook or create a conflict? Which patch is applied before?
Finally, where in your DLL do you determine the final D3D resolution?
Thanks!
- JeremyaFr
- Posts: 3843
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
Hello,
I've uploaded the changes of the resolution hook to OneDrive and GitHub.
Hello,
I've uploaded the changes of the resolution hook to OneDrive and GitHub.
- DTM
- Posts: 2118
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
Hallo,
I found a problem with the last version of the "Hook_Resolution.dll"
You know that XWA has a disappearance problem with large OPT (Large OPTs disappear when moving away from their center). For planetary missions and other objects I had found a balance: at the resolution of 1600x900 OPT smaller than 26Km they don't have this problem.
With the last version of "Hook_Resolution.dll" (12.04.2020) the disappearance problem happens also with OPT smaller than 26 Km.
With the version dated 26.01.2019 there is no problem
EDIT:
I understand the problem: even if I set the game with a resolution of 1600x900, with the new "Hook_Resolution.dll" the game's resolution is overwrittne by the settings of the file "Hook_Resolution.cfg". With the values set at number 0 (default), the games runs at my screen resolution (1920x1080). I have to set the resolution of 1600x900 in the "Hook_Resolution.cfg".
May I suggest to use the value "0" to keep the "game's resolution" instead the "screen resolution"?
I found a problem with the last version of the "Hook_Resolution.dll"
You know that XWA has a disappearance problem with large OPT (Large OPTs disappear when moving away from their center). For planetary missions and other objects I had found a balance: at the resolution of 1600x900 OPT smaller than 26Km they don't have this problem.
With the last version of "Hook_Resolution.dll" (12.04.2020) the disappearance problem happens also with OPT smaller than 26 Km.
With the version dated 26.01.2019 there is no problem
EDIT:
I understand the problem: even if I set the game with a resolution of 1600x900, with the new "Hook_Resolution.dll" the game's resolution is overwrittne by the settings of the file "Hook_Resolution.cfg". With the values set at number 0 (default), the games runs at my screen resolution (1920x1080). I have to set the resolution of 1600x900 in the "Hook_Resolution.cfg".
May I suggest to use the value "0" to keep the "game's resolution" instead the "screen resolution"?
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
DTM: just set the following in the cfg:
Code: Select all
IsAutoResolutionEnabled = 0
- DTM
- Posts: 2118
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
I understand, thanks.
Than, may I suggest to set "IsAutoResolutionEnabled = 0" as default value. If someone does not know about this new feature, it may have problems, as I had them, because the resolution of the game has changed without my noticing.
Than, may I suggest to set "IsAutoResolutionEnabled = 0" as default value. If someone does not know about this new feature, it may have problems, as I had them, because the resolution of the game has changed without my noticing.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
Nice catch DTM, I wondered why my screen had changed sizes, never thought anything of it until now
Next time you make an installer, change this in the cfg file, I already changed mine to "IsAutoResolutionEnabled = 0" as default value
Next time you make an installer, change this in the cfg file, I already changed mine to "IsAutoResolutionEnabled = 0" as default value
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3843
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Makes sense.
I will modify the default value.
I enabled the feature by default for people that don't know how to modfy the resolution to get a widescreen resolution (using XwaHacker).
By disabling the feature by default, people will have to read the readme and config files for DDraw dll and resolution hook.
I think it will fine to disable the feature by default.
I will modify the default value.
I enabled the feature by default for people that don't know how to modfy the resolution to get a widescreen resolution (using XwaHacker).
By disabling the feature by default, people will have to read the readme and config files for DDraw dll and resolution hook.
I think it will fine to disable the feature by default.
- JeremyaFr
- Posts: 3843
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
Done.
I've modified the default value.
Now the feature is disabled by default.
Done.
I've modified the default value.
Now the feature is disabled by default.
- DTM
- Posts: 2118
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
I feel like a fool 
for years I have fought with XWA because objects larger than 26 km disappear at resolutions greater than 1600x900. The solution has always been available in xwahacker! I had tested it in the past, but it didn't seem to work. Instead it works!

"Fix graphical corruption like disappearing objects"
I just tested a planetary mission with this function active at the resolution of 1920x1080 (the maximum allowed by the screen of my lapto). It works! No effect of disappearing large objects!
Hell, I'm as happy as I am bitter about not being able to get this fix to work first!
However, with AutoResolutionEnabled the effect of this fix wears off and the objects disappear again.

for years I have fought with XWA because objects larger than 26 km disappear at resolutions greater than 1600x900. The solution has always been available in xwahacker! I had tested it in the past, but it didn't seem to work. Instead it works!
"Fix graphical corruption like disappearing objects"
I just tested a planetary mission with this function active at the resolution of 1920x1080 (the maximum allowed by the screen of my lapto). It works! No effect of disappearing large objects!
Hell, I'm as happy as I am bitter about not being able to get this fix to work first!
However, with AutoResolutionEnabled the effect of this fix wears off and the objects disappear again.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
The question is what the "Fix graphical corruption like disappearing objects" actually change and could Jeremy apply it to a hook (if he hasn't done so already) if it's a valid fix???
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- DTM
- Posts: 2118
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
Sorry guys ... I don't know if I'm going crazy or what's going on. I used a planetary mission for a few minutes at a resolution of 1920x1080 ... I also made screenshots to be sure of having this resolution ... it worked!
Now I have made some changes with Xwahacker ... and the fix no longer works! I can't reproduce what I had done before !!!!

EDIT: No, I'm not crazy! I used a backup file to recreate the previous setting. It works with 26Km opts at 1920x1080...but why??? I will continue with my test...
Now I have made some changes with Xwahacker ... and the fix no longer works! I can't reproduce what I had done before !!!!



EDIT: No, I'm not crazy! I used a backup file to recreate the previous setting. It works with 26Km opts at 1920x1080...but why??? I will continue with my test...
- DTM
- Posts: 2118
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
I restored a backup file of Xwingalliance.exe and applyed the fix. I did several changes. It works. Probably I had corrupted the old Xwingalliance.exe file…
My test report about the function of Xwahacker called: "Fix graphical corruption like disappearing objects"
Without the fix:
-With a game resolution of 1600x900 26 Km large opts do not disappear. Larger OPTs disappear
-With a game resolution of 1920x1080 26 Km disappear
With the fix:
-With a game resolution of 1920x1080 26 Km large opts do not disappear. 52 Km opts disappear.
It would be interesting to understand what this fix really does. It seems that it improves the relationship between resolution and size of the disappearing OPTs. So it's not a fix, but a recalibration of some parameter (?) Anyway, the experience I had makes me believe that this fix is not stable ...
My test report about the function of Xwahacker called: "Fix graphical corruption like disappearing objects"
Without the fix:
-With a game resolution of 1600x900 26 Km large opts do not disappear. Larger OPTs disappear
-With a game resolution of 1920x1080 26 Km disappear
With the fix:
-With a game resolution of 1920x1080 26 Km large opts do not disappear. 52 Km opts disappear.
It would be interesting to understand what this fix really does. It seems that it improves the relationship between resolution and size of the disappearing OPTs. So it's not a fix, but a recalibration of some parameter (?) Anyway, the experience I had makes me believe that this fix is not stable ...
- JeremyaFr
- Posts: 3843
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
The "Fix graphical corruption like disappearing objects" fix replaces
with
in the function L00597F9F.
Code: Select all
HRESULT ebp68 = s_XwaZBufferSurface.DirectDrawSurface->Blt( &ebp78, 0, 0, DDBLT_WAIT | DDBLT_DEPTHFILL, &ebp64 );
Code: Select all
HRESULT ebp68 = ((LPDIRECT3DVIEWPORT3)s_XwaD3D_Viewport)->Clear2( 1, &ebp78, D3DCLEAR_ZBUFFER, 0, ebp14, 0 );
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
I don't know what any of that means, but is it something that could be added to a hook, is it even a valid fix?
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- JeremyaFr
- Posts: 3843
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
I can add the fix to the opt limit hook.
But before doing that, I want to be sure that fix fixes the problem.
@DTM Can you test with a clean XWA install? Make 2 copies of the XWA dir. In one, make sure that the fix is not applied. In the other, make sure that the fix is applied. So you now you have 2 installs of XWA where the only one difference is the whether the fix is applied or not, to be sure that there is no other difference with which patch is applied.
But before doing that, I want to be sure that fix fixes the problem.
@DTM Can you test with a clean XWA install? Make 2 copies of the XWA dir. In one, make sure that the fix is not applied. In the other, make sure that the fix is applied. So you now you have 2 installs of XWA where the only one difference is the whether the fix is applied or not, to be sure that there is no other difference with which patch is applied.
-
- Posts: 239
- Joined: Mon Jan 19, 2009 11:45 am
I wonder if this might be an issue with the ddraw.dll.
The Clear2 implementation does:
this->_deviceResources->clearDepth = dvZ;
this->_deviceResources->clearDepthSet = true;
The Blt implementation does:
// To do this correctly we'd need to know the exact buffer format
this->_deviceResources->clearDepth = lpDDBltFx->dwFillDepth > 0 ? 1.0f : 0.0f;
this->_deviceResources->clearDepthSet = true;
(well, at least in my fork, sorry if it's something I messed with)
Maybe dwFillDepth > 30000 instead of > 0 would work better? Even if it's still not a proper fix.
EDIT: or just always fill with 0? Not sure inverted depth if ever used. It might be the game engine only clears with non-0 to avoid precision issues, but those should no longer be relevant with modern graphics.
The Clear2 implementation does:
this->_deviceResources->clearDepth = dvZ;
this->_deviceResources->clearDepthSet = true;
The Blt implementation does:
// To do this correctly we'd need to know the exact buffer format
this->_deviceResources->clearDepth = lpDDBltFx->dwFillDepth > 0 ? 1.0f : 0.0f;
this->_deviceResources->clearDepthSet = true;
(well, at least in my fork, sorry if it's something I messed with)
Maybe dwFillDepth > 30000 instead of > 0 would work better? Even if it's still not a proper fix.
EDIT: or just always fill with 0? Not sure inverted depth if ever used. It might be the game engine only clears with non-0 to avoid precision issues, but those should no longer be relevant with modern graphics.
- JeremyaFr
- Posts: 3843
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Yes, always clear with 0 seems better.
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
If this ends up being a solution to finally fix the 26K size of opt limits, this would be awesome!
Jeremy, special request. Could you add a FOV field too to your Hook_Resolution.cfg file?
My monitor's maximum screen pixel resolution is 1680x1050. Assuming performance is not an issue, I'm still trying to figure out a suggested maximum in-game resolution to use. Thanks.
Jeremy, special request. Could you add a FOV field too to your Hook_Resolution.cfg file?
My monitor's maximum screen pixel resolution is 1680x1050. Assuming performance is not an issue, I'm still trying to figure out a suggested maximum in-game resolution to use. Thanks.
Last edited by Bman on Sun May 10, 2020 12:26 am, edited 1 time in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- keiranhalcyon7
- Posts: 599
- Joined: Tue Jan 02, 2018 6:41 am
FOV and HUD scale options through config files would be most welcome.
However, please confer with Blue Max. He already had a FOV setting in a different config file, and it would be best for them to not conflict.
-
- Posts: 20
- Joined: Sun May 13, 2007 11:01 pm
Minor suggestion: For simplicity, when setting the resolutions in the installer, could the \Star Wars - X-Wing Alliance\DDRaw.cfg PreserveAspectRatio value be set to '1' by default?
The default install appears to set it to '0', which, if you've got a multi-monitor setup, ends up, rather spectacularly, distorting the view, until you figure out the right flag to change.
thank you,
Harry Voyager
The default install appears to set it to '0', which, if you've got a multi-monitor setup, ends up, rather spectacularly, distorting the view, until you figure out the right flag to change.
thank you,
Harry Voyager
- Ace Antilles
- Posts: 7706
- Joined: Sat Jan 22, 2000 12:01 am
- Contact:
There's an option in the latest Effects from Blue Max to change the Aspect RatioVoyager wrote: ↑Wed Jul 15, 2020 12:45 amMinor suggestion: For simplicity, when setting the resolutions in the installer, could the \Star Wars - X-Wing Alliance\DDRaw.cfg PreserveAspectRatio value be set to '1' by default?
The default install appears to set it to '0', which, if you've got a multi-monitor setup, ends up, rather spectacularly, distorting the view, until you figure out the right flag to change.
thank you,
Harry Voyager