Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Heavy Rain Tool

Programs that are related to this or that game.
Modman69
veteran
Posts: 108
Joined: Wed Jun 17, 2009 4:33 pm
Has thanked: 21 times
Been thanked: 4 times

Re: Heavy Rain Tool

Post by Modman69 »

HugoPeters

Do you have tools like you created for BTS for Heavy Rain also?
User avatar
HugoPeters
veteran
Posts: 133
Joined: Thu Apr 03, 2014 9:49 am
Location: The Netherlands
Has thanked: 64 times
Been thanked: 168 times
Contact:

Re: Heavy Rain Tool

Post by HugoPeters »

Modman69 wrote:HugoPeters

Do you have tools like you created for BTS for Heavy Rain also?
I took a few stabs at implementing HR and got some stuff running, but never finished it due to lack of time/interest.
It looks like MushroomLT is well on his way though and I hope he continues it :)
Image

"I'm going to throw my shit at you" —The Great Mighty Poo
_______________________>> check my portfolio I wish the [center] bbcode was turned on
_______________________>> or my twitter
daemon1
MEGAVETERAN
MEGAVETERAN
Posts: 2647
Joined: Tue Mar 24, 2015 8:12 pm
Has thanked: 65 times
Been thanked: 2871 times

Re: Heavy Rain Tool

Post by daemon1 »

HugoPeters wrote:then we'll talk :bleh:
I don't want to talk with you.

Let me rephrase my question. People who posted information and tools for Beyond two souls were threatened with bans and their messages were deleted. So my question again:

Is it now allowed to talk about (and post tools for) Quantic Dream engine here on xentax ?
User avatar
HugoPeters
veteran
Posts: 133
Joined: Thu Apr 03, 2014 9:49 am
Location: The Netherlands
Has thanked: 64 times
Been thanked: 168 times
Contact:

Re: Heavy Rain Tool

Post by HugoPeters »

daemon1 wrote:
HugoPeters wrote:then we'll talk :bleh:
I don't want to talk with you.

Let me rephrase my question. People who posted information and tools for Beyond two souls were threatened with bans and their messages were deleted. So my question again:

Is it now allowed to talk about (and post tools for) Quantic Dream engine here on xentax ?
No need for that saltiness man.
("then we'll talk" is a figurative expression btw)

Regarding your question, consider what QD told me when I was working on my project, and the risks that it will cause for Xentax as a whole when more advanced tools / extractors are posted.
Image

"I'm going to throw my shit at you" —The Great Mighty Poo
_______________________>> check my portfolio I wish the [center] bbcode was turned on
_______________________>> or my twitter
Mr.Mouse
Site Admin
Posts: 4073
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 450 times
Been thanked: 682 times
Contact:

Re: Heavy Rain Tool

Post by Mr.Mouse »

daemon1 wrote: My question is: can I now talk about this on xentax?
I see no reason why not at this time.
Loomy
advanced
Posts: 41
Joined: Sat Sep 12, 2015 2:16 am
Location: South Africa
Has thanked: 20 times
Been thanked: 6 times

Re: Heavy Rain Tool

Post by Loomy »

MushroomLT wrote:DataContainer structure reversed - working on the storyboard now, which links all the scenes.
Image
.
so glad to see someone actually pick this up again ;) and actually making progress, unlike my on and off dabbling for over a year getting nowhere slowly :D

I managed to successfully index + extract meshes/uv/ from heavy rain ages back, but focus has been on B2S mostly. .

there are some slight differences on things like uvs, but for most part b2s & HR data is nearly identical.


Everything is made easier by parsing the lua file by file and tying it up finding the SEQUENCES, and catalogs.

Models(meshes) can appear multiple times, sometimes just referenced or actual dupe of mesh data. but will usually only have one core file with a skelton, of which would contain textures, weights and so on.

to find models just brute force way, each mesh char or Area / prop file will contain "FX_EVENT_" attribute can also search for PRIMEDGE SKELETON NODE_AR (Primedges are reference and offsets to vertex/uv/ compressed EDGES) each of which is usually aligned at the start of one of the sub-seg' archives of that file .

usually 3x LODs of each char, multiple meshparts,cloth and hair.

CUSTSHADER attribute are the materials. in them linking to FILETEXT ..textures trhemselves are found hiding between segs, size defined in either FILETEXT or custshader, IDK

