The online racing simulator
[PROJECT] Cruise Control
(23 posts, started )
[PROJECT] Cruise Control
Hey Guys,

First: I have never made a Mod before, so I'm completely noobish in Mod things.

I thought about a mod that emulates a cruise control when i was on a cruise server. I think it would be a good thing to have in this game especially for cruise servers.

I just wanted to let you know that i will start experimenting and trying to release a cruise control mod.

Maybe some modders can help me.

grz
AWESOME! So nice if you done it!
Would you make a virtual joystick to modulate the throtle? (if this, I am interested in the source code :nod
Or are you going the easy way with a "i" keypress like rev-limiters?


Anyway, it could be interesting for a pit-limiter also.
Quote from Whiskey :Would you make a virtual joystick to modulate the throtle? (if this, I am interested in the source code :nod
Or are you going the easy way with a "i" keypress like rev-limiters?

hm...

I need to try different things... but if i could control the accelerator-axis via insim somehow it would be very cool.

I need help from experienced modders :/

Maybe the Source would look like this:

IF "set-speed" - "actual-speed" = >0 +2% Throttle
IF "set-speed" - "actual-speed" = <0 -2% Throttle
IF "set-speed" - "actual-speed" = 0 restart
OutGauge is read-only. AFAIK you need to create a virtual joystick and need LFS and Windows to recognise it as a pluged-in device, which is the hard part (I couldn't find how to do that when I tried my experiment)
Quote from Whiskey :OutGauge is read-only. AFAIK you need to create a virtual joystick and need LFS and Windows to recognise it as a pluged-in device, which is the hard part (I couldn't find how to do that when I tried my experiment)

Hm. I see.

There is no easy way to manipulate the axis.
I've technically written this before during my experimental AIRS in LFS project.

EDIT: However, it requires things that (in my opinion) make the mod not acceptable for general use... I'm pretty sure it can NOT be done while also giving the player control of the car.
Quote from blackbird04217 :I've technically written this before during my experimental AIRS in LFS project.

EDIT: However, it requires things that (in my opinion) make the mod not acceptable for general use... I'm pretty sure it can NOT be done while also giving the player control of the car.

The more I could do was creating a virtual joystick reading my G25 input, but could't guess how to send that info to LFS or Windows

I agree this could have bad uses, in my case it doesn't, I want to alter iddle RPM, but I'm stuck.
There was a guy who wrote a traction control mod for cars that don't have it in LFS. He didn't release it so all we got was a couple of videos showing what it does. It's certainly possible, perhaps a proxy DLL would help?
Quote from MadCatX :There was a guy who wrote a traction control for cars that don't have it in LFS. He didn't release it so all we got was a couple of videos showing what it does. It's certainly possible, perhaps a proxy DLL would help?

That guy was the one who inspired me, sadly people made him remove his program almost inmediatly...
Quote from Whiskey :The more I could do was creating a virtual joystick reading my G25 input, but could't guess how to send that info to LFS or Windows

I agree this could have bad uses, in my case it doesn't, I want to alter iddle RPM, but I'm stuck.

What you would need to do is use ppjoy? or whatever it was for the virtual joystick. Then read in the input for the wheel/controller device (which limits you to wheels, and the settings could be different from LFS settings, etc etc list of problems).

Then when cruise control is set on, instead of sending the controller device info to the virtual joystick, you would send the cruise control algorithm information to it... Which this is relatively straight forward. I don't see any bad uses for this, but for a general mod - installing a virtual controller is asking too much... (imo).
I wonder if we could ask him for a few tips as I could use the possibility of altering joystick input/output myself...
Quote from MadCatX :There was a guy who wrote a traction control mod for cars that don't have it in LFS. He didn't release it so all we got was a couple of videos showing what it does. It's certainly possible, perhaps a proxy DLL would help?

Really now? This seems like it would require some information like wheel spin which I was running into problems with regarding my AI project ... I'd be interested to know how he did that portion of it, although I am guessing he simply used the RPM values and if it spiked he would cut back the throttle. Either way, this would need the virtual controller method being talked about - which I did get working after a lot of trial and error.
Yup. Check out these two threads. The guy got banned (probably because he used cracked LFS) but he certainly managed to do this somehow. He used OutGauge and OutSim to calculate the wheelspin I guess.
Would you mind sharing your info on the virtual controller? I tried to do some research myself but came out pretty much empty handed...
Well if you only want to simulate a simple TC and not ESP, you could compare OutSim (actual) and OutGauge (indicated, i.e. differential or wheel reading) velocity and reduce throttle until they match.

€: MadCatX beat me to it :P
It is possible to do it an crazy way. You need to make program that emulates wheel with axis and it controls car when enabled but when you disable cruise control program have to get the real wheel axis value and put it on virtual.
There was a guy who made something like this called CARR I think...his name was Timberbunny iirc....I tried to find the thread but it went bye bye. He basically used the mouse axis and virtually moved the mouse with the program...I'd PM or email him.
Quote from roadrash17 :There was a guy who made something like this called CARR I think...his name was Timberbunny iirc....I tried to find the thread but it went bye bye. He basically used the mouse axis and virtually moved the mouse with the program...I'd PM or email him.

lol, that really sounds like an easy way to do it, isn't it?
I think it was pretty simple...but I'm not sure as I didn't code it...The downside to it was that you had to map your controls to the mouse, iirc...I'll PM him about a DL for the program...
This is a link to my AIRS project thread, which has some of the Virtual Controller information. I saw a bit on post #100 where I had first got PPJoy working even though it still had problems.

http://www.lfsforum.net/showthread.php?t=63807

Not sure it will be useful, there is a lot of stuff to sift through in there though...

As far as the OutGauge/OutSim responses to use the gauge speed vs actual speed - I wasn't thinking this would be accurate enough (especially for my needs) for a decent traction control thing...

Although since this is about Cruise Control, it should not be to hard to use SetCursorPos (Windows specific, which LFS is anyway), and set the throttle axis to use the mouse... I'm not sure if you can use the mouse for only throttle though. But I know you could create an LFS script to change the controls as needed as the cruise control gets toggled on/off.
so, anyone gonna build this?
I have a small proof-of-concept hack which allows me to edit the steering input live without the need of any virtual joysticks or other crazy stuff. I might or might not turn it into a functioning cruise control mod, I don't have pretty much any free time to work on in though.

I mention this only because guys like BlackBird could have used something like this, so if you're interested in the source, feel free to contact me. Please understand that this kind of hack opens many possibilities to write cheats, so unless you give me a good reason, I might not give you the source. Thanks for understanding...

[PROJECT] Cruise Control
(23 posts, started )
FGED GREDG RDFGDR GSFDG