The online racing simulator
Program your own AI?
1
(30 posts, started )
Program your own AI?
I was just thinking of how in Torcs, you can program your own AI drivers. I think that there should be some way to do this in LFS. People always complain about the AI, but if you could program your own, then you could have lots of fun if you wanted too! I do not know how the code would work. Maybe a .dll file would be the best way. So, you would program your dll to return the controls at every 'tick' in time. LFS would call a function which would be in the .dll that would use give all of the data to the code in the .dll. So, here is an example of what I think would be nice:

1. LFS Calls function getCtrl(0.5,400,[Other values (speed, etc)])
2. Code in the dll file calls the LFS function for sendCtrl(1.0,0.0,700) (sends throttle, brake, clutch, steering, etc)

I am not really making a suggestion, but rather just saying that it would be interesting if this were possible in LFS.
+1000. If we could control AI cars through InSim we programming geeks could have a lot of fun having 'robot' tournaments, plus if behaviour could be packed in some kind of .AI file, all the offline players (there must be some out there) would be happy too.

Controllable AI through InSim would rock.
i would already like a "racer-like" system.
u drive a path and they follow it.
thats a good idea, cause then you could do ur best new lap and they could do exactly same thing, then you have some one exactly same level of skill to follow and learn where your mistakes are


+
Quote from [RCG]Boosted :i would already like a "racer-like" system.
u drive a path and they follow it.

the racer system has flaws though. hte ai is unsteady when turning left of right. it likes to weave back and forth all the time. and the lap at the start/finish line has to be in the same place of the car will spin there. and rarely it caused racer to crash (mac version). for more Racer Ai info: http://forum.rscnet.org/showthread.php?t=205451
i said "like" , i didnt say exactly the same
of course, racer has quite a few problems and this is one of em.
just meant going into that direction wouldnt be bad, im sure this system can be much better.
#7 - vane
i suggested this ages ago but someone said only the programmers could do it
this would be good if you wanted AIs to demonstrate your autocross layout, maybe like when you press shift+a you can change the sounds, maybe shift+s to load up a different AI path

booyah a thanks, thanks
Wouldn`t it be extremely difficoult to do this?
I don`t say that it is impossible, but it would take a lot of time and a hell of a good editer to get it working.
I think that AI is all about scripts, telling it what to do, and let it choose from allready implented choises in give situations. And then you have to add and edit those random choises the AI does and such... damn a lot of work indeed.

But if someone was good enough to do this, then I`m totally in for it
#9 - CSU1
Quote from wheel4hummer :I was just thinking of how in Torcs, you can program your own AI drivers. I think that there should be some way to do this in LFS. People always complain about the AI, but if you could program your own, then you could have lots of fun if you wanted too! I do not know how the code would work. Maybe a .dll file would be the best way. So, you would program your dll to return the controls at every 'tick' in time. LFS would call a function which would be in the .dll that would use give all of the data to the code in the .dll. So, here is an example of what I think would be nice:

1. LFS Calls function getCtrl(0.5,400,[Other values (speed, etc)])
2. Code in the dll file calls the LFS function for sendCtrl(1.0,0.0,700) (sends throttle, brake, clutch, steering, etc)

I am not really making a suggestion, but rather just saying that it would be interesting if this were possible in LFS.

...i don't really get the concept...give an example of what the ai would actually do other than drive good or bad
Quote from CSU1 :...i don't really get the concept...give an example of what the ai would actually do other than drive good or bad

Pit in, say stuff to wreckers, have an argument with someone, do a donut at the end of the race.... I just wanted to be able to program my own AI. That was all the thread was about.

Quote from The Very End :I don`t say that it is impossible, but it would take a lot of time and a hell of a good editer to get it working.

I'm not talking about an editor. I'm talking about a dll file that could be compiled to control the AI. An InSim AI interface simply would not be fast enough.
Thats making things too complicated...

If you want us to compile our own DLL files,
then what language are you expecting all of use to learn, C#, C++ , Java? VB.Net?

Sorry, Ill stick to PHP and build little website thingies, or just mod PHPBB, alot simpler, and less likely to generate errors!
#12 - vane
also if you could choose how fast the AIs go at certain places so it would be possible to make them pit every lap
Quote from CodieMorgan :Thats making things too complicated...

If you want us to compile our own DLL files,
then what language are you expecting all of use to learn, C#, C++ , Java? VB.Net?

Sorry, Ill stick to PHP and build little website thingies, or just mod PHPBB, alot simpler, and less likely to generate errors!

Sorry, but I'm missing the point of this post? It just seems to be a showcase for your skills..

Making something like AI modification isn't going to be easy. Unless you fully intend to make something that says steer to X degrees, power for Y seconds, etc. (which is NOT AI). Writing a true AI replacement is not going to be easy.

Yes raising the bar to require a DLL is making it slightly more complex, but how else would you intend to get the granularity required? You'll naturally want to run at the same speed as part of the physics engine. As wheel4hummer has said, it would be too slow to use a network protocol, like InSim or OutSim, in the current incarnation(s).

