FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

itsloopyo/yakuza-0-headtracking: An OpenTrack compatible head tracking mod for Yakuza 0 · GitHub

Repository navigation

About

An OpenTrack compatible head tracking mod for Yakuza 0

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Yakuza 0 Head Tracking

An unofficial head tracking mod for Yakuza 0 that moves the camera with your head while your mouse or controller keeps control of movement, driven by a webcam, phone, or any OpenTrack compatible tracker, with no VR headset required.

Features

  • Decoupled look and movement - your head moves the camera, your mouse and controller work as they always did
  • 6DOF tracking - rotation and positional lean
  • Works with any OpenTrack compatible tracker - free options available for PC, iOS and Android

Requirements

  • Yakuza 0 on Steam, latest patch.
  • A head tracking source: OpenTrack with a webcam, VR headset, TrackIR, or a phone tracking app.
  • Windows 10/11, 64-bit.

Installation

Lopari

Download Lopari, choose Yakuza 0, and click Play with head tracking.

Standalone Installer

  1. Download the latest Yakuza0HeadTracking-vX.Y.Z-installer.zip from Releases.
  2. Extract it anywhere.
  3. Double-click install.cmd. It auto-detects your Steam install, places the mod next to Yakuza0.exe, and sets up Ultimate ASI Loader if it isn't already present.
  4. Configure OpenTrack (or your phone app) to output UDP to 127.0.0.1:4242 (see Setting Up OpenTrack).
  5. Launch the game.

If the installer can't find your game, point it at the install folder yourself, either way works:

# Option 1: environment variable
$env:YAKUZA_0_PATH = "D:\Games\Yakuza 0"; .\install.cmd

# Option 2: pass the path directly
.\install.cmd "D:\Games\Yakuza 0"

Manual Installation