I think they compressed with some form of lzma or huffman or just standard Ps3 sdk EDGE dxt compression tools, (as are Edges) but not looked into it

NODE_AR attribute contains bone info, and links up skeleton to nodes to custshader top text to meshes to meshdata to primedges (geom) or something like that...

something in meanwhile will be dusting off more useful goodies to add to the cause, will revert back soon


check here below (010 template): struct ENTITY_ABC (this links all things in a character file) this was work in progress never finished, and the references outdated will send u those seperate (its huge :P )

also commented out is file i was using it on if u want to see it in action. ineed to relook at heavy rain i remember there were some differences


Code: Select all

https://pastebin.com/RmbYmeAp
Last edited by Loomy on Wed Dec 13, 2017 7:27 pm, edited 1 time in total.
daemon1
MEGAVETERAN
MEGAVETERAN
Posts: 2647
Joined: Tue Mar 24, 2015 8:12 pm
Has thanked: 65 times
Been thanked: 2871 times

Re: Heavy Rain Tool

Post by daemon1 »

Loomy wrote:textures trhemselves are found hiding between segs

I think they compressed with some form of lzma or huffman or just standard Ps3 sdk EDGE dxt compression tools
Textures are not "hiding between segs". Each segment actually may include raw data part in the end, which holds textures

Since Mr.Mouse approved that, i can say that my tools for Heavy Rain and Beyond 2 Souls are posted here
https://facepunch.com/showthread.php?t=1566950
and here http://cgig.ru/forum/viewtopic.php?p=9316#p9316

I could probably post it here too, but who needs them now, when we can get PS4 version?
Last edited by daemon1 on Wed Dec 13, 2017 4:59 pm, edited 1 time in total.
Loomy
advanced
Posts: 41
Joined: Sat Sep 12, 2015 2:16 am
Location: South Africa
Has thanked: 20 times
Been thanked: 6 times

Re: Heavy Rain Tool

Post by Loomy »

some of the HR mesh locations:- (left id = sequential index / right hex = sdat absolute offset in particularbigfile if i recall)

https://pastebin.com/9xF1Edjm
Loomy
advanced
Posts: 41
Joined: Sat Sep 12, 2015 2:16 am
Location: South Africa
Has thanked: 20 times
Been thanked: 6 times

Re: Heavy Rain Tool

Post by Loomy »

I say "hiding" as an ignorant person who for longest time has just been concatenating segs together thinking those tails were too small to be anything :) meanwhile... that compression is insane.

A huge thanks to you and your brilliant work on ur tools, u smashed it ;) if only u knew how long i been banging head against wall for clues.

Ur resulting output files helped alot, most notably how huge they were compared my own - and that noesis rapi.edgeDecompress is losing many faces in process, some few k' per mesh.

I have 10,0001 questions id love to ask :p but hope you would kindly oblige me with just your advice if you know offhand:-

Im looking to research the animation for b2s, between EDGE libs/psd sdk and Havok which i should be looking to as reference. seems like havok is used fror more than just cloth & physics. and just out of interest were textures using some kind of combination of bitpacking & lzma, or was something else like EDGE dxt cmprssn. I just find it crazy how ithey shrunk files like that, but then again alot of them are fairly low rez, and quite a small pallette.

daemon1 wrote:
Loomy wrote:textures trhemselves are found hiding between segs

I think they compressed with some form of lzma or huffman or just standard Ps3 sdk EDGE dxt compression tools
Textures are not "hiding between segs". Each segment actually may include raw data part in the end, which holds textures

Since Mr.Mouse approved that, i can say that my tools for Heavy Rain and Beyond 2 Souls are posted here
https://facepunch.com/showthread.php?t=1566950
and here http://cgig.ru/forum/viewtopic.php?p=9316#p9316

I could probably post it here too, but who needs them now, when we can get PS4 version?
daemon1
MEGAVETERAN
MEGAVETERAN
Posts: 2647
Joined: Tue Mar 24, 2015 8:12 pm
Has thanked: 65 times
Been thanked: 2871 times

Re: Heavy Rain Tool

Post by daemon1 »

I didn't look into animations, but as for beyond 2 souls textures, they are compressed with JPEG-like algorythm that was introduced by ID-Software in 2006 with source code published. Except a few little tweaks, its just a standard JPEG. Heavy Rain, on the contrary, used usual DDS.
Loomy
advanced
Posts: 41
Joined: Sat Sep 12, 2015 2:16 am
Location: South Africa
Has thanked: 20 times
Been thanked: 6 times

