www.tombraiderforums.com

www.tombraiderforums.com (https://www.tombraiderforums.com/index.php)
-   Tomb Raider III (https://www.tombraiderforums.com/forumdisplay.php?f=8)
-   -   Have issues with TR3 (Widescreen Patch and Peixoto), need help to fix them. (https://www.tombraiderforums.com/showthread.php?t=217766)

annl 16-04-17 14:44

Have issues with TR3 (Widescreen Patch and Peixoto), need help to fix them.
 
I have TR3 and I have to play it with a Widescreen patch but I have two issues.

If I run it using the Widescreen Patch, it looks too zoomed in and while I can play it, it doesn't look right. I play in 1360x768 on a Widescreen TV if that helps.

If I play it with Peixoto's Patch, it looks right but the framerate is dreadful and while I seem to have fixed that, the FMV sounds loop over and over and the sound ends up behind on the video.

Also, occasionally with Peixoto's Patch it crashes with a AutoHotkey.dll error.

Can anyone help? I bought TR3 The Lost Artifact from eBay and I want to fix this issue before it arrives.

ThatSassyKid 16-04-17 14:52

Right click on tomb3.exe, then go to the Compatibility tab. Then, check the box that says Disable display scaling on high DPI settings.
That's how I fixed the same problem. :)

annl 16-04-17 14:53

I tried this, no change.

Arsunt 16-04-17 19:25

Quote:

Originally Posted by annl (Post 7732801)
I have TR3 and I have to play it with a Widescreen patch but I have two issues.

This widescreen is done very lazily. The person who created it just decided to adjust the constants, instead of really fixing the problem of calculating the aspect ratio and the field of the view.
Quote:

Originally Posted by annl (Post 7732801)
Also, occasionally with Peixoto's Patch it crashes with a AutoHotkey.dll error.

I consider Peixoto's patch a good temporary workaround. But it's based on the assumption that everyone has the same version of the EXE, and the patch does some things in a very rude way. I will do everything possible to ensure that this patch remains in the past, and in its place came a normal solution in the form of clean fixes in the game code (And much has been done).
Quote:

Originally Posted by annl (Post 7732801)
Can anyone help?

I can apply my aspect ratio and FOV patch to your exe file manually if you share it to me (I do not know what version you have). Or, if it's GOG or Steam, I'll apply a patch to this one and upload it here.

annl 16-04-17 19:29

Quote:

Originally Posted by Arsunt (Post 7732912)
This widescreen is done very lazily. The person who created it just decided to adjust the constants, instead of really fixing the problem of calculating the aspect ratio and the field of the view.

I consider Peixoto's patch a good temporary workaround. But it's based on the assumption that everyone has the same version of the EXE, and the patch does some things in a very rude way. I will do everything possible to ensure that this patch remains in the past, and in its place came a normal solution in the form of clean fixes in the game code (And much has been done).

I can apply my aspect ratio and FOV patch to your exe file manually if you share it to me (I do not know what version you have). Or, if it's GOG or Steam, I'll apply a patch to this one and upload it here.

I use the Steam Version.

annl 16-04-17 19:33

The zoom only affects my resolution, which is 1360 x 768. Is that the problem? I can't use any other resolution without it looking awkward.

charmedangelin 16-04-17 20:03

What are your fov and camera distance values.

I use the default camera distance, but I set the fov to zero. Also I set the widescreen patch to 16:9 instead of typing in a custom resolution. Have you tried that?

annl 16-04-17 20:14

Quote:

Originally Posted by charmedangelin (Post 7732928)
What are your fov and camera distance values.

I use the default camera distance, but I set the fov to zero. Also I set the widescreen patch to 16:9 instead of typing in a custom resolution. Have you tried that?

Done both, no change.

Arsunt 16-04-17 21:43

I've uploaded the patched EXE for TR3 and The Lost Artifact. It includes my (exclusive) FOV patch. It was was not published anywhere until now.

That's how it works. There is the original code (let it be C pseudocode):
Code:

#define SCREEN_WIDTH        dword_5A6AF4
#define SCREEN_HEIGHT        dword_4D790C
#define ASPECT_RATIO        flt_4C3244        // 1.3333334

void sub_402030(__int16 a1) {
    int v1, v2, v3;

    v1 = SCREEN_WIDTH / 2 * sub_4B4C58(a1 / 2);
    v2 = sub_4B4C5E(a1 / 2);
    dword_4F6D50 = v1 / v2;

    v3 = sub_4B5E10(v2, v1 % v2, flt_4C5084);
    dword_5A6A28 = v3 / dword_4F6D50;

    flt_5A6AB8 = (double)dword_4F6D50; // heigth ratio
    flt_4F6D48 = flt_4C5084 / flt_5A6AB8; // depth ratio
    flt_53170C = flt_5A6AB8 / flt_56C0A0;

    flt_4D38D8 = ASPECT_RATIO / ((double)SCREEN_WIDTH / (double)SCREEN_HEIGHT);

    sub_48D6A0(v3 % dword_4F6D50);
}

And I've changed it to this code:
Code:

#define SCREEN_WIDTH        dword_5A6AF4
#define SCREEN_HEIGHT        dword_4D790C
#define ASPECT_RATIO        flt_4C3244        // 1.3333334

const float flt_4D38D8 = 1.0;    // it is always 1.0 now

int sub_4020B8() {
    return (int)((float)SCREEN_HEIGHT * ASPECT_RATIO)
}

void sub_402030(__int16 a1) {
    int v1, v2, v3;

    // SCREEN_WIDTH value replaced by new function sub_4020B8
    v1 = sub_4020B8 / 2 * sub_4B4C58(a1 / 2);
    v2 = sub_4B4C5E(a1 / 2);
    dword_4F6D50 = v1 / v2;

    v3 = sub_4B5E10(v2, v1 % v2, flt_4C5084);
    dword_5A6A28 = v3 / dword_4F6D50;

    flt_5A6AB8 = (double)dword_4F6D50; // heigth ratio
    flt_4F6D48 = flt_4C5084 / flt_5A6AB8; // depth ratio
    flt_53170C = flt_5A6AB8 / flt_56C0A0;

    sub_48D6A0(v3 % dword_4F6D50);
}

There are v1, v2, v3 variables to calculate FOV. I changed the formula so that they depended on the original aspect ratio (4/3) and the current screen height, but NOT screen width, because this is not correct for wide screens.

The flt_4D38D8 variable is pixel aspect ratio. It must always be 1.0 if we want correct aspect ratio.

P.S. Do not combine this patch with other Widescreen patches and Peixoto's patch. They will break the formula.

UPD. I've updated the patch. Old links deleted.

annl 16-04-17 21:45

Quote:

Originally Posted by Arsunt (Post 7732973)
I've uploaded TR3 exe for GOG and for Steam with my (exclusive) FOV patch. It was was not published anywhere until now.

That's how it works. There is the original code (let it be C pseudocode):
Code:

#define SCREEN_WIDTH    dword_5A6AF4
#define SCREEN_HEIGHT    dword_4D790C
#define ASPECT_RATIO    flt_4C3244    // 1.3333334

void sub_402030(__int16 a1) {
    int v1, v2, v3;

    v1 = SCREEN_WIDTH / 2 * sub_4B4C58(a1 / 2);
    v2 = sub_4B4C5E(a1 / 2);
    dword_4F6D50 = v1 / v2;

    v3 = sub_4B5E10(v2, v1 % v2, flt_4C5084);
    dword_5A6A28 = v3 / dword_4F6D50;

    flt_5A6AB8 = (double)dword_4F6D50; // heigth ratio
    flt_4F6D48 = flt_4C5084 / flt_5A6AB8; // depth ratio
    flt_53170C = flt_5A6AB8 / flt_56C0A0;

    flt_4D38D8 = 1.3333334 / ((double)SCREEN_WIDTH / (double)SCREEN_HEIGHT);

    sub_48D6A0(v3 % dword_4F6D50);
}

And I've changed it to this code:
Code:

#define SCREEN_WIDTH    dword_5A6AF4
#define SCREEN_HEIGHT    dword_4D790C
#define ASPECT_RATIO    flt_4C3244    // 1.3333334

const float flt_4D38D8 = 1.0;    // it is always 1.0 now

int sub_4020B8() {
    return (int)((float)SCREEN_HEIGHT * ASPECT_RATIO)
}

void sub_402030(__int16 a1) {
    int v1, v2, v3;

    // SCREEN_WIDTH value replaced by new function sub_4020B8
    v1 = sub_4020B8 / 2 * sub_4B4C58(a1 / 2);
    v2 = sub_4B4C5E(a1 / 2);
    dword_4F6D50 = v1 / v2;

    v3 = sub_4B5E10(v2, v1 % v2, flt_4C5084);
    dword_5A6A28 = v3 / dword_4F6D50;

    flt_5A6AB8 = (double)dword_4F6D50; // heigth ratio
    flt_4F6D48 = flt_4C5084 / flt_5A6AB8; // depth ratio
    flt_53170C = flt_5A6AB8 / flt_56C0A0;

    sub_48D6A0(v3 % dword_4F6D50);
}

There are v1, v2, v3 variables to calculate FOV. I changed the formula so that they depended on the original aspect ratio (4/3) and the current screen height, but NOT screen width, because this is not correct for wide screens.

The flt_4D38D8 variable is pixel aspect ratio. It must always be 1.0 if we want correct aspect ratio.

P.S. Do not combine this patch with other Widescreen patches and Peixoto's patch. They will break the formula.

Fantastic work Arsunt! Works fantastic! Can you do one for TR3 Gold too? Also message AlexFly, get this uploaded on his website! It's your choice, but many people have the same problem I had.

EDIT: The FMVs are not working well now, the sounds loop and then the FMV cuts off and auto skips halfway, what is wrong?


All times are GMT. The time now is 19:09.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.