Guest User

Infinity: Battlescape, and TrackIR

a guest
Oct 1st, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. DIDDLER9000's Guide to TrackIR in Infinity: Battlescape
  2. Disclaimer: This guide assumes you are already familiar with setting up and using head-tracking solutions in games that officially support them (IE: DCS, Falcon BMS, racing sims, etc). If you are brand-new to head-tracking you may wish to research that subject first.
  3. Other disclaimer: I threw this together quickly mostly from memory. The two programs used here I've also had installed for a long time and the links are just from quick google searches. Let me know in Discord if anything is outdated or incorrect.
  4.  
  5. Infinity: Battlescape took Steam by storm with its recent release, and its simulator feel and HOTAS support really begs for head-tracking to go with it. Unfortunately, the game does not support TrackIR or similar solutions out of the box. The good news is that the game has axis input events for modifying your camera angle. With a bit of trickery, we can use our headtracking as a virtual joystick to control this. If at any point during this tutorial (esp. during vJoy) you are asked to restart your machine, do so before moving on.
  6.  
  7. Resources:
  8. vJoy: http://vjoystick.sourceforge.net/site/index.php/download-a-install/download
  9. FreePIE: https://andersmalmgren.github.io/FreePIE/
  10. TrackIR script: https://forum.ysfhq.com/viewtopic.php?t=8773
  11.  
  12. 1. Verify head-tracking works as-is
  13. Open up TrackIR or your head-tracking application of choice and verify that your current setup allows you to look up, down, left and right with no blind-spots. If you're an avid user of TrackIR you can probably skip this.
  14.  
  15. 2. Install vJoy (http://vjoystick.sourceforge.net/site/index.php/download-a-install/download)
  16. vJoy is a virtual joystick driver that installs a "fake" USB joystick. We will use this to map our head movements to the game. vJoy has documentation available if you need to troubleshoot this step. Once installed, you should use the Configure vJoy application to ensure that at least the X and Y axes are enabled and that Enable vJoy is checked (near the bottom). It does not need buttons or other axes but will not cause problems if they are left on.
  17.  
  18. 3. Install FreePIE (https://andersmalmgren.github.io/FreePIE/)
  19. FreePIE is a program that allows its users to write scripts to emulate input. Don't worry, you're not writing any code here! That will be supplied for you. You do, however, need the program installed to run the script.
  20.  
  21. 4. Verify your head-tracking solution is currently running
  22. TrackIR must be open and running for this to work. If you are using Opentrack or another solution, ensure that it is emulating TrackIR and not its own interface (FaceTrackNoIR has a specific setting for this).
  23.  
  24. 5. Open FreePIE and enter the script
  25. Here is the script in plain text (Credits to windows_x_seven from the YSFHQ forums). Some of the constants are changed here so it is advised to use this and not the one from the link near the top.
  26. =========================
  27. def update():
  28. yaw = filters.mapRange(trackIR.yaw, -180, 180, -vJoy[0].axisMax, vJoy[0].axisMax)
  29. pitch = filters.mapRange(trackIR.pitch, -90, 90, -vJoy[0].axisMax, vJoy[0].axisMax)
  30. vJoy[0].x = yaw
  31. vJoy[0].y = pitch
  32.  
  33. if starting:
  34. trackIR.update += update
  35. =========================
  36. Open FreePIE, go to File -> New, and you should be able to then paste the above block of code into the editor. Save this script so that you can open it later. You can now run the script either by pressing F5 or going to Script -> Run at the top.
  37.  
  38. 6. Verify the script is working properly
  39. Open the Windows Game Controllers dialog (fastest way: press Win+R, type joy.cpl, press enter). You should see an entry labeled vJoy Device if step 2 completed successfully. If you do not, you need to make sure vJoy is correctly installed. If you do, select it, press Properties, and you should see the X/Y axes move with your head. If you see vJoy Device listed but do not see its axes moving with your head, the FreePIE script is either not running or your headtracking is not working properly.
  40.  
  41. 7. Map the controls in-game
  42. Here's the fun part. Open Infinity, go to Options -> Keybinds. Bind the vJoy Device to one of the four open assigned input devices (near the top). Scroll to near the bottom, in the View section, and try to bind SetViewPitch by clicking on it and moving your head up and down. You can do the same for SetViewYaw by moving your head left and right. Invert axes as required (I had to invert pitch, myself).
  43.  
  44. 8. Feel like a cyborg with your cruiser guns slaved to your head
  45. That should be everything you need to do! There was a lot of setup involved but now that you've installed the required software, the only thing you'll need to do from here is make sure the FreePIE script and your head-tracking is running before you start the game.
Add Comment
Please, Sign In to add comment