Re: Looking for some advice an creating and training a new AI in torcs.

James Ihrig <[email protected]> Mon, 8 Oct 2012 22:08:40 -0400
Newsgroups gmane.games.torcs.devel
Message-ID <CAKQyFNe3PS8jTs7Ar6owmDNQvzenzbqw+Km2winshYDibfFiAQ@mail.gmail.com>
--===============0826315840926748306==
Content-Type: multipart/alternative; boundary=0016e6d9a1531a086f04cb96d13e

--0016e6d9a1531a086f04cb96d13e
Content-Type: text/plain; charset=ISO-8859-1

Thank you, that was quite helpful and I think it definitely pointed me in
the right direction. I see that the types of sensors I am looking for are
commonly provided by competition software. I grabbed the latest linux patch
I could find in the CIG link you gave me. However, it seems to work with
version 1.3.1, not the latest version 1.3.3.

http://sourceforge.net/projects/cig/files/SCR%20Championship/

Does anyone know if there is a patch for the latest version floating around
somewhere?

I'm looking into what it's going to take to make the fixes myself, but
given my unfamiliarity with the project, it looks like a bit more than I
bargained for. (Despite the diffs available.) If there is no patch, I may
just go back to 1.3.1, so it's not the end of the world if there isn't one.

-Jim

On Mon, Oct 8, 2012 at 1:22 AM, Bernhard Wymann <[email protected]> wrote:

> Hi Jim
>
>
> On 10/08/2012 04:32 AM, James Ihrig wrote:
>
>> Greetings,
>>
>> I am looking to train some neural networks to drive vehicles in Torcs. I
>> have a TON of questions, hopefully someone can answer at least a few for
>> me. I've been digging into the code for about a week now and have
>> amassed plenty of questions. I apologize an advance for the length.
>>
>> *First some background:*
>>
>>
>> I have found a program that implements HyperNEAT that I would like to
>> use in conjunction with torcs. This program however is just that, a
>> program, not a library. So I will be looking to run it as a program
>> simultaneously with torcs, and have the two processes communicate with
>> eachother via XML.
>>
>> To do this, I would like to:
>>
>> 1) Read XML configuration and populate drivers with neural network data.
>> (One driver per race.)
>> 2) Skip all menu's, and go straight to some default race.
>> 3) Run a race until X time has passed, or Y laps complete.
>> 4) Write results to XML and wait for new configuration to re-populate
>> drivers with neural network data.
>>
>> rinse and repeat.
>>
>> Right now, I'm just trying to see if I can skip the menus and read in
>> the XML file at an appropriate place. (I see ANN.cpp and ANN.h specify
>> an loadANN() function, but I don't see the file format specified
>> anywhere.)
>>
>
> Command line mode exists since TORCS 1.3.3, see
> http://torcs.sourceforge.net/**index.php?name=Sections&op=**
> viewarticle&artid=30#c6_7<http://torcs.sourceforge.net/index.php?name=Sections&op=viewarticle&artid=30#c6_7>
>
>
>
>> I have found what looks to be a way to skip the menus. I have tried to
>> call torcs with
>> torcs -r $FULL_PATH_TO_SRC/quickrace.**xml
>> and got the message:
>> Human drivers not allowed in console race, fix race setup.
>> Which tells me I'm probably on the right track, but I can't find any
>> documentation on how or what to change to fix the setup.
>>
>
> Just open TORCS as usual and configure the race, this will alter the XML,
> the message means that no human driver is allowed in a command line race (I
> thought this is straightforward;-) ), so just remove the human driver from
> the race ("Player" in the standard distribution without adding more
> players), then it will work.
>
> Beware, on Windows Vista or higher the virtual store might be a bit
> confusing, but if you pass the right file, it will work.
>
>  Also, I have already created a driver that attempts to follow the center
>> of the road using a basic tutorial I have found.
>> *
>> My actual questions:*
>>
>> Is there any UML documentation for the control flow of the program?
>>
>
> No. But various people have drawn some things in the past, have a look at
> the existing papers (English wikipedia entry, http://sourceforge.net/**
> projects/cig/files/ <http://sourceforge.net/projects/cig/files/>).
>
>
>  What would be the best way to start a race without going through menus?
>>
>> Is there a good way to restart a race after a race is completed without
>> menus?
>>
>
> See http://torcs.sourceforge.net/**index.php?name=Sections&op=**
> viewarticle&artid=30#c6_8<http://torcs.sourceforge.net/index.php?name=Sections&op=viewarticle&artid=30#c6_8>,
> basically you can taylor the race state engine to your needs.
>
>
>  On a race restart, I will need a new ANN, which I can read from a file,
>> which holds about 100 individual AI's to test. Is there a way I can
>> track how many I've tested? Is 'index' in Driver::newrace(int index,
>> tCarElt* car, tSituation *s) something I can use for this? (I can't find
>> documentation saying what index is.)
>>
>
> I guess no, have a look into the robot tutorial. A module (so, dll) can
> currently handle up to 10 robots, so to know which one is meant to drive
> the index is given. You can save something during the shutdown of your
> module, e.g. see the bt robots distributed with TORCS, they save a "karma"
> file.
>
>
>  Are there any pre-existing classes that are good for detecting
>> environment such as track edges? (range finders?)
>> http://www.youtube.com/watch?**v=FKAULFV8tXw&feature=related<http://www.youtube.com/watch?v=FKAULFV8tXw&feature=related>
>>
>> If not, is there an easy way to find a track edge to do an intersection
>> test of my own with?
>>
>
> No idea, but as well here you could find something:
> http://sourceforge.net/**projects/cig/files/<http://sourceforge.net/projects/cig/files/>
>
>
>  Any help would be appreciated, even if it's just pointing to new
>> documentation I haven't yet found.
>>
>
> - English wikipedia entry (TORCS, uppercase)
> - http://sourceforge.net/**projects/cig/files/<http://sourceforge.net/projects/cig/files/>
> - http://cig.dei.polimi.it/
> - http://games.ws.dei.polimi.it/**competitions/scr/<http://games.ws.dei.polimi.it/competitions/scr/>
>
> Hope this helps
>
> Best regards
>
> Bernhard
>

