Paintjobs 11+ in MM2

Thought I'd share this...

aaro4130
MM2X Super Active User
MM2X Super Active User
Posts: 2405
Registered for: 15 years 10 months
Location: Canada
Been thanked: 1 time

Paintjobs 11+ in MM2

Postby aaro4130 » Tue Apr 24, 2018 9:06 am

So, we've always had the sailboat/tugboat/somekindofboat in our car issue with paintjobs over 10.

Today I dug into this issue, and dear god is the cause amusing.

When the game initializes your car, it starts initializing level geometry. The game goes through each item in the car (hardcoded list, basically), and adds body, shadow, tlight, etc. Finally, it adds the variantPAINTJOB items, which I recently posted a topic about.

Here's the catch. It only adds 10 of these.

This wouldn't be a big deal, but later on in the initialization, it adds a breakable to your car. It tries to use the banger "carname_variantPAINTJOB", but it also passes in a model ID. The model ID = paintjob + car items.

The memory layout of models is
[CAR STUFF][VARIANT STUFF (ONLY 10)][OTHER GEOMETRY]

So, to sum up
This bug is caused by an unused feature in the base game, because they don't check if your paintjob is less than 11, and then it overflows into other geometry. :lol:

I did some tests and was able to fix this by initializing 64 objects instead of 10.
[img]https://i61.tinypic.com/25zrngo.jpg[/img][color=white]
- Most creative active member
- Most smart active member
- Best MM2 innovation of the year
- Best programmer

[img]https://i60.tinypic.com/2m4c2h5.jpg[/img]
- Most helpful active member[/color]

Jeremiahjobling
MM2X Occasional User
MM2X Occasional User
Posts: 319
Registered for: 12 years 2 months
Location: London
Been thanked: 2 times
Great Britain

Postby Jeremiahjobling » Tue Apr 24, 2018 11:34 am

Interesting find :o

