Viewing Collision

From Ōkami Speedrun Wiki
Revision as of 18:14, 17 February 2025 by Auride (talk | contribs) (Adding link to the Collision images category)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Note: This page pertains to Reverse Engineering of Okami.

Introduction

Okami stores collision data in various file formats. Using the tools found here, these can be collected into .gltf files separated by map.

Navigating .gltf collision files with Blender 4.x

  1. Open Blender (v4.0?)
  2. Press esc to close the welcome dialog.
  3. Click anywhere in the viewport
  4. Press a to select everything (the camera and the cube) then Del to delete everything.
  5. Click File in the top left, then Import, then glTF 2.0
  6. Navigate to the .gltf file of the map you want to look at. Double click to import it.
  7. Press n which will open a sidebar on the right of the viewport. Click on the "View" tab (written in sideways vertical text).
  8. Set "Click Start" to 1m and "End" to 100000m (add 2 zeroes).
  9. Anywhere in the viewport, hold down middle click and drag around to pan the viewport camera. Look for the level collision. It might be all around you or it might be far away. Scroll up or down to zoom so you can see everything (more-or-less).
  10. In the "Scene Collection" menu in the far top right of the window, SHIFT CLICK on the eye icon of the group called "Scenery" and the one which ends with .SCI. This will remove the green parts (the polygons the level textures are painted onto, which aren't true collision) and the red boxes (not sure what those mean tbh). You may also want to disable things like the "Bit Flag" (often used for setting which audio layers are playing), the "Examine" group (for reading signs), the .SCA group (for merchants and similar static NPCs?). The "Collision" and "Exit" (loading zone) groups are the most important.
  11. Click on any object to highlight it, then press a to select every object, then right click anywhere and press "Shade Flat". This will remove the default smoothing blender applies, which makes it easier to see the exact polygons.
  12. Click Edit in the top left, then Preferences, then go to the Navigation tab on the left, scroll down and expand "Fly & Walk" click "Walk", make sure Gravity is unchecked, click Walk, and set Walk Speed to 100 m/s (max).
  13. While still in the Preferences window, click "Keymap" on the left, then search "fly" and check what the key bind is set to. I have it set to Shift+`. If it's not set to anything, set it to something you'll remember.
  14. Close the preferences menu.
  15. Press your Walk/Fly bind. Press w to start moving around in the level. Scroll up on the mouse wheel until you start moving at a reasonable speed (takes like 10 scrolls for me). From there you can use wasd to move forward, left, backwards, and right (respectively) relative to the camera angle. You can use q and e to move directly up and down regardless of camera angle. You can also hold shift to move faster and alt to move slower.
    • Left clicking will take you out of Walk/Fly mode but maintain your camera angle. Right clicking will instead reset your view to what it was before enabling Walk/Fly mode. Middle clicking will zoom you directly to the wall you're looking at.
    • When not in Walk/Fly mode, you can use shift+middle click to pan around perpendicularly to the view direction. This is especially useful when looking down.
    • If you ever get a circle around your mouse, it's probably because you pressed w while not in Walk/Fly mode. You can fix it by pressing w a few more times until the Select tool (in the top left of the viewport) is "Select Box" instead of "Select Circle". You can also just click and hold on the Select Tool icon to change it.
  16. Move and angle the camera to the point where you want to take an image of the collision.
  17. If there is extra collision in the way which you want to remove, you can click on the object and press Del to get rid of it, h to hide it (though you might have trouble finding it to unhide it), or m then "Collection" to move it to the top Collection in the scene, from where you can hide it using the eye button in the collection menu in the top right.
    • If you only want to hide part of an object (e.g. the upper polygons of a large level object) you can click "Object Mode" in the top left of the viewport, then select "Edit mode". This will show all of the vertices. From there, click and drag with the left mouse button to highlight vertices you want to remove and press Del, then click "Vertices" to remove them.
    • You can also change the color/transparency of an object. After selecting it, in the left sidebar of the bottom right window sidebar, click the red circle "Material" icon (second from the bottom). In the top right of that window sidebar, press the minus "-" button to remove the default material (e.g. "Collision"), then the "+ New" button to add a new material. Expand the "Viewport Display" section and click on the Color field to select the color. You can share that material with other objects if you want them to all have the same color.
    • If you want to recolor just part of an object, you can select all the relevant vertices in Edit Mode, right click and click "Separate > Selection", go back to Object Mode, click to select just the object you just separated, m to re-parent it to another collection, then follow the same above steps to change its material color.
  18. To get an orthographic view, Click on one of the directions in the XYZ tool in the top right of the viewport. +Z is the most useful, as it looks straight down, just like the in-game map. You can then scroll up/down to adjust zoom, and shift+middle click to pan the view.
  19. Once you have your desired view in the viewport, press "View" in the top left of the viewport (next to "Object Mode"), then click "Viewport Render Image". This will bring up another window with a copy of what you see in the viewport, but without the UI, at the resolution of your display. Then press ctrl+s to save it where you want. You can then edit the image in any photo editing software.
  20. Press Esc or hit the X button in the top right of the window to close it, then go back to Blender to adjust your view and take more images.

If you upload collision images to this wiki, please place them under the Category:Collision Images Category.