The Forum is up for sale: XeNTaX Forum looking for new owner

3ds max PSSG model import

Post questions about game models here, or help out others!
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: 3ds max PSSG model import

Post by finale00 »

Saw them. Want more from different games also :D
To see the differences in nodes and stuff.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: 3ds max PSSG model import

Post by howfie »

Ripper for magic the gathering tactics. Currently incomplete. Sorry don't have time to work on it.
Has model and UV. Texture extraction works but for some reason something is wrong with it; they are dark and they only open in Ifranview. Somebody told me something was wrong with diffuse component. Even Microsoft Texture Explorer doesn't load them; not sure why. Some models have points all over the place; those are morph maps I think, which I save but don't load faces for. Levels don't look right for same reason as totori and meruru; there are transform nodes I don't traverse. Really, PSSG is a pain in the ass format as you really have to load the entire tree and traverse it to get everything right.

Instructions:
Extract all .PSSG.gz files into their own folders.
Place ripper in root directory.
Run.
You do not have the required permissions to view the files attached to this post.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: 3ds max PSSG model import

Post by howfie »

Source code for finale. Look at pssg.h and pssg.cpp.

File format is as follows:

First part of file is node descriptors. Contains name of nodes and associates each node with a unique ID. For example, node 0 is the root node, PSSGDATABASE. Also associated with each node is a bunch of properties like so. Each property (i.e. width, height, etc.) is also associated with an id.

Code: Select all

// TEXTURE
// CHILD CHUNKS: YES
struct TEXTURE : public TREENODE {
 uint32 width;
 uint32 height;
 std::string texelFormat;
 uint32 transient;
 uint32 wrapS;
 uint32 wrapT;
 uint32 wrapR;
 uint32 minFilter;
 uint32 magFilter;
 uint32 automipmap;
 uint32 numberMipMapLevels;
 uint32 gammaRemapR;
 uint32 gammaRemapG;
 uint32 gammaRemapB;
 uint32 gammaRemapA;
 uint32 lodBias;
 uint32 resolveMSAA;
 uint32 imageBlockCount;
 uint32 allocationStrategy;
 std::string filename;
};
Some nodes have children, some do not. Look at pssg.h to find out.

Second part of file is just a list of nodes and data, each node starting with it's ID.
After ID is chunksize of data. Use this to skip nodes if you like.
After that is the number of bytes in the property table. For example, even though TEXTURE has 20 properties or so, a node may only use 10 of them.
After that is the property table.
After that is a list of children or a bunch of data; it depends on the node type.

The following code for PSSGDATABASE should explain what is what per node.

Code: Select all

bool extractor::processPSSGDATABASE(const binary_stream& bs, uint32 position)
{
 using namespace std;
 if(debug) dfile << endl;
 if(debug) dfile << "--------------" << endl;
 if(debug) dfile << " PSSGDATABASE " << endl;
 if(debug) dfile << "--------------" << endl;
 if(debug) dfile << "offset = " << position << endl;

 // set stream position
 binary_stream stream(bs);
 stream.seek(position);

 // create node
 boost::shared_ptr<TREENODE> node(new PSSGDATABASE);
 typedef map<uint32, boost::shared_ptr<TREENODE>>::value_type value_type;
 tree.insert(value_type(position, node));

 // set parent
 uint32 parent = 0;
 map<uint32, uint32>::iterator iter = parent_list.find(position);
 if(iter != parent_list.end()) parent = iter->second;
 if(debug) dfile << "parent = " << parent << endl;
 node->parent = parent;

 // read chunk properties
 PSSGDATABASE* info = static_cast<PSSGDATABASE*>(node.get());
 info->chunktype = stream.BE_read_uint32(); if(stream.fail()) return error("Read failed.");
 info->chunksize = stream.BE_read_uint32(); if(stream.fail()) return error("Read failed.");
 info->propbytes = stream.BE_read_uint32(); if(stream.fail()) return error("Read failed.");
 if(debug) dfile << "chunktype = " << info->chunktype << endl;
 if(debug) dfile << "chunksize = " << info->chunksize << endl;
 if(debug) dfile << "propbytes = " << info->propbytes << endl;

 // validate
 if(info->propbytes > 1000) return error("Unexpected number of property table bytes.");
 if(info->propbytes == 0) return error("Property table expected.");

 // read properties
 uint32 bytes_read = 0;
 while(bytes_read < info->propbytes)
      {
       // read index
       uint32 type = stream.BE_read_uint32();
       if(stream.fail()) return error("Read failed.");
       bytes_read += 4;
      
       // data bytes
       uint32 size = stream.BE_read_uint32();
       if(stream.fail()) return error("Read failed.");
       bytes_read += 4;
       bytes_read += size;
      
       // find index
       typedef map<uint32, PSSGATTRIBUTE>::iterator iterator;
       iterator iter = attrlist.find(type);
       if(iter == attrlist.end()) {
          stringstream ss;
          ss << "Failed to find property for index " << type << "." << ends;
          return error(ss.str().c_str());
         }
      
       // read attributes
       const string& parameter = iter->second.parameter;
       const string& attribute = iter->second.attribute;
       if(parameter == "PSSGDATABASE" && attribute == "creator") {
          if(!readString(stream, info->creator)) return false;
          if(debug) dfile << "info->creator = " << info->creator << endl;
         }
       else if(parameter == "PSSGDATABASE" && attribute == "creationMachine") {
          if(!readString(stream, info->creationMachine)) return false;
          if(debug) dfile << "creationMachine = " << info->creationMachine << endl;
         }
       else if(parameter == "PSSGDATABASE" && attribute == "creationDate") {
          if(!readString(stream, info->creationDate)) return false;
          if(debug) dfile << "creationDate = " << info->creationDate << endl;
         }
       else if(parameter == "PSSGDATABASE" && attribute == "scale") {
          if(!readVector3(stream, &info->scale[0])) return false;
          if(debug) dfile << "scale = " << "<" << info->scale[0] << "," << info->scale[1] << "," << info->scale[2] << ">" << endl;
         }
       else if(parameter == "PSSGDATABASE" && attribute == "up") {
          if(!readVector3(stream, &info->up[0])) return false;
          if(debug) dfile << "up = " << "<" << info->up[0] << "," << info->up[1] << "," << info->up[2] << ">" << endl;
         }
       else {
          stringstream ss;
          ss << "Unknown block property " << parameter << ":" << attribute << "." << ends;
          return error(ss.str().c_str());
         }
      }

 // add child chunks to stack
 if(info->chunksize == info->propbytes + 4) return true;
 return processChildren(stream, node, position, info->chunksize - bytes_read - 4);
}
You do not have the required permissions to view the files attached to this post.
HatsuneMiku15
n00b
Posts: 10
Joined: Mon May 07, 2012 12:13 pm
Has thanked: 1 time
Been thanked: 1 time

