XWA Custom & Widescreen Resolutions

Any issues with the XWAU or X-Wing Alliance? Please let us know here!

Re: XWA Custom & Widescreen Resolutions

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 08, 2020 2:49 pm

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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Apr 08, 2020 3:30 pm

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

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 08, 2020 4:33 pm

UPDATE

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.

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 08, 2020 4:35 pm

Darksaber wrote:
Wed Apr 08, 2020 3:30 pm
which slot does the Hook alter?
The hook is not tied to a specific slot. It doesn't modify the exe.

User avatar
m0rgg
XWAU Member
Posts: 266
Joined: Wed Apr 01, 2020 10:33 pm

Post by m0rgg » Sun Apr 12, 2020 10:56 am

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!

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Apr 12, 2020 2:00 pm

UPDATE

Hello,
I've uploaded the changes of the resolution hook to OneDrive and GitHub.

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Tue Apr 21, 2020 9:04 pm

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"?

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Wed Apr 22, 2020 5:17 am

DTM: just set the following in the cfg:

Code: Select all

IsAutoResolutionEnabled = 0

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Wed Apr 22, 2020 8:40 am

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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Apr 22, 2020 8:56 am

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
“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

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 22, 2020 10:41 am

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.

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 22, 2020 10:55 am

UPDATE

Done.
I've modified the default value.
Now the feature is disabled by default.

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Wed Apr 22, 2020 11:21 am

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!

Image

"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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Apr 22, 2020 11:54 am

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

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Wed Apr 22, 2020 12:08 pm

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 !!!! :kopfwand: :kopfwand: :kopfwand:

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...

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Wed Apr 22, 2020 1:29 pm

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 ...

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 22, 2020 3:50 pm

The "Fix graphical corruption like disappearing objects" fix replaces

Code: Select all

        HRESULT ebp68 = s_XwaZBufferSurface.DirectDrawSurface->Blt( &ebp78, 0, 0, DDBLT_WAIT | DDBLT_DEPTHFILL, &ebp64 );
with

Code: Select all

        HRESULT ebp68 = ((LPDIRECT3DVIEWPORT3)s_XwaD3D_Viewport)->Clear2( 1, &ebp78, D3DCLEAR_ZBUFFER, 0, ebp14, 0 );
in the function L00597F9F.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Apr 22, 2020 8:32 pm

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

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Apr 22, 2020 9:38 pm

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.

Reimar
Cadet 1st Class
Posts: 239
Joined: Mon Jan 19, 2009 11:45 am

Post by Reimar » Fri May 08, 2020 9:52 pm

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.

User avatar
JeremyaFr
XWAU Member
Posts: 3922
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat May 09, 2020 12:35 pm

Yes, always clear with 0 seems better.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat May 09, 2020 2:39 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.
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.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 599
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sat May 09, 2020 7:12 pm

Bman wrote:
Sat May 09, 2020 2:39 pm
Jeremy, special request. Could you add a FOV field too to your Hook_Resolution.cfg file?
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.

Voyager
Cadet 3rd Class
Posts: 38
Joined: Sun May 13, 2007 11:01 pm

Post by Voyager » Wed Jul 15, 2020 12:45 am

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

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7829
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Wed Jul 15, 2020 12:50 am

Voyager wrote:
Wed Jul 15, 2020 12:45 am
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
There's an option in the latest Effects from Blue Max to change the Aspect Ratio
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Post Reply