CTR-tools / CTR-tools

Crash Team Racing (PS1) tools - a C# framework and a set of tools by DCxDemo to parse files found in the original kart racing game by Naughty Dog (and a bit of Crash Bash too).
https://discord.gg/WHkuh2n
GNU General Public License v2.0
158 stars 14 forks source link

[lev] Investigate array referred to as VisData #31

Open DCxDemo opened 4 years ago

DCxDemo commented 4 years ago

At this point we know this array is a kind of BSP tree used to render QuadBlocks. Defines sets of visible quads from every other quad in the level. Every node stores a bounding box. Rendered bounding boxes loosely repeat the level shape. Every node has some flag, denoting node type. Some nodes store links to leaves.

DCxDemo commented 3 years ago

format progress so far 111

DCxDemo commented 3 years ago

It was figured out that water effect is controlled by bit1 in node flags value. Turning that on renders everything as water. Rest is unknown, but bits 3 and 4 somehow affect the subdivision.

DCxDemo commented 2 years ago

bits 3 and 4 reduce 4x4 subdivision down to 4x1 and 4x2 respectively. bit6 correctly hides all invisible meshes

DCxDemo commented 2 years ago

"can point to some data" on the screenshot is assumed to link to another list of nodes for instanced models. this way the game knows how to collide with instances (boxes, signs, etc)

DCxDemo commented 1 year ago

it was figured the general approach is similar to Quake's BSP/PVS, every quad is linked to the chunk of bitstream data that describes what is visible from this point and what not.