MTM2.com

A forum for mtm2 discussion
FAQ :: Search :: Members :: Groups :: Register
Login
It is currently Mon Nov 25, 2024 1:54 am



Post new topic Reply to topic  [ 126 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next   
Author Message
 Post subject: Re: MTM2 Source Code
PostPosted: Sun Dec 27, 2015 2:26 pm 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
I think the truck screen/winner's circle might be a little more complicated but I can definitely flag the game to use direct3d every time it loads a level. I will have to look a bit into it but right now, when you don't use full screen the game goes back to software renderer but it does so only because the code simply uses a flag like "directd3d mode = 0" instead of "directd3d mode = 1".

Of course complications might arise but I'll get to it in due course.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Tue Dec 29, 2015 12:22 am 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
Sigh. I thought I was on a roll and was hoping to get the beta out today before I leave for holidays but... meh. Anything above 1600x1200 just crashes straight up.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Tue Dec 29, 2015 12:47 pm 
Member
User avatar

Joined: Sun Oct 16, 2005 4:39 pm
Posts: 1822
Location: Winnipeg Manitoba, Canada
Fila wrote:
Sigh. I thought I was on a roll and was hoping to get the beta out today before I leave for holidays but... meh. Anything above 1600x1200 just crashes straight up.

I'm pretty sure that's too big of a directdraw surface for DX5.
I made a quick test program in dx7 and directdraw appears to be supporting 1080 but that's all my old XP machine supports so I can't go higher.

_________________
Image


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Tue Dec 29, 2015 1:11 pm 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
I've never done this before and since there's no reliable way to check I don't know but I assume I moved the game to directx 7.

I replaced all the headers that were dx5 with the equivalent dx7 headers and replaced the library files as well. So i assume when it compiles it does so against dx7. Unless there's some TRI code in their own files that stops it from happening (since you can instruct the dx headers to use a previous version).

Also the crashes are somewhat varied in nature.

1360x768 - refuses to go into full screen mode
1366x768 - works fine
1600x900 - works fine
1440x900 - refuses to go into full screen mode
1680x1050 - it loads correctly in ddraw after i force the game to ignore some code but it doesn't load correctly in software mode (note: ignoring that specific code has no effect for the other resolutions)
1600x1200 - works fine
1920x1080 - crashes at the loading screen with a windows runtime error
1920x1200 - it loads in software mode and ddraw but crashes after 5-10sec with a blank AV error
2560x1440 - crashes at the loading screen with a windows runtime error

Considering that 1600x900 and 1600x1200 work correctly it kinda makes me think there must be some issues in TRI's code and not really ddraw's fault. With the exception of 2560x1440... that one might indeed be unsupported.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Wed Dec 30, 2015 2:23 pm 
Member
User avatar

Joined: Sun Oct 16, 2005 4:39 pm
Posts: 1822
Location: Winnipeg Manitoba, Canada
Fila wrote:
I've never done this before and since there's no reliable way to check I don't know but I assume I moved the game to directx 7.

I replaced all the headers that were dx5 with the equivalent dx7 headers and replaced the library files as well. So i assume when it compiles it does so against dx7. Unless there's some TRI code in their own files that stops it from happening (since you can instruct the dx headers to use a previous version).

Also the crashes are somewhat varied in nature.

1360x768 - refuses to go into full screen mode
1366x768 - works fine
1600x900 - works fine
1440x900 - refuses to go into full screen mode
1680x1050 - it loads correctly in ddraw after i force the game to ignore some code but it doesn't load correctly in software mode (note: ignoring that specific code has no effect for the other resolutions)
1600x1200 - works fine
1920x1080 - crashes at the loading screen with a windows runtime error
1920x1200 - it loads in software mode and ddraw but crashes after 5-10sec with a blank AV error
2560x1440 - crashes at the loading screen with a windows runtime error

Considering that 1600x900 and 1600x1200 work correctly it kinda makes me think there must be some issues in TRI's code and not really ddraw's fault. With the exception of 2560x1440... that one might indeed be unsupported.


That is odd.

_________________
Image


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Mon Jan 11, 2016 8:53 pm 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
Aight, I'm back from the holiday. I'm going to play a little more with this and whether I get it fully working or not I will release a beta version. At least to see if the game crashes the same for everyone or whether it's just me.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Wed Mar 23, 2016 1:36 pm 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
There's some big behind the scene news. The code was updated and is compilable with Visual Studio 2015 and it works. There are a few kinks as a result of the porting, like the truck preview screen is all black and doesn't rotate and high scores aren't registered but I'm sure these are fixable.

And just as a funny side news, my visual studio 2015 installation got borked right after this and I am unable to start or even reinstall the bloody thing. It seems like an OS reformat is in order. Blah.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Wed Mar 23, 2016 10:22 pm 
MTM2 Engineer
User avatar

Joined: Fri Oct 10, 2003 6:19 pm
Posts: 1350
Location: Valparaíso, Chile.
By the way Slayer, i played around with sweetFX + nglide (had to use nglide because it translates the DX5/7? calls to DX9), but I couldn't get anything useful from it, except for the SMAA antialiasing. Is there any custom setup you use? By the way, i couldn't use 1080 in 3dfx mode (didn't test the other resolutions), should that work or not?

My system: i7 4790k, R9 290, 16gb ram, 1920x1080 /60hz Win7

I have heard the VS2015 IDE is awesome, hopefully it aids development and porting to DX9.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Thu Mar 24, 2016 2:42 am 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
The resolutions are sadly for direct3d only. 3dfx won't work.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Thu Mar 31, 2016 12:03 am 
Member
User avatar

Joined: Sun Oct 16, 2005 4:39 pm
Posts: 1822
Location: Winnipeg Manitoba, Canada
Kmaster wrote:
By the way Slayer, i played around with sweetFX + nglide (had to use nglide because it translates the DX5/7? calls to DX9), but I couldn't get anything useful from it, except for the SMAA antialiasing. Is there any custom setup you use? By the way, i couldn't use 1080 in 3dfx mode (didn't test the other resolutions), should that work or not?

My system: i7 4790k, R9 290, 16gb ram, 1920x1080 /60hz Win7

I have heard the VS2015 IDE is awesome, hopefully it aids development and porting to DX9.

I posted a config awhile ago, but it might be gone.

Dunno how to collapse this but....
Code:
   /*-----------------------------------------------------------.
  /                      Choose effects                         /
  '-----------------------------------------------------------*/

// Set to 1 for ON or 0 for OFF
#define USE_SMAA_ANTIALIASING 0 //[0 or 1] SMAA Anti-aliasing : Smoothens jagged lines.
#define USE_LUMASHARPEN   1 //[0 or 1] LumaSharpen : Also sharpens the antialiased edges which makes them less smooth - I'm working on fixing that.
#define USE_BLOOM         1 //[0 or 1] Bloom : Makes bright lights bleed their light into their surroundings (relatively high performance cost)
#define USE_HDR           1 //[0 or 1] HDR : Not actual HDR - It just tries to mimic an HDR look (relatively high performance cost)
#define USE_TECHNICOLOR   0 //[0 or 1] TECHNICOLOR : Attempts to mimic the look of an old movie using the Technicolor three-strip color process (Techicolor Process 4)
#define USE_DPX           0 //[0 or 1] Cineon DPX : Should make the image look like it's been converted to DXP Cineon - basically it's another movie-like look similar to technicolor.
#define USE_LIFTGAMMAGAIN 0 //[0 or 1] Lift Gamma Gain : Adjust brightness and color of shadows, midtones and highlights (avoids clipping)
#define USE_TONEMAP       0 //[0 or 1] Tonemap : Adjust gamma, exposure, saturation, bleach and defog. (may cause clipping)
#define USE_VIBRANCE      1 //[0 or 1] Vibrance : Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation.
#define USE_CURVES        0 //[0 or 1] Curves : Contrast adjustments using S-curves.
#define USE_SEPIA         0 //[0 or 1] Sepia : Sepia tones the image.
#define USE_VIGNETTE      0 //[0 or 1] Vignette : Darkens the edges of the image to make it look more like it was shot with a camera lens. May cause banding artifacts.
#define USE_DITHER        0 //[0 or 1] Dither : Applies dithering to simulate more colors than your monitor can display. This lessens banding artifacts (mostly caused by Vignette)
#define USE_SPLITSCREEN   0 //[0 or 1] Splitscreen : Enables the before-and-after splitscreen comparison mode.


   /*-----------------------------------------------------------.
  /                  SMAA Anti-aliasing settings                /
  '-----------------------------------------------------------*/

#define SMAA_THRESHOLD 0.05           // [0.05 to 0.20] Edge detection threshold
#define SMAA_MAX_SEARCH_STEPS 98       // [0 to 98] Determines the radius SMAA will search for aliased edges
#define SMAA_MAX_SEARCH_STEPS_DIAG 16  // [0 to 16] Determines the radius SMAA will search for diagonal aliased edges
#define SMAA_CORNER_ROUNDING 100        // [0 to 100] Determines the percent of antialiasing to apply to corners.

// -- Advanced SMAA settings --
#define COLOR_EDGE_DETECTION 1        // [0 or 1] 1 Enables color edge detection (slower but slightly more acurate) - 0 uses luma edge detection (faster)
#define SMAA_DIRECTX9_LINEAR_BLEND 1  // [0 or 1] Using DX9 HARDWARE? (software version doesn't matter) if so this needs to be 1 - If not, leave it at 0.


   /*-----------------------------------------------------------.
  /                       LumaSharpen settings                  /
  '-----------------------------------------------------------*/
// -- Sharpening --
#define sharp_strength 1.70    // [0.10 to 3.00] Strength of the sharpening
#define sharp_clamp    0.350  // [0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035

// -- Advanced sharpening settings --
#define pattern 2        // [1|2|3|4] Choose a sample pattern. 1 = Fast, 2 = Normal, 3 = Wider, 4 = Pyramid shaped.
#define offset_bias 1.0  // [0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern.
                         // I designed the pattern for offset_bias 1.0, but feel free to experiment.
                           
// -- Debug sharpening settings --
#define show_sharpen 0   // [0 or 1] Visualize the strength of the sharpen (multiplied by 4 to see it better)


   /*-----------------------------------------------------------.
  /                       Bloom settings                        /
  '-----------------------------------------------------------*/
#define BloomThreshold 50.00 //[0.00 to 50.00] Threshold for what is a bright light (that causes bloom) and what isn't.
#define BloomPower 2.8500     //[0.0000 to 8.0000] Strength of the bloom
#define BloomWidth 0.0442    //[0.0000 to 1.0000] Width of the bloom


   /*-----------------------------------------------------------.
  /                        HDR settings                         /
  '-----------------------------------------------------------*/
#define HDRPower 1.35  //[0.0 to 8.0] Strangely lowering this makes the image brighter
#define radius2  1.09 //[0.0 to 8.0] Raising this seems to make the effect stronger and also brighter


   /*-----------------------------------------------------------.
  /                      TECHNICOLOR settings                   /
  '-----------------------------------------------------------*/
#define TechniAmount 0.21        //[0.0 to 1.0]
#define TechniPower  2.8         //[0.0 to 8.0]
#define redNegativeAmount   0.88 //[0.0 to 1.0]
#define greenNegativeAmount 0.88 //[0.0 to 1.0]
#define blueNegativeAmount  0.88 //[0.0 to 1.0]


   /*-----------------------------------------------------------.
  /                      Cineon DPX settings                    /
  '-----------------------------------------------------------*/
#define Red   8.0  //[1.0 to 15.0]
#define Green 8.0  //[1.0 to 15.0]
#define Blue  8.0  //[1.0 to 15.0]

#define ColorGamma    2.5  //[0.1 to 2.5] Adjusts the colorfulness of the effect in a manner similar to Vibrance. 1.0 is neutral.
#define DPXSaturation 3.0  //[0.0 to 8.0] Adjust saturation of the effect. 1.0 is neutral.

#define RedC   0.36  //[0.6 to 0.2]
#define GreenC 0.36  //[0.6 to 0.2]
#define BlueC  0.34  //[0.6 to 0.2]

#define Blend 0.2    //[0.0 to 0.1] How strong the effect should be.


   /*-----------------------------------------------------------.
  /                      Lift Gamma Gain settings               /
  '-----------------------------------------------------------*/
#define RGB_Lift  float3(1.000, 1.000, 1.000)  //[0.000 to 2.000] Adjust shadows for Red, Green and Blue
#define RGB_Gamma float3(1.000, 1.000, 1.000)  //[0.000 to 2.000] Adjust midtones for Red, Green and Blue
#define RGB_Gain  float3(1.000, 1.000, 1.000)  //[0.000 to 2.000] Adjust highlights for Red, Green and Blue


   /*-----------------------------------------------------------.
  /                        Tonemap settings                     /
  '-----------------------------------------------------------*/
#define Gamma 1.0        //[0.00 to 2.00] Adjust midtones

#define Exposure -0.10    //[-1.00 to 1.00] Adjust exposure

#define Saturation -0.30  //[-1.00 to 1.00] Adjust saturation

#define Bleach 0.00      //[0.00 to 1.00] Brightens the shadows and fades the colors

#define Defog 0.000  //[0.00 to 1.00] How much of the color tint to remove
#define FogColor float3(0.00, 0.00, 2.55) //[0.00 to 1.00, 0.00 to 1.00, 0.00 to 1.00] What color to remove - default is blue


   /*-----------------------------------------------------------.
  /                       Vibrance settings                     /
  '-----------------------------------------------------------*/
#define Vibrance 0.32 //[-1.0 to 1.0] Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation.


   /*-----------------------------------------------------------.
  /                        Curves settings                      /
  '-----------------------------------------------------------*/
#define Curves_contrast 0.30  //[-1.0 to 1.0] The amount of contrast you want

// -- Advanced curve settings --
#define Curves_formula 7      //[1|2|3|4|5|6|7] The constrast s-curve you want to use.


   /*-----------------------------------------------------------.
  /                         Sepia settings                      /
  '-----------------------------------------------------------*/
#define ColorTone float3(1.40, 1.10, 0.90) //[0.00 to 1.00, 0.00 to 1.00, 0.00 to 1.00] What color to tint the image
#define GreyPower  0.11                    //[0.0 to 1.0] How much desaturate the image before tinting it
#define SepiaPower 0.58                    //[0.0 to 1.0] How much to tint the image



   /*-----------------------------------------------------------.
  /                       Vignette settings                     /
  '-----------------------------------------------------------*/
#define VignetteRadius 1.00   //[-1.00 to 3.00] lower values = stronger radial effect from center
#define VignetteAmount -1.00  //[-2.00 to 1.00] Strength of black. -2.00 = Max Black, 1.00 = Max White.
#define VignetteSlope 8       //[1 to 16] How far away from the center the change should start to really grow strong (odd numbers cause a larger fps drop than even numbers)
#define VignetteCenter float2(0.500, 0.500)  //[0.00 to 1.00] Center of effect.


   /*-----------------------------------------------------------.
  /                        Dither settings                      /
  '-----------------------------------------------------------*/
//No settings yet, beyond switching it on or off in the top section.

//Note that the checkerboard pattern used by Dither, makes an image harder to compress.
//This can make your screenshots and video recordings take up more space.


   /*-----------------------------------------------------------.
  /                     Splitscreen settings                    /
  '-----------------------------------------------------------*/
#define splitscreen_mode 1  //[1|2|3|4|5]  1 = Vertical 50/50 split, 2 = Vertical 25/50/25 split, 3 = Vertical 50/50 angled split, 4 = Horizontal 50/50 split, 5 = Horizontal 25/50/25 split


_________________
Image


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Thu Mar 31, 2016 3:39 am 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
A little update:

What was updated was the original source code given to me by TRI. So right now all the changes I've done so far have disappeared (don't worry I obviously have it saved). I'm going through them right now to implement all the changes back into the updated source code. Once that is done I will resume trying to improve the game.

Kmaster. I spoke to someone that knows Directx9 and OpenGL coding. Right now... it's very unlikely this will get done. According to him the whole rendering part has to be rewritten and it's not something that is viable at this point in time. Hopefully in the future things will change.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Thu Mar 31, 2016 7:38 pm 
Member
User avatar

Joined: Sun Oct 16, 2005 4:39 pm
Posts: 1822
Location: Winnipeg Manitoba, Canada
Fila wrote:
Kmaster. I spoke to someone that knows Directx9 and OpenGL coding. Right now... it's very unlikely this will get done. According to him the whole rendering part has to be rewritten and it's not something that is viable at this point in time. Hopefully in the future things will change.

Yep this is true. DX7 had massive changes, then again in DX8. Making going from DX6 and older, to DX9 very very difficult.

_________________
Image


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Fri Apr 01, 2016 1:44 am 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
Got some pretty good news. Seems that the AV that always happened at the exact same spot has been magically fixed while the code was changed to be compatible with VS2015.

So basically all resolutions work correctly except:

2560x1440 - will be taken out. This is not supported prior to DirectX 8/9.
1440x900 - I suspect it's not supported by Dx5/7 but works in software
1536x864 - I suspect it's not supported by Dx5/7 but works in software

I will try one more attempt at making a widescreen version for 3dfx and then I will attempt to fix the menu bar (or rather, to stop the menu bar from just sitting there). Once the menu bar and the hall of fame issue have been fixed (hall of fame issue happened because of vs2015) I will release a new version.

The next step afterwards will be to fix all the other small annoying issues that are easily fixable but are time consuming.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Mon Apr 04, 2016 3:41 am 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
3dfx widescreen achieved \o/! Hall of Fame has also been fixed together with a bunch of smaller fixes.

The one thing that is completely elusive is the menu bar. I simply cannot get rid of that. I think I have to delete the current menu bar and write in a new one. I suspect the reason is that whatever code TRI had to hide the bar doesn't play well with any of the more modern OSes. But alas this will have the lowest priority right now.

Stay tuned for a new beta in the next 2-3 days and if all works nicely then I will finally get to work on the UI and have proper menus and dashboard etc.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Tue Apr 05, 2016 10:16 pm 
Member
User avatar

Joined: Sun Oct 16, 2005 4:39 pm
Posts: 1822
Location: Winnipeg Manitoba, Canada
Fila wrote:
3dfx widescreen achieved \o/! Hall of Fame has also been fixed together with a bunch of smaller fixes.

The one thing that is completely elusive is the menu bar. I simply cannot get rid of that. I think I have to delete the current menu bar and write in a new one. I suspect the reason is that whatever code TRI had to hide the bar doesn't play well with any of the more modern OSes. But alas this will have the lowest priority right now.

Stay tuned for a new beta in the next 2-3 days and if all works nicely then I will finally get to work on the UI and have proper menus and dashboard etc.


Without going to far into that...
What menu bar?

Menu bar doesn't show for the stock game when in race. What did you do? lol

_________________
Image


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Wed Apr 06, 2016 12:19 am 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
It doesn't?

That's weird... it does on my end (in the vanilla version too). The regular menu bar with the race,view,options buttons.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Wed Apr 06, 2016 3:07 am 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
Btw Slayer, you asked a while ago what does Dithering do and I couldn't figure it out (it's not explained in the code either).

http://retro-sanctuary.com/comparisons% ... ering.html

If this is true... dithering is probably used for software rendering as going by that website, it must be useless for direct3d/3dfx.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Wed Apr 06, 2016 12:24 pm 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
Hmmm. Just tried what I released on Win 7 and there's no menu bar. It means the problem is exclusive to Win8/10.


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Wed Apr 06, 2016 7:06 pm 
Member
User avatar

Joined: Sun Oct 16, 2005 4:39 pm
Posts: 1822
Location: Winnipeg Manitoba, Canada
Fila wrote:
Hmmm. Just tried what I released on Win 7 and there's no menu bar. It means the problem is exclusive to Win8/10.

Now that's interesting.

I wonder if you could just hide the menu bar using a resource hacker?

_________________
Image


Top
 Profile  
 
 Post subject: Re: MTM2 Source Code
PostPosted: Sun Apr 17, 2016 3:57 am 
Member
User avatar

Joined: Mon Jul 02, 2001 2:01 pm
Posts: 1426
Location: Lost in Translation
Does anyone have experience with the resource editor in visual c++?

Basically the menus (garage, driver check-in etc) are created with the dialog editor. Which is fine but for some reason I simply cannot move and/or scale the buttons around. I can disable them, delete them, make them invisible but I just can't move their positions at all and until I can figure out why I'm not able to fix the UI (which is easy, just needs different sized background files. Oh btw, I should try and see if I can make the game use .jpg otherwise the UI.POD will be HUGE with all the the bmp for all the resolutions).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 126 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next   


Who is online

Users browsing this forum: No registered users and 18 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group