XWA Custom & Widescreen Resolutions

Need help with hardware? Game doesn't run? System wont boot? We might be able to help!

Moderators: Darksaber, Forceflow, decoy

Re: XWA Custom & Widescreen Resolutions

Justagai
Cadet 1st Class
Posts: 179
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Mon Dec 31, 2018 10:55 pm

Code: Select all

<Patch Name="1600x1200 to 1920x1080 Resolution - HUD Scale 1.49">
    <Item Offset="10A3BC" From="4006" To="8007"/>
    <Item Offset="10A3C1" From="B0" To= "38"/>
    <Item Offset="10F500" From="00000040" To= "52B8BE3F"/>
    <Item Offset="10F50A" From="0005" To= "8004"/>
Based on what I've found...

The first and second offsets modifies the width and height of the resolution in the 1600x1200 spot. The third is what sets the time scale and the last sets the FOV.

The original bytes are correct, and so are the new bytes. The HUD scale gets set to 1.49 with the third offset.

Each resolution setting has their own hud scale and fov that can be set. I've gotten the HUD scale and FOV of the rest of the resolutions since it looks like you have the height and width for the others already.

Code: Select all

640x480:
HUD Scale: 0000803F (10F428)
FOV: 00020000 (10F432)

800x600:
HUD Scale: 0000803F (10F455)
FOV: 80020000 (10F45F)

1024x768
HUD Scale: 0AD7A33F (10F482)
FOV: 33030000 (10F48C)

1152x864
HUD Scale: EC51B83F (10F4AC)
FOV: 9A030000 (10F4B6)

1280x1024
HUD Scale: 6666E63F (10F4D6)
FOV: C0030000 (10F4E0)

Bman
Lieutenant JG
Posts: 628
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Jan 01, 2019 10:12 am

Great DS & Justagai, thanks for posting that. For the TFTC project, I was using the Backdrop scaling factor from 256.0f to 64.0f, because I was using larger .dat files like 2048x2048 for sharper background images, but I'm thinking of readjusting back to the newer standard of DTM's 128.0f. I haven't mentioned this before, but I think I recall another solution is using AlliED to scale the .dat images referenced as BackDrop Flight Groups. Instead of using whole integer numbers size = 1, 2, 3 etc. we can use decimals to tweak the scaling of backdrops i.e. 2.34 on a per mission basis. I'll revisit this but it seemed to work when I tested it two years ago. My power went out the other night in middle of testing, so either my .exe is now corrupted or my .plt file is. When I launch a skirmish test mission it crashes to desktop. :-( Anyway, I'll be back up running soon.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

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

Post by Reimar » Tue Jan 01, 2019 4:12 pm

I am not entirely following the discussion, but just to make sure you're not duplicating effort, xwahacker calculates default fov and HUD scale like this:

GUI_EXPORT int default_fov(int height) {
int fov = height * 1.0666f + 0.5f;
return fov > 0 ? fov : 1;
}

GUI_EXPORT float default_hud_scale(int height) {
float res = height / 600.0f;
return res > 1.0f ? res : 1.0f;
}

General FOV calculation:

GUI_EXPORT float fov2deg(int fov, int height) {
return atan((float)height / fov) * 2 / pi * 180;
}

GUI_EXPORT int deg2fov(float deg, int height) {
int fov = height / tan(deg / 180 * pi / 2) + 0.5f;
return fov > 0 ? fov : 1;
}

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9964
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Jan 01, 2019 4:15 pm

EDIT: Thanks Reimer, but I just don't understand what you have there, but... I did use XWAHacker to input the resolutions below, and as you say it calculates the FOV and HUD, the only HUD's I changed was 1440x900, 1680x1050, 1920x1080 due to the reason below , so thanks)

Update on the Wide Screen Resolutions

The Most common Screen Resolution I could find (remember these a few years old now) are :-

1280x720
1280x768
1280x800
1366x768
1440x900
1680x1050
1920x1080

All these work OK, but anything larger and I just can't test as my monitor max is 1920x1080, I felt there wasn't a need to change or edit 640x480, 800x600 or 1024x768, as most people these day I imagine have a screen with a better resolution