(To be honest, if MM2 was released as an "unfinished" game, that feature you just discovered really wouldn't be surprising since MM2 has a number of unused features)
Last edited by Jeremiahjobling on Thu Apr 26, 2018 12:34 am, edited 1 time in total.
Dubai = Supercarland

When it comes to normal street driving, any car is as good as good as any other. Only the racetrack can truly separate the cars' abilities.

--

In my opinion, BlameTruth is the Jeremy Clarkson of gamers and gameplay video commentators on the internet. You can follow him on Twitter here

User avatar
cody
MM2X Occasional User
MM2X Occasional User
Posts: 340
Registered for: 18 years 5 months
Location: United States
Contact:

Postby cody » Tue Apr 24, 2018 6:19 pm

Being an unfinished game actually WOULD explain all the known problems with MM2:

1. The game crashing when running into props at high speed (MMClone doesn't have this problem);
2. Speed limited to roughly 1118.468146... mph (500 m/s, 1800 kph; could be caused by the speed being stored as a floating-point number, whose limit is set to 1800 kph; might be adjustable, but it might not be; probably fixed in MMClone);
3. Cops chasing you initially limited to 3 (already fixed);
4. Falling through the ground under the highway (near the Bay Bridge end; a problem with the INST object being over 2 PSDL blocks), and other places in SF, London, and other tracks;
5. Heap size initially set to 32 MB (this could just be due to the game being from the early 2000's, can be adjusted using Heap Patcher);
6. The high elasticity/unusual behavior of the cops (even though this can be changed in vpcop.vehcarsim and vpcop_cop.vehcarsim);
7. The way MM2 interprets corners in PSDL roads on hills (i.e. the corner on the 4-lane beside the Pacific Ocean, just north of Golden Gate Park).

And, of course, there's the paintjob issue you're discussing. I bet all of these problems could be fixed (at least partially) through some hex editing, mods/addons, or trainer usage. It may take us a while, but we'll eventually be able to complete it. It's a trial-and-error process, though, because we don't have the original source code to use as a reference.
My Member Number is prime. LOL!

aaro4130
MM2X Super Active User
MM2X Super Active User
Posts: 2405
Registered for: 15 years 10 months
Location: Canada
Been thanked: 1 time

Postby aaro4130 » Tue Apr 24, 2018 6:32 pm

Being an unfinished game actually WOULD explain all the known problems with MM2:

1. The game crashing when running into props at high speed (MMClone doesn't have this problem);
2. Speed limited to roughly 1118.468146... mph (500 m/s, 1800 kph; could be caused by the speed being stored as a floating-point number, whose limit is set to 1800 kph; might be adjustable, but it might not be; probably fixed in MMClone);
3. Cops chasing you initially limited to 3 (already fixed);
4. Falling through the ground under the highway (near the Bay Bridge end; a problem with the INST object being over 2 PSDL blocks), and other places in SF, London, and other tracks;
5. Heap size initially set to 32 MB (this could just be due to the game being from the early 2000's, can be adjusted using Heap Patcher);
6. The high elasticity/unusual behavior of the cops (even though this can be changed in vpcop.vehcarsim and vpcop_cop.vehcarsim);
7. The way MM2 interprets corners in PSDL roads on hills (i.e. the corner on the 4-lane beside the Pacific Ocean, just north of Golden Gate Park).

And, of course, there's the paintjob issue you're discussing. I bet all of these problems could be fixed (at least partially) through some hex editing, mods/addons, or trainer usage. It may take us a while, but we'll eventually be able to complete it. It's a trial-and-error process, though, because we don't have the original source code to use as a reference.
1. dunno about this
2. this is caused by some weird math issues on the hud
3. this is done for optimization, all the cops have to pathfind in realtime
4. could also be due to invalid perimeter vertices in the PSDL
5. yup, from 2000s
6. vpcop_cop vehcarsim is never used, and actually _opp is never used either. They "launch" when in the air due to intentional behaviour. Idk why that was added in the first place though.
7. what do you mean by this one?
Interesting find :o

(To be honest, if MM2 was released as an "unfinished" game, that really wouldn't be surprising)
It was "finished" but very rushed
[img]https://i61.tinypic.com/25zrngo.jpg[/img][color=white]
- Most creative active member
- Most smart active member
- Best MM2 innovation of the year
- Best programmer

[img]https://i60.tinypic.com/2m4c2h5.jpg[/img]
- Most helpful active member[/color]

User avatar
Franch88
MM2X Admin
MM2X Admin
Posts: 15758
Registered for: 16 years 9 months
Location: Italy
Been thanked: 1 time
Contact:
Italy

Postby Franch88 » Tue Apr 24, 2018 8:15 pm

Very nice discover Aaro, and it's great that you've increased that limit a lot. :) It's probably a wanted limit, since the only default game vehicle with more paintjobs is the VW New Beetle Cup, with 7 of them.
A limit of 10 working paintjobs isn't so strict in most of the cases, but, what's more strict is the characters limit for their names in the .info file; now that's something needed to be increased, together with the characters of basenames in the vehtypes.csv file.

Cody, those are such non-problems, or wanted limits, made also because of the games technology back in late 1990s and year 2000... The game crashing into props at high speed is a non-problem, since the game isn't designed for insane speeds. Cops chasing is limited to 3 on purpose surely because the game had to lag with much more cops active, considering the power of computers in late 1990s and year 2000; and yes, the cops use the paths of the traffic to control themselves. Those parts under the ground aren't meant to be driven in the original game. Heap size is natively so limited for the same reason of the power of computers in late 1990s and year 2000, and with the low polygons models that the game has, it's more than enough.

Comparing MM2 with Aaro's MMClone is useless, because he's making it with the purpose of having a lot of MM2 limits removed and an overall better quality. The game engine is totally different, then.
MM2 is certainly a rushed game, and it has some unfinished unused feature like the replays one.
Fiat 500 = Italian motorization. Franch88, MM2 eXtreme forum and website Administrator.
|Franch88's MM2 Releases|

User avatar
sajmon14
MM2X VIP Member
MM2X VIP Member
Posts: 5321
Registered for: 16 years 1 month
Location: Poland
Contact:
Poland

Postby sajmon14 » Tue Apr 24, 2018 8:52 pm

7. what do you mean by this one?
I bet he meant this place ;) Car is getting stuck in air.

Image

User avatar
cody
MM2X Occasional User
MM2X Occasional User
Posts: 340
Registered for: 18 years 5 months
Location: United States
Contact:

Postby cody » Tue Apr 24, 2018 8:58 pm

Yep. That's the corner I'm talking about. It also happens on the U-shaped road on the south end of the rainbow area.
My Member Number is prime. LOL!

aaro4130
MM2X Super Active User
MM2X Super Active User
Posts: 2405
Registered for: 15 years 10 months
Location: Canada
Been thanked: 1 time

Postby aaro4130 » Tue Apr 24, 2018 9:19 pm

Ah that. That's due to non co-planar road faces.
[img]https://i61.tinypic.com/25zrngo.jpg[/img][color=white]
- Most creative active member
- Most smart active member
- Best MM2 innovation of the year
- Best programmer

[img]https://i60.tinypic.com/2m4c2h5.jpg[/img]
- Most helpful active member[/color]