From: rars-d-request@lysator.liu.se Subject: rars-d Digest V97 #40 X-Loop: rars-d@lysator.liu.se X-Mailing-List: archive/volume97/40 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 40 Today's Topics: Drivers Re: Simple collision avoidance Re: newbie Re: Results of 10.04 BORS race Re: Start in rows of two cars. Re: Random Events II Re: Random Events II Re: Random Events II Re: Random Events II Re: newbie Re: Start in rows of two cars. Re: Results of 10.04 BORS race Re: Start in rows of two cars. OS/2 version Re: Results of 10.04 BORS race Re: newbie ------------------------------ Date: Fri, 11 Apr 1997 11:04:17 -0300 From: Maido Remm To: rars@lysator.liu.se Subject: Drivers Message-Id: <3.0.1.16.19970411110417.2e7728ba@tamm.ebc.ee> Content-Type: text/plain; charset="us-ascii" Henning, I am sorry if I was too offensive describing your cars, I thought that they were team players. And there is nothing wrong developing new strategies even if it is not allowed in real racing. We do the RARS for having fun, don't we? I think your idea of making drivers block the road would be really interesting and you should give it a try. But then you should have also one quicker bot that your bots let past safely? This is not too easy to code. And also if there are many different submitters, we are limited to one-two cars per person. Rob wrote: >It's funny how Maido seems to have the most points. I'm sure that >it's not because he runs the races though, because that'd be >cheating... ;-) Where is your car? :-} I'll add code of apex2 to this letter so anybody could try it instantly, to be sure that there was no cheating. I'll post all cars to ftp://ftp.ijs.com/incoming under name bdrv1004.zip. My cars were successful this time, but this was only because they were lucky enough not to get too much damage (no avoiding code!). If there have been full field of 16 drivers driving, Apex2 certainly would have been out. It also does not follow ideal line around the track, doing stupid twists while braking and so on, but it was fastest from my bots. I tried to make better one which would follow optimal path with enlarged radius (Apex3) but this did not work for some unknown reason. If anybody finds my car good enough to be used feel free to take it, modify a single bit and submit under your name. I will be only glad to have more competitors in series. See you in Milwaukee. Maido Start of apex2.cpp //========================================================================== ==== ///// This is my second robot. I started from tutorial robot Turtle5 by ///// Ralph Scott, reduced braking distance, added APEX, floating target at ///// end of straigths and curves and more gentle acceleration and decceleration. ///// The key constants are....:-) Well everything is important to get in ///// balance, to get smooth transition from one fragment to another. ///// Last three constants are less important. It is fast but not stable enough in races. ///// This bot knows only left hand ovals. It is optimized for -s1 oval2.trk (75.60 mph). ///// After some tinkering it could perform well on others too. No anti-collision code. ///// Maido Remm, ESTONIA (mremm@ebc.ee) 29.03.1997 #include #include #include #include "car.h" #include "os.h" static double APEX = 0.43; // fraction of curve from end static double CURVESPEEDMULTIPLIER = 5.85; static double BRAKEPOINT = 0.0062; // determines how early we start braking static double MARGIN = 2.0; // in feets from left static double RMARGIN = 18.0; // in feets from right static double END_STR = 10.0; // in feets from the end of straigth static double END_CRV = 70.0; // in feets from the end of curve static double ACC_STR = 1.7; // acceleration ( * s.v) in straigth static double ACC_CRV = 1.19; // acceleration after apex in curves static double BRAKE_HARD = 0.15; // decceleration before curve ///// calculate braking distance from speed vnow to speed vthen static double distancetobraketo(double vnow, double vthen) { if (vnow 20000) { BRAKEPOINT = 0.01; MARGIN = 8; RMARGIN = 25; END_CRV = 50; ACC_CRV = 1.1; } if (s.damage > 5000) { MARGIN = 5; RMARGIN = 21; } double directionoftravel = asin(s.vn/s.v); double to_end = curvelength(s.to_end, s.cur_rad); // current segment double length = curvelength(s.cur_len, s.cur_rad); // current segment double width = s.to_lft + s.to_rgt; // width of the track ///// This statement calculates desired angle to reach target point at the end ///// of straight. The target point is floating: it moves from right to left ///// if to_end decreases. At the end of straight (END_STR feets) we do not ///// bother of current target and simply keep the angle until to the next ///// segment. double ideal_alpha = atan( (s.to_lft - MARGIN - to_end*(width-RMARGIN)/length) / to_end); if (s.cur_rad == 0.0 && to_end < END_STR) ideal_alpha = atan( (s.to_lft - MARGIN) / END_STR); ///// The same is calculated for curves. Here we use asin as we move on sinusoid ///// The target here floats from left to right, thus smoothly increasing radius ///// after the apex. This is required due to the increasing speed and lateral ///// acceleration (we need some g for normal acceleration as well). To avoid ///// sliding out of the track we limit our right side trail by RMARGIN double lane = (s.to_lft - MARGIN)/to_end; if (to_end < APEX*length) lane = (s.to_lft - ((APEX*length - to_end) * (width-RMARGIN)/(APEX*length)))/to_end; if (to_end < END_CRV) lane = 0; //(s.to_lft - (width-RMARGIN))/to_end; ///// asin must have argument between -1 and 1. if (lane > 1) lane = 1; if (lane < -1) lane = -1; if (s.cur_rad != 0) // in other words, we are in a curve ideal_alpha = asin(lane); result.alpha = ideal_alpha - directionoftravel; //////////////////////////// NOW calculate speed ////////////////// ///// Normally we have (1.5 * s.v) on straigths and 5.9sqr(rad) in curves ///// before APEX. result.vc = curvespeed(s.cur_rad, MARGIN, s.v); ///// After apex increase speed gently if ((s.cur_rad != 0.0) && (to_end < (APEX * length))) result.vc = ACC_CRV * s.v; ///// For next curve brake hard, additional code required for two or more ///// sequential curves with decreasing radius. if (to_end < distancetobraketo(s.v, curvespeed(s.nex_rad, MARGIN, s.v))) result.vc = BRAKE_HARD * s.v; ///// That's it!//////////// return result; } //============================================================================= ------------------------------ Date: Fri, 11 Apr 1997 09:39:27 -0400 (EDT) From: rscott@NetUSA.Net (Ralph Scott) To: rars@lysator.liu.se Subject: Re: Simple collision avoidance Message-Id: Content-Type: text > > You could try something like this to avoid collisions: > > > > if (s.dead_ahead) result.vc = 0.9*s.v; > > SLOWDOWN !!!!!!!!!!!!!!!! > > are you CRAZY :-))))))))) > > well i think i'll try > > if(s.dead_ahead) pos_vir=pos_vir-car_witdh; > > pos_vir : position in tracks ( s.to_lft/track_width ) Just hope you aren't at the left hand wall! :-) The dead ahead trick is nice except that it only comes into play when you are within 2 car lengths. Sometimes that is not enough time to slow down. ---ralph ------------------------------ Date: Fri, 11 Apr 1997 09:42:59 -0400 (EDT) From: rscott@NetUSA.Net (Ralph Scott) To: rars@lysator.liu.se Subject: Re: newbie Message-Id: Content-Type: text > > On Thu, 10 Apr 1997, Ralph Scott wrote: > :)Send it to me when you are ready. > :) Oops. Don't send it to me if you are not going to enter the races I run. Maido runs the oval races, which is easier ones, and the one you probably read about. I run the, err... non-oval races. BTW, have you been to maidos website? Seen the tutorials? > It's Computer Programming 2. I go to Land O' Lakes HS, just north of > Tampa, Florida. We are working in Borland C++ 4.5 for Windows, but have a > copy of Turbo C++ for DOS so we'll be able to compile and run RARS. (or > BORS, which ever we enter.) Same code (more or less), just different tracks. ---ralph ------------------------------ Date: Fri, 11 Apr 1997 09:50:50 -0400 (EDT) From: rscott@NetUSA.Net (Ralph Scott) To: rars@lysator.liu.se Subject: Re: Results of 10.04 BORS race Message-Id: Content-Type: text > > Here are the results from the opening race of BORS 10th April, 1997 Darn, I was just saying to myself that I should check when to enter my standard Ralph2 bot. Oh well, I'll enter for next race. And maybe even a second bot. > qualifying, but "too careful" in race. Well, next race is longer, track is In my opinion, too careful is not possible. > narrower and I probably make car size to 10x15 feets to see them better on > longer tracks. I am sure my cars won't survive next race without further > improvement. > Thus, it cannot be stressed enough - you do not need a fast car, just a car > that finishes the race. And you should enter the Unlimiteds as well. > modifications (do not forget put in credits to Ralph) and submit it - you > P.S. I also included Rachel by Mark Nau in that race. After little tweaking Did you get Marks permission? > QUALIFICATION > 10 laps solo speed. The best of 2 attempts. Wow, must have been alot of work. ---ralph ------------------------------ Date: Fri, 11 Apr 1997 10:02:40 -0400 (EDT) From: rscott@NetUSA.Net (Ralph Scott) To: rars@lysator.liu.se Subject: Re: Start in rows of two cars. Message-Id: Content-Type: text > > At 13:50 10.04.1997 +0200, Henning wrote: > > >By the way: 2 rows might cause problems if there are many cars and the > >starting straight is short, e.g. on michigan. Maybe some cars won't > >fit behind the starting line... > > I have tested it on several tracks incl. micigan and have seen no trouble. Well, you are using much smaller cars. Have you tried it on adelaide? Or nurburg? Those have short starting straights. ---ralph ------------------------------ Date: Fri, 11 Apr 1997 18:00:35 +0200 From: kim@ida.his.se (Kim Laurio) To: rars@lysator.liu.se Subject: Re: Random Events II Message-Id: <199704111600.SAA02361@nora.ida.his.se> Christoher wrote: > I would like to suggest the idea of 'uniform random events'. [snip] > In the same manner, RARS incorporates a number of variables which are > constant for all races (e.g. air drag). What if one of more of these > variables was tweaked slightly before each race session. The effect could > be from non-existant to significant depending on the variable(s) and > algorithms of the car. By keeping the variation slight, the effects > shouldn't be devastating. ^^^^^^^^^^^^^^^^^^^^^^^^ Except for those that optimize their parameters (by using some sort of simulated annealing or evolutionary algorithm) for specific tracks and environments. For them a slight change might be a total disaster. :-) Basically, I'm not against anything of this, but to me it sounds like these features should be reserved for the experts of the experts. I guess that a more spectacular visual presentation will lure more people into RARS than increased complexity of the simulation. However, if someone thinks this would be really cool and wants to do it, then no one will object. As long as you make the new features optional. Kim ------------------------------ Date: Fri, 11 Apr 1997 13:01:08 -0400 (EDT) From: rscott@NetUSA.Net (Ralph Scott) To: rars@lysator.liu.se Subject: Re: Random Events II Message-Id: Content-Type: text > Basically, I'm not against anything of this, but to me it sounds like > these features should be reserved for the experts of the experts. Of which we have none. > I guess that a more spectacular visual presentation will lure more > people into RARS than increased complexity of the simulation. However, I agree with this part very much. At least right now. We need a good dedicated movie player. ---ralph ------------------------------ Date: Fri, 11 Apr 1997 10:00:06 -0700 From: Christopher D Lund To: rars@lysator.liu.se (Rars mailing-list) Subject: Re: Random Events II Message-Id: <3.0.1.32.19970411100006.00a8ac40@carlsbad.ucsd.edu> Content-Type: text/plain; charset="us-ascii" Kim writes: >Except for those that optimize their parameters (by using some sort of >simulated annealing or evolutionary algorithm) for specific tracks and >environments. For them a slight change might be a total disaster. :-) Ah, but then that becomes part of the fun. How do you optimize for a track and environment such that little changes in conditions aren't disastrous. I would imagine that adds to the realism of "learning" the track without fixating on the "weather". >Basically, I'm not against anything of this, but to me it sounds like >these features should be reserved for the experts of the experts. And at this point you'll get no disagreement from me. >I guess that a more spectacular visual presentation will lure more >people into RARS than increased complexity of the simulation. However, >if someone thinks this would be really cool and wants to do it, then >no one will object. As long as you make the new features optional. And again, I agree. Without drawing people in, there's no point in adding complexity. But it's just something to think about as an option or better yet, a down-the-road idea. - Christopher Lund ------------------------------ Date: Fri, 11 Apr 1997 16:40:38 -0400 From: "Me!" To: "Rars mailing-list" Subject: Re: Random Events II Message-Id: <199704112039.QAA03587@picspc01.pics.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit hi, can I be taken off the list? I have no clue about programming, I just like racing.. ---------- > From: Christopher D Lund > To: Rars mailing-list > Subject: Re: Random Events II > Date: Friday, April 11, 1997 1:00 PM > > Kim writes: > > >Except for those that optimize their parameters (by using some sort of > >simulated annealing or evolutionary algorithm) for specific tracks and > >environments. For them a slight change might be a total disaster. :-) > Ah, but then that becomes part of the fun. How do you optimize for a track > and environment such that little changes in conditions aren't disastrous. > I would imagine that adds to the realism of "learning" the track without > fixating on the "weather". > > >Basically, I'm not against anything of this, but to me it sounds like > >these features should be reserved for the experts of the experts. > And at this point you'll get no disagreement from me. > > >I guess that a more spectacular visual presentation will lure more > >people into RARS than increased complexity of the simulation. However, > >if someone thinks this would be really cool and wants to do it, then > >no one will object. As long as you make the new features optional. > And again, I agree. Without drawing people in, there's no point in adding > complexity. But it's just something to think about as an option or better > yet, a down-the-road idea. > > - Christopher Lund > ------------------------------ Date: Fri, 11 Apr 1997 16:22:18 -0400 (EDT) From: Daniel Brooks To: Rars mailing-list Subject: Re: newbie Message-ID: Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 11 Apr 1997, Ralph Scott wrote: :)> :)> On Thu, 10 Apr 1997, Ralph Scott wrote: :)> :)Send it to me when you are ready. :)> :) :) :)Oops. Don't send it to me if you are not going to enter the races I run. :)Maido runs the oval races, which is easier ones, and the one you probably :)read about. I run the, err... non-oval races. :) :)BTW, have you been to maidos website? Seen the tutorials? Yea, he posted the message in the news, and I have seen his site. What other sites are there? :)Same code (more or less), just different tracks. Yea, the only difference would probably be that all the turns are in the same direction on and oval, but not on a non-oval. | 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: Fri, 11 Apr 1997 23:09:05 -0300 From: Maido Remm To: rars@lysator.liu.se (Rars mailing-list) Subject: Re: Start in rows of two cars. Message-Id: <3.0.1.16.19970411230905.384f8ef4@tamm.ebc.ee> Content-Type: text/plain; charset="us-ascii" At 10:02 11.04.1997 -0400, you wrote: >> >> At 13:50 10.04.1997 +0200, Henning wrote: >> >> >By the way: 2 rows might cause problems if there are many cars and the >> >starting straight is short, e.g. on michigan. Maybe some cars won't >> >fit behind the starting line... >> >> I have tested it on several tracks incl. micigan and have seen no trouble. > >Well, you are using much smaller cars. Have you tried it on adelaide? >Or nurburg? Those have short starting straights. > >---ralph > You are right. 30 feet long cars do not fit. But we can 1) reduce the distance between cars (2.5 CAR_LEN currently) 2) make them start 3 in row 3) reduce length to universal 15x10 (which looks pretty good to me for current tracks). Maido ------------------------------ Date: Fri, 11 Apr 1997 23:17:55 -0300 From: Maido Remm To: rars@lysator.liu.se (Rars mailing-list) Subject: Re: Results of 10.04 BORS race Message-Id: <3.0.1.16.19970411231755.384f1eb0@tamm.ebc.ee> Content-Type: text/plain; charset="us-ascii" At 09:50 11.04.1997 -0400, you wrote: >> >> Here are the results from the opening race of BORS 10th April, 1997 > >Darn, I was just saying to myself that I should check when to enter >my standard Ralph2 bot. Oh well, I'll enter for next race. And >maybe even a second bot. You should do that. Do not forget - 22.april, Tuesday is the last day to submit >> qualifying, but "too careful" in race. Well, next race is longer, track is > >In my opinion, too careful is not possible. > >> narrower and I probably make car size to 10x15 feets to see them better on >> longer tracks. I am sure my cars won't survive next race without further >> improvement. >> Thus, it cannot be stressed enough - you do not need a fast car, just a car >> that finishes the race. > >And you should enter the Unlimiteds as well. I will. You probably have received my car already. It looks pretty much similar to "turtle 5", but I made some necessary improvements. Hope you do not mind for using partly your code against your Ralph2 car :-). Currently I cannot figure out any other simple and good way to make a stable bot. >I also included Rachel by Mark Nau in that race. After little tweaking > >Did you get Marks permission? > I tried, but nau@agames.com did not exist any more. Wasn't his code marked "public"? I must have downloaded it from ftp.ijs.com. Do you know his new address ? Maido ------------------------------ Date: Fri, 11 Apr 1997 18:21:20 -0400 (EDT) From: rscott@NetUSA.Net (Ralph Scott) To: rars@lysator.liu.se Subject: Re: Start in rows of two cars. Message-Id: Content-Type: text > >> >By the way: 2 rows might cause problems if there are many cars and the > >> >starting straight is short, e.g. on michigan. Maybe some cars won't > >> >fit behind the starting line... > >> > >> I have tested it on several tracks incl. micigan and have seen no trouble. > > > >Well, you are using much smaller cars. Have you tried it on adelaide? > >Or nurburg? Those have short starting straights. > > > > You are right. 30 feet long cars do not fit. But we can > 1) reduce the distance between cars (2.5 CAR_LEN currently) > 2) make them start 3 in row > 3) reduce length to universal 15x10 (which looks pretty good to me for > current tracks). I happen to like the smaller cars, this would shorten up the distance between cars (as its based on car_len). I also am hoping to write code that will properly place cars even when they extend off the first segment. ---ralph ------------------------------ Date: Fri, 11 Apr 97 17:27:08 From: "Jonathan Michael Butzke" To: "rars" Subject: OS/2 version Message-Id: <199704112230.WAA246598@pop03.ca.us.ibm.net> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Is the os/2 version on the ftp site "r_os2_66.zip" the latest version for OS/2? I am having a problem getting it to run correctly. I can compile it (Borland c++ v2.0 for OS/2) with a couple of warnings, but when I try running it, nothing happens. It is like it is getting caught in a loop somewhere before it even draws the windows. I can trace through it for eons, but I never seem to get to a point where it stops working (maybe I just need to trace farther, but I have gone past the point where I think the windows should start popping up). I fully admit that this could all be some dumb mistake on my part..... Basically, if you have bothered to read this far, what I would like is a makefile/project file from anyone that has gotten this code to work. Or (probably easier) some advice on what I can do to make it work/narrow down the problem. thanks, from one of the usually quiet listeners.... Jonathan Michael Butzke ------------------------------ Date: Fri, 11 Apr 1997 21:32:46 -0400 (EDT) From: rscott@NetUSA.Net (Ralph Scott) To: rars@lysator.liu.se Subject: Re: Results of 10.04 BORS race Message-Id: Content-Type: text > > I will. You probably have received my car already. It looks pretty much > similar to "turtle 5", but I made some necessary improvements. Hope you do Oh no! I thought that was posted to the list, and not to be entered, I'll see if I can recover it somehow (probably), but if you time please resend it. > > > I tried, but nau@agames.com did not exist any more. Wasn't his code marked > "public"? I must have downloaded it from ftp.ijs.com. Do you know his new > address ? Only nau@agames.com But if its public, then go ahead. ---ralph ------------------------------ Date: Fri, 11 Apr 1997 21:34:10 -0400 (EDT) From: rscott@NetUSA.Net (Ralph Scott) To: rars@lysator.liu.se Subject: Re: newbie Message-Id: Content-Type: text > :)BTW, have you been to maidos website? Seen the tutorials? > > Yea, he posted the message in the news, and I have seen his site. What > other sites are there? > Hmm, that is the main one. > :)Same code (more or less), just different tracks. > > Yea, the only difference would probably be that all the turns are in the > same direction on and oval, but not on a non-oval. Yes, and the other difference is that you have to plan ahead more for each curve. ---ralph -------------------------------- End of rars-d Digest V97 Issue #40 **********************************