Re: 3ds max PSSG model import

Post by HatsuneMiku15 »

Awww! Noire is so cute! I wish I had her files! ><
demonman2011
ultra-n00b
Posts: 1
Joined: Wed May 23, 2012 2:38 pm

Re: 3ds max PSSG model import

Post by demonman2011 »

LOL, IM OPENING THE PSSG FILE OF DIRT 3 !! :D

im converting the mitsubishi lancer x jun for gta 4, http://gta-real.com/load/mitsubishi_lan ... 5-1-0-3232
florianrallycross
ultra-n00b
Posts: 1
Joined: Wed May 23, 2012 8:09 pm

Re: 3ds max PSSG model import

Post by florianrallycross »

Good evening all

Can explain to me how to extract the 3d file and texture file of a dirt 3 car.

Thank you in advance for your response
Ryder25
ultra-n00b
Posts: 9
Joined: Fri Dec 31, 2010 11:43 pm
Has thanked: 1 time
Been thanked: 1 time

Re: 3ds max PSSG model import

Post by Ryder25 »

This is some great stuff here. Currently I have an app that opens pssg files completely but only supports exporting/importing textures and cubemaps. You can find it here: http://petar.outer-heaven.net/downloads/

I'd love to extend it to work with models, but the problem is that I have zero knowledge of models and the terminology. If anyone has anything that can possibly teach how models "work" I'd be happy to learn.
d2rnattakorn
beginner
Posts: 39
Joined: Fri Mar 19, 2010 2:18 pm
Has thanked: 4 times

Re: 3ds max PSSG model import

Post by d2rnattakorn »

Hi everyone :D
I am try to open the PSSG model files from Supremacy MMA game on Xbox360 (need help please).

So far, the PSSG3.ms only extract the texture files (.DDS files), no model has import to the scene.
So, after the script is finish running, I got the textures and the empty scene.

I also try the ripper.exe that posted here, it happen to extract the texture files as well as the model file into .lwo file.
Then I open the model with LightWave and export it into 3ds max. But now the problem is that the model dosen't or missing the UV map.
And when I look back at LightWave, there are no UV on the model as well.
Image
Thanks: ฝากรูป
I then try another ripper.exe from other post (like the one for [PS3] One Piece Kaizoku Musou post) but they did not do anything (no textures or model are extracted), not like the version that posted here.

So I wonder if Chrrox or Howfie can update your tool to work with this game please!!! :cry:
This is the file I am using for the model: http://www.mediafire.com/?xi81g7e2b383kt3
Thank you for your help.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: 3ds max PSSG model import

Post by howfie »

Yeah, my ripper only works on Atelier Totori and Atelier Meruru, and in another thread it also works somewhat on Magic the Gathering: Tactics as well. You can try that one too. Every PSSG game that comes out they change stuff. You should post a formal request here with some in-game pics (preferably females from the game) to help motivate those that visit here. When I think MMA I think buff chicks, so it's not that interesting to me. I was planning on working on the latest DiRT game but even the most hardcore DiRT fans say the new game sucks donkey balls big time.

BTW, every ripper.exe I release is different and is only meant to work on that specific game. That is why the one from One Piece won't work.

Also, if there is no UV data, my ripper should throw an error for any PSSG. PM me the resulting LightWave file and I will take a look at it.
THX1138
ultra-n00b
Posts: 6
Joined: Sat Jul 24, 2010 6:00 pm
Has thanked: 5 times

Re: 3ds max PSSG model import

Post by THX1138 »

howfie wrote:oh ok, I think I can send you some sample files if you want them. i'll send you my pssg.cpp source if you don't mind looking at C++ :-). be nice to see if somebody can extract the models from Journey, which also uses PhyreEngine.
Would also like to see Journey's PSSGs opened, and the models extracted. I can provide sample PSSGs taken from the trial version of the game.
tomatopasta
beginner
Posts: 32
Joined: Thu Aug 16, 2012 7:49 pm
Has thanked: 1 time
Been thanked: 1 time

Re: 3ds max PSSG model import

Post by tomatopasta »

Dazz wrote:Sorry to bump an old topic,

But I'm currently trying to use this script, and I've tried it using Max 9, and Max 2010 - I assume that this is something for a specific version of 3DS Max?
I get the same results in an error box as previously posted.

Any help would be much obliged! :)
I used 3dsmax9 and it worked, put the *.ms file into the C:\Program Files\****\Scripts\Startup\ directory and boot the 3dsmax, it will ask for .pssg at startup. If you are using different versions, try put the .ms into any directory possible in the 3dsmax folder, it will worked out as the directory match.
Post Reply