Re: Heavy Rain Tool

Post by Loomy »

@ MushroomLT

How far are u planning to go with this, and if i contribute code can it be in either c#, python or php which is preferred, while i can read java, its not my first language.

Can i stick to my animation research, ive already mapped out most of system and the MotionGraph rigging + default motions, im now trying 2 map out animation blocks and animation tracks and so on.

Do u have the default data mappings as defined in lua ? i think theyre not quite part of Initialization script, but are in the EBOOT, its quite huge, but will help u to automap most attributes, arguments and datatypes

ie:

Code: Select all

"QDT.GMK_ANIMATION_DATABASE.NewPlacedCtx=function(table1,table2,nom,id) QDR[table1][table2][nom]={_Instance=NewOS(table1..\".\"..table2..\".\"..nom,4234,id)} setmetatable(QDR[table1][table2][nom],{__index=function(table,key) return(table._Instance[key])end})end",
"QDT.SEQUENCE_CONTROLLER_PLAY._MT.SetbDisableForceLoad = function (self, value) return ( self:GenericSetBool(4290, 2, value) ) end",
			"QDT.SEQUENCE_CONTROLLER_PLAY._MT.SetGameplayEndAutomationAtFailure = function (self, value) return ( self:GenericSetBool(4290, 8, value) ) end",
			"QDT.SEQUENCE_CONTROLLER_PLAY._MT.SetGameplayStartAutomation = function (self, value) return ( self:GenericSetBool(4290, 6, value) ) end",
			"QDT.SCRIPT_SOUND_CONTROLLER_FADE._MT.SetbDisableForceLoad = function (self, value) return ( self:GenericSetBool(4263, 2, value) ) end",
			"QDT.SEQUENCE_CONTROLLER_PLAY._MT.SetGameplayEndAutomationAtSuccess = function (self, value) return ( self:GenericSetBool(4290, 7, value) ) end",
			
or shall i send u one ive merged between b2s & HR
Loomy
advanced
Posts: 41
Joined: Sat Sep 12, 2015 2:16 am
Location: South Africa
Has thanked: 20 times
Been thanked: 6 times

Re: Heavy Rain Tool

Post by Loomy »

In an attempt to get things moving, and take advantage of holidays and time off from real work :P One of main challenges is linking everything together, after that,everything else falls into place and makes further research a little easier.

here are some of my findings, if it helps. My main issue is not having a moddable ps3(4k slim P.O.S.), and cant for the life of me get rpcss emuworking, I can only imagine what i could do with Debug logs/output if someone were to take the trouble to make and share such logs. Of interest would be sequential listing of offsets and files/sizes read as game loads to menu, and as it loads into the game itself, - further to that is hacking the LUA system. IE. like B2s, we could do alot with that - printing variables while game running and so on.


Also id like to add, i think it important to give this project some context - to avoid stepping on anyones toes or threatening IP. For me at least, this is solely for the fun of it - and researching how PS SDK Toolchain + Havok + Mogre + Lua + Mocap came together to deliver one of the highest quality & visual fidelity titles in recent history (that still comparable to its ps4 version) - and ps3 data formats in general - before moving onto all things ps4. This is not about making some port, or trying to extract any of the game assets and so on - there already tools for that.. (which for me are useless as none of them took the time to share their findings, i can only be thankful that Hugo like to brag as much as he did (and still does :D) ) as this research in general can apply to a multitude of titles now and in future, using similar toolchains and formats.. how many games use havok ? :P plus B2s/HR have all debug strings not encrypted or custom formats, any idiot or noob (like me) can use it as a great source of learning.
Loomy
advanced
Posts: 41
Joined: Sat Sep 12, 2015 2:16 am
Location: South Africa
Has thanked: 20 times
Been thanked: 6 times

Re: Heavy Rain Tool - Data File Linking

Post by Loomy »

Regarding file linking :-

Sorry bit much to look at, but see notes below :

Image

--------------------------