Code: Select all

  <Patch Name="1152x864 to 1280x720 Resolution, FOV 86.30, HUD Scale 1.20">
    <Item Offset="10A37D" From="8004" To="0005"/>
    <Item Offset="10A382" From="6003" To= "D002"/>
    <Item Offset="10F4B6" From="9A" To= "00"/>
    <Item Offset="10F4AC" From="EC51B8" To= "9A9999"/>
  </Patch>
  <Patch Name="1152x864 to 1280x768 Resolution, FOV 86.32, HUD Scale 1.28">
    <Item Offset="10A37D" From="8004" To="0005"/>
    <Item Offset="10A382" From="6003" To= "0003"/>
    <Item Offset="10F4B6" From="9A" To= "33"/>
    <Item Offset="10F4AC" From="EC51B8" To= "0AD7A3"/>
  </Patch>
  <Patch Name="1152x864 to 1280x800 Resolution, FOV 86.33, HUD Scale 1.33">
    <Item Offset="10A37D" From="8004" To="0005"/>
    <Item Offset="10A382" From="60" To= "20"/>
    <Item Offset="10F4B6" From="9A" To= "55"/>
    <Item Offset="10F4AC" From="EC51B8" To= "ABAAAA"/>
  </Patch>
  <Patch Name="1152x864 to 1366x768 Resolution, FOV 86.32, HUD Scale 1.28">
    <Item Offset="10A37D" From="8004" To="5605"/>
    <Item Offset="10A382" From="60" To= "00"/>
    <Item Offset="10F4B6" From="9A" To= "33"/>
    <Item Offset="10F4AC" From="EC51B8" To= "0AD7A3"/>
  </Patch>
  <Patch Name="1152x864 to 1440x900 Resolution, FOV 86.30, HUD Scale 1.49">
    <Item Offset="10A37D" From="8004" To="A005"/>
    <Item Offset="10A382" From="60" To= "84"/>
    <Item Offset="10F4B6" From="9A" To= "C0"/>
    <Item Offset="10F4AC" From="EC51B8" To= "0000C0"/>
  </Patch>
  <Patch Name="1600x1200 to 1680x1050 Resolution, FOV 86.30, HUD Scale 1.49">
    <Item Offset="10A3BC" From="40" To="90"/>
    <Item Offset="10A3C1" From="B0" To= "1A"/>
    <Item Offset="10F50A" From="0005" To= "6004"/>
    <Item Offset="10F500" From="00000040" To= "52BBBE3F"/>
  </Patch>
  <Patch Name="1600x1200 to 1920x1080 Resolution, FOV 86.30, HUD Scale 1.49">
    <Item Offset="10A3BC" From="4006" To="8007"/>
    <Item Offset="10A3C1" From="B0" To= "38"/>
    <Item Offset="10F50A" From="0005" To= "8004"/>
    <Item Offset="10F500" From="00000040" To= "52B8BE3F"/>
  </Patch>
I could add these to both the XWACP and DSUCP, but I'll also add an option for NO Change to the Resolutions, so the user can download XWAHacker and manually change to there preferred resolution.

I should explain the for Hud Scale setting it to 1.49 is due to the XWA FONT FIX as seen here is states
***************************
X-Wing: Alliance
***************************

Title: High Resolution fonts for Nvidia Cards
Author: Behelith

IMPORTANT NOTICE:
If you're playing X-Wing Alliance with XWA Upgrade and XWAhacker you'll probably notice some cut fonts. To solve the problem reduce the HUD scale to lower than 1.50 (e.g. 1.49 or lower) in XWA hacker. The only resolution where the HUD scale is set higher than 1.49 by default is 1600x1200. I set mine to 1.49 and all the characters are rendered correctly, the HUD is a little bit smaller but you'll be able top read all the characters correctly. Another option is to use 1152x864 resolution which I also find very nice on my 2560x1600 monitor as the HUD will be a bit larger. This trick will probably work all 3rd party font files.
“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
keiranhalcyon7
Cadet 1st Class
Posts: 195
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Tue Jan 01, 2019 6:36 pm

Is there any interest in a hook that just reads the values to use out of a text file? With the offsets known, I could probably write it, if I can find the time.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9964
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Jan 01, 2019 7:03 pm

Thanks, but no thanks, personally I'll keep this as patch files thanks again though
“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

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1284
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Jan 02, 2019 5:51 pm

Hello,
Have you considered calling GetSystemMetrics( SM_CXSCREEN ) and GetSystemMetrics( SM_CYSCREEN ) to get the screen resolution and then choose which patch to apply based on that.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1284
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 26, 2019 5:50 pm

Hello,
Here is a hook that displays the screen resolution in the video options screen.

xwa_hook_resolution.zip

Instead of the default screen resolutions, the resolutions set with XWA Hacker with be displayed.
Last edited by JeremyaFr on Tue Jan 29, 2019 9:28 am, edited 1 time in total.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9964
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Sat Jan 26, 2019 6:55 pm

Oh I thought that was done through the Frontxt.txt file?

I can soon remove my text changes from my script :)
“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

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1284
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Jan 26, 2019 7:17 pm

Yes, the game reads the resolution texts from "Fronttxt.txt". My hook overrides that.

User avatar
keiranhalcyon7
Cadet 1st Class
Posts: 195
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sat Jan 26, 2019 7:34 pm

Aw, crap, now I gotta rename my work in progress...

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

Post by Reimar » Sat Jan 26, 2019 9:54 pm

On that topic, if someone is interested in XWAHacker, I released a new version.
The GUI will now warn about needing the hook for height > 1200 and suggest a HUD scale <= 1.49.
And it supports setting the FPS limit.
The command-line version also allows setting the FPS limit for the other games in the series, but I have not tested that properly.
(and in case anyone actually prefers the UWP version via Windows store, I updated it as well, but it's a typical Microsoft experience - i.e. in particular decidedly developer-unfriendly and slow, so expect it to take a week to actually become available...)

Bman
Lieutenant JG
Posts: 628
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Jan 27, 2019 3:53 pm

Thanks Reimar, and Jeremy. Both are great.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9964
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Jan 29, 2019 8:11 am

JeremyaFr wrote:
Sat Jan 26, 2019 5:50 pm
Hello,
Here is a hook that displays the screen resolution in the video options screen.

xwa_hook_resolution.zip

Instead of the default screen resolutions, the resolutions set with XWA Hacker with be displayed.
Jeremy is this Hook going to be added to your GitHub, OneDrive and your Hook Setup tool ???

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

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1284
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Jan 29, 2019 9:30 am

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

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 9964
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Tue Jan 29, 2019 2:20 pm

Thanks :)
“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
Murdokk
Recruit
Posts: 2
Joined: Mon Feb 25, 2019 6:59 am

Post by Murdokk » Tue Feb 26, 2019 6:40 am

Hey guys, I'm brand new to these forums and have just finally got around to picking up an old copy of XWA. I've been a huge fan of space sims but for whatever reason never got around to playing this one until now. Very excited to start my journey with this one! I've got it all installed and modded up fully with the most recent packs, wanted to say a huge THANKS to all the hard work you guys have put in here - truly monumental effort, and wow it's just awesome to see. The help guides have all been perfect so far, everything has run smoothly and it looks beautful for me. Runs fantastic so far and I'm amazed at how easy the mod installs have gone. I've flown just the first 3 intro missions so far, and can tell I'm going to be hooked on XWA, just love it so far.

Quick question for the wise Gurus out there: Widescreen settings - how to fully squeeze the best out of them?

My system is pretty decent, while not super top-end it's definitely got more than enough horsepower for XWA:
Monitor: 3440x1440 Ultrawide (21:9) 34"
CPU: AMD FX-9590 8-core
VID: AMD RX-580 8-GB OC
RAM: 16GB Overclocked

I am using XWA Hacker (the new Windows gui ver0.32 just out last month) and so far have these settings:

2200x1200 res ; FOV=104.45 ; HUD=1.49

I have chosen them because while my Ultrawide monitor natively displays 3440x1440, that's very probably asking way too much from XWA and given the HUD font issue, would make the text super small if I went higher than 1200 on the height. However at 1920x1200 (a setting discussed in these forums) - things still look very stretched. So I have increased the numbers on width and increased the FOV - and so far things look pretty good. At 2200x1200 this ratio gives me 16.5:9 - which looks good but it doesn't appear to change much if I increase the numbers (resolution and FOV) beyond that. Is XWA limited to a 16:9 maximum ratio? Is there a max useable FOV?

Any advice would be appreciated from anyone having success with wide/Ultrawide resolutions. Many thanks - and once again FANTASTIC WORK to all the modders that have contributed to this project, I am super impressed!

Cheers

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

Post by Reimar » Tue Feb 26, 2019 9:27 pm

FOV to my knowledge is actual vertical FOV, you I think you normally shouldn't touch it when changing resolution.
The aspect of the resolution you specify should match the aspect of your screen (and you have the ddraw.dll set to preserve aspect you'll see the black bars if that is not the case instead of it being stretched). That would mean something around 2860x1200 in your case.
Note that this only affects the resolution of 2D things like HUD etc, so it might actually look nicer to your eye if you just go for some nice round scale factor like 2x, e.g. use 1720x720...

User avatar
Murdokk
Recruit
Posts: 2
Joined: Mon Feb 25, 2019 6:59 am

Post by Murdokk » Thu Feb 28, 2019 10:50 pm

Alright - well I've done more testing and here's what I've found out, hopefully this helps some other newcomers as well:

Initially I did not want to put my vertical resolution higher than 1200, as there were lots of notes in help guides suggesting this was a hard limit, the game would crash if values were set higher than this. Turns out (thanks to the GENIUS of the hook files written by Jérémy Ansel) there is now a hook file that overcomes this limit, so I am able to run XWA at full 3440x1440 Ultrawide resolution. This file is "Hook_Res1200.dll" and of course it is included in the latest XWAU v1.6 and also the DSUCP v2.6 (which is what I am using). If you don't have it - I'd suggest installing either of those packs or checking Jeremy's GitHub to download the latest version of his hooks there. Link below:

https://github.com/JeremyAnsel/xwa_hooks

So as for the FOV setting - it does not only affect the vertical, but of course the horizontal FOV as well. As I have found it can be modified much higher for wider, larger views (I have tried values up to 120) and can be set to values much lower (I have tested as low as 70) and you get narrower more "zoomed in" views with lower settings. Seems to me this can be changed around to suit your personal preference. Below I have a link to some screenshots I took, both with my Max resolution set at 3440x1440, the first image has FOV 86 (default value) and the second a wider FOV of 111. As you can see, with FOV of 111, it appears more "zoomed out" and you can see more of the interior cockpit, and a wider view from side to side:

https://imgur.com/gallery/Oqc5lcg


Reimar - you are exactly correct!! Thankyou for this tip - that the resolution you set doesn't actually affect the 3D gameplay resolution, it only affects the resolution of 2D things like HUD etc. So by setting a lower resolution than my monitor is capable of (like setting half, as you suggested) the HUD screens are larger, the text printing on the HUD is much easier to read, and the 3D gameplay looks exactly the same.

So bottom line, I have gone with setting 1720 x 720 (half of my monitor's 3440 x 1440) ; to get a slightly wider view I have increased my FOV slightly to 94 (it just looks better to me like this so far); and I have left the default HUD setting at 1.2. The game really looks fantastic at these settings for me.

While this might be old news to the veterans here, hopefully this helps someone else out there which is why I have posted. Thanks again for the advice Reimar!
Cheers all, MTFBWY! :D

User avatar
ffaaway
Cadet 2nd Class
Rebel Alliance
Posts: 92
Joined: Mon May 05, 2003 11:01 pm

Post by ffaaway » Mon May 20, 2019 2:50 pm

Murdokk wrote:
Thu Feb 28, 2019 10:50 pm

So bottom line, I have gone with setting 1720 x 720 (half of my monitor's 3440 x 1440) ; to get a slightly wider view I have increased my FOV slightly to 94 (it just looks better to me like this so far); and I have left the default HUD setting at 1.2. The game really looks fantastic at these settings for me.

While this might be old news to the veterans here, hopefully this helps someone else out there which is why I have posted.
Thanks Murdokk for posting this info here so I didn't have to spend a week fiddling with hex trying to figure out how to get 3440x1440 21:9 working. :D

Thank you to Reimar for the new and improved XWA Hacker w/GUI that made this process super easy!

Thank you Jeremyafr for the hook allowing more than 1200px height!

I thought my XWA days were truly over due to this limitation but the XWAUP team just keep pulling off miracles that keep XWA alive and better than EVER!!

Image

Full size image

With these xwahacker-gui-0.32-win settings:
Image
X-Wing pilot since 1993 and still kickin'

Post Reply