[ Midtown Madness 2 Central ] [ Midtown Madness 2 Central ]

Midtown Madness 2 Central > City Editing > [ROI] PKG Format
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
View previous topic | View next topic
Author
Message Post new topicReply to topic
fre_ber
triangle fan
Moderator

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

Status: Offline


Post subject: [ROI] PKG Format Reply with quote

Hi, I have discovered several inaccuracies with the PKG format as described by the sample source of the ZModeler filter. I will here show you what I think:
Code:
PKG
{
    char[4]   header = "PKG3";
    PKGFile[] files;
}

PKGFile
{
    char[4]     header = "FILE";

    String      name;   // Name of this section
    long        length; // Length of this PKGFile in bytes
    PKGFileData data;   // Format depends of name, see below
}

String
{
    unsigned byte    length;     // Number of bytes in this string including the string terminator.
    char[length - 1] characters; // ASCII characters
    char             terminator = '\0';
}

The PKGFileData is different depending on the name of the PKGFile.

"VL", "L", "M", "H":
Code:
PKGFileData
{
    long nSections;    // Number of sections making up this LOD
    long nVerticesTot; // Total number of vertices in this LOD
    long nIndiciesTot; // Total number of indicies in this LOD
    long nSections2;   // Repetition of the number of sections?
                       // Highly unlikely, but I have no better suggestion at this time
    long flags;        // Flags defining what components are provided with each vertex, see below
    PKGSection[nSections] sections;
}

PKGSection
{
    long nStrips;         // Number of geometry strips in this section
    long shaderOffset;    // Offset into the shader list of the requested paintjob
    long verticesPerFace; // Determines if the strips are quads or triangles, have only seen 3 in this field though
    long nVertices;       // Number of vertices in this section
    PKGVertex[nVertices];
    long nIndices;        // Number of indices making up the geometry strip
    ushort[nIndices] indices;
}

PKGVertex
{
    Vertex3D coordinate;         // If flags indicate coordinates
    Vector3D normal;            // If flags indicate normals
    Vertex2D textureCoordinate;  // If flags indicate texture coordinates
}

Vertex3D
{
    float x;
    float y;
    float z;
}

Vector3D
{
    float x;
    float y;

    float z;
}

Vertex2D
{
    float x;
    float y;
}

Description of the bits for the flags field:
  • Bit 1: Texture coordinates or coordinates
  • Bit 4: Normals
  • Bit 8: Coordinates or texture coordinates
All other bits are unknown at this time.

"shaders":
Code:
PKGFileData
{
    long shaderType; // Bit 7: Shader type
                     // Bit 0-6: Number of paint jobs
    long shadersPerPaintJob;
    PKGShader[Number of paint jobs * shadersPerPaintJob] shaders;
}

PKGShader (Type 0)
{
    String textureName;
    Color4f ambient;
    Color4f diffuse;
    Color4f specular;
    Color4f emissive;
    float shininess;
}

PKGShader (Type 1)
{
    String textureName;
    Color4f ambient;
}

Color4f
{
    float red;
    float green;
    float blue;
    float alpha;
}


"offset":
Code:
PKGFileData
{
    Vector3D offset; // Have not tested, but could be an offset added to all vertices in the object
}


"xref":
A PKG can reference external objects stored in other PKGs, when rendering a PKG with external references, each object referenced will be rendered too. These objects are possibly breakable, meaning that they can be detached from the main object.
Code:
PKGFileData
{
    long     nReferences;
    Vector3D xAxis;
    Vector3D yAxis;
    Vector3D zAxis;
    Vector3D origin;
    char[]   name;
    char     terminator = 0x00; // Just to end the string
    char[]   unknown0 = "max";
    ushort[] unknown1 = {0, 0, 0, 0, 0, 0, 0};
}

_________________

"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 23 Apr 2006 03:20 pm; edited 6 times in total
Post 13 Jul 2003 07:45 pm
View user's profile Send private message Visit poster's website
Yallis
Professional Sucker
Moderator

Joined: 20 Jul 2002
Posts: 693
Location: city.psdl

Status: Offline


Post subject: Reply with quote