1. (Bottom) *BigFile.sdat Container List - Lists all individual Data Containers or segments. They give offset + BigFile location + a unique FileID (ID). (some of them Duplicated, as there is identical copy in SetupBigFiles ( BigFiles = Streaming, SetupBigFiles = installed locally) . There are cases of some files only appearing in setupFiles. All Beta content and unused stuff is also mostly found in Setup Files. For our purposes we just take the first entry we find.

----------------------

2. (Far Right) *BigFile.DEP Container Header Entries - I have only now discovered this, its unique to HR, the B2s version mostly useless afaik. This is an actual Listing of each of the Communicator Entries, or actual content of the above Containers (Which are normally indexed in each Data Container headers..) So dont need to UNSEG every single file and parse all 20gb to generate this list anymore. There are total of 550k+ entries - which sounds about right - B2s is around the same.

There are Data COntainer entries in this list. each of them 0xC (217) specifies the number of nested entries, or the next number of entries that are found in that specific data container. (not sure what this value means for other entries - could be similar - some communicators have multiple sub/nested entries ?)

The DataContainer entry itself 0x8 (296) specifies the .SDAT id of the file. so the next 217 entries will all be found in SDAT file/seg with ID 296.

For other Entries 0x4 = Global Unique ID, or Communicator ID, as per CommHeader. and also the ID that is referenced in LUA scripts.

EXAMPLE:

SetSequence(NewOS("_0501_SLEEPLESS_NIGHT_UNDERWATER_STurnShaun", 4288, 3140))

4288: Communicator Type (Sequence)
3140: Communicator GlobalID (will be found in CommHeaders, or look it up in .DEP file list). (again there could be multiple entries.)

so from DEP list we can find the File or DataContainer(s) where we will find this SEQUENCE

-------------------------------------

3. (center) The Parsed Content of File 296, communicator headers at center top, and attributes, or actual communicator blocks or content in file itself at center (these i still parse manually, or search for their 0x8 magic )

While this doesnt delve into COM_CONT and other attribute stuff - the main point im making here is the linking between SDAT + DEP files + CommHeaders

** Note that some Communicators can appear multiple times, in multiple DataContainers/Files, linking together with its attached LoadingZone, or other linked elements should usually filter this to correct entry
Loomy
advanced
Posts: 41
Joined: Sat Sep 12, 2015 2:16 am
Location: South Africa
Has thanked: 20 times
Been thanked: 6 times

Re: Heavy Rain Tool - Storyboard Structure

Post by Loomy »

Regarding Storyboard Structure:-

Storyboard = Play Order of Scenes / Levels, from start to finish.. or at least suppose to be.

I am having issues here, as there is meant to be 2x storyboards: Development + Production, the latter being the actual. But there are multiple storyboards in multiple files, each one missing parts, or not in sequential order, contains unused stuff, or stuff without names or scenes/areas at all. There meant to be around 50 something main Scenes of the game (each containing one to three parts ie: _0101, _0102, _0103 would be scene 1 + 3 parts.

Also unsure of weather there are the same scenes for different characters, each having their own entries in storyboard. Need to research further, but for now at least, see structs below :-

Image

Structure =


struct STORYBOARD
{
char magic[8]; // STORYBRD
int unknown; // 1
int numElements;
STORYBOARD_ELEMENT[numElements];
int numScenes;
STORYBOARD_SCENE[numScenes];
};

struct STORYBOARD_ELEMENT
{
byte uk0; // 1
uint Comm_Type; // 0x0000107F
int uk1; // 1
char Comm_Magic[8]; // STBRDELM
int uk2; // 3 (always)
int uk3; // 0 (always)
int numLinked; // 1 to n
int Scene_Idx[numLinked]; // points to / groups Scenes from SCENES array below (seems groups: _0401, _0402, _0403) etc
};
struct STORYBOARD_SCENE
{
byte uk0; // 1
uint Comm_Type; // 0x00001135
int uk1; // 1
char Comm_Magic[8]; // STBRDSCN
int uk2; // 4
int scn_len; // 4
char Scene_Label[scn_len]; // _0201_PROLOGUE_BIRTHDAY
int sav_len; // 4
char Trophy_Save_Label[sav_len]; // HR_6000_SAVEDATA_ALLSCENES_AASAVE_S004006C05
int var_len; // 4
char Lua_VarName[var_len]; // QDR.HEAVY_RAIN_Var._B26BD95025A240CF9CF52192243A3737()
int uk3; // 4
int uk4; // possibly bigFile id ?
SCENE_ELEMENT[n]; // variable length - parse all b4 next scene Magic
};

struct SCENE_ELEMENT
{
byte uk0; // 1
uint Comm_Type; // 0x00001136
int uk1; // 1
char Comm_Magic[8]; // STBSCELM
int uk2; // 3
0x8 = CommType + ID (Scene or Area) // afaik
int scn_len; //
char Scene_Label[scn_len]; // Label or Var idk ? usually empty
int pre_len; //
char Preload_Message[pre_len]; // PreloadMessageNotSet
0x8 = CommType + ID (LoadingZone)
int end_len; //
char StopEnd_Message[end_len]; // StopMessageNotSet
};



Storyboard im parsing can be found in my above post SDAT entry file 196 BigFile_PS3.dat @ offset 76847104 (segs)

Just search for STORYBRD magic, u will find 2 of them

* I have not yet factored in the Bunch of LoadingZone / LoadingContainer definitions / list that preceed each Storyboard, these no doubt are important piece of puzzle.

Why does HR Storyboard look like such a mess versus B2s

@ MUSHROOM_LT: iin ur pic ur SceneList looks relatively sorted, can u give some insight, or is it sorted by hand ?

Cheers to all & MERRY XMAS 8)
Loomy
advanced
Posts: 41
Joined: Sat Sep 12, 2015 2:16 am
Location: South Africa
Has thanked: 20 times
Been thanked: 6 times

Re: Heavy Rain Tool

Post by Loomy »

Making Progress ! Can now pick any Scene from Storyboard, and get the initial initialization lua scripts & vars for that Scene as well as the AREA (init + geom) Catalog, so in theory can effectively load a level and its mesh collection (all with properly linked & referenced textures -> unlike dumperTool on facepunch.) honestly not hard to link correct meshes to textures, as same PRIMEDGE block that defines mesh also links specific texture(s) literally right after.

Still trying to find the linkage to the Characters, Anim & Movie (sequence) catalogs.

Using _1301_Nightmare (Madison Intro) as example:-

1. Storyboard links 2x Scenes:-

Scene [ 235] Zone [22729]
Scene [ 80] Zone [ 5754]

2. From .DEP Lookup, Find DataContainer (SDAT entry) with Scene 80

In this file you will find an AREA id: 29, a Lua Initialization script for this area, and the link to the DataContainer that contains the Scene (CATALOG). Decompiled lua script looks something like the following - basically defines AREA, and nodes,cameras, spawn locations, for everything specific to the scene and its static objects.

Code: Select all

QDT.AREA.New("MADISONHOUSE", 29)

QDR.MADISONHOUSE_Var.OppositeWay = false
QDR.MADISONHOUSE_Var.VarLightOn = false

QDT.ADDRESS.NewPlaced("MADISONHOUSE_Var", "VarAdCrossDown", 0)
QDT.VECTOR.NewPlaced("MADISONHOUSE_Var", "VarAdPosition", 0)
QDT.QUATERNION.NewPlaced("MADISONHOUSE_Var", "VarAdDirection", 0)

QDR.MADISONHOUSE_Var.VarUp6 = false
QDR.MADISONHOUSE_Var._1301TrophyWC = false
QDR.MADISONHOUSE_Var._1301TrophyShowerCut = false
QDR.MADISONHOUSE_Var.VarFridgeClosedArea = false
QDR.MADISONHOUSE_Var.VarPositionZ = 0

QDT.VECTOR.NewPlaced("MADISONHOUSE_Var", "VarPosition", 0)
QDT.ADDRESS.NewPlaced("MADISONHOUSE_Var", "AdDefaultCam", 0)


3. The COM_CONT section preceeding, or wrapping the actual AREA section in this INIT file, will contain some links, bottom of those links,we find the actual AREA CATALOG file (id). Going back to DEP lookup we can find the DataContainer (SDAT entry)

Image

4. Opening up the linked Catalog DataContainer, in the Comm Headers we find a Catalog entry (id:50). going to the block of that catalog, or the COM_CONT section links, we find a DATA_CONTAINER reference, which points to the SDAT entry containing the actual MESHES, textures, geom, etc. for Madison' Apartment (40mb seg file).


So that all said, now only need to explore other linked stuff, and these loading zones,and also important i think si the script zones, script objects. try to find all other linked catalogs (characters, movies, anim)
Post Reply