The problem with using a custom DLL, or similiar, is that LFS would be handing control over to the DLL, which could effectively being a bit of blocking, or slow, code, thus hurting the performance of LFS causing no end of trouble. Perhaps we wont see it for this reason.

Would definately be cool though.
Once patch Y is out would any of this really matter? I mean, the AI are getting a full recode, and will be heavily improved, I'm just, well, still wondering what having control over an AI would be, seeing that once you have control of it, it wouldn't be an AI anymore to be honest.
Quote from XCNuse :Once patch Y is out would any of this really matter? I mean, the AI are getting a full recode, and will be heavily improved, I'm just, well, still wondering what having control over an AI would be, seeing that once you have control of it, it wouldn't be an AI anymore to be honest.

Something you want to share with the class XCNuse?

As for why:
Quote :artificial intelligence: the branch of computer science that deal with writing computer programs that can solve problems creatively

By having control we can delegate control to another, better program. This would allow for coders to come up with creative solutions for various scenarios. Perhaps handing off AI control to a separate machine for instance. Or better understanding on "racing ettiquette". A better neural network to find better combinations of racing paths and tactics.

Granted it does potentially mean that someone could create means to control an AI (so that it then becomes a player), but I dont think that's relevant.
Scawen already said he was going to rewrite the AI code (in the patch X thread)

I mean I kind of understand why someone would want to code AI, as you put it, but I'm sure once patch Y comes out many of you will see no need to code alterations in the AI.

Question is.. when will we see the beginnings of patch Y. :s
Quote from XCNuse :Scawen already said he was going to rewrite the AI code (in the patch X thread)

I mean I kind of understand why someone would want to code AI, as you put it, but I'm sure once patch Y comes out many of you will see no need to code alterations in the AI.

Question is.. when will we see the beginnings of patch Y. :s

I dont wanna seee beginnings but endings would be nice
Dont expect anything too soon...maybe christmas present at best?
Quote from XCNuse :Scawen already said he was going to rewrite the AI code (in the patch X thread)

I mean I kind of understand why someone would want to code AI, as you put it

Because then I could customize my AI however I wanted. I program it and make an AI banger racing mod. Will the Patch Y AI do banger racing? I don't think it will.
Quote from wheel4hummer :Because then I could customize my AI however I wanted. I program it and make an AI banger racing mod. Will the Patch Y AI do banger racing? I don't think it will.

Keep the current AI right now and you can get all the banger racing you want.
i dont get it.

so far i know you can do that, noobie, pro , and so on. and there is standing in the lfs logo, online racing simulator...
Quote from hotmail :i dont get it.

so far i know you can do that, noobie, pro , and so on. and there is standing in the lfs logo, online racing simulator...

That's setting the internal AI code within LFS how it should react. The point behind this thread is writing your own AI code, which LFS then executes.
I think a scripting languagewould be better suited and better to learn,

Bringing a higher leval (or lower leval, i mean) form of LFSScript that functions like an object oriented language would make much more sense. Something that is easy to update on the fly, and it could run much like a clientsite script, being parsed as LFS runs.

I think it would be easier to learn this way!
Quote from CodieMorgan :I think it would be easier to learn this way!

indeed... thing is, AI are ridiculously more complex than what you're saying, not just "if distance to turn = 100 meters, than brake" (as the_angry_angel has said). That's why it's called artificial intelligence.

i think making "real" AIs would require something more powerful, and would be very difficult to implement (maybe that's why there's only very few games with very good IA).
#24 - vane
Quote from The Very End :a hell of a good editer

LFS devs then? i think we can safely say they are good, after all they have made the whole LFS!!!
#25 - CSU1
Quote from wheel4hummer :Pit in, say stuff to wreckers, have an argument with someone, do a donut at the end of the race.... I just wanted to be able to program my own AI. That was all the thread was about.

...maybe there is no 'thought process' involved with the current AI at all, maybe the AI code is simply written to react to triggers on the track surface. Programming scripts for AI to argue and talk to one and other is quite simple I imagine...all you'd need is a library of silly sentences and words and get them to referre to different areas of the library depending on the situation ie. AI1 get's wrecked by AI2, A1 sends "you donkey, whtz yur problem noob" etc.

Having AI to do doughnuts and tricks is yet another action that could work with the current AI system and on-track triggers ie. cones tell AI to go left/right, other trigger objects could be introduced to have them do tricks ect. by placing the trigger obj on track.

Imo what you're looking for is not really more complex AI thought behavior...it could simply be implimented with triggers on track. I agree however that realising the code to AI would be very fun for the programming geeks among us...but imo you'll probably just learn that the AI do nothing more than follow these triggers around the track again and again...eg. AI PRO = 100% trigger accuracy and AI Beginner = 60% trigger accuracy etc...[is just how I imagine the AI code is structured]
1

Program your own AI?
(30 posts, started )
FGED GREDG RDFGDR GSFDG