Hmh, nobody seems to reply on this one. Neutral Well, great work fre_ber, as usual! Wink
I've been researching this format a bit too. Never thought about that other objects can have paintjobs as well, but I have noticed that MM2 supports more PKGFiles than Oleg's official Zmodeler .pkg filter. These may be ignored by ZM, or causing it to crash.
_________________
Post 17 Jul 2003 02:20 am
View user's profile Send private message Visit poster's website
fre_ber
triangle fan
Moderator

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

Status: Offline


Post subject: Reply with quote

Thanks for showing interest. I'm slowly beginning to loose faith in the abilities of the MM2 community to gain complete understanding of MM2. Maybe everyone is just too young... Sad
_________________

"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate
Post 17 Jul 2003 08:48 am
View user's profile Send private message Visit poster's website
Missionary
RIDE BMX

Joined: 25 Jul 2003
Posts: 205
Location: Chicago

Status: Offline


Post subject: Reply with quote

meabu id show some intrest- but i have yeat to learn how to package my ar file and im having problems trying to fiqure that out. And i have no clue to what any of that means- meaby im too young-16
Post 25 Aug 2003 10:31 pm
View user's profile Send private message AIM Address
fre_ber
triangle fan
Moderator

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

Status: Offline


Post subject: Reply with quote

Hehe, Driver and Stereo has just managed to raise my hopes again. (Take a look at the action in "PSDL Tunnels and Railings" and "PSDL Roads" to see how Smile)

About packing your files into an AR, simply use WinZip. I think it has to be WinZip 8 or higher. Make sure that the directory structure in the archive follows the one in the core files. If you need more information about this, please search the forums, and if you still haven't found what you need - post a new topic and I'll see what I can do to help.
_________________

"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate
Post 25 Aug 2003 10:35 pm
View user's profile Send private message Visit poster's website
mm1guy
­

Joined: 04 Aug 2003
Posts: 1558


Status: Offline


Xbox Live Gamertag:
mm2guy
Post subject: Reply with quote

Actually, WinRAR is better, you ACTUALLY see the directory structure Very Happy Shocked
Post 25 Aug 2003 10:42 pm
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Stereo
Senior Dismember
Moderator

Joined: 22 Jul 2002
Posts: 4023
Location: London, Ontario

Status: Offline


Post subject: Reply with quote

fre_ber wrote:
Hehe, Driver and Stereo has just managed to raise my hopes again. (Take a look at the action in "PSDL Tunnels and Railings" and "PSDL Roads" to see how Smile)

I'm better on the theory of these things than actually putting them into practice, unfortunately Sad
_________________
Hi!
I can bend minds with my spoon.

A member of Team Graduation 2004/05!
Post 25 Aug 2003 11:30 pm
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Legoguy
Lego Maniac
Administrator

Joined: 21 Jul 2002
Posts: 1081
Location: Computer Chair (Spruce Grove, Alberta, Canada)

Status: Offline


Post subject: Reply with quote

Bringing back this old topic, is anyone willing to write a new, much more accurate filter for ZM? I'm fed up with the current one.

Or maybe I could catch Oleg and point him this way.

Edit: Maybe I can get him to do it for ZM2, which he is working on.
_________________
"There is no loneliness on this planet. All the dark things are in your mind. This place is colorful and neutral; brutal, nice, caring and destructive -- all at the same time. Start to think a little." -- Pete Namlook; The Dark Side of the Moog X: Astro Know Me Domina, Part I
Post 05 Oct 2003 03:57 pm
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Rippance
Hates Custom Titles
Administrator

Joined: 14 Jul 2002
Posts: 2711
Location: Netherlands

Status: Offline


Xbox Live Gamertag:
Rippance
Post subject: Reply with quote

Legoguy wrote:
Edit: Maybe I can get him to do it for ZM2, which he is working on.


I highly doubt he'll do it. He has said several times he won't do anymore work on the Midtown Madness 2 filter. Unless he needs to rewrite all the filters anyway due to a change in the way filters work in ZM2. Hmm .. give it a shot Wink
_________________
Rippance

w: http://www.crumbl.com
c: #mm2c @ irc.gamesurge.net
Post 05 Oct 2003 04:16 pm
View user's profile Send private message Send e-mail Visit poster's website
RD-Online
Newbie Modeler