--0016e6d9a1531a086f04cb96d13e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you, that was quite helpful and I think it definitely pointed me in t=
he right direction. I see that the types of sensors I am looking for are co=
mmonly provided by competition software. I grabbed the latest linux patch I=
 could find in the CIG link you gave me. However, it seems to work with ver=
sion 1.3.1, not the latest version 1.3.3.<br>
<br><a href=3D"http://sourceforge.net/projects/cig/files/SCR%20Championship=
/">http://sourceforge.net/projects/cig/files/SCR%20Championship/</a><br><br=
>Does anyone know if there is a patch for the latest version floating aroun=
d somewhere?<br>
<br>I&#39;m looking into what it&#39;s going to take to make the fixes myse=
lf, but given my unfamiliarity with the project, it looks like a bit more t=
han I bargained for. (Despite the diffs available.) If there is no patch, I=
 may just go back to 1.3.1, so it&#39;s not the end of the world if there i=
sn&#39;t one.<br>
<br>-Jim<br><br><div class=3D"gmail_quote">On Mon, Oct 8, 2012 at 1:22 AM, =
Bernhard Wymann <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex">
Hi Jim<div class=3D"im"><br>
<br>
On 10/08/2012 04:32 AM, James Ihrig wrote:<br>
</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div class=3D"im">
Greetings,<br>
<br>
I am looking to train some neural networks to drive vehicles in Torcs. I<br=
>
have a TON of questions, hopefully someone can answer at least a few for<br=
>
me. I&#39;ve been digging into the code for about a week now and have<br>
amassed plenty of questions. I apologize an advance for the length.<br>
<br></div>
*First some background:*<div class=3D"im"><br>
<br>
I have found a program that implements HyperNEAT that I would like to<br>
use in conjunction with torcs. This program however is just that, a<br>
program, not a library. So I will be looking to run it as a program<br>
simultaneously with torcs, and have the two processes communicate with<br>
eachother via XML.<br>
<br>
To do this, I would like to:<br>
<br>
1) Read XML configuration and populate drivers with neural network data.<br=
>
(One driver per race.)<br>
2) Skip all menu&#39;s, and go straight to some default race.<br>
3) Run a race until X time has passed, or Y laps complete.<br>
4) Write results to XML and wait for new configuration to re-populate<br>
drivers with neural network data.<br>
<br>
rinse and repeat.<br>
<br>
Right now, I&#39;m just trying to see if I can skip the menus and read in<b=
r>
the XML file at an appropriate place. (I see ANN.cpp and ANN.h specify<br>
an loadANN() function, but I don&#39;t see the file format specified anywhe=
re.)<br>
</div></blockquote>
<br>
Command line mode exists since TORCS 1.3.3, see <a href=3D"http://torcs.sou=
rceforge.net/index.php?name=3DSections&amp;op=3Dviewarticle&amp;artid=3D30#=
c6_7" target=3D"_blank">http://torcs.sourceforge.net/<u></u>index.php?name=
=3DSections&amp;op=3D<u></u>viewarticle&amp;artid=3D30#c6_7</a><div class=
=3D"im">
<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<br>
I have found what looks to be a way to skip the menus. I have tried to<br>
call torcs with<br>
torcs -r $FULL_PATH_TO_SRC/quickrace.<u></u>xml<br>
and got the message:<br>
Human drivers not allowed in console race, fix race setup.<br>
Which tells me I&#39;m probably on the right track, but I can&#39;t find an=
y<br>
documentation on how or what to change to fix the setup.<br>
</blockquote>
<br></div>
Just open TORCS as usual and configure the race, this will alter the XML, t=
he message means that no human driver is allowed in a command line race (I =
thought this is straightforward;-) ), so just remove the human driver from =
the race (&quot;Player&quot; in the standard distribution without adding mo=
re players), then it will work.<br>

