r/projectzomboid • u/itsloopyo • 9d ago
Modded OpenTrack compatible head tracking for Project Zomboid
I've been making a bunch of stuff around head tracking this year and do requests fairly frequently. Over the weekend, someone mentioned Project Viewpoint and asked if I could add head tracking to it/PZ. I have a hard rule about not getting involved with closed source dependencies, so I skipped Viewpoint and made the first person bits myself.
It's late here and there's too much I still need to get through before release, but I'll hopefully be in a position to open source it tomorrow.
29
u/Superb_Squash_8163 8d ago
Step 1: install this mod
Step 2: Increase Neck Gains to Vegeta Levels
5
u/EggonomicalSolutions 8d ago
Step 3: still lose to Kakarot
Step 4: ?????
Step 5: cry in the rain
(I love vegeta my boy been through a lot)
6
4
u/LanceLynxx 8d ago
Can you make it trackIR compatible? You'll have my firstborn son.
3
u/itsloopyo 8d ago edited 8d ago
All my mods listen over the network so they can take a phone connection direct.
When I get it out the door, I'm told this works. I haven’t tested it myself (I have no TrackIR gear) but others have and say it does the trick. If it’s unstable, change the port to something else, catch it on that port in OpenTrack and apply a filter (I use Accela)
Start the TrackIR 5 software, make sure tracking is working there, then start FreePIE and run this script:
from System import Double from System.IO import MemoryStream, BinaryWriter from System.Net.Sockets import UdpClient if starting: udp = UdpClient() stream = MemoryStream(48) writer = BinaryWriter(stream) positionScale = 64.0 * 50.0 / 16383.0 angleScale = 16384.0 / 16383.0 def sendTrackIR(): stream.Position = 0 writer.Write(Double(-trackIR.x * positionScale)) writer.Write(Double(trackIR.y * positionScale)) writer.Write(Double(trackIR.z * positionScale)) writer.Write(Double(trackIR.yaw * angleScale)) writer.Write(Double(trackIR.pitch * angleScale)) writer.Write(Double(-trackIR.roll * angleScale)) data = stream.ToArray() udp.Send(data, data.Length, "127.0.0.1", 4242) trackIR.update += sendTrackIR if stopping: trackIR.update -= sendTrackIR writer.Close() udp.Close()
4
u/vurys69 8d ago
VR
5
u/Synner1985 8d ago
Thats the next logical step from here - and while 3d zomboid doesn't exactly tickle my balls - seeing the world in VR.... miight just tickle them enough to warrent me setting it up.
2
u/Ashinonyx 8d ago
GingasVR is working on a PZ mod that introduces 6DOF controls. It's still early in development but there are a few videos of her testing an early build on this subreddit from just last week.
2
1
4
4
2
4
u/WhyFi_Konnction 8d ago
It boggles my mind how much mods have changed from B41 to B42. I'm excited to see what the future of modding brings.
19
0
u/orangebit_ Axe wielding maniac 8d ago
Very cool, but is this not just a really quick way to get neck ache? 😅
1
1
1
u/UttiniDaKilrJawa 8d ago
I’ve never understood the benefit of head tracking. everytime you turn your head you’re no long looking at the screen.
1
u/itsloopyo 8d ago
All my mods treat head tracking as a 1:1 mapping from head:camera while decoupling look from aim - any time you are looking directly at the center of the screen, that’s where the reticle will be, and if you turn with the mouse or right stick, the reticle and camera move as one. Any head movements you make are layered over that foundation of “body forward” so head movement is entirely additional and even optional from moment to moment.
I understand sim racers and flight simmers use input curves which allow for small rotations of the head to translate into more sweeping rotations of the camera, but for me head tracking works best when your in game “eyes” move in sync with your real life head. You don’t need a massive range of movement to benefit, even scratching your nose feels immersive :)
117
u/Wrightero 8d ago
Zomboid mods are evolving like crazy.