For users who prefer to place files by hand:

  1. Download Ultimate ASI Loader (Win64 dinput8.zip), extract dinput8.dll, rename it to winmm.dll, and place it in media\ next to Yakuza0.exe.
  2. Place Yakuza0HeadTracking.asi (from the installer ZIP's plugins\ folder) in the same media\ folder.

Alternatively, the Nexus ZIP (Yakuza0HeadTracking-vX.Y.Z-nexus.zip) extracts directly into the game's install folder; it contains only media\Yakuza0HeadTracking.asi, so you still need an ASI loader installed.

Setting Up OpenTrack

The mod listens for OpenTrack pose data on UDP port 4242, on every network interface. One datagram is six little-endian 64-bit floats in the order x, y, z, yaw, pitch, roll: position in centimetres, rotation in degrees, 48 bytes in total. Anything that sends that to that port drives the view. OpenTrack's UDP over network output sends exactly this, and the steps below set it up.

  1. Install OpenTrack.
  2. Pick a tracker under Input, using the notes below.
  3. Set Output to UDP over network, host 127.0.0.1, port 4242.
  4. Press Start. Tracking and the game can start in either order.

Webcam

OpenTrack ships a neuralnet tracker input that reads a plain webcam. Select it under Input, pick your camera in its settings, and use the output settings above. How well it tracks depends on your camera and your lighting, so try it before buying anything.

Phone

A phone app can reach the mod directly, with no OpenTrack on the PC, if it sends the datagram described above. Point it at this PC's IP address (run ipconfig to find it) on port 4242. Not every phone tracker speaks this protocol, so check yours for an OpenTrack or UDP output option first. Headcam sends it, and I wrote it so decent tracking is free for anyone who already owns a phone.

Sending direct works when the app filters its own signal on the device. The mod's smoothing is sized to take the edge off a clean signal rather than to rescue a noisy one, so a raw feed sent direct will jitter. If it does, point the app at OpenTrack's UDP over network input on some other port, say 5252, and let OpenTrack's filters and curves clean it up before its output forwards to 127.0.0.1:4242.

Anything arriving from outside 127.0.0.0/8 counts as a remote connection and is smoothed with RemoteSmoothing rather than LocalSmoothing. That includes a tracker on this very PC that sends to the machine's own LAN address, because the mod reads the source address and not the machine.

Headset or other hardware

If your device has an OpenTrack input driver, select it under Input and use the same output settings. OpenTrack's own Input list is the authority on what it can read; the mod only ever sees what OpenTrack sends.

Centring

Centring belongs to your tracker. The mod subtracts no centre of its own: it applies the pose it receives exactly as it arrives, so a stream of zeros holds the view where the game itself puts it. Press the centre control in your tracker (OpenTrack's Center bind, or the CENTER button in Headcam) and the tracker zeroes its own output, which leaves the view centred with the mod doing nothing.

That is why there is no centre hotkey here and nothing to re-centre in game. Two centres in series would drift apart, because each side re-centres at moments the other cannot see, and you would end up pressing twice to centre once. If the view sits off to one side, centre it in the tracker.

Controls

Two equivalent binding sets - use whichever your keyboard has. These are the defaults of the key lists in CameraUnlock.ini (see Configuration), where each key, chords included, can be rebound or removed:

Action Nav-cluster Chord
Toggle tracking End Ctrl+Shift+Y
Cycle tracking mode Page Up Ctrl+Shift+G
Toggle yaw mode Page Down Ctrl+Shift+H

There is no recenter key. The mod applies the pose your tracker sends as-is, so centre it in the tracker app: OpenTrack's Center bind, or the CENTER button in Headcam.

Page Up / Ctrl+Shift+G cycles tracking mode:

  1. Normal head-tracked gameplay
  2. Positional tracking disabled, rotational tracking enabled
  3. Rotational tracking disabled, positional tracking enabled
  4. Back to normal

Page Down / Ctrl+Shift+H toggles between world-space (horizon-locked) yaw and camera-local yaw.

The tracking mode and the yaw mode are saved to CameraUnlock.ini the moment they change, so they come back at the next launch. End / Ctrl+Shift+Y changes the current session only: tracking starts on or off as EnableOnStartup says.

Configuration

The mod reads its settings from media\CameraUnlock.ini in the game folder, and creates the file when it starts and finds none. Edit it with any text editor.

A setting set to default takes its value from Defaults.ini, which every head tracking mod that keeps its settings in CameraUnlock.ini reads. Head tracking mods that keep their settings in another file do not read it. Writing a value in place of default changes that setting for this game only. When the mod saves a setting that a hotkey changed in game, it writes the new value in place of default, so that setting no longer follows Defaults.ini in this game until you set it to default again.

Defaults.ini is %AppData%\CameraUnlock\Defaults.ini on Windows; $XDG_CONFIG_HOME/CameraUnlock/Defaults.ini on Linux, or ~/.config/CameraUnlock/Defaults.ini where XDG_CONFIG_HOME is not set, under Wine and Proton too; and ~/Library/Application Support/CameraUnlock/Defaults.ini on macOS. The mod's log, where it writes one, names the file it read.

When the mod starts and finds no Defaults.ini, it creates one holding the built-in values, unless Windows runs the game as a packaged app. The mod never changes Defaults.ini after that. Edit it with any text editor.

The built-in value of each setting set to default below:

  • UdpPort=4242
  • EnableOnStartup=true
  • WorldSpaceYaw=true
  • RotationEnabled=true
  • LocalSmoothing=0.0
  • RemoteSmoothing=0.15
  • PositionEnabled=true
  • PositionLimitX=0.3
  • PositionLimitY=0.2
  • PositionLimitYDown=0.2
  • PositionLimitZ=0.4
  • PositionLimitZBack=0.1
  • ToggleKey=End, Ctrl+Shift+Y
  • CycleTrackingModeKey=PageUp, Ctrl+Shift+G
  • YawModeKey=PageDown, Ctrl+Shift+H

With every setting at its default, the file reads:

; Yakuza 0 head tracking settings.
; Comments start with ; and go on their own line. Text after a value is part of the value.
; Hotkeys are key names such as End, PageUp or Ctrl+Shift+Y. Separate several with commas; leave empty for none.
; A setting set to default takes its value from Defaults.ini, which every head tracking mod
; that keeps its settings in CameraUnlock.ini reads: %AppData%\CameraUnlock\Defaults.ini on
; Windows, $XDG_CONFIG_HOME/CameraUnlock/Defaults.ini (normally ~/.config/CameraUnlock) on
; Linux, under Wine and Proton too, and ~/Library/Application Support/CameraUnlock/Defaults.ini
; on macOS. The log names the file it read. Write a value instead of default to change that
; setting for this game only.

[CameraUnlock]
; Written by the mod. Leave this section in place.
ConfigFormat=1

[Network]
; UDP port the mod receives tracker data on (OpenTrack protocol).
UdpPort=default

[General]
; true: head tracking is on when the game starts. ToggleKey turns it on and off.
EnableOnStartup=default
; true: yaw turns around the world's up axis. false: around the camera's own up axis.
WorldSpaceYaw=default
; true: turning your head turns the view.
; Tracking mode at startup, with PositionEnabled. The mode hotkey changes both.
RotationEnabled=default

[Smoothing]
; Smoothing when the tracker runs on this PC. 0 is the least, 1 the most.
LocalSmoothing=default
; Smoothing when the tracker is another device on the network, such as a phone.
; 0 is the least, 1 the most.
RemoteSmoothing=default

[Position]
; true: moving your head moves the view.
; Tracking mode at startup, with RotationEnabled. The mode hotkey changes both.
PositionEnabled=default
; How far, in metres, leaning left or right can move the view.
PositionLimitX=default
; How far, in metres, raising your head can move the view.
PositionLimitY=default
; How far, in metres, lowering your head can move the view.
PositionLimitYDown=default
; How far, in metres, leaning forward can move the view.
PositionLimitZ=default
; How far, in metres, leaning back can move the view.
PositionLimitZBack=default

[Hotkeys]
; Turns head tracking on and off.
ToggleKey=default
; Changes the tracking mode: rotation and position, rotation only, position only.
CycleTrackingModeKey=default
; Switches yaw between the world's up axis and the camera's own (WorldSpaceYaw).
YawModeKey=default

Troubleshooting

Mod not loading:

  • Check for Yakuza0HeadTracking.log in media\ next to Yakuza0.exe after launching the game. If it's missing, the ASI loader isn't engaging; re-run install.cmd.
  • The log is rewritten from scratch on every launch and the launch before it is kept as Yakuza0HeadTracking.prev.log, so it is safe to attach as-is. udp: First UDP packet received is the line that confirms your tracker's data reached the game.
  • Verify both winmm.dll and Yakuza0HeadTracking.asi are in media\.

No tracking response:

  • Confirm OpenTrack's output is UDP over network to 127.0.0.1, port 4242, and that OpenTrack is started.
  • Make sure only one source is sending to port 4242 (don't run a phone app and OpenTrack at the same time pointing at the same port).
  • Tracking may have been toggled off; press End (or Ctrl+Shift+Y).
  • The game pauses when its window loses focus, so keep it focused while testing.

Jittery / unstable tracking:

  • Enable a smoothing filter in OpenTrack (Accela is the default and works well).
  • Wireless phone trackers on congested WiFi can stutter; move closer to the router or switch to a webcam tracker.

Yaw feels wrong when looking up or down at extreme angles:

  • Try toggling between world-locked and camera-local yaw with Page Down. World-locked (default) is horizon-stable; camera-local follows the camera's current up-axis.

Updating

Download the new release and run install.cmd again. Your config is preserved.

Uninstalling

Run uninstall.cmd from the installer ZIP. This removes the mod files and leaves your settings in media\CameraUnlock.ini. The ASI loader is only removed if the installer put it there; use uninstall.cmd /force to remove it anyway.

Building from Source

Requires Visual Studio 2022 Build Tools, CMake 3.20+, and pixi.

git clone --recurse-submodules https://github.com/itsloopyo/yakuza-0-headtracking
cd yakuza-0-headtracking
pixi run build
pixi run test
pixi run package

Community & Support

  • Discord: Loop's Head Tracking Hangout - setup help, bug reports, and new-release announcements
  • Lopari - free Windows launcher with one-click install and launch for the released head-tracking mods
  • Headcam - free app that turns your iPhone or Android phone into the head tracker

License

MIT License - see LICENSE for details. Third-party components are listed in THIRD-PARTY-NOTICES.md.

Credits

Disclaimer

This mod is not affiliated with, endorsed by, or supported by Ryu Ga Gotoku Studio or Sega. Use at your own risk.

About

An OpenTrack compatible head tracking mod for Yakuza 0

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL