From: rars-d-request@lysator.liu.se Subject: rars-d Digest V97 #45 X-Loop: rars-d@lysator.liu.se X-Mailing-List: archive/volume97/45 Precedence: list MIME-Version: 1.0 Content-Type: multipart/digest; boundary="----------------------------" To: rars-d@lysator.liu.se Reply-To: rars@lysator.liu.se (Rars mailing-list) ------------------------------ Content-Type: text/plain rars-d Digest Volume 97 : Issue 45 Today's Topics: Re: Reminder for BORS participants Re: newbie Rars for MSVC 4.0 Re: newbie Re: Rars for MSVC 4.0 Re: Reminder for BORS participants Re: passing code ------------------------------ Date: Sat, 19 Apr 1997 16:32:17 -0300 From: Maido Remm To: rars@lysator.liu.se (Rars mailing-list) Subject: Re: Reminder for BORS participants Message-Id: <3.0.1.16.19970419163217.18efd128@tamm.ebc.ee> Content-Type: text/plain; charset="us-ascii" At 16:16 18.04.1997 -0400, you wrote: >> P.S. Do not get confused while reading JackBot, it was designed for older >> version of rars, the x and y in s.nearby are defined differently. Currently >> x is distance to the right, y distance to front. dy == -1 means that front >> car is 1 feet/sec slower than you are. dx == -1 means that other car is >> moving left 1 feet/sec relative to your car. > >Now *I* am confused. Has the nearby structure changed from v.64 to >v.65? From JackBot: vx=s.nearby[i].rel_xdot; // get forward relative speed vy=s.nearby[i].rel_ydot; // get lateral relative speed ^^^^^^^ Sorry, the code in JackBot is OK, just comments are confusing. Nevertheless, the nearby structure has got more data in it in ver.065b. Also I think 0.64 can "see" only 3 cars ahead of you. From version 0.64 for DOS: struct rel_state { double rel_x; // how far to your right is the car ahead? double rel_y; // how far in front of you? double rel_xdot; // how fast cutting accross from left-to-right? double rel_ydot; // how fast is he getting away from you? int who; // an identifier for that car. }; From version 0.65b for DOS: // relative position and velocity vectors of a car in front // These are wrt a non-rotating frame of reference centered on // the car behind. The y axis is in the direction the car is pointing. struct rel_state { double rel_x; // how far to your right is the car ahead? double rel_y; // how far in front of you? double rel_xdot; // how fast cutting accross from left-to-right? double rel_ydot; // how fast is he getting away from you? double alpha; // car's current alpha double behind; // time behind car based on last crossing double to_lft; // car's s.to_lft position double to_rgt; // car's s.to_rgt position double v; // car's velocity double vn; // car's velocity wrt track double dist; // distance ahead on track int who; // an identifier for that car. int braking; // car is braking int for_position; // pass is for position }; Maido. ------------------------------ Date: Sat, 19 Apr 1997 13:57:58 -0400 (EDT) From: Daniel Brooks To: Rars mailing-list Subject: Re: newbie Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 18 Apr 1997, Henning Klaskala wrote: :)On April 10, Daniel Brooks wrote: :)> Yea, but like I said, we don't all know that much about C++, let alone the :)> math I've seen in the robots I've downloaded. I'm only a sophmore, and :)> havent had trig yet. I am going to borrow a trig text book to learn as we :)> go. Fortunatly, there are several juniors that have had trig. :) :)Knowing trig may help, but isn't necessary. I don't even include math.h :)in my robots. Nevertheless they are usually the fastest. :)The math in the other robots is there only to impress and confuse newbies. :);-) Yea, I was thinking that if I wanted to enter bors, I could just make a statement that adjusts the distance from the left/right wall according to the lenght of the curve and possibly its radius, so as to take a path as close to a circle as possible. ie: on the two straighs, go towards the middle of the track for the first half, and towards the inside for the second. Then, on a curve, go from outside to inside to outside, and repeat. ____-------____ ___/ \___ _/ \_ / \ / PPPPPPPPP \ | PPP___---___PPP | | PPP / \ PPP | | P | | P | Thus making my path, P sorta like that. It should be less than a few hundred bytes, because is only like 3 nested if's. then I'll do similar for curves. BTW, does the limit for midgets include header files? Thanks, Daniel Brooks PS: I think I have figured out the math from the book I borrowed. At least some of it. | Daniel Brooks -- Email: d-brooks@usa.net | | PGP key fingerprint - DB 10 E4 99 4C B5 86 11 3B 5A BC 56 34 37 57 18 | ------------------------------ Date: Sat, 19 Apr 1997 23:43:30 +0200 From: mkeijzer@knoware.nl (Maarten Keijzer) To: rars@lysator.liu.se (Rars mailing-list) Subject: Rars for MSVC 4.0 Message-Id: <199704192143.XAA08708@utrecht.knoware.nl> Content-Type: text/plain; charset="us-ascii" Hi all, a while ago someone mentioned that he/she had build a version of RARS for msvc 4.0. I want to try this out but can't find the original mail nor ftp adress for this. The regular rars-stuff doesn't mention it at all. Can someone help me out? thanx, -Maarten- ------------------------------ Date: Sun, 20 Apr 1997 09:25:28 -0300 From: Maido Remm To: rars@lysator.liu.se (Rars mailing-list) Subject: Re: newbie Message-Id: <3.0.1.16.19970420092528.2e777400@tamm.ebc.ee> Content-Type: text/plain; charset="us-ascii" At 13:57 19.04.1997 -0400, you wrote: > > ____-------____ > ___/ \___ > _/ \_ > / \ > / PPPPPPPPP \ > | PPP___---___PPP | > | PPP / \ PPP | > | P | | P | > Interesting idea, try it. BTW, does the limit for midgets include header files? As far as I know it did not include the body of any standard header file. Currently we have no competition going that limits the car size. The midgets are history ( at least for some time :-) Actually, I think it would be interesting to try RARS Summer Series, where everybody competes for car efficiency - SPEED/BYTE. Then your 50-100 byte car will easily outrun Bulle (100k). Maido >Thanks, >Daniel Brooks > >PS: I think I have figured out the math from the book I borrowed. At >least some of it. > >| Daniel Brooks -- Email: d-brooks@usa.net | >| PGP key fingerprint - DB 10 E4 99 4C B5 86 11 3B 5A BC 56 34 37 57 18 | > > > ------------------------------ Date: Sun, 20 Apr 1997 09:16:01 -0300 From: Maido Remm To: rars@lysator.liu.se (Rars mailing-list) Subject: Re: Rars for MSVC 4.0 Message-Id: <3.0.1.16.19970420091601.2e77466e@tamm.ebc.ee> Content-Type: text/plain; charset="us-ascii" At 23:43 19.04.1997 +0200, you wrote: >Hi all, > >a while ago someone mentioned that he/she had build a version of RARS for >msvc 4.0. I want to try this out but can't find the original mail nor >ftp adress for this. The regular rars-stuff doesn't mention it at >all. Can someone help me out? > Here is a letter from Marc Guery: I have uploaded my version of rars 0.64 for Visual C++ 4.0. It's not completely finshed (but it's working). I wished to include the changes made by Greg for VC++. But with the future arrival of JavaRars, I don't think it's neccessary.... The files are in ftp.ijs.com/incoming vc_r0642.zip 150Kb The source code (Zip with long names) vc_r0642.gif 12Kb A screenshot For more info, read the file "vc_r0642.zip/doc/info.txt". For the people that have VC++ 4.0 or 5.0, try it, I think it's interesting ... I don't know whether it is still there... Maido ------------------------------ Date: Sat, 19 Apr 97 11:01 GMT From: jusa@darkstar.bb.bawue.de (Jürgen Sang) To: rars@lysator.liu.se Subject: Re: Reminder for BORS participants Message-Id: Maido Remm (mremm@ebc.ee) wrote: : from last race will not survive to the end of race. They collide with slow : cars (H4 - 40 mph, H5 - 5 mph!). Thus I strongly suggest to spend this : weekend in designing anti-collision code. Consider the presence of : unnormally slow cars on the track. BTW, passing slower cars is difficult enough with the normal differences in speed. Having cars on the track whose sole purpose it is to kill faster cars during passing seems like a quite destructive approach to me, which will also not increase the joy newbies will have writing robots. Just my .02 ------------------------------ Date: Sun, 20 Apr 1997 19:08:43 -0300 From: Maido Remm To: rars@lysator.liu.se (Rars mailing-list) Subject: Re: passing code Message-Id: <3.0.1.16.19970420190843.18ef836e@tamm.ebc.ee> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit At 11:01 19.04.1997 GMT, Jürgen wrote: >Maido Remm (mremm@ebc.ee) wrote: > >: from last race will not survive to the end of race. They collide with slow >: cars (H4 - 40 mph, H5 - 5 mph!). Thus I strongly suggest to spend this >: weekend in designing anti-collision code. Consider the presence of >: unnormally slow cars on the track. > >BTW, passing slower cars is difficult enough with the normal differences >in speed. Having cars on the track whose sole purpose it is to kill >faster cars during passing seems like a quite destructive approach to >me, which will also not increase the joy newbies will have writing >robots. Just my .02 That's true. Nevertheless, it is a lesson that every car should include in passing code. In expert series I would use 107% rule, but not for beginners. BECAUSE, someone someday maybe cannot write faster car than 5 or 40 mph. I wouldn't prohibit their race solely because they cannot run faster. BTW, I think the AVOIDING of accident with slower car is easy even for beginner, the problem is to get past it safely and without loss of speed. If anybody is interested, I post here a core of my avoiding algoritm that I have developed within last week: (unless the previous posting, this works fine in most cases). Now, if only those faster cars wouldn't hit me from behind :-). ///// A look-ahead code: ////////////////////////////////// static void avoid_cars(situation &s, con_vec &result) { double v, d, x, y, vx, vy, vc1; int danger = 0; int kount = 0; for(int i=0;i<3;i++) if(s.nearby[i].who<16) { x=s.nearby[i].rel_x; // distance to right (or left if < 0) y=s.nearby[i].rel_y; // distance ahead vx=s.nearby[i].rel_xdot; // relative lateral speed component vy=s.nearby[i].rel_ydot; // relative forward speed d=sqrt(x*x + y*y); // distance to other car if (vy> 0) continue; // ignore faster cars else if (d > 300) continue; // look ahead 300 feets and be careful ++kount; // how many slower cars within 300 feets? danger = 1; // if we see a slower car closer than // 300 feets - danger! } //////////////////////// Danger! What to do? /////////////////////////////// if (danger == 0) // if no danger, keep the speed vc1 = result.vc; if (danger == 1) { if (kount > 1) { vc1 = 0.95 * s.v; // brake if there is more than one problem car: if (vy > 0 && d < 30) // get a little closer and vc1 = s.v; // keep that speed from 30 feets away } // and wait situation to clear else // only one car ahead and we have potential to drive faster vc1 = 0.95* s.v; // add your own passing code here. // Evaluate situation carefully and decide whether // to pass left or right. Increase or decrease // result.alpha accordingly. // Be careful or you will run off the track or // hit other cars! } // end of danger vc1 = ( vc1 < 10) ? 10 : vc1; // To avoid stopping behind standing car result.vc = vc1; } // end of avoid_cars function Maido -------------------------------- End of rars-d Digest V97 Issue #45 **********************************