This is a poorly written python program that uses InSim and OutSim to level the camera relative to the horizon.
Updated to work with Z30, now with working joystick look axis: http://www.mediafire.com/file/igz89t86gpljfnz/camlevel2_2.7z
Here's a video showing what it does: http://www.youtube.com/watch?v=uLVUq_Ex2H4
It's terribly primitive and doesn't do much error checking, so if too much goes wrong it'll either lock up or just quit. I haven't tested it online, so that may not work at all, or maybe only work if the server isn't using InSim. I've tested it on my computer using XP Home SP3 32 bit and Windows 7 64 bit.
So, first download the file and decompress the archive (it's a 7-Zip file if you can't open it,) wherever you find handy as it doesn't need to be installed.
To use your controller to look left/right, first run configure_controller.exe. It will (should) print a list of any game controllers on your system. Enter the ID of the correct one and hit enter. Then type 1 or 2 and enter to indicate if you want to use buttons/hat or a joystick axis. Then it will prompt you to hit the button or hat direction that will look left. Then it will do the same for the right button/hat. At this point it'll create (or overwrite) a file named input_cfg.txt and exit. Looking left/right won't work with the keyboard and/or mouse, sorry.
Next, run camlevel.exe. It should start up and start attempting to connect to the port listed in the camlevel_cfg.txt file. Start LFS and hit the / key to get the message prompt. Type /insim 10100 and hit enter, although if you've changed the default port enter that instead. In a moment you should get a message in LFS saying camlevel has connected and that OutSim is enabled. Then go driving around and see if you like or hate the effect. It seems to work better if you're not using the in-game camera acceleration shifts, but your mileage may vary.
The camlevel_cfg.txt file contains various settings:
The first two lines are self-explanatory, the InSim and OutSim ports it attempts to connect to.
Next are the pitch and roll multipliers. They control how close to the horizon (besides the averaging described next) the camera is kept level. 1.0 means always level with the horizon, 0.0 meaning not at all (like the normal LFS camera.)
Next is the averaging window, which is the length of time over which the camera will attempt to return to the level of the car interior. This helps keep the camera angle from getting nauseating on the corners of KY1 for example. It is defined in hundredths of a second so 100 would be one second.
The averaging multiplier controls how far back to the level of the car the averaging returns to, 1.0 being all the way and 0.0 being not at all (no averaging.)
The camera average tells LFS how long to take (in thousandths of a second) to move the camera to each new angle, so the movements are smooth instead of jerky. This probably doesn't need to be changed, but it might be different if your computer is faster or slower, I'm not sure.
Then there are the pitch and roll limits. These will keep the camera from pitching or rolling beyond those limits, which will keep the camera from going too bonkers if you roll the car.
Next, there's the angle the camera goes to when looking left or right, and the second angle the camera goes to when holding down both look buttons, just like in LFS. The look_angle2 line also sets the view angle when at maximum deflection with a joystick axis.
And last, a fixed amount of pitch to add to the final pitch angle.
Updated to work with Z30, now with working joystick look axis: http://www.mediafire.com/file/igz89t86gpljfnz/camlevel2_2.7z
Here's a video showing what it does: http://www.youtube.com/watch?v=uLVUq_Ex2H4
It's terribly primitive and doesn't do much error checking, so if too much goes wrong it'll either lock up or just quit. I haven't tested it online, so that may not work at all, or maybe only work if the server isn't using InSim. I've tested it on my computer using XP Home SP3 32 bit and Windows 7 64 bit.
So, first download the file and decompress the archive (it's a 7-Zip file if you can't open it,) wherever you find handy as it doesn't need to be installed.
To use your controller to look left/right, first run configure_controller.exe. It will (should) print a list of any game controllers on your system. Enter the ID of the correct one and hit enter. Then type 1 or 2 and enter to indicate if you want to use buttons/hat or a joystick axis. Then it will prompt you to hit the button or hat direction that will look left. Then it will do the same for the right button/hat. At this point it'll create (or overwrite) a file named input_cfg.txt and exit. Looking left/right won't work with the keyboard and/or mouse, sorry.
Next, run camlevel.exe. It should start up and start attempting to connect to the port listed in the camlevel_cfg.txt file. Start LFS and hit the / key to get the message prompt. Type /insim 10100 and hit enter, although if you've changed the default port enter that instead. In a moment you should get a message in LFS saying camlevel has connected and that OutSim is enabled. Then go driving around and see if you like or hate the effect. It seems to work better if you're not using the in-game camera acceleration shifts, but your mileage may vary.
The camlevel_cfg.txt file contains various settings:
The first two lines are self-explanatory, the InSim and OutSim ports it attempts to connect to.
Next are the pitch and roll multipliers. They control how close to the horizon (besides the averaging described next) the camera is kept level. 1.0 means always level with the horizon, 0.0 meaning not at all (like the normal LFS camera.)
Next is the averaging window, which is the length of time over which the camera will attempt to return to the level of the car interior. This helps keep the camera angle from getting nauseating on the corners of KY1 for example. It is defined in hundredths of a second so 100 would be one second.
The averaging multiplier controls how far back to the level of the car the averaging returns to, 1.0 being all the way and 0.0 being not at all (no averaging.)
The camera average tells LFS how long to take (in thousandths of a second) to move the camera to each new angle, so the movements are smooth instead of jerky. This probably doesn't need to be changed, but it might be different if your computer is faster or slower, I'm not sure.
Then there are the pitch and roll limits. These will keep the camera from pitching or rolling beyond those limits, which will keep the camera from going too bonkers if you roll the car.
Next, there's the angle the camera goes to when looking left or right, and the second angle the camera goes to when holding down both look buttons, just like in LFS. The look_angle2 line also sets the view angle when at maximum deflection with a joystick axis.
And last, a fixed amount of pitch to add to the final pitch angle.