Giromancy

Member

User avatar

Posts: 187

Joined: Aug 30, 2010

Location: Argentina

Yet another way to export 3D models

Post by Giromancy on Mon Oct 16, 2017 10:08 pm

Johnny_Doe wrote:Wow... I wonder how many more of these are in this game. What if there's more in demo versions?


SCUS_94278 (OPM Official U.S. PlayStation Magazine #16 demo)
SLPM_80363 (Japanese Trial Edition)
SLUS_90050 (US Trial Edition)
SLUS_80707 (Trade Demo)
SLUS_00707 (US Retail Version)
SLED_01735 (EU Demo - Came with the official MGS game)
SLED_02186 (Australian PlayStation September Issue 05 demo)

The OPM & Japanese Trial demo are the most early versions of SH demos, so we could find different files or unfinished 3d models in comparisson with other demos that are more close to the retail version.
==================================
Image Image Image
==================================
 
 
 
 
 

Johnny_Doe

Member

Posts: 72

Joined: Oct 17, 2012

Yet another way to export 3D models

Post by Johnny_Doe on Tue Oct 17, 2017 1:14 am

I hope you're right about that.
 
 
 
 
 
 

Sparagas

Member

User avatar

Posts: 103

Joined: Feb 17, 2014

Yet another way to export 3D models

Post by Sparagas on Wed Oct 18, 2017 9:21 am

Sorry, for not writing very often. Got a little bit busy :(

But here are some observations about last two unknown sectors:

These are FLAUROS.PLM and AidKit from BG_ITEM.PLM with marked 3D model parts:

Image

Image

Code: Select all
As we know, the first 4 bytes are sizes of every section:
Polygon Count (including UV, Faces etc)
XY and Z vertices count
Count of First unknown section
Count of Second unknown section (this part is always 0 in character .ILM files)

Each section uses different size for... packets? I don't know if this is the right word
Code: Select all
Poly - 20 bytes
XY - 4 bytes
Z - 2 bytes
1st unknown - 4 bytes
2nd unknown 1 byte

So to know each section size we just need to multiply it by their count.

So from observing these examples we can see that 2nd unknown section bytes never exceeds vertices count.
And first unknown ending is always the same - 01, or 04 (in other models I saw 03, 06 etc.) But in the whole mesh it is always the same number. Could they be color codes for vertices?
Also first unknown count looks like always the same as vertices count. But only in character .ILM files.

UPDATE: Belek said this is Normals table, but I don't know how they work, or how they are written.
He also said that last 4 bytes of Poly pack are normal index. But I also don't understand how they work. And it's bytes also don't exceed vertices count, but only in not shifted models.

Here are some more examples from earlier posts:

REVEAL SPOILER
Image

Image

Image

Image

Image

Image


Also I extracted all BG models, so here are name codes:

Code: Select all
APU - bad amusement park (there is no good area)
DR - good sewers
DRU - bad sewers
ER - nowhere and other random inside places from over-world maps
HP - good hospital
HU - bad hospital
RSR - good resort over-world area
RSU - bad resort over-world area
SC - good school
SPR - good town center over-world area
SPU - bad town center over-world area
SU - bad school
THR - good old town over-world area (there is no bad area)

exclusive to global .plm files:
APR - good amusement  park (there are only few models, and textures look glitchy. Maybe there was plans to develope also good amusement park section)
BG_ITEM - common pick up items, like aid-kits, ammo etc.
MGR - unknown and even more glitchy stuff


So we still have some unresolved mysteries, like 2nd unknown data pack (and normals stuff for me personally),
how are BG_ITEM.PLM placed in maps, what are the last unknown byte before models offset, why there are models list after models directory, we still have no documentation on .ANM files and no cut-scene files.
Let's make SILENT HILL just PLAIN SCREAM
 
 
 
 
 

PaulSilentin

Member

User avatar

Posts: 154

Joined: May 01, 2014

Yet another way to export 3D models

Post by PaulSilentin on Wed Oct 18, 2017 3:05 pm

BTW if someone here still need explanation about playstation TIM format, try to look here. It's on russian language, but useful, i hope.

https://translate.google.com/translate? ... t=&act=url
https://translate.google.com/translate? ... t=&act=url
https://translate.google.com/translate? ... t=&act=url
 
 
 
 
 

belek666

Posts: 22

Joined: Feb 18, 2012

Yet another way to export 3D models

Post by belek666 on Thu Oct 19, 2017 6:28 am

@Sparagas
I also not sure about normal data but this is how I'm interpreting it. After faces data you got normal indices (if there are 4 faces indices you got 4 normal indices, if 3 you got 3 - for each vertex). Each element in normal table is actually 1 byte long. Index number from polygon pack points to element from that table, so if normal index is 0 you use first value from table, if its 1 you use 2nd value from table and etc.

Edit
Maybe the 4th data is item vertex/points which are connected to character (when item is used/held).

@Giromancy
Could you point me where those texture glitches appear? I can't find "psychedelic car" even.

I've probably fixed reversed faces. New build: https://www.sendspace.com/file/v5arcm
From now it ignores wrong uvs (on texture conversion side only).
 
 
 
 
 
 

Sparagas

Member

User avatar

Posts: 103

Joined: Feb 17, 2014

Yet another way to export 3D models

Post by Sparagas on Thu Oct 19, 2017 9:51 am

@PaulSilent ty, it will help

belek666 wrote:@Sparagas
I also not sure about normal data but this is how I'm interpreting it. After faces data you got normal indices (if there are 4 faces indices you got 4 normal indices, if 3 you got 3 - for each vertex). Each element in normal table is actually 1 byte long. Index number from polygon pack points to element from that table, so if normal index is 0 you use first value from table, if its 1 you use 2nd value from table and etc.

Edit
Maybe the 4th data is item vertex/points which are connected to character (when item is used/held).

Ty for explanation.
4th data pack is in .PLM and .IPD, so it is everywhere, except in characters and enemies. Even in buildings. So it should be something else.

BTW, how did you converted .TIM files? Did you knew how they were documented? Also, if object uses more than one texture, how do you know which one to use?
Let's make SILENT HILL just PLAIN SCREAM
 
 
 
 
 

Giromancy

Member

User avatar

Posts: 187

Joined: Aug 30, 2010

Location: Argentina

Yet another way to export 3D models

Post by Giromancy on Thu Oct 19, 2017 4:06 pm

belek666 wrote:@Giromancy

I've probably fixed reversed faces. New build: https://www.sendspace.com/file/v5arcm
From now it ignores wrong uvs (on texture conversion side only).


:) Correctly exported, there is no need to flip normals in Blender now:
Image

belek666 wrote:Could you point me where those texture glitches appear? I can't find "psychedelic car" even.


"Psychedelic car" is in THR00FE.IPD file, but it seems that with the updated build is exported correctly:
Reversed faces problem??
Image

same with THRF9FD.IPD
Image

The file THR02FC.IPD with wrong uv´s message works fine now, but there are some missing faces on the truck:
Image


The interior of Cafe 5to2 has missing front faces, (windows, door, wood frames etc)
The file is: THR0006.IPD
Image

The file RSR00FD.IPD has bushes with incorrect colors, brown, it should be green instead:
Image

The lines and squares texture glitches are still appearing in some files:
Image
Image

This have uv coordinates distortion on the ¨Midwich Elementary School¨ sign.
Also the two windows frames below the sign has uv distortion:
Image

Also, im having this error when i tried to convert any DR (sewers) files, not all files, but most of it:
Image
Looks like there is a missing texture called DWAVE.TIM


Btw, i succesfully import the whole OLD SH map into Blender:
Image

But i cant find the interior of the Convenience Store, someone found it?

Thanks belek for keep working on this tool, much appreciated.
I'll keep looking for more errors.
==================================
Image Image Image
==================================
 
 
 
 
 

Sparagas

Member

User avatar

Posts: 103

Joined: Feb 17, 2014

Yet another way to export 3D models

Post by Sparagas on Thu Oct 19, 2017 4:52 pm

But i cant find the interior of the Convenience Store, someone found it

Yes. Convenience store along with church, school bus, (s)hell gass station and other random interiors from other maps are in ER map (Nowhere).
Let's make SILENT HILL just PLAIN SCREAM
 
 
 
 
 

Johnny_Doe

Member

Posts: 72

Joined: Oct 17, 2012

Yet another way to export 3D models

Post by Johnny_Doe on Fri Oct 20, 2017 4:45 pm

Man, that looks cool. By the way, has anyone managed to convert the other files from the TEST folder? And a question for Giromancy, did you use that Blender script to import the whole map or it was done one by one?
 
 
 
 
 
 

belek666

Posts: 22

Joined: Feb 18, 2012

Yet another way to export 3D models

Post by belek666 on Sat Oct 21, 2017 6:29 am

Sparagas wrote:BTW, how did you converted .TIM files? Did you knew how they were documented? Also, if object uses more than one texture, how do you know which one to use?


I've used information about TIM format from this site http://wiki.qhimm.com/view/PSX/TIM_format
In polygon pack (with uvs, faces, etc) as I wrote before you have information about texture and palette. Texture number selects which to use (at the beginning of plm file there is textures name list). If it is 0 polygon use first texture (name from list) if 1 use 2nd and etc.

About conversion, in program it look like this (for each polygon pack if texture number isn't 0x7F):
- interpreting polygon pack - finding texture name, palette number, uvs
- open tim file
- open tga file if it exist or create it
- basing on uvs rectangular area of image is specified
- read that area from tim with selected palette and convert pixels to RGBA format
- write converted data to tga with the same coordinates
- close files
 
 
 
 
 
 

Giromancy

Member

User avatar

Posts: 187

Joined: Aug 30, 2010

Location: Argentina

Yet another way to export 3D models

Post by Giromancy on Sat Oct 21, 2017 11:34 am

Sparagas wrote:Yes. Convenience store along with church, school bus, (s)hell gass station and other random interiors from other maps are in ER map (Nowhere).


Thanks, i found it.
Btw, most of the ER files (not all) are extracted with glitched textures, Church, Antique Shop, Motel rooms, Garage, Annies Bar, Indian Runner, etc.

Johnny_Doe wrote:Man, that looks cool. By the way, has anyone managed to convert the other files from the TEST folder? And a question for Giromancy, did you use that Blender script to import the whole map or it was done one by one?


Test folder have five .IPD files, and two .ILM files, one of them has been converted to .obj RMT0000.IPD wich is the prototype room. There are other files: BTT_0000.IPD - BTT_00FF.IPD - BTT_FF00.IPD - BTT_FFFF.IPD wich i couldnt extract yet. Both .ILM files PRS2.ILM - PRS3.ILM seems to be beta characters, but i didnt check it yet.

About, Blender, yes, i used the file that Sparagas said earlier, here you can download it: https://blender.stackexchange.com/quest ... -obj-files
you must install it on Blender and then you simply select all the .OBJ files and let Blender do the rest, the map will import each texture and model correctly in position, you dont need to do nothing.

I succesfully imported the OLD SH & Central SH into Unity and made a simple ¨Level Viewer¨.
I had to add fog and use Occlusion culling to reduce the lag, both maps are too much to render without doing this.
Image

Here is a video i made:


And a direct download link for the Level viewer:
SHLV_0.0.1 (28Mb):
https://drive.google.com/uc?id=0B3KIusr ... t=download
==================================
Image Image Image
==================================
 
 
 
 
 

Sparagas

Member

User avatar

Posts: 103

Joined: Feb 17, 2014

Yet another way to export 3D models

Post by Sparagas on Sat Oct 21, 2017 12:02 pm

This is fantastic! I already commented on the video :)
Also you can press SHIFT+F or CTR+F to enter WASD mode, like in level viewer, for better navigation

EDIT: dreams really come true, we are viewing Silent Hill town outside game! One of the happiest days for me. Thanks everyone for the help - this is unbelievable what a few passionate people can do in such a short time!

I don't want to say anything wrong about CharlesM and it's unreleased model viewer. But this is example if one person do it secretly, and not openly with community - everything is lost, if that person doesn't continue it's work.
Let's make SILENT HILL just PLAIN SCREAM
 
 
 
 
 

id-daemon

Posts: 21

Joined: Oct 06, 2017

Yet another way to export 3D models

Post by id-daemon on Sat Oct 21, 2017 1:32 pm

Sparagas wrote:I don't want to say anything wrong about CharlesM and it's unreleased model viewer.


I think he was unable to build character (skeletal) models. It's not easy to get them together. That could frustrate him and he gave up.
 
 
 
 
 
 

Sparagas

Member

User avatar

Posts: 103

Joined: Feb 17, 2014

Yet another way to export 3D models

Post by Sparagas on Sat Oct 21, 2017 1:40 pm

id-daemon wrote:
Sparagas wrote:I don't want to say anything wrong about CharlesM and it's unreleased model viewer.


I think he was unable to build character (skeletal) models. It's not easy to get them together. That could frustrate him and he gave up.

BTW. you said you will release skeletal documentation. We are waiting for it :)
Let's make SILENT HILL just PLAIN SCREAM
 
 
 
 
 

Johnny_Doe

Member

Posts: 72

Joined: Oct 17, 2012

Yet another way to export 3D models

Post by Johnny_Doe on Sat Oct 21, 2017 3:10 pm

You are amazing, thank you guys for keeping up good work. And thank you Giromancy for the links and your level viewer. I think it's not too long before someone puts the characters and mosters into the game. Someday this will become a decent PC port. My imagination keeps building more and more ideas but I have to stay realistic. Someday... someday...
 
 
 
 
 
 

id-daemon

Posts: 21

Joined: Oct 06, 2017

Yet another way to export 3D models

Post by id-daemon on Sun Oct 22, 2017 8:49 am

Sparagas wrote:BTW. you said you will release skeletal documentation. We are waiting for it :)


I had no time to test it fully, that's why its not working properly in all animations, and it doesn't work at all on some of them, which have more than one position track (like FAT one), but here it is:

REVEAL SPOILER
ANM header:
--------------------------

short - data offset
byte - number of rotation tracks
byte - number of position tracks
short - frame size (in bytes)
short - number of bones
int - unknown flag
int - total animation size
short - number of frames
short - position data scale (in bits)


0x0014: for each bone, bone description:
-------------------------------
byte - parent
byte - rotation track
byte - position track
byte - position X
byte - position Y
byte - position Z



animation frame:
===============================
for each position track:
-------------
byte - position X
byte - position Y
byte - position Z
------------
for each rotation track:
-------------
9 bytes: rotation matrix
 
 
 
 
 
 

belek666

Posts: 22

Joined: Feb 18, 2012

Yet another way to export 3D models

Post by belek666 on Tue Oct 24, 2017 8:05 am

Giromancy wrote:The file THR02FC.IPD with wrong uv´s message works fine now, but there are some missing faces on the truck:
Image

It should be ok now.
Giromancy wrote:The interior of Cafe 5to2 has missing front faces, (windows, door, wood frames etc)
The file is: THR0006.IPD
Image

Front wall model and windows are in plm section of ipd but ipd itself doesn't use them (no position and rotation data). From what I've found those missing models names are used in MAP0_S01.BIN file.
Giromancy wrote:The file RSR00FD.IPD has bushes with incorrect colors, brown, it should be green instead:
Image

It happens if program use 4th uvs in texture conversion function. You can find here: https://www.sendspace.com/file/96qwvc two version of program, one ignores 4th uvs data in texture conversion process.

Giromancy wrote:The lines and squares texture glitches are still appearing in some files:
Image
Image

New build may fix them.
Giromancy wrote:This have uv coordinates distortion on the ¨Midwich Elementary School¨ sign.
Also the two windows frames below the sign has uv distortion:
Image

Maybe this is because quads (or triangle strip) are converted to single triangles.
Giromancy wrote:Also, im having this error when i tried to convert any DR (sewers) files, not all files, but most of it:
Image
Looks like there is a missing texture called DWAVE.TIM

In TIM folder there is file called DR_WAVE.TIM maybe this is missing texture.

Thank you for your reports. Great work with lever viewer. Maybe someday we get full silent hill town map in 3d by combining models from all games.

Edit:
BIN files from VIN folder actually contain game's code (they are loaded to ram by main executable) and they generate position data for rest of models from ipd file and items. So it not possible to obtain that data without using ram dumps for each map. I've updated my program to detect models without position data and extract them also. Position of tree leaves is defined in ipd file but since they are probably 2d sprites we can't get its model. New version of ipd2obj puts model of LEAF_1 (triangle) in place of tree leaves so it can be replaced in future with maintaining original position.

Binary:
https://www.sendspace.com/file/eazosq

Source code (for good, old Dev-C++):
https://www.sendspace.com/file/jsiilp
 
 
 
 
 
 

Coconut

User avatar

Posts: 8

Joined: Aug 05, 2017

Yet another way to export 3D models

Post by Coconut on Sat Nov 18, 2017 12:09 am



Very nice indeed :)
 
 
 
 
Previous


Return to Silent Hill1 Modding



Who is online

Users browsing this forum: No registered users and 2 guests