I really wanted to make that "professional looking" document about PSDL, but it seems as if I need to get this out in the open sooner...

Chapter 1 - Road strips

Roads can be made by the use of a number of block attribute families, the most common family is the ones for regular roads with a sidewalk on each side. The attributes are:

0x0080 - Any number of cross sections

0x0082 - Two cross sections

0x0083 - Three cross sections

0x0084 - Four cross sections

0x0085 - Five cross sections

0x0086 - Six cross sections

0x0087 - Seven cross sections

There could actually be a few more of these, but these are the ones I have verified.

The cross sections define the shape of the road, this image illustrates:
The yellow hexadecimal number indicate the order these vertices are assigned to a 0x0084 attribute in city.psdl. Each four vertices make up a cross section of the road.

The sidewalks are about 15 cm high but the exact height is not yet accurately measured. The two outer vertices of each cross section should be in the height of the sidewalk and the two inner vertices of each cross section should be about 15 centimeters below those, that means at the height of the road. A closeup clarifies:

To make curved roads, simply adjust the vertices of each cross section slightly. The reason that the road strip in the example uses four cross sections to make a perfectly straight road lies in the shadows. As far as I know, the exact same result could be achieved with only two cross sections in an 0x0082 attribute.

Edit:
The road surface uses the texture indicated byt the previous texture attribute (0x0050), this texture is mirrored in the center of the road. The sidewalks use the texture after the one indicated by the texture attribute._________________
"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate

Last edited by fre_ber on 18 Apr 2006 12:22 pm; edited 5 times in total

30 Dec 2002 11:51 am

fre_bertriangle fan

Joined: 15 Jul 2002
Posts: 2399
Location: ZZ9 Plural Z Alpha

Status: Offline

Post subject:

Chapter 2 - Road crossings

A road crossing is a bit complicated. Road crossings are made up by several block attributes of different types. This image shows some of these:

Yellow - Perimeter, this is not really an attribute

Orange - 0x002e, road triangle fan

Green - 0x002a, road triangle fan, four vertices

Cyan - 0x0024, crosswalk strip, four vertices

For each of the crossing roads, the four vertex road triangle fan and the crosswalk strip are used as shown in this example.

The sidewalks are created by a siedwalk strip, these are a family of attributes:

0x0008 - Any number of vertex pairs

0x000a - Two vertex pairs

0x000b - Three vertex pairs

0x000c - Four vertex pairs

0x000d - Five vertex pairs

0x000e - Six vertex pairs

0x000f - Seven vertex pairs

The sidewalk strips could be stretched out to be rectangular sections like normal triangle strips, but in most crossings, like the ones in this example, one side of the strip converges in a single point.
The yellow line shows a single sidewalk strip, attribute 0x0008. The hexadecimal numbers are vertex indices. With these indices, the striangle strip would be defined as: 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, a, 0, b, 0
A sidewalk strip always starts with the vertex next to the road surface and that is followed by a vertex on the outside of the sidewalk. In this cas, as we said earlier the outer vertices are all vertex 0. This will cause the strip to bend around this vertex, producing the sidewalk corner.

Just like the sidewalks in road strips, the vertices next to the road surface should be about 15 cm below the vertices on the outside of the sidewalk.

The cyan line in the image is a road triangle fan attribute, 0x002a that fills up the ground between the sidewalk and the surrounding attributes. Note that this attribute takes four vertices! In this case the closest one is duplicated.

Road crossing attributes use three textures. The one indicated by the previous texture attribute (0x0050) is used for the road surface attributes, the one after this is used for sidewalks and the texture after that is used for crosswalk strips._________________
"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate

Last edited by fre_ber on 01 Aug 2003 06:22 pm; edited 2 times in total

30 Dec 2002 01:05 pm

BoosterMMMaking mm2 tracks

Joined: 12 Sep 2002
Posts: 713
Location: Spain (Espaņa)

Status: Offline

Post subject:

And if you want make a underground parking with 2 floors, one up the other, can it be made with psdl viewer?_________________In the time you smoke a cigarette, 3 people die in the world working.

So, don't smoke, and don't work

30 Dec 2002 02:27 pm

smashingpunk007MM2C Regular

Joined: 23 Aug 2002
Posts: 149

Status: Offline

Post subject:

thank you very very very much.

30 Dec 2002 03:32 pm

BoosterMMMaking mm2 tracks

Joined: 12 Sep 2002
Posts: 713
Location: Spain (Espaņa)

Status: Offline

Post subject:

For what is the attribute 0080. If this attribute is for make any number of cross sections, for what is this attribute?? Because if you have any cross section you have nothing! I'm wrong?_________________In the time you smoke a cigarette, 3 people die in the world working.

So, don't smoke, and don't work

Last edited by BoosterMM on 06 Sep 2003 09:16 am; edited 1 time in total

31 Dec 2002 11:40 pm

fre_bertriangle fan

Joined: 15 Jul 2002
Posts: 2399
Location: ZZ9 Plural Z Alpha

Status: Offline

Post subject:

Ehm, I mean any as in as many as you want. This is not entirely true - there must be at least two cross sections. So any number between 2 and 65536 is a valid number of cross sections for attribute 0x0080._________________
"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate

01 Jan 2003 10:32 am

BoosterMMMaking mm2 tracks

Joined: 12 Sep 2002
Posts: 713
Location: Spain (Espaņa)

Status: Offline

