Page 1 of 1

Unrestricted 6DOF with TIR

Posted: Tue Mar 30, 2010 5:19 pm
by Lawndart
FC2 now allows you to use TIR with 6DOF even for the aircraft without 3D cockpits. The Black Shark already has 6DOF, and after looking in the server.lua if you copy the code for the KA-50 to the other planes it allows you to have full 6DOF even in the F-15 (and other planes). There will be some "gaps" behind the dash and some missing parts since the cockpits are still 2D (unlike the Black Shark's 3D cockpit), but this tweak allows you to have full 6DOF control and the ability to lean around the canopy bow!

Edit your server.lua as follows (and don't forget to backup your original file first):

Find these original contents of the server.lua

Code: Select all

limits_6DOF = {}
limits_6DOF[PlaneIndex.iSu_27]   = old_aircrafts_6DOF
limits_6DOF[PlaneIndex.iSu_33]   = old_aircrafts_6DOF
limits_6DOF[PlaneIndex.iSu_25]   = old_aircrafts_6DOF
limits_6DOF[PlaneIndex.iSu_39]   = old_aircrafts_6DOF
limits_6DOF[PlaneIndex.iMiG_29]  = old_aircrafts_6DOF
limits_6DOF[PlaneIndex.iMiG_29K] = old_aircrafts_6DOF
limits_6DOF[PlaneIndex.iA_10]    = old_aircrafts_6DOF
limits_6DOF[PlaneIndex.iF_15]    = old_aircrafts_6DOF
limits_6DOF[PlaneIndex.iKA_50]   = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
Replace the lines above with:

Code: Select all

limits_6DOF = {}
limits_6DOF[PlaneIndex.iSu_27] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.20,0.20},roll = 90.0}
limits_6DOF[PlaneIndex.iSu_33] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
limits_6DOF[PlaneIndex.iSu_25] = {x = {-0.02,0.15},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
limits_6DOF[PlaneIndex.iSu_39] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
limits_6DOF[PlaneIndex.iMiG_29] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
limits_6DOF[PlaneIndex.iMiG_29K] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
limits_6DOF[PlaneIndex.iA_10] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
limits_6DOF[PlaneIndex.iF_15] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
limits_6DOF[PlaneIndex.iKA_50] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
Basically, what's done here is copying the line for 6DOF used for the KA-50 found in the original file and using it for all the other airplanes too (instead of the value [= old_aircrafts_6DOF]). You can also change the values to limit the x-, y-, z-, and roll- axes for 6DOF as needed when testing.

For example, to limit 6DOF roll try lowering the value from 90. 0 degrees to 70. 0 for example. You can also limit the other 6DOF limits to find more realistic limits for how much a pilot would be able to move his head around inside the F-15 cockpit with a helmet on. We may want to lower some of the values to reduce 2D cockpit clipping also, but still be able to lean around the canopy bow!

Posted: Wed Mar 31, 2010 12:48 am
by Lawndart
All this is just a start. The parameters need to be adjusted to each aircraft to avoid too much travel of the axis.

Su-25 example posted at the ED boards:


Realistically 'up/down' should have the least motion, followed right up with 'forward/back' which should be fairly restricted, and only left/right should be significantly less restricted (0.1 works, you might want to try up to 0.15).

Source.

Posted: Wed Mar 31, 2010 1:06 am
by Lawndart
Azrayen wrote:So far, I find the following values are good, no (not too much) cockpit bugs (missing panels...), more freedom left/right to avoid canopy 'arch' (?), and light tweaking on other axis.
Instead of changing each aircraft individually in the server.lua, edit the "local old_aircrafts_6DOF" instead. Find the following two lines:

Code: Select all

--local old_aircrafts_6DOF  = {x = {-2,2},y = {-2,2},z = {-2,2},roll = 90.0} -- {x = {0,0},y = {0,0},z = {0,0},roll = 0}
local old_aircrafts_6DOF  = {x = {-0.02,0.05},y = {-0.03,0.03},z = {-0.03,0.03},roll = 90.0}
Replace with:

Code: Select all

--local old_aircrafts_6DOF  = {x = {-2,2},y = {-2,2},z = {-2,2},roll = 90.0} -- {x = {0,0},y = {0,0},z = {0,0},roll = 0}
--local old_aircrafts_6DOF  = {x = {-0.02,0.05},y = {-0.03,0.03},z = {-0.03,0.03},roll = 90.0} --original FC2 limited 6DOF
local old_aircrafts_6DOF  = {x = {-0.05,0.15},y = {-0.08,0.04},z = {-0.1,0.1},roll = 90.0} --less limited 6DOF
The "--" denotes unused code.

This was posted by Azrayen at the ED boards. He basically increased the values a little from the original FC2 "limited 6DOF", but not quite as much as the KA-50 values. I haven't tried these numbers yet, but I plan to play around with it some more and if needed find a happy medium between more freedom while avoiding clipping.

Posted: Wed Mar 31, 2010 2:53 am
by Lawndart
Here's another way to set this up in the server.lua file that is cleaner from a programming standpoint. Please note that the values for x, y, z under "new_6DOF" aren't changed from the default ones for the KA-50 in this post. I'm currently finding the values posted by Azrayen to work the best so far...
Necroscope wrote:Try this config (same method but much more attractive in programming view):

--local old_aircrafts_6DOF = {x = {-2,2},y = {-2,2},z = {-2,2},roll = 90.0} -- {x = {0,0},y = {0,0},z = {0,0},roll = 0}
local old_aircrafts_6DOF = {x = {-0.02,0.05},y = {-0.03,0.03},z = {-0.03,0.03},roll = 90.0}
local new_6DOF = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}

limits_6DOF = {}
limits_6DOF[PlaneIndex.iSu_27] = new_6DOF
limits_6DOF[PlaneIndex.iSu_33] = new_6DOF
limits_6DOF[PlaneIndex.iSu_25] = new_6DOF
limits_6DOF[PlaneIndex.iSu_39] = new_6DOF
limits_6DOF[PlaneIndex.iMiG_29] = new_6DOF
limits_6DOF[PlaneIndex.iMiG_29K] = new_6DOF
limits_6DOF[PlaneIndex.iA_10] = new_6DOF
limits_6DOF[PlaneIndex.iF_15] = new_6DOF
limits_6DOF[PlaneIndex.iKA_50] = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
For those of you not wanting to mess around in the server.lua right now, as long as you make sure all 6 Degrees Of Freedom (Yaw, Pitch, Roll, X, Y, Z) is enabled in your TrackIR software, even vanilla FC2 has some minor 6DOF straight out of the box for the planes with 2D cockpits now.


For those of you, on the other hand, wanting to mess around and amplify their 6DOF, here's an explanation of the values to edit:

Code: Select all

local old_aircrafts_6DOF = {x = {-0.02,0.35},y = {-0.15,0.21},z = {-0.26,0.26},roll = 90.0}
In the server.lua: x = {aft, fore}, y = {down, up}, z = {left, right}, roll = # of degrees to either side}

Note, that in the TrackIR software the axes are defined differently: X = left/right (lateral), Y = up/down (vertical), Z = fore/aft (longitudinal).

Posted: Wed Mar 31, 2010 4:25 pm
by Ray
That is awesome! The full 6 DOF adds so much to the immersion/feel of the sim.