From 7e16b1c27d04855cb1ae7b26608dfc81115c12ca Mon Sep 17 00:00:00 2001 From: Zurphing <72351816+Zurphing@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:04:04 -0500 Subject: [PATCH 1/3] Update with named surface flags thanks to kenjiuno/Disgustor BAR templates, documented each Ground value --- docs/tool/CLI.MapGen/index.md | 73 +++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/docs/tool/CLI.MapGen/index.md b/docs/tool/CLI.MapGen/index.md index 3e2b0868e..c16135d48 100644 --- a/docs/tool/CLI.MapGen/index.md +++ b/docs/tool/CLI.MapGen/index.md @@ -266,13 +266,41 @@ disableBSPCollisionBuilder: true ``` ### surfaceFlags - +4 bitflags that control various properties of surfaces. Whether or not Inverse Kinematics should apply, if a player can grab the ledge, etc.
+Grabbable Ledges should only be placed on top of surfaces, some buggier interactions with ledges may occur otherwise.
```yml # Specify `surfaceFlags` to this material. # `0x3f1` is one of floor representation. - name: 'floor' surfaceFlags: 0x3f1 ``` +Bit 1 +``` +Kind: 0x1, 0x2, 0x3, or 0x4 +Hit_Player: 0x10 +Hit_Enemy: 0x20 +Hit_Flyenemy: 0x40 +Hit_Attack: 0x80 +``` +Bit 2 +``` +Hit_Safety: 0x1 +IK: 0x2 +Grabbable Ledge: 0x4 +Barrier: 0x8 +MSG_Wall: 0x10 +Callback: 0x20 +Carrib_Disp: 0x40 or 0x80 +``` +Bit 3 (Unknown uses an additional one?) +``` +Belt: 0x1 +Polygon_SE: 0x2 or 0x4 +Hit_RTN: 0x8 +Nohit_Floor: 0x10 +Unk: 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xE0, 0x100, 0x120, 0x140, 0x160 +``` +Add up the bits you'll need to get the proper value for your surface; 0x3F1 has Kind(1), Hit_Player, Hit_Enemy, Hit_Flyenemy, Hit_Attack, Hit_Safety, and IK. ### maxColorIntensity @@ -335,14 +363,50 @@ reuseImd: true ### ground -Ground value in collision. Such as 30, 25, 8, 2, 1, or 0 - +Ground value in collision.
+These values are used to determine which footsteps to play when walking or running across the collision with that materials name.
+Most sound effects will not play without modifying [12soundinfo.bar](/docs/kh2/file/type/12soundinfo.md) for that rooms world.
+PAX like water splashes and footprints also depend on the collision having specific values.
For light collision, this is index to `onColorTable[]`. ```yml - name: 'floor' ground: 1 ``` +What each value corresponds to is shown below. +``` +1: Stone +2: Stone_SP +3: Dirt* +4: Dirt_SP +5: Sand +6: Sand_SP +7: Wood +8: Board +9: Creakwood +10: Lawn* +11: Grass +12: Drygrass +13: Water* +14: Deepwater +15: Snow* +16: Metal +17: Ironwire +18: Carpet +19: Cloth +20: Sofa +21: Roof +22: Roof_SP +23: Electric +24: Electric_SP +25: Glass +26: Rubber +27: Bone +28: Paper +29: Fragment +30: Last +*This will play PAX Effects if available. +``` ### floorLevel @@ -584,5 +648,6 @@ eachFileName: - Design a full map model data with [Blender](https://www.blender.org/), and then export entire world to `.fbx` file format. +- Ideally, you'll want to generate the regular map model without collision, then create a lower-poly collision mesh, where you select specific vertices and define each set as materials as needed. +- _Note :_ The Y coordinate is up vector in KH2. -_Note :_ The Y coordinate is up vector in KH2. From e73c53c5bd1481113fe77a60216648be473f58e4 Mon Sep 17 00:00:00 2001 From: Zurphing <72351816+Zurphing@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:40:28 -0500 Subject: [PATCH 2/3] Update with additional info for UV Scrolling, SurfaceFlags documented thanks to kenjiuno/Disgustor BAR template, & ground values documented. --- docs/tool/CLI.MapGen/index.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/tool/CLI.MapGen/index.md b/docs/tool/CLI.MapGen/index.md index c16135d48..a35bc2ce3 100644 --- a/docs/tool/CLI.MapGen/index.md +++ b/docs/tool/CLI.MapGen/index.md @@ -205,8 +205,11 @@ textureOptions: ``` ### uvscList - ```yml +# Values to use to control the speed of horizontal and vertical UV scrolling. +# Mapgen doesn't seem to append these values, so they'll need to be added manually. +# Additionally, looping will need to be fixed in the GSInfo portion of the texture that has UV Scrolling. +# The 129th-132nd bytes in that texture control this. uvscList: - index: 0 u: 64000000 @@ -266,11 +269,12 @@ disableBSPCollisionBuilder: true ``` ### surfaceFlags -4 bitflags that control various properties of surfaces. Whether or not Inverse Kinematics should apply, if a player can grab the ledge, etc.
-Grabbable Ledges should only be placed on top of surfaces, some buggier interactions with ledges may occur otherwise.
```yml # Specify `surfaceFlags` to this material. # `0x3f1` is one of floor representation. +# This value is made up of 4 bitflags. +# They control things like whether Inverse Kinematics should apply, if a player can grab the ledge, etc. +# Grabbable Ledges should only be placed on top of surfaces, some buggier interactions with ledges may occur otherwise. - name: 'floor' surfaceFlags: 0x3f1 ``` @@ -300,7 +304,6 @@ Hit_RTN: 0x8 Nohit_Floor: 0x10 Unk: 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xE0, 0x100, 0x120, 0x140, 0x160 ``` -Add up the bits you'll need to get the proper value for your surface; 0x3F1 has Kind(1), Hit_Player, Hit_Enemy, Hit_Flyenemy, Hit_Attack, Hit_Safety, and IK. ### maxColorIntensity @@ -355,20 +358,21 @@ reuseImd: true ``` ### uvscIndex - ```yml +# Index of UV Scrolling values to use. +# These are found at the end of the texture file. +# "_KN5" denotes the end of the number of entries. - name: 'six' uvscIndex: 0 ``` -### ground +### ground Ground value in collision.
These values are used to determine which footsteps to play when walking or running across the collision with that materials name.
Most sound effects will not play without modifying [12soundinfo.bar](/docs/kh2/file/type/12soundinfo.md) for that rooms world.
PAX like water splashes and footprints also depend on the collision having specific values.
For light collision, this is index to `onColorTable[]`. - ```yml - name: 'floor' ground: 1 From 933d6d5909f38b4887fe0629fab1a0222f2efb9c Mon Sep 17 00:00:00 2001 From: Zurphing <72351816+Zurphing@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:50:08 -0500 Subject: [PATCH 3/3] Slight update to "Kind" surface flag --- docs/tool/CLI.MapGen/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tool/CLI.MapGen/index.md b/docs/tool/CLI.MapGen/index.md index a35bc2ce3..2d1cdfbc3 100644 --- a/docs/tool/CLI.MapGen/index.md +++ b/docs/tool/CLI.MapGen/index.md @@ -280,7 +280,7 @@ disableBSPCollisionBuilder: true ``` Bit 1 ``` -Kind: 0x1, 0x2, 0x3, or 0x4 +Kind: 0x1, 0x2, 0x3, 0x4, may go up to 0x0F? Hit_Player: 0x10 Hit_Enemy: 0x20 Hit_Flyenemy: 0x40