Post subject:

Ahh! Sorry my English is very bad, I believe that any was none (a language error)
I will see if I underestand it:
If I want to create a road with 4 cross sections, I can use the attribute 0084 or the attribute 0080...
And for what are the attributes 0082, 0083, 0084, 0085, 0086 and 0087 if I can create all cross sections I wish with 0080 attribute?? Have it the same result?_________________In the time you smoke a cigarette, 3 people die in the world working.

So, don't smoke, and don't work

01 Jan 2003 12:17 pm

fre_bertriangle fan

Joined: 15 Jul 2002
Posts: 2399
Location: ZZ9 Plural Z Alpha

Status: Offline

Post subject:

My thoughts are that the MM2 graphics engine can optimize rendering if the number of cross sections are known in advance. I recommend using the attributes with a fixed number of cross sections whenever possible. Maybe even to the extent of trying to identify more road attributes than I have found and presented here._________________
"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate

01 Jan 2003 05:40 pm

BoosterMMMaking mm2 tracks

Joined: 12 Sep 2002
Posts: 713
Location: Spain (Espaņa)

Status: Offline

Post subject:

I have tried to do a road that starts then of another block with attribute 00b0, but there was some peoblems:
1-the textures aren't in the 3d view (And I have put a texture for the road before the attribute 0082 and other then for the sidewalk)
2-The game crashes. I have made the road with 2 cross sections that starts from a block with attribute 00b0 and ends in other block of 00b0.
These are the blocks:
0*******1
*¨¨¨¨¨¨¨*
*¨¨¨0¨¨¨*
*¨¨¨¨¨¨¨*
2*3***4*5
*¨*¨¨¨*¨*
*¨*¨¨¨*¨*
*¨*¨1¨*¨*
*¨*¨¨¨*¨*
*¨*¨¨¨*¨*
6*7***8*9
*¨¨¨¨¨¨¨*
*¨¨¨2¨¨¨*
*¨¨¨¨¨¨¨*
a*******b

I have tried write the vertexs 2 and 5 like neighbourds of block 1, the vertexs 6 and 9 like neighbourds of block 3, and I have defined the vertexs 3, 4, 7 and 8 like vertexs without neighbour -
It crashes
Then I have tried write the vertexs 2, 3, 4, and 5 like neighbourds of block 1, and the vertexs 6, 7, 8, and 9 like neighbourds of block 3.
It crashes too
I don't know if the roads have to start form another road (for example making a square or 4 squares with a cross in the middle like the city.psdl file that there is in the city folder) or can it start from any block??[/b]

EDIT: I forgot the 0 in the draw!_________________In the time you smoke a cigarette, 3 people die in the world working.

So, don't smoke, and don't work

Last edited by BoosterMM on 19 Jan 2003 12:16 pm; edited 1 time in total

18 Jan 2003 12:24 pm

fre_bertriangle fan

Joined: 15 Jul 2002
Posts: 2399
Location: ZZ9 Plural Z Alpha

Status: Offline

Post subject:

As far as I know, there should not be any problems with aligning blocks like that - except of course that the sidewalk will look wrong where ther road meets the b0 block.

One thing that might or might not be necessary is to make sure that the vertices 4 and 5 are also in the perimeter of block 1. Similarily the vertices 8 and 9 should be in the perimeter of block 3. I would make sure that these vertices are included in the b0 attribute as well - since there are height differencies between vertex 7 and 8 it would look very wrong otherwise.

As for debugging game crashes, I can only say that you test one of these blocks at a time, first you add block 1 with all vertices 1-6 and test this in game. Then add block 2 and test in game. Finally add block 3 and test._________________
"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate

18 Jan 2003 02:18 pm

Jasonā˛ __ā˛

Joined: 25 Jul 2002
Posts: 4109
Location: Ontario

Status: Offline

Post subject:

wow, when i was reading that, i actually thought that you knew exactly how to make these roads... even though i wont ever understand this anytime soon, may i ask if you would be able to make complex roads like this from scratch?_________________

18 Jan 2003 07:24 pm

fre_bertriangle fan

Joined: 15 Jul 2002
Posts: 2399
Location: ZZ9 Plural Z Alpha

Status: Offline

Post subject:

Lol, these are the simple roads...

The divided roads are more difficult - like the highway in SF or the roads with a grass patch between the driving lanes. These attributes have a variable - possibly a bit pattern - that determines the type of sidewalk and divider. This needs to be researched. Also the road crossings need some more research, but these simple standard roads are a piece of cake. _________________
"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate

18 Jan 2003 08:16 pm

Jasonā˛ __ā˛

Joined: 25 Jul 2002
Posts: 4109
Location: Ontario

Status: Offline

Post subject:

can you test trying to make a crossing? to see if its possible._________________

18 Jan 2003 08:24 pm

fre_bertriangle fan

Joined: 15 Jul 2002
Posts: 2399
Location: ZZ9 Plural Z Alpha

Status: Offline

Post subject:

Of course it is possible. I can make crossings, but not all kinds of crossings._________________
"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate

18 Jan 2003 08:26 pm

Jasonā˛ __ā˛

Joined: 25 Jul 2002
Posts: 4109
Location: Ontario

Status: Offline

Post subject:

thats good to know... and can you make those pools of water like in london? cause with the effects you could make boat racing in mm2... with a special track...

and if you can edit the amount of resistance to make it less, than i think it would be awesome._________________