Propdefs.csv and proprules.csv

How do they work?

User avatar
tonius11
MM2X Occasional User
MM2X Occasional User
Posts: 297
Registered for: 14 years
Location: Netherlands

Propdefs.csv and proprules.csv

Postby tonius11 » Mon Jan 03, 2011 8:54 pm

I have been looking around the MM2 core files, and I stumbled upon two interesting files: propdefs.csv and proprules.csv. They are in the city/sf and city/london folders. I also saw them in some add-on cities. Can someone tell me what they do?
[url=https://www.mm2x.com/page.php?name=Downloads&d_op=viewdownloaddetails&cid=65&lid=923&ttitle=Default_Cars_Traffic_Mod#dldetails][img]https://dl.dropbox.com/u/4604962/GetTrafficMod.jpg[/img][/url]

User avatar
dummiesboy
MM2X Super Active User
MM2X Super Active User
Posts: 2430
Registered for: 15 years 9 months
Location: USA
Been thanked: 1 time
Contact:

Postby dummiesboy » Mon Jan 03, 2011 9:00 pm

I haven't looked at them too much before, but I think they are just leftover files.
Image

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

Postby sajmon14 » Mon Jan 03, 2011 9:19 pm

I think one of these was adding lamps in SF(they aren't in props or inst)

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

Postby Franch88 » Mon Jan 03, 2011 9:19 pm

They aren't left over files, they look used to set the adding of the PROP objects like the lampposts and the park meters (like Sajmon means too), that are kinda automatically added to the city. If you open the SF and London PSDL in MM2 City Toolkit loading all the files, you'll see that the props.pathset files of both have few PROP objects, when in reality are used many more.
I haven't got how they really work, but I've found the IDs in them set to the road type PSDL terrain blocks of the two cities, they're visible with PSDL Viewer program.
Fiat 500 = Italian motorization. Franch88, MM2 eXtreme forum and website Administrator.
|Franch88's MM2 Releases|

User avatar
dummiesboy
MM2X Super Active User
MM2X Super Active User
Posts: 2430
Registered for: 15 years 9 months
Location: USA
Been thanked: 1 time
Contact:

Postby dummiesboy » Mon Jan 03, 2011 9:24 pm

Oh, I always wondered how those got placed automaticly. I thought it was something in the exe, but i guess i was wrong. Thanks for this information, could be helpful. :wink:
Image

User avatar
zoot
MM2X Super Active User
MM2X Super Active User
Posts: 2444
Registered for: 14 years 10 months
Location: United States

Postby zoot » Mon Jan 03, 2011 9:27 pm

Oh, I always wondered how those got placed automaticly. I thought it was something in the exe, but i guess i was wrong. Thanks for this information, could be helpful. :wink:
Yes. I agree. I also wondered how the props got placed. When making tracks, I always placed them manually in Zmodeler. Now I know, it'll be faster. :)
Administrator at MMarchive | Arrow Block Entertainment Owner

User avatar
tonius11
MM2X Occasional User
MM2X Occasional User
Posts: 297
Registered for: 14 years
Location: Netherlands

Postby tonius11 » Tue Jan 04, 2011 2:05 pm

Sounds interesting! Does anyone know HOW they work? It can save me a lot of work!
[url=https://www.mm2x.com/page.php?name=Downloads&d_op=viewdownloaddetails&cid=65&lid=923&ttitle=Default_Cars_Traffic_Mod#dldetails][img]https://dl.dropbox.com/u/4604962/GetTrafficMod.jpg[/img][/url]

User avatar
tonius11
MM2X Occasional User
MM2X Occasional User
Posts: 297
Registered for: 14 years
Location: Netherlands

Postby tonius11 » Thu Jan 06, 2011 4:20 pm

I found this on MM2C. Lots of info! (PSDL Viewer is needed.)
Each block in PSDL defines one proprule. A proprule is a rule that tells MM2 how to place props along the sides of a road. A value of zero for proprule means that this block has no props assigned. If the value isn't zero, however, the value is an index into the file city/<cityname>/proprules.csv. Proprules come in pairs, first one rule for the left side of the road and then one rule for the right side. In other words, rule one is defined by the first two lines of proprules.csv and rule two is defined by the third and fourth lines. Each line first gives a name of the rule, this is arbitrary and probably only used by AS for debugging. Following the name is a number of prop definitions. Each identify one prop to be used. The names match the names in the file city/<cityname>/propdefs.csv.

In city/<cityname>/propdefs.csv each prop, for use along roads, is defined, one line each. The first column is the name that is used to identify this prop in the proprules.csv file. The following columns are used for this:

* start - The distance in metres from the beginning of the road
* distance - The distance in metres between each repetition of this prop
* maxUse - The maximum number of times this prop can be used
* minLerp - The minimum distance from the edge of the road surface
* maxLerp - The maximum distance from the edge of the road surface

After these values comes a list of the actual geometry files to use. If more than one geometry file is listed, these will be used in a round-robin manner.

The props are placed at a random distance from the edge of the road surface, limited by the max and min Lerp values.

In addition to the proprule value for each block in the PSDL file, each road must be defined as a road in order to enable the props. This is done in the roads section of the PSDL. This section is a bit ambiguous, it contains data that appears to be closely related to BAI. This may be a remnant of an automatic way to generate BAI files based on the roads in the PSDL. Changing these values appears to have no apparent effect on the game. However, some values do have effect. In particular an ordered list of the indices of the blocks the road passes through.

Note for PSDL Viewer:
In order to create a road definition in PSDL Viewer, right click the Roads list window and Add. Then enter values in the fields, for example Unknown0 = 0041, Unknown1 = 0000 and Unknown2 = 8080. As stated above, it is unclear if any of these have an effect, but SF and London have them specified. SF and London also have start and end intersections defined by eight vertices. Changing these have no apparent effect, but removing them is fatal. Therefore, make sure that each of the lists Start and End contain four vertex indices each. The value of the indices appear irrelevant, but for safety, use a vertex thatexists. For example index zero. Then add the block indices in the order of the road in the Blocks list.

Don't forget to assign the prop rule index to each of the blocks on the road in the main block list.
[url=https://www.mm2x.com/page.php?name=Downloads&d_op=viewdownloaddetails&cid=65&lid=923&ttitle=Default_Cars_Traffic_Mod#dldetails][img]https://dl.dropbox.com/u/4604962/GetTrafficMod.jpg[/img][/url]