Joined: 30 Aug 2003
Posts: 246
Location: UK

Status: Offline


Post subject: Reply with quote

Sorry i know that this is a bit off topic but its kinda related to the last post.

Is there a 'suggestions box' for ZM2 as ive thought of an idea that would be really helpful and that i havent seen anywhere in ZM1.07b

Its just that if you could save in the z3d the export information as its a bit annoying changing directory and setting all (7 so far) colour schemes every time i make an adjustment.

Thanx
Richard
_________________
1st Project :: Gulf Stream Motor Home-RELEASED Info|DOWNLOAD
2nd Project :: Toyota Yaris - ON HOLD Info
3rd Project :: Concept Vehicle - DETAILS COMING SOON
Post 05 Oct 2003 04:31 pm
View user's profile Send private message Visit poster's website
Legoguy
Lego Maniac
Administrator

Joined: 21 Jul 2002
Posts: 1081
Location: Computer Chair (Spruce Grove, Alberta, Canada)

Status: Offline


Post subject: Reply with quote

I'll mention it to him; but that, i fear, waold require adding something to the filter, and as Rippance said, unless the filters need be reprogrammed, he won't touch them (which is a shame...)
_________________
"There is no loneliness on this planet. All the dark things are in your mind. This place is colorful and neutral; brutal, nice, caring and destructive -- all at the same time. Start to think a little." -- Pete Namlook; The Dark Side of the Moog X: Astro Know Me Domina, Part I
Post 05 Oct 2003 06:13 pm
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
fre_ber
triangle fan
Moderator

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

Status: Offline


Post subject: Reply with quote

Legoguy wrote:
Bringing back this old topic, is anyone willing to write a new, much more accurate filter for ZM? I'm fed up with the current one.

Or maybe I could catch Oleg and point him this way.

Edit: Maybe I can get him to do it for ZM2, which he is working on.

I thought you'd never ask... Wink

I would like to see someone do this as well. I feel that I don't have the time to do it myself. Sad

If interest exists, you could also talk to Martin_sw about adding the MC specifics to be able to load the Statue of Liberty for example.. Wink The additions are not very big. (Still, it is not easy to convert MC PKGs to MM2 PKGs though...)
As far as I know, the biggest difference is that MC can use polygons of any vertex count while MM2 only accepts triangles.
_________________

"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate
Post 05 Oct 2003 11:02 pm
View user's profile Send private message Visit poster's website
Chadwick
Not An Administrator

Joined: 21 Jul 2002
Posts: 834


Status: Offline


Post subject: Reply with quote

well how hard is it, im sure anyone with knowledge in C++ which is what he uses, and through the use of his sdk and stuff could do it, its just a matter of knowing what needs to be added and stuff...
_________________
[dA][Chadwick]
Post 06 Oct 2003 04:31 pm
View user's profile Send private message Send e-mail AIM Address MSN Messenger
fre_ber
triangle fan
Moderator

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

Status: Offline


Post subject: Reply with quote

Yes, I don't think it would be too difficult to simply adapt the current filter and add the correct interpretation of things... Of course if ZModeler can't handle arbitrary polygons natively, one might have to be satisfied with a correct interpretation of the MM2 PKG format and hope for better support of MC PKGs in ZM2.. Wink
_________________

"He who re-invents the wheel, understands much better how a wheel works."

<[4D]JoeShmo> what we have here, is a failure.. to communicate
Post 06 Oct 2003 05:20 pm
View user's profile Send private message Visit poster's website
Chadwick
Not An Administrator

Joined: 21 Jul 2002
Posts: 834


Status: Offline


Post subject: Reply with quote

so all you really want to be able to do is export pkg's without limits on what the objects are named?
_________________
[dA][Chadwick]
Post 06 Oct 2003 06:23 pm
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Display posts from previous: Post new topicReply to topic

Page 1 of 9 All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next


Jump to:  
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 vote in polls in this forum
Home - MM2C.com - Contact - Staff & Seniors - FAQ - Community Rules - Syndication


Powered by phpBB © 2001, 2005 phpBB Group