airdoc Posted December 25, 2014 Posted December 25, 2014 (edited) Hi, This is a modification of the Camera Jiggle function, that produces a more realistic shake than the current one. To use it, open the View.Lua file, located at C:\Users\[yourname]\Saved Games\DCS\Config\View directory, and replace the current Camera Jiggle Function with the following lines: function CameraJiggle(t,rnd1,rnd2,rnd3) ---modded local rotX, rotY, rotZ, ampx, ampy, ampz1, ampz2, durz, freqz ampx=0.022 ---x axis shake amplitude ampy=0.022 ---y axis shake amplitude ampz1=0.015 ---z axis shake amplitude for the equations of the first part of rotZ ampz2=0.035 --- z axis shake amplitude, for the intervening pulses, defined by the last part rotz equations, starting with math.floor(math.abs(... durz=0.1 ---duration of pulses for z axis freqz=60 ---frequency of vibrations during the pulse for z axis rotX = ampx*math.sin(55.0 * (t - 2.0))- 2*ampx*math.sin(0.86 * (60*t+5))+1.5*ampx*math.sin(1.86 * (65*t+3))+3*ampx*math.sin(1.86 * (52*t+3))+2*ampx*math.sin(1.86 * (68*t+6)); rotY = ampy*math.sin(50.0 * (t - 5.0))- 0.52*ampy*math.sin(0.86 * (40*t+3))+0.01*ampy*math.sin(1.86 * (65*t+3))+0.45*ampy*math.sin(1.86 * (42*t+3))+0.4*ampy*math.sin(1.86 * (60*t+6)); rotZ = ampz1*math.sin(55.0 * (t - 2.0))- 0.80*ampz1*math.sin(0.86 * (70*t+5))+1.3*ampz1*math.sin(1.86 * (65*t+3))+1.8*ampz1*math.sin(1.86 * (62*t+3))+2*ampz1*math.sin(1.86 * (78*t+6))-1.8*ampz1*math.sin(1.2*(66*t+2))+math.floor(math.abs(math.sin(0.8*t)+2*durz))*math.sin(1.34*freqz*t)*ampz2+math.floor(math.abs(math.sin(0.2*t)+2*durz))*math.sin(1.5*freqz*t)*ampz2+math.floor(math.abs(math.sin(0.3*t)+2*durz))*math.sin(1.4*freqz*t)*0.875*ampz2+math.floor(math.abs(math.sin(0.05*t)+durz))*math.sin(1.68*freqz*t)*1.125*ampz2+math.floor(math.abs(math.sin(0.03*t)+1.2*durz))*math.sin(1.48*freqz*t)*0.75*ampz2+math.floor(math.abs(math.sin(0.025*t)+3.4*durz))*math.sin(1.36*freqz*t)*ampz2; return rotX, rotY, rotZ end For better results, set the Camera Float dX, dY, dZ parameters, that are located below the jiggle function, to 0. Backup your View.lua file before doing any modifications. You can experiment with the ampx, ampy, ampz1, ampz2, freqz, durz parameters in order to tail the camera shake according to your demands. ampx, ampy and ampz1 are the main variables that define how large the shake is. Ampz2, freqz and durz currently affect only z-axis shake, that has a different structure from the rest, with intervening pulses. Ampz2, freqz and durz define the amplitude, frequency (the pulse vibration frequency and not how often the pulses appear), and duration of pulses. The numbers given are for an average shake. It can be used for in-cockpit view, shift+F4 (nose or wing) view or other views. They are meant for simulating aerodynamic vibrations and not camera shakes for airshow cameras. Setting ampz1 and ampz2 to zero, will produce a softer shake, that may be better for continuous in-cockpit view. Edited December 25, 2014 by airdoc The three best things in life are a good landing, a good orgasm, and a good bowel movement. The night carrier landing is one of the few opportunities in life to experience all three at the same time.
Devrim Posted December 25, 2014 Posted December 25, 2014 Thanks. I'm always interested in jiggle camera feature. I'll try this code. Thank you. Intel i7-14700@5.6GHz | MSI RTX4080 SuperSuprimX | Corsair V. 64GB@6400MHz. | Samsung 1TB 990 PRO SSD (Win10Homex64) Samsung G5 32" + Samsung 18" + 2x8"TFT Displays | TM Warthog Stick w/AVA Base | VPC MongoosT-50CM3 Throttle | TM MFD Cougars | Logitech G13, G230, G510, PZ55 & Farming Sim Panel | TIR5 & M.Quest3 VR >>MY MODS<< | Discord: Devrim#1068
Vespa Posted December 25, 2014 Posted December 25, 2014 (edited) Thanks a lot.Me too I'm interested in this feature Edit: sorry for the silly question...in that path on my PC I can just find a server.lua file. How to use the function above? Do I need to create a new file? Thanks Edited December 25, 2014 by Vespa
Devrim Posted December 25, 2014 Posted December 25, 2014 Browse "..\DCS World\Config\View\" folder, copy View.lua and paste it into "C:\Users\{username}\Saved Games\DCS\Config\View\" folder. Intel i7-14700@5.6GHz | MSI RTX4080 SuperSuprimX | Corsair V. 64GB@6400MHz. | Samsung 1TB 990 PRO SSD (Win10Homex64) Samsung G5 32" + Samsung 18" + 2x8"TFT Displays | TM Warthog Stick w/AVA Base | VPC MongoosT-50CM3 Throttle | TM MFD Cougars | Logitech G13, G230, G510, PZ55 & Farming Sim Panel | TIR5 & M.Quest3 VR >>MY MODS<< | Discord: Devrim#1068
uboats Posted December 25, 2014 Posted December 25, 2014 Is there any way to enable jiggle by default (no need press the shortcut in game)? [sIGPIC][/sIGPIC] My DCS Mods, Skins, Utilities and Scripts | Windows 10 | i7-4790K | GTX 980Ti Hybrid | 32GB RAM | 3TB SSD | | TM Warthog Stick | CH Pro Throttle + Pro Pedal | TIR5 Pro | TM MFD Cougar | Gun Camera: PrtScn |
Devrim Posted December 25, 2014 Posted December 25, 2014 (edited) We looked for it very long time, Uboats, but no luck unfortunately... :\ It may be hard coded and, got no answer due to FPS issue maybe. If it was default, other users would probably complaint, "Please! No jiggle by default!". ;) Edited December 25, 2014 by Devrim Intel i7-14700@5.6GHz | MSI RTX4080 SuperSuprimX | Corsair V. 64GB@6400MHz. | Samsung 1TB 990 PRO SSD (Win10Homex64) Samsung G5 32" + Samsung 18" + 2x8"TFT Displays | TM Warthog Stick w/AVA Base | VPC MongoosT-50CM3 Throttle | TM MFD Cougars | Logitech G13, G230, G510, PZ55 & Farming Sim Panel | TIR5 & M.Quest3 VR >>MY MODS<< | Discord: Devrim#1068
airdoc Posted December 25, 2014 Author Posted December 25, 2014 You 're welcome Devrim and Vespa. If you come up with specific combinations of numbers for the variables, don't hesitate to post them here. With this code, it is a lot easier than the stock one to experiment and come up with different results. For the time being, I haven't introduced other variables, in order to keep the code as simple as possible. If people are interested, the modification of other axes (x and y) for introduction of pulses and the addition of a general shake frequency variable shouldn't be hard to implement. The three best things in life are a good landing, a good orgasm, and a good bowel movement. The night carrier landing is one of the few opportunities in life to experience all three at the same time.
uboats Posted December 25, 2014 Posted December 25, 2014 We looked for it very long time, Uboats, but no luck unfortunately... :\ It may be hard coded and, got no answer due to FPS issue maybe. If it was default, other users would probably complaint, "Please! No jiggle by default!". ;) I mean something like an option (not key press), or something like boolean variable that can be set in the autoexec.cfg file. [sIGPIC][/sIGPIC] My DCS Mods, Skins, Utilities and Scripts | Windows 10 | i7-4790K | GTX 980Ti Hybrid | 32GB RAM | 3TB SSD | | TM Warthog Stick | CH Pro Throttle + Pro Pedal | TIR5 Pro | TM MFD Cougar | Gun Camera: PrtScn |
JayPee Posted January 7, 2015 Posted January 7, 2015 (edited) Hi, This is a modification of the Camera Jiggle function, that produces a more realistic shake than the current one. To use it, open the View.Lua file, located at C:\Users\[yourname]\Saved Games\DCS\Config\View directory, and replace the current Camera Jiggle Function with the following lines: function CameraJiggle(t,rnd1,rnd2,rnd3) ---modded local rotX, rotY, rotZ, ampx, ampy, ampz1, ampz2, durz, freqz ampx=0.022 ---x axis shake amplitude ampy=0.022 ---y axis shake amplitude ampz1=0.015 ---z axis shake amplitude for the equations of the first part of rotZ ampz2=0.035 --- z axis shake amplitude, for the intervening pulses, defined by the last part rotz equations, starting with math.floor(math.abs(... durz=0.1 ---duration of pulses for z axis freqz=60 ---frequency of vibrations during the pulse for z axis rotX = ampx*math.sin(55.0 * (t - 2.0))- 2*ampx*math.sin(0.86 * (60*t+5))+1.5*ampx*math.sin(1.86 * (65*t+3))+3*ampx*math.sin(1.86 * (52*t+3))+2*ampx*math.sin(1.86 * (68*t+6)); rotY = ampy*math.sin(50.0 * (t - 5.0))- 0.52*ampy*math.sin(0.86 * (40*t+3))+0.01*ampy*math.sin(1.86 * (65*t+3))+0.45*ampy*math.sin(1.86 * (42*t+3))+0.4*ampy*math.sin(1.86 * (60*t+6)); rotZ = ampz1*math.sin(55.0 * (t - 2.0))- 0.80*ampz1*math.sin(0.86 * (70*t+5))+1.3*ampz1*math.sin(1.86 * (65*t+3))+1.8*ampz1*math.sin(1.86 * (62*t+3))+2*ampz1*math.sin(1.86 * (78*t+6))-1.8*ampz1*math.sin(1.2*(66*t+2))+math.floor(math.abs(math.sin(0.8*t)+2*durz))*math.sin(1.34*freqz*t)*ampz2+math.floor(math.abs(math.sin(0.2*t)+2*durz))*math.sin(1.5*freqz*t)*ampz2+math.floor(math.abs(math.sin(0.3*t)+2*durz))*math.sin(1.4*freqz*t)*0.875*ampz2+math.floor(math.abs(math.sin(0.05*t)+durz))*math.sin(1.68*freqz*t)*1.125*ampz2+math.floor(math.abs(math.sin(0.03*t)+1.2*durz))*math.sin(1.48*freqz*t)*0.75*ampz2+math.floor(math.abs(math.sin(0.025*t)+3.4*durz))*math.sin(1.36*freqz*t)*ampz2; return rotX, rotY, rotZ end For better results, set the Camera Float dX, dY, dZ parameters, that are located below the jiggle function, to 0. Backup your View.lua file before doing any modifications. You can experiment with the ampx, ampy, ampz1, ampz2, freqz, durz parameters in order to tail the camera shake according to your demands. ampx, ampy and ampz1 are the main variables that define how large the shake is. Ampz2, freqz and durz currently affect only z-axis shake, that has a different structure from the rest, with intervening pulses. Ampz2, freqz and durz define the amplitude, frequency (the pulse vibration frequency and not how often the pulses appear), and duration of pulses. The numbers given are for an average shake. It can be used for in-cockpit view, shift+F4 (nose or wing) view or other views. They are meant for simulating aerodynamic vibrations and not camera shakes for airshow cameras. Setting ampz1 and ampz2 to zero, will produce a softer shake, that may be better for continuous in-cockpit view.I will try this mod later today because the current jiggle feels over-done. Is it possible to have your jiggle mod turned on by default instead of after tapping the jiggle key 3 or 4 times? EDIT: From analysing the code I gather the jiggle is fully mathematically pre-scripted and is not affected by actual factors like air pressure, turbulence, AoA, etc. Am I right? Edited January 7, 2015 by JayPee i7 4790K: 4.8GHz, 1.328V (manual) MSI GTX 970: 1,504MHz core, 1.250V, 8GHz memory
airdoc Posted January 7, 2015 Author Posted January 7, 2015 (edited) Hi Jaypee As far as I know, one has to use the keys to enable jiggle. Its function is tied to the camera float, so when you enable jiggle, you always get a float as well, that's why I recommended to set the float parameters to zero. As you noticed, jiggle parameters are prescripted (like the stock ones). I 've looked around for ways to introduced G or AoA - dependent jiggle, but wasn't able to find the functions in the lua file. EDIT : if you feel that stock jiggle is overdone, you may find this jiggle mod excessive as well. In that case, try reducing the ampx, ampy, ampz1, ampz2 parameters by 30-50% to see if the results match your expectations. cheers Edited January 7, 2015 by airdoc The three best things in life are a good landing, a good orgasm, and a good bowel movement. The night carrier landing is one of the few opportunities in life to experience all three at the same time.
Recommended Posts