The online racing simulator
Searching in All forums
(156 results)
Rotareneg
S3 licensed
I suspect they're betting they'll get enough "if it's expensive, it has to be better!" idiots, just like audiophiles who swear by their $485 volume knobs.
Rotareneg
S3 licensed
Here's two videos:

Normal LFS camera: http://www.youtube.com/watch?v=RBmOi6rpveU

And with CamLevel: http://www.youtube.com/watch?v=uLVUq_Ex2H4
Last edited by Rotareneg, .
Rotareneg
S3 licensed
Quote from ACCAkut :I get a "outsim closed" followed by a "Outsim enabled" every few seconds
Edit: Not with W4h's version

Both versions do that. After 10 seconds of not receiving any outsim packets it closes and reopens the outsim connection. It shouldn't do it while actually racing, just while in the menus.
Rotareneg
S3 licensed
Quote from wheel4hummer :I have modifed the program so that the config file can be customized more easily. For example, the order of the variables do not matter. They are assigned using "variable=value", and a "#" designates a comment. Also, all of the data besides the source-code and the config has been shrunk into the single exe. I also made it Python 2.4 compatible (No "Struct" methond in python 2.4) since I use 2.4 and not 2.5.

Thanks! I was hoping someone who knew what they were doing would come along and clean up the mess I made. Also, I just noticed a tiny typo in my code where it sends the IS_CPP packet: I accidentally left a "21" in the yaw rotation, should be zero:


insim.send(struct.pack(is_cpp, 32,9,0,0,0,0,0,0,pitch,roll,
255,255,90.0,camera_average,8192))

I'll drop the attachment from my first post and link to the post with your version, if you don't mind.
Rotareneg
S3 licensed
Made a little InSim application that does all that:

http://www.lfsforum.net/showthread.php?t=37537
Rotareneg
S3 licensed
Probably a Vista thing, like different libraries or something. You might try downloading Python and running the camlevel.py directly.
Rotareneg
S3 licensed
Quote from Matt0snap :
1 more question: If I change the port for the Camera, will it stop with problem, and will I be able to use CSR and the cam and the same time?

Just checked, it's not my fault. LFS automatically sets OutGauge Mode to 0 when you use /insim to open any port.
Rotareneg
S3 licensed
Quote from xaotik :Amen - this is much much better... now if only we could turn the view right and left (no problem if it's an extra hotkey [command with an insim prefix or something] and doesn't use the in-game left+right)...

EDIT:
Oh yes: it also won't let you enter the editor/free camera view (shift-u).

As a sidethought - maybe an extra command to enable/disable camlevel on the fly would be handy?

PS: If you flip the car over with CamLevel enabled it's hilarious - it's like you're not wearing a harness and you're tumbling inside the car like it's a washing machine.

Looking at InSim.txt, it seems the only way to communicate with insim apps is either by text messages, "/o whatever", or with on-screen buttons, neither of which are really useful for looking left or right while racing. The free camera is probably disabled by the same override that stops looking left and right from working.
Last edited by Rotareneg, .
Rotareneg
S3 licensed
Quote from Jakg :"InSim guest closed : CamLevel"

Every time i start a race running this :X

Hmm, you might try changing the insim and/or outsim port it uses (first and second lines in the config file,) just in case something is conflicting with them. What happens if you load camlevel.exe again once you start racing?
Rotareneg
S3 licensed
Ah... much better now! I dumped the nasty limiter and added averaging which does a much better job of leveling out banking and elevation changes.
Rotareneg
S3 licensed
Added limiters so you can control how far the pitch and/or roll gets adjusted.
Rotareneg
S3 licensed
Quote from Shotglass :nice idea works really well and gives a surprisingly good feel for what the car is doing

the only problem i see is that it doesnt work all that well on steep hills like eg the chicane at aston

You might try setting the third line in the camlevel.cfg file to 0.5 or 0.75. If the banking in KY1 gets too disorienting you can set the fourth lower as well.
Rotareneg
S3 licensed
Quote from burnsy1882 :is there some setting that you've neglected to tell us what to set it to? or some setting in LFS to set to? because it doesn't do anything for me.

Did you type /insim 10000 and get a message in the top left corner saying "InSim : port 10000"?

After doing that you can start camlevel.exe and you should see two messages in LFS: "InSim - TCP: CamLevel (UDP port 10001)" and "OutSim : enabled". Then, until a race is going, it should time out and reconnect over and over until a race is going, with "Timed out" showing up in the camlevel.exe window and "InSim guest closed : CamLevel" in LFS followed by the inital connection messages. If you're running a firewall it could interfere with InSim packets too, so you may need to adjust its settings.

I've only tested it on XP and 2000, so there could be missing .dll or other problems with 98 and/or Vista.
Last edited by Rotareneg, .
Rotareneg
S3 licensed
Posted a slightly nicer version the program in the addons forum:

http://www.lfsforum.net/showthread.php?t=37537
Rotareneg
S3 licensed
Quote from hugoluis :When i leave the race/replay for go to pits or lfs main menu, the program will close, and i need to open it again aways if the race start.

I changed it so it should stay open, but as the computer I have here at work can't really run LFS I wasn't able to test it very well.
Rotareneg
S3 licensed
Oh, and I just updated it slightly so the pitch and roll are only half leveled, which looks a little nicer.
Rotareneg
S3 licensed
Just decompress the .zip and run camlevel.exe when a race or replay is running, it shouldn't need to be in any specific folder.
"Real life" camera pitch/roll with InSim
Rotareneg
S3 licensed
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.
Last edited by Rotareneg, . Reason : New version
Rotareneg
S3 licensed
Oohh, got it working!


import struct, socket, os, math

is_isi = struct.Struct('BBBBHHBBH16s16s')
is_ver = struct.Struct('BBBB8s6sH')
is_cpp = struct.Struct('BBBB3lHHHBBfHH')
is_tiny = struct.Struct('BBBB')
is_small = struct.Struct('BBBBL')
outsimpack = struct.Struct('I3ffff3f3f3L')

config = open('camlevel_cfg.txt', 'r')
insimport = int(config.readline())
outsimport = int(config.readline())
pitch_multi = float(config.readline())
roll_multi = float(config.readline())
average_window = int(config.readline())
average_multi = float(config.readline())
camera_average = int(config.readline())
config.close()

pitch_list = [0]*average_window
roll_list = [0]*average_window

socket.setdefaulttimeout(10)

insim = socket.socket()
insim.connect(('127.0.0.1',insimport))
insim.send(is_isi.pack(44,1,0,0,outsimport,0,0,0,0,'','CamLevel'))
insim.send(is_small.pack(8,4,0,1,1))
outsim = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
outsim.bind(('127.0.0.1',outsimport))
while True:
try:
pitch, roll = (outsimpack.unpack(outsim.recv(64))[5:7])
pitch, roll = math.degrees(pitch),math.degrees(roll)
del pitch_list[0]
pitch_list.append(pitch)
del roll_list[0]
roll_list.append(roll)
pitch = pitch - (sum(pitch_list) / average_window)*average_multi
roll = roll - (sum(roll_list) / average_window)*average_multi
pitch, roll = pitch * pitch_multi, roll * roll_multi
pitch = int(pitch * 182.044444444444)
roll = int(roll * 182.0444444444)
if pitch < 0:
pitch = -pitch
else:
pitch = 65535 - pitch
if roll < 0:
roll = -roll
else:
roll = 65535 - roll
insim.send(is_cpp.pack(32,9,0,0,0,0,0,21,pitch,roll,
255,255,90.0,camera_average,8192))
except socket.timeout:
insim.send(is_small.pack(8,4,0,1,0))
insim.send(is_small.pack(8,4,0,1,1))
pitch_list = [0]*average_window
roll_list = [0]*average_window

Last edited by Rotareneg, .
Outsim pitch and roll
Rotareneg
S3 licensed
For some reason I think I've decided I might be competent enough to write a little python app that stabilizes the camera relative to the world, and after doing some searches I've ended up a tad confused about the pitch and roll values. Are they relative to the car body, the velocity vector, or the world?
Rotareneg
S3 licensed
They tried shifting into reverse at speed on an episode of Mythbusters. The manual wouldn't shift into reverse no matter how hard they pushed on the shifter, it just made a lovely grinding noise (I'd love to have seen the transmission fluid afterwards. )
Rotareneg
S3 licensed
Another cost benefit of drum brakes is that it's cheaper and easier to implement parking brakes with them as opposed to disk brakes.
Rotareneg
S3 licensed
Quote from Breizh :Do the same with a real car and report back...

Once I had to drive 5 miles in second gear (shifter cable broke) on city streets with plenty of stop lights. The clutch held out just fine, although I admit I wasn't trying to race.

As far as burnt clutches go, when I was getting my CDL another student appeared to be unable to learn how to use the clutch and overheated the poor thing to the point that it would start slipping just driving over a highway overpass.

Also, with unsynchronized transmissions it's easy to shift without the clutch, just lift off the throttle a bit to take the load of the gears, shift into neutral, then blip or cut the throttle to match RPMs. I'm not sure if most manual transmissions in race cars are synchronized or not however.
Rotareneg
S3 licensed
In previous versions I always used the digital speedometer, and IRL I prefer digital too.

Also, having to drop the throttle manually for upshifts is cool but could the blip throttle on downshift option be put back for us gamepad users? It's mighty hard to move the throttle/brake stick forward AND backwards at the same time.
Rotareneg
S3 licensed
-1. However, it'd be nice if the look function could also temporarily widen the field of view.
FGED GREDG RDFGDR GSFDG