<br>
Beware, on Windows Vista or higher the virtual store might be a bit confusi=
ng, but if you pass the right file, it will work.<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">
Also, I have already created a driver that attempts to follow the center<br=
>
of the road using a basic tutorial I have found.<br></div>
*<br>
My actual questions:*<div class=3D"im"><br>
Is there any UML documentation for the control flow of the program?<br>
</div></blockquote>
<br>
No. But various people have drawn some things in the past, have a look at t=
he existing papers (English wikipedia entry, <a href=3D"http://sourceforge.=
net/projects/cig/files/" target=3D"_blank">http://sourceforge.net/<u></u>pr=
ojects/cig/files/</a>).<div class=3D"im">
<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
What would be the best way to start a race without going through menus?<br>
<br>
Is there a good way to restart a race after a race is completed without<br>
menus?<br>
</blockquote>
<br></div>
See <a href=3D"http://torcs.sourceforge.net/index.php?name=3DSections&amp;o=
p=3Dviewarticle&amp;artid=3D30#c6_8" target=3D"_blank">http://torcs.sourcef=
orge.net/<u></u>index.php?name=3DSections&amp;op=3D<u></u>viewarticle&amp;a=
rtid=3D30#c6_8</a>, basically you can taylor the race state engine to your =
needs.<div class=3D"im">
<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
On a race restart, I will need a new ANN, which I can read from a file,<br>
which holds about 100 individual AI&#39;s to test. Is there a way I can<br>
track how many I&#39;ve tested? Is &#39;index&#39; in Driver::newrace(int i=
ndex,<br>
tCarElt* car, tSituation *s) something I can use for this? (I can&#39;t fin=
d<br>
documentation saying what index is.)<br>
</blockquote>
<br></div>
I guess no, have a look into the robot tutorial. A module (so, dll) can cur=
rently handle up to 10 robots, so to know which one is meant to drive the i=
ndex is given. You can save something during the shutdown of your module, e=
.g. see the bt robots distributed with TORCS, they save a &quot;karma&quot;=
 file.<div class=3D"im">
<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Are there any pre-existing classes that are good for detecting<br>
environment such as track edges? (range finders?)<br>
<a href=3D"http://www.youtube.com/watch?v=3DFKAULFV8tXw&amp;feature=3Drelat=
ed" target=3D"_blank">http://www.youtube.com/watch?<u></u>v=3DFKAULFV8tXw&a=
mp;feature=3Drelated</a><br>
<br>
If not, is there an easy way to find a track edge to do an intersection<br>
test of my own with?<br>
</blockquote>
<br></div>
No idea, but as well here you could find something: <a href=3D"http://sourc=
eforge.net/projects/cig/files/" target=3D"_blank">http://sourceforge.net/<u=
></u>projects/cig/files/</a><div class=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Any help would be appreciated, even if it&#39;s just pointing to new<br>
documentation I haven&#39;t yet found.<br>
</blockquote>
<br></div>
- English wikipedia entry (TORCS, uppercase)<br>
- <a href=3D"http://sourceforge.net/projects/cig/files/" target=3D"_blank">=
http://sourceforge.net/<u></u>projects/cig/files/</a><br>
- <a href=3D"http://cig.dei.polimi.it/" target=3D"_blank">http://cig.dei.po=
limi.it/</a><br>
- <a href=3D"http://games.ws.dei.polimi.it/competitions/scr/" target=3D"_bl=
ank">http://games.ws.dei.polimi.it/<u></u>competitions/scr/</a><br>
<br>
Hope this helps<br>
<br>
Best regards<span class=3D"HOEnZb"><font color=3D"#888888"><br>
<br>
Bernhard<br>
</font></span></blockquote></div><br>

--0016e6d9a1531a086f04cb96d13e--


--===============0826315840926748306==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
--===============0826315840926748306==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Torcs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/torcs-devel

--===============0826315840926748306==--