PDA

View Full Version : TrackIR/Freetrack FOV control


lelek
04-19-2011, 08:00 PM
Hello everybody,

Just wanted to post a request to the dev's to implement an option to control Field of View (Zoom) with z-axis movements of TrackIR/Freetrack instead of moving back and forth in the cockpit.

I'think this setup would greatly improve my dogfighting skills since abrupt changes of FOV settings with a button usualy make me lose sight of the enemy.

For me it would be a much better sollution to use head tracking for FOV change and a button for toggling different, useful "center" spots around the cockpit.

Maybe someone in the community already has a workaround for this? GlovePIE or PPJoy maybe?

Thanks, I'm enjoing the game and hope the rest of the problems clear up easily.:wink:

1.JaVA_Platypus
04-19-2011, 09:01 PM
To tell you the truth, I think this is highly preferential. I have the wide/medium/close views programmed on a POV hat on my joystick and the SHIFT F1 as well. I've been using this set-up with Il-2 (1946) for years. So, I hope they don't change it ;)

Extreme_One
04-19-2011, 09:46 PM
To tell you the truth, I think this is highly preferential. I have the wide/medium/close views programmed on a POV hat on my joystick and the SHIFT F1 as well. I've been using this set-up with Il-2 (1946) for years. So, I hope they don't change it ;)

That's exactly what I do too. :cool: Perfect.

I'm not trying to stifle other's choices but just saying what works for me.

Dazzed DJ
04-20-2011, 12:12 AM
I also have track IR 5 and use the FOV change on joystick, I find it more helpful the way it is, sorry. Also if you zoom in with the FOV do you notice that dots at exteam distance disapear or become to small to see so the wide setting is best for looking for others while the close good for targeting work. :).
I am not saying that your option does not mater mate but am adding my 2c to the debate. Maybe if there is an option box to have it one way or the other, that is when the development team has fixed the major bugs. :)

brando
04-20-2011, 12:56 AM
I gave up using the FoV three positions and instead used the incremental 'zoom' toggle and the Shift+F1 option. I also use TIR_5 and the pro-clip, but the head forward and back isn't working well. Maybe I need to use the Loosen straps command to make it work properly - just a thought?

MadBlaster
04-21-2011, 08:51 AM
This might work for you OP. Glovepie script just wrote for myself today. Allows you to zoom FOV style with your hat at 90 degrees, and snap back to FOV 90 with hat at 270 degrees. You need to measure your monitor height in mickeys and substitute your numbers for what I have in there. You do this with the debug command in Glovepie (i.e., debug=mouse.DirectInputY). Using your up/ down arrow keys, starting at the top and scrollling down to the bottom...note the difference in mickeys and put that number in the script in place of what I have. See my notes for rest. It's a bit clunky but it does the job.:grin:

*GLOBAL
var.mcx=640/2 //game resolutions
var.mcy=480/2//game resolutions

if var.mcy=480/2 then //changes zoom variable when game resolution changes
var.mckmstr=480
elseif var.mcy=600/2 then
var.mckmstr=600
elseif var.mcy=768/2 then
var.mckmstr=768
elseif var.mcy=864/2 then
var.mckmstr=864
endif

*ZOOM [HotKey viewset]
if (joystick1.pov1=90.00 and var.a=0) then
key.PageDown=true //FOV to 90
key.PageDown=false
mouse.cursorposx=var.mcx //initilze cursor, var.mcx and var.mcy equal to game resolution divided by 2 so that mouse cursor is centered.
mouse.cursorposy=var.mcy
mouse.cursorposy=0 //intialize mickey count
var.mick=mouse.DirectInputY //initialize mickey count
var.a=1 //start action
endif
if (joystick1.pov1=90.00 and var.a=1) or (joystick1.pov1=90.00 and var.a=2) then //action
key.Alt=true //"hold to adjust field of view" mapped to Alt-Z
key.Z=true
mouse.DirectInputY=mouse.DirectInputY+20 //cursor moves -y direction, sensitivity set here
endif
if (abs(mouse.DirectInputY)-abs(var.mick) > var.mckmstr) and var.a=1 then //first stage ends
key.Delete=true //opens the door to further zoom
key.Delete=false
mouse.cursorposx=var.mcx //initilze cursor, var.mcx and var.mcy equal to game resolution divided by 2 so that mouse cursor is centered.
mouse.cursorposy=var.mcy
mouse.cursorposy=0 //initialize mickey count
var.mick=mouse.DirectInputY //initialize mickey count
var.a=2 //kick back to action
endif
if (abs(mouse.DirectInputY)-abs(var.mick) > var.mckmstr) and var.a=2 then //second stage ends
var.a=3
key.Alt=false //job done, turn off now
key.Z=false
endif
if released(joystick1.pov1=90.00) then
var.a=0 //reinitialize variables to do it again
var.mick=0
mouse.DirectInputY=0
key.Alt=false
key.Z=false
mouse.cursorposx=var.mcx //initilze cursor, var.mcx and var.mcy equal to game resolution divided by 2 so that mouse cursor is centered.
mouse.cursorposy=var.mcy
endif
if (joystick1.pov1=270.00) then //snap back to FOV 90
key.PageDown=true
key.PageDown=false
endif

