Skip to content

Commit

Permalink
Documentation: Mesh Vertex Data Init + Extraction Update
Browse files Browse the repository at this point in the history
  • Loading branch information
thearchivalone committed Dec 3, 2024
1 parent bb404da commit be5aa4b
Show file tree
Hide file tree
Showing 181 changed files with 1,254 additions and 970 deletions.
24 changes: 19 additions & 5 deletions BRS-Extract.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ $cwd = (Get-Item . | % { $_.FullName })

$game_dir = "Game"
$tools_dir = "Tools"
$docs_dir = "Docs"
$extraction_dir = "Extraction"
$assets_dir = "Assets"
$models_dir = $assets_dir + "\Models"
$audio_dir = $assets_dir + "\Audio"

$extraction_script = "Scripts\BRS-Extract.bms"
$scripts_dir = "Scripts"
$bones_script = $scripts_dir + "\BRS-Dig-For-Bones.bms"

$extraction_script = $scripts_dir + "\BRS-Extract.bms"
$extraction_script = Get-Item -Path $extraction_script | % { $_.FullName }

$archive_types += @("vol", "zzz", "gz")
Expand Down Expand Up @@ -187,6 +188,15 @@ Function Extract_Title {
Extract_Internals
}

Function Dig_For_Bones {
$model_dir = $extraction_dir + "\PSP_GAME\USRDIR\GAMEDATA\FLD\FCHR\"
$model_dir = Get-Item -Path $model_dir | % { $_.FullName }
foreach ($item in (Get-ChildItem -Path $model_dir -Force -Recurse -File)) {
$doc_item = $docs_dir + "\Technical\Models\Field\" + (Split-Path $item -Leaf).Split(".")[0] + ".MD"
& $quickbms_command -Y $bones_script $item > $doc_item
}
}

