Widescreen Gaming Forum

[-noun] Web community dedicated to ensuring PC games run properly on your tablet, netbook, personal computer, HDTV and multi-monitor gaming rig.
It is currently 30 Dec 2024, 19:19

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 06 Dec 2009, 03:20 
Offline

Joined: 06 Dec 2009, 03:07
Posts: 2
1. Open config.dat in a hex editor like XVI32.
2. The horizontal resolution is at the 4th byte from the start of the file. It is a 4-byte value or a signed/unsigned 32-bit integer.
3. The vertical resolution is at the 8th byte from the start of the file. It is a 4 byte value or a signed/unsigned int 32-bit integer.

This was verified by the following process:
1. Opened up config.dat in Notepad++ to find out if the file was being altered by the program.
2. Went in game and selected 1024x768 resolution
3. Exited the game and notepad++ stated that config.dat had been altered.
4. Opened config.dat in XVI32 and found the bytes that represent 1024x768.
5. Saved the file as config.old.
6. Went back into the game and set the resolution to 1600x1200.
7. Again the file was altered as verified by notepad++.
8. Opened another instance of XVI32 and put the two windows side by side and went through two files byte by byte.
9. Found the values 1600 and 1200 at file_start + 4 bytes and file_start + 8 bytes.
10. Told XVI32 to encode 1600 at starting at byte position 4.
11. Told XVI32 to encode 900 starting at byte position 8.
12. Saved the file.
13. Ran the game and when the mission started the screen resolution was 1600x900.

The problem with the game is that in the list of resolutions only 4:3 resolutions are listed. This doesn't mean the underlying engine only supports 4:3. I've flown around for a little bit now and haven't seen too many issues. Shadows at times did flicker underneath the helicopter but unsure if this is a game glitch or related to the widescreen resolution. Have not seen incorrect or early frustum culling where objects disappear just before the edges of the screen as of yet.

Not sure if anyone plays this game anymore or if I'm the only moron here who plays old games. Note that this solution may also work for Vietnam Med-Evac by the same development team.

Note that the video resolution is not set and Direct3D is not created until the mission actually starts. Verified by using a debugger and setting breakpoints on Direct3DCreate8(). This widescreen fix only applies to the game missions or the 3D portion of the game. Menus and such are not affected and work just like they came out of the box.


Top
 Profile  
 


PostPosted: 06 Dec 2009, 11:35 
Offline
Editors
Editors
User avatar

Joined: 06 Mar 2008, 17:20
Posts: 3424
:shock: You're not a moron. You, sir, are now my god.
I thought the SAR series would forever lie in my mental list of "cool memories, but hopelessly narrow" games. It has now moved to the "find the darn cd and give it a shot, WSGF-style" section of my brain.
What's more, this solution probably applies to Operation Air Assault 1 & 2 in addition to Viet-Nam Med Evac, as these all seem to be built on the very same engine. Oh my, I'm drooling again.
Thank you so much ! :bowdown

Could your highness please provide us mere morons with a divine '4:3 vs. wide' screenshot comparison ?


Top
 Profile  
 
PostPosted: 07 Dec 2009, 14:34 
Offline
Editors
Editors
User avatar

Joined: 06 Mar 2008, 17:20
Posts: 3424
And indeed it works with OAA2.
The result is basically Vert- but the game has free zoom, pitch and dolly on some cameras, all of which can help for taking advantage of wider ARs. No luck for the cockpit view though.
The HUD does not stretch to keep up with the AR... it inflates instead.

4:3 (1024x768)


16:10 (1680x1050)


3x 16:10 (5040x1050), default camera settings


3x 16:10 (5040x1050), zoom+dolly+pitch in action (will stick only until you switch cameras or end mission :!: )



Menus are always displayed at 1024x768, the res changes happen on loading screens. Although non-4:3 resolutions are not available in-game, the video options screen displays the actual "in-mission" resolution accurately after the edit.


Top
 Profile  
 
PostPosted: 08 Dec 2009, 09:53 
Offline

Joined: 06 Dec 2009, 03:07
Posts: 2
Thanks for the compliments but it really wasn't that hard. I had originally intended to find where d3d8::CreateDevice() was being called and change the D3DPRESENT_PARAMETERS BackBufferWidth and BackBufferHeight members
to what I wanted. However I was unable to find the function and could only find Direct3DCreate8() which only creates the base interface that then can be used to actually init the
device, backbuffer, z-buffer, and so forth.

Code:

   typedef struct D3DPRESENT_PARAMETERS {
       UINT BackBufferWidth, BackBufferHeight;
       D3DFORMAT BackBufferFormat;
       UINT BackBufferCount;
       D3DMULTISAMPLE_TYPE MultiSampleType;
       DWORD MultiSampleQuality;
       D3DSWAPEFFECT SwapEffect;
       HWND hDeviceWindow;
       BOOL Windowed;
       BOOL EnableAutoDepthStencil;
       D3DFORMAT AutoDepthStencilFormat;
       DWORD Flags;
       UINT FullScreen_RefreshRateInHz;
       UINT PresentationInterval;
   } D3DPRESENT_PARAMETERS, *LPD3DPRESENT_PARAMETERS;
   

As you can see all I would have had to do was change the first two 4 byte values starting at the base address of the structure. This structure is from Direct3D9 but 8 was not all that different. In the end it worked out and I feel that
changing the dat file it uses is probably a more elegant solution than altering the code and definitely more EULA compliant. I'm glad to hear it works for other games by this dev house as well.

I will work on getting some 4:3 and 16:9 screenshots to compare. It definitely isn't a perfect widescreen but it still enables me to play the game pretty much as it was before just in much higher resolution. Have done
several missions now and haven't noticed any early culling or disappearing textures as happens on other older 4:3 games when pushed to widescreen (IE: Vampire: Masquerade and IL2 1946 are a few that come to mind that I know suffer from this).
I really can't believe some of those games hard-coded the the width/height aspect ratio, or did not take the this ratio into account when fudging their AABBs used for frustum culling.


Top
 Profile  
 
PostPosted: 09 Dec 2009, 00:33 
Offline
Editors
Editors
User avatar

Joined: 06 Mar 2008, 17:20
Posts: 3424
I really can't believe some of those games hard-coded the the width/height aspect ratio, or did not take the this ratio into account when fudging their AABBs used for frustum culling.
I probably understood less than 10% of your post, but I remember (back in the day, when helosim.com was big) InterActiveVision's guys stating that they had coded their stuff in a way that it'd be virtually impossible to crack it open (and thus to mod in any way), because this was the best way for a small company like them to annoy pirates and secure some sales. Apparently this also allowed them to release numerous full-priced games that could've looked like mere expansion packs more often than not, had the game code been a little more open.

In short: there's probably nothing better you can do. And for an old fan like me, it's pretty awesome already ! :)


Top
 Profile  
 
PostPosted: 26 Oct 2010, 02:05 
Offline

Joined: 26 Oct 2010, 02:02
Posts: 1
Shameless bump as i AM a moron! Cannot get this to work at all. The only res options are 4:3, eg the max. is 1600x1200. My monitors native resolution is 1680x1050.

Help!


Top
 Profile  
 
PostPosted: 02 Nov 2010, 20:08 
Offline
Editors
Editors
User avatar

Joined: 06 Mar 2008, 17:20
Posts: 3424
Sorry if my last screenie was misleading - you cannot select wide resolutions from the in-game options and the menus will always be rendered at 1024x768. After the hex edit, and only after you've actually started a mission, the resolution will change to the one you specified. In other words, the 3D part of the game is the only area that you can "fix".


Top
 Profile  
 
PostPosted: 31 Mar 2018, 11:05 
Offline
User avatar

Joined: 19 Jan 2018, 06:05
Posts: 3
There is one more solution.

Open Sar4.exe with a hex editor such as HxD.
Press Ctrl+F, "Datatype" option to "Text String" and paste 1600 in the text field.
In the right column you'll see all the resolution in plain text:

1600 x 1200 x 32....
1280 x 960 x 32.
1152 x 864 x 32.
1024 x 768 x 32.
800 x 600 x 32..
640 x 480 x 32..
1600 x 1200 x 16....
1280 x 960 x 16.
1152 x 864 x 16.
1024 x 768 x 16.
800 x 600 x 16..
640 x 480 x 16

Change the resolution to the desired widescreen and save the changes (In my case, I replaced 1600 x 1200 => 1920 x 1080 and 1024 x 768 => 1366 x 768).
Then start the game, go to the settings and set widescreen resolution you need.

This decision probably refers to Operation Air Assault 1 and 2 in addition to Viet-Nam Med Evac.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  




Powered by phpBB® Forum Software © phpBB Group