lelek
04-21-2011, 04:35 PM
Thanks MadBlaster! I'll certainly give that a try. I knew there was somebody out there who's got the nerves to solve this.:grin:

Now it would be great if the dev's could implement a feature for someone to replace me at work while I stay at home and play CoD.:grin:

SFF_Karhu
04-21-2011, 06:01 PM
Hi lelek.

I use this JoyToKey (http://forum.1cpublishing.eu/showthread.php?t=20399&page=2) thing to incremental zoom. Have to press only 2 keys on my joystick, one to zoom in and the another to zoom out. Works fine for me. Like Sans fov changer (http://il2fovchanger.byethost7.com/)in Il-2 sturmovik, and you can adjust the speed of changing fov.

jimbop
04-21-2011, 09:41 PM
Discussed (with solutions) in thus thread: http://forum.1cpublishing.eu/showthread.php?t=20697

335th_GRAthos
04-22-2011, 06:57 PM
That's exactly what I do too. :cool: Perfect.

I'm not trying to stifle other's choices but just saying what works for me.

+1

lelek
04-24-2011, 04:47 PM
Ok. I've managed to work out something that works for me.
I'm using this little GlovePIE script:

PIE.FrameRate = 108 Hz
if Pressed(q) then
if var.a=1 then
var.a=0
Release(Mouse.MiddleButton)
Else
var.a=1
Key.End = True
Key.End = False
endif
endif

if var.a=1 then
Mouse.MiddleButton = True
Mouse.DirectInputY = RealTrackIR.z * 6
endif

For this to work you have to map middle mouse button to "Hold to adjust FOV" setting within CoD, and put z-axis sensitivity in FreeTrack to minimum (this basicaly swiches off back and forth movement in cockpit). (For some reason FakeTrackIR.z = 0 didn't work. This is a workaround).

How it works is when you press the "q" button z-axis will controll FOV but you won't be able to use the mouse until you press "q" again to regain control of the mouse and that's about it.
You can play with the number - (* 6) to adjust sensitivity or change the buttons if you want.

MadBlaster
04-25-2011, 12:15 AM
Right on guy:!: I guess you have 3 point cap? I'm only single point, so no Z axis data. Anyway, it's good to see another guy figure it out. We will conquer CLOD in short order.

lelek
05-04-2011, 08:52 PM
It's me again and I’ve got a new script!
I know no one really cares, but I think it’s brilliant and just need to share with the World. Anyway, I’ll need to break this up a bit for clarity.

What it does:
1. Press space and your center view will shift to the right to line up with the gun sight. Press space again and you’re back to center view. In my opinion this completely resolves issues with German gun sights some people were complaining about.
2. I’m kind of a lazy guy, so when being chased by an opposing fighter (which is most of the time) it’s a bit of a hassle for me to look behind AND lean to the side in order to see around the back seat. That’s why I’ve made the script do the leaning for me while looking towards the back of the plane. And this is done almost imperceptibly I might add.
3. By pressing the middle mouse button you can switch to FOV mode. In this mode you control smooth FOV adjustments with z-axis movement of Freetrack/TIR devices. Actually z-axis movements move your in game head back and forth AND adjust FOV simultaneously. And you can modify the amount at witch one happens over the other (ratio of head movements over FOV adjustment) to suit your preferences. Press the middle mouse button again to regain control of the mouse and click on switches.

How to set it up:
1. Within Il-2 Cliffs of Dover go to Options – Controls – Camera and set “Hold to Adjust Field of View” to “Mouse Middle” and in Aircraft unbind “Space” which is bound by default to “Fire Guns (Machine Guns)”
2. In Freetrack uncheck all of the “View relative translations” check boxes in Profile – Advanced or if you’re using TIR – switch off TrueView. The script already incorporates view relative translations so leaving these options on would produce unpredictable results.
3. Download and install GlovePIE (don’t know the site. Just Google it, you shouldn’t have trouble finding it – it’s free).
4. Run your head tracking software before launching GlovePIE, copy and paste the following script into GlovePIE and press “Run”. After that launch Cliffs of Dover.

PIE.FrameRate = 120 Hz
If Released(Mouse.MiddleButton) then
If var.a = 1 then
var.a = 0
Else
var.a = 1
Key.End = True
Key.End = False
Endif
Endif

If Pressed(Space) then
If var.b = 1 then
var.b = 0
var.xx = 0
Else
var.b = 1
var.xx = 0.02
Endif
Endif

if var.a = 1 then
Mouse.MiddleButton = True
Mouse.DirectInputY = RealTrackIR.z * 0.6
EndIf

var.k = 0.08
If RealTrackIR.yaw > 90 Then
var.x = (- sin(RealTrackIR.yaw) + 1) * (var.k - var.xx)
ElseIf RealTrackIR.yaw < -90 Then
var.x = (- sin(RealTrackIR.yaw) - 1) * (var.k + var.xx)
Else
var.x = 0
EndIf

FakeTrackIR.x = var.xx + var.x + (RealTrackIR.x * cos(RealTrackIR.yaw) * cos(RealTrackIR.roll) + RealTrackIR.y * (-1 * cos(RealTrackIR.pitch) * sin(RealTrackIR.roll) + sin(RealTrackIR.pitch) * sin(RealTrackIR.yaw) * cos(RealTrackIR.roll)) + RealTrackIR.z * (sin(RealTrackIR.pitch) * sin(RealTrackIR.roll) + cos(RealTrackIR.pitch) * sin(RealTrackIR.yaw) * cos(RealTrackIR.roll)))

FakeTrackIR.y = RealTrackIR.x * cos(RealTrackIR.yaw) * sin(RealTrackIR.roll) + RealTrackIR.y * (cos(RealTrackIR.pitch) * cos(RealTrackIR.roll) + sin(RealTrackIR.pitch) * sin(RealTrackIR.yaw) * sin(RealTrackIR.roll)) + RealTrackIR.z * (-1 * sin(RealTrackIR.pitch) * cos(RealTrackIR.roll) + cos(RealTrackIR.pitch) * sin(RealTrackIR.yaw) * sin(RealTrackIR.roll))

FakeTrackIR.z = RealTrackIR.x * (-1 * sin(RealTrackIR.yaw)) + RealTrackIR.y * sin(RealTrackIR.pitch) * cos(RealTrackIR.yaw) + RealTrackIR.z * cos(RealTrackIR.pitch) * cos(RealTrackIR.yaw)

FakeTrackIR.pitch = RealTrackIR.pitch
FakeTrackIR.yaw = RealTrackIR.yaw
FakeTrackIR.roll = RealTrackIR.roll

5. There is one other thing to look out for if you want GlovePIE to emulate TIR properly. After running the script for the first time type regedit and look for the key: HKEY_CURRENT_USER\Software\NaturalPoint\NATURALPOI NT\NPClient Location. There should be two path values inside: one is the GlovePie “Path” which tells games where to find NPClient.dll library and the other is labeled “RealPath” which tells GlovePIE where the real NPClient.dll is so it can emulate it. Anyway. If you don’t find this, or if you only have the “Path” value (GlovePIE should create this automatically the first time you run a “FakeTrackIR” script but this didn’t happen for me, hence this explanation) create a FakeTrackIR.reg file with notepad, write the following into it and run it:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\NaturalPoint\NATURALPOI NT\NPClient Location]
"Path" = "C:\\Insert\\GlovePIE\\NPClient\\Directory\\Here"
"RealPath" = "C:\\Insert\\FreeTrack\\or\\TrackIR\\NPClient\\Dire ctory\\Here"

How to adjust parameters to your liking:
1. var.xx = 0.02 is by how much you want to move to the right to line up the gun sight (negative values move left). The value 0.02 works for the Bf 109 so you might have to change this for other planes.
2. var.k = 0.08 is by how much you want to move to each side while looking back towards the tail of the plane. Feel free to experiment with it to see what works best for you (setting var.k = 0 turns this feature off).
3. The line “Mouse.DirectInputY = RealTrackIR.z * 0.6” has a factor of 0.6 which is really the ratio between in-game z-axis head movement and FOV adjustment sensitivity. This factor is used in combination with your z-axis sensitivity settings within Freetrack or TIR software and is most prone to experimentation. I use Freetrack and my z-axis sensitivity is at 0.3 with tons of smoothing (200 local and 150 global) and a large soft-zone curve, so if you find the FOV changes are too violent for you try reducing this number and vice versa.
4. If you don’t like view relative translations a.k.a. ”TrueView” type behavior just delete the lines which start with FakeTrackIR.x, FakeTrackIR.y and FakeTrackIR.z with a lot of sin-cos stuff and instead put in:

FakeTrackIR.x = var.xx + var.x + RealTrackIR.x
FakeTrackIR.y = RealTrackIR.y
FakeTrackIR.z = RealTrackIR.z

That’s it. Simple really.:mrgreen: Try it out and tell me what you think.

Figura
04-30-2012, 10:41 PM
Good idea ;-)