Function Extract_All {
Extract_Field
Extract_Battle
Expand All @@ -211,6 +221,7 @@ Function Get_User_Input {
Write-Output "7) Extract the System Volume"
Write-Output "8) Extract the Title Volume"
Write-Output "a) Extract the important things"
Write-Output "b) Dig for Bones"
Write-Output "q) Quit the program"
Write-Output "d) Remove extracted files"

Expand All @@ -222,6 +233,9 @@ Function Get_User_Input {
if ($input -eq 'a') {
Extract_All
}
if ($input -eq 'b') {
Dig_For_Bones
}
if ($input -eq 'd') {
Delete
}
Expand All @@ -247,4 +261,4 @@ Clean

Write-Output "Have a wonderful day! Happy modding, digging, and BRSing!!! :D"

#Write-Output "Models, Audio and other extracted assets can be found in the Assets folder"
#Write-Output "Models, Audio and other extracted assets can be found in the Assets folder"
5 changes: 3 additions & 2 deletions Docs/Technical/Formats/INSM.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@

* Extension: .mdl (if PTMD or alternative structures are found within)
* Header: INSM
* Purpose: Stores model, texture and material data
* Purpose: Stores model, mesh and material data
* Notes:
* Vertex Stride seems to vary a bit depending on where the model will be seen in game; ranges between 4 and 8 lines from what I've observed with some junk here and there that must be skipped on read
* Vertex Data Section ranges from where 0x3c starts to just before the location at 0x34
* Structure:
* 0x08 - Address to Unknown Data Section with possible model data
* 0x10 - Address where padding starts before embedded section
* 0x14 - Offset from 0x3c to the vertex data that creates the full mesh; subtract 0x04 to get to first X value (bosses may have augmentations); all values here draw straight lines between vertices; section ends with 0
* 0x18 - Address to unknown data structure
* 0x24 - Address where the math calculation tables start
* 0x28 - Start position of Unknown Data section - patterns of floats have been found here and at 0x2c but not sure what they're for yet
* 0x2c - Offset from 0x28 to get to the a Second Unknown Data Section
* 0x34 - Offset of PTMD or alternative structures from Header
* 0x3c - Vertex Data Section Start Address (where original model quads were found)
* 0x3c - Offset to Mesh Vertex Data Start from Header
18 changes: 6 additions & 12 deletions Docs/Technical/Models/Field/FCHR_B_CYZ00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,17 @@

---

* Meshes: 7
* Meshes: 1

* Located At:

* 0: 0x23c60
* 0: 0x230

* 1: 0x34070
* Vertices: 99

* 2: 0x34880

* 3: 0x35090

* 4: 0x360c0

* 5: 0x384d0
---

* 6: 0x39500
* Materials: 7

---

Expand Down Expand Up @@ -90,7 +84,7 @@

* Bone Group: 1

* Vertex Data Address: 0x46914
* Vertex Data Address: 0x466ec

* Calculation Type: 0x28

Expand Down
16 changes: 5 additions & 11 deletions Docs/Technical/Models/Field/FCHR_B_CYZ00B.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,17 @@

---

* Meshes: 7
* Meshes: 1

* Located At:

* 0: 0x23bf0
* 0: 0x1c0

* 1: 0x34000
* Vertices: 99

* 2: 0x34810

* 3: 0x35020

* 4: 0x36050

* 5: 0x38460
---

* 6: 0x39490
* Materials: 7

---

Expand Down
22 changes: 11 additions & 11 deletions Docs/Technical/Models/Field/FCHR_B_CYZ00P.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,17 @@

---

* Meshes: 7
* Meshes: 1

* Located At:

* 0: 0x23bf0
* 0: 0x1c0

* 1: 0x34000
* Vertices: 99

* 2: 0x34810

* 3: 0x35020

* 4: 0x36050

* 5: 0x38460
---

* 6: 0x39490
* Materials: 7

---

Expand All @@ -58,6 +52,8 @@

* Bone Group: 0

* Vertex Data Address: 0x3b8ec

* Calculation Type: 0x28

* Calculations: 0x25
Expand All @@ -72,6 +68,8 @@

* Bone Group: 0

* Vertex Data Address: 0x3ec6c

* Calculation Type: 0x28

* Calculations: 0x25
Expand All @@ -86,6 +84,8 @@

* Bone Group: 1

* Vertex Data Address: 0x4660c

* Calculation Type: 0x28

* Calculations: 0x25
Expand Down
12 changes: 6 additions & 6 deletions Docs/Technical/Models/Field/FCHR_B_KAL00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@

---

* Meshes: 4
* Meshes: 1

* Located At:

* 0: 0x21630
* 0: 0x230

* 1: 0x21c40
* Vertices: 199

* 2: 0x22250
---

* 3: 0x32660
* Materials: 4

---

Expand Down Expand Up @@ -84,7 +84,7 @@

* Bone Group: 2

* Vertex Data Address: 0x41100
* Vertex Data Address: 0x40708

* Calculation Type: 0x28

Expand Down
10 changes: 5 additions & 5 deletions Docs/Technical/Models/Field/FCHR_B_KAL00B.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@

---

* Meshes: 4
* Meshes: 1

* Located At:

* 0: 0x215c0
* 0: 0x1c0

* 1: 0x21bd0
* Vertices: 199

* 2: 0x221e0
---

* 3: 0x325f0
* Materials: 4

---

Expand Down
16 changes: 11 additions & 5 deletions Docs/Technical/Models/Field/FCHR_B_KAL00P.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@

---

* Meshes: 4
* Meshes: 1

* Located At:

* 0: 0x215c0
* 0: 0x1c0

* 1: 0x21bd0
* Vertices: 199

* 2: 0x221e0
---

* 3: 0x325f0
* Materials: 4

---

Expand All @@ -52,6 +52,8 @@

* Bone Group: 0

* Vertex Data Address: 0x349e8

* Calculation Type: 0x28

* Calculations: 0x24
Expand All @@ -66,6 +68,8 @@

* Bone Group: 1

* Vertex Data Address: 0x37d08

* Calculation Type: 0x28

* Calculations: 0x24
Expand All @@ -80,6 +84,8 @@

* Bone Group: 2

* Vertex Data Address: 0x40628

* Calculation Type: 0x28

* Calculations: 0x24
Expand Down
20 changes: 8 additions & 12 deletions Docs/Technical/Models/Field/FCHR_B_MAZ00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,17 @@

---

* Meshes: 6
* Meshes: 1

* Located At:

* 0: 0x20640
* 0: 0x230

* 1: 0x22690
* Vertices: 361

* 2: 0x22ea0

* 3: 0x236b0

* 4: 0x33ac0
---

* 5: 0x35ed0
* Materials: 6

---

Expand All @@ -56,7 +52,7 @@

* Bone Group: 0

* Vertex Data Address: 0x47508
* Vertex Data Address: 0x474e8

* Calculation Type: 0x28

Expand All @@ -72,7 +68,7 @@

* Bone Group: 0

* Vertex Data Address: 0x49c98
* Vertex Data Address: 0x49c78

* Calculation Type: 0x28

Expand All @@ -88,7 +84,7 @@

* Bone Group: 1

* Vertex Data Address: 0x4edf0
* Vertex Data Address: 0x4ebc8

* Calculation Type: 0x28

Expand Down
14 changes: 5 additions & 9 deletions Docs/Technical/Models/Field/FCHR_B_MAZ00B.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,17 @@

---

* Meshes: 6
* Meshes: 1

* Located At:

* 0: 0x212a0
* 0: 0x1c0

* 1: 0x232f0
* Vertices: 361

* 2: 0x23b00

* 3: 0x24310

* 4: 0x34720
---

* 5: 0x36b30
* Materials: 6

---

Expand Down
Loading

0 comments on commit be5aa4b

Please sign in to comment.