PDA

View Full Version : Fine Tuning of the Collisions



bazik
04-27-2009, 08:40 PM
Instead of using the main 1.08 topic, i think its best we discuss here how to fine tune the settings on the engine.ini

Here are the guidelines from siread himself:


Regarding the com AI, it might be possible to improve it slightly through the tweaking of variables in the Engine.ini.

Imagine 2 circles in front of the car, one slightly to the left and one to the right. This isn't a perfect illustration by any means, but it should help you to see what I mean.


O
/
[car]
\
OBasically, if an opposing car is in one of these invisible circles then the driver will know that the direction is blocked and he will move in the opposite direction. If both circles are blocked then he will brake.

collisionangle=32.5
This is the angle of the circles from the forward direction of the car.

collisioncheckdist=6.0
This is how far away the circles are from the car.

collisionsize=5.5
This is the size of the circles.

This means you can make the COM drivers more cautious by increasing the size of the circle or change the angle and distance of the circle to react sooner or later.

It's possible to mess up the AI completely with these settings but the more curious/dedicated players might want to see if they can improve upon the settings. I'm sure they are not perfect. :)

PS, changing the collision settings won't disable leaderboards. ;)


The car is 36 pixels long.

The circle size is 16 + (collisionsize x speed). So the circle has a minimum radius of 16 pixels (when not moving). The faster the car is going the bigger the collision check. Car speed ranges from 0 to 8.75. So at top speed the circle radius is 16 + (6.0 x 8.75) = 68.5 pixels. (Roughly 2 car lengths, or 4 cars in diameter.)

Similarly the circle distance is 24 + (collisioncheckdist x speed) from the centre of the car between the two front wheels. So the mimimum distance is 24 pixels (when not moving) and the maximum is 24 + (5.5 x 8.75) = 72.125 pixels.

Using siread's instructions i made a visual reference of the Default behavior:
collisionangle=32.5
collisioncheckdist=6.0
collisionsize=5.5
Blue = When Stopped
Green = 1/2 of Top Speed
Red = Top Speed

http://img115.imageshack.us/img115/1892/default3.png

i will now try to fine tune this so there some worries about drivers on the side since we all hate when they just repeatedly bang us from the sides trying to ocupy the raceline when we are in the way. Will keep updating this topic. Meanwhile if you have good suggestions for these values share :)

bazik
04-27-2009, 08:53 PM
Just noticed siread switched the values. Should've been:

The circle size is 16 + (collisionsize x speed). So the circle has a minimum radius of 16 pixels (when not moving). The faster the car is going the bigger the collision check. Car speed ranges from 0 to 8.75. So at top speed the circle radius is 16 + (5.5 x 8.75) = 64.1 pixels. (Roughly 2 car lengths, or 4 cars in diameter.)

Similarly the circle distance is 24 + (collisioncheckdist x speed) from the centre of the car between the two front wheels. So the mimimum distance is 24 pixels (when not moving) and the maximum is 24 + (6.0 x 8.75) = 76.5 pixels.

Edited the image

bazik
04-27-2009, 10:54 PM
This needs testing still, but visually it looks right.

What do you think?

http://img126.imageshack.us/img126/8268/my50255.png

Values:
collisionangle=50.0
collisioncheckdist=2.5
collisionsize=5.0

Feel free to test it and post some feedback, i will too!

bazik
04-27-2009, 11:46 PM
my 1st impression is that only the side attacks have ended, but the AI cars still seem to brake to late on the tight bends, and come crashing into my rear.

So i tryed to increase the zone on the front, without increasing too much on the sides:
collisionangle=45.0
collisioncheckdist=6.4
collisionsize=7.6

http://img513.imageshack.us/img513/8246/my2456476.png

siread
04-28-2009, 08:45 AM
Great work bazik. I'd love to hear some opinions of these settings from others.

Sida79
04-28-2009, 08:56 AM
This is what makes these games so cool, I'm at work atm but can't wait to try it myself :)

markohladnik
04-28-2009, 11:21 AM
Wonderful work, guys! :)

SmiLe
04-28-2009, 11:33 AM
Great!

I hope this settings doesn't prevent AI to overpass the player and makes it too cautious.

markohladnik
04-28-2009, 11:52 AM
They are good at both avoiding and passing you now :) great. One setback, though, is that they just tend to sverve left or right all too much and end out of the track really easy - when there are 3 side to side for example, at starts, or passing at high speeds (which could be expected from the sketch bazik provided). I've been 'analyzing' some replays.

Wonderful improvement already!

bazik
04-28-2009, 12:09 PM
They are good at both avoiding and passing you now :) great. One setback, though, is that they just tend to sverve left or right all too much and end out of the track really easy - when there are 3 side to side for example, at starts, or passing at high speeds (which could be expected from the sketch bazik provided). I've been 'analyzing' some replays.

Wonderful improvement already!

Indeed this still needs some improvement, i think i have a good suggestion coming up!

Siread, am i correct in assuming, that you use a single point for each car?
This is, that central point in the center of the car between the front wheels, and when searching for cars inside the "collision balls" you only test for this single point?
This is, the test you make is: For each car, is the single point of other cars on my (this car) "collision balls"?
I'm assuming this, or am i wrong and you test for multiple points for each car?

ravezz
04-28-2009, 01:06 PM
Wow. Really just great what you already did here.

I'll reset my rather ridiculous tries from the last two days now and continue with your ones, they seem to be really good.

Fantastic graphics, by the way! :)
Now we can really imagine how it's working.


EDIT: Okay, my last values were 20 / 6.0 / 8.0, only the collisionangle far away from yours. :)

siread
04-28-2009, 04:38 PM
Indeed this still needs some improvement, i think i have a good suggestion coming up!

Siread, am i correct in assuming, that you use a single point for each car?
This is, that central point in the center of the car between the front wheels, and when searching for cars inside the "collision balls" you only test for this single point?
This is, the test you make is: For each car, is the single point of other cars on my (this car) "collision balls"?
I'm assuming this, or am i wrong and you test for multiple points for each car?

Yes, it just tests for the car "hotspot". The mid-point between the two front wheels.

bazik
04-28-2009, 06:26 PM
Ok, i've been thinking about this problem.

The main problem is the use of circles IMO, because i tried to protect the sides, and they crashed frontal, then i tried to protect both, but they swerve too much off the road, because you can't increase the front, without increasing (too much) the sides.

So i thought in 2 possible alternative collisions systems, just as options for siread to think about:

1)
The 1st one that came to mind, is maybe a little bit too complicated to implement now. I thought about rectangles, because you could increase the front without increasing the sides too much.
Something like this:
http://img212.imageshack.us/img212/2681/my412623.png

This could be done like this:

instead of 3 variables in the engine.ini, only 2. frontcollisionsize and sidecollisionsize.
Then we could use the following formulas:
http://img230.imageshack.us/img230/5544/my4scheme.png
For each rectangle:
the B sides would be at 25px from the "hotspot"
the F sides would be at 40+(frontcollisionsize*speed) px from the "hotspot"
Sr and Sl would be at 25+(sidecollisionsize*speed) px from the "hotspot"
Sl and Sr would be at 10px from the "hotspot"

the 1st picture in the post would have the following settings:
frontcollisionsize = 12.6
sidecollisionsize = 2.3

This all would work, and would solve the problem, BUT it has 2 main disadvantages:
1) Its a completely new system, which would take more time to code
2) The computational/math complexity to find if a "hotspot" is inside a rectangular area is much more complex than calculating the distance to one spot like its being done now.

2)
This brings us to my second alternative idea:
That uses the system already in place but with a single differnce, instead one pair of collision balls, 2 pair! Something like a butterfly:

http://img140.imageshack.us/img140/4743/my325875667025.png

This has the advantage of using the current system, with a minor tweak, now the left ball, is really 2 balls. This would be just some extra "OR"'s in the code. If (is in Leftball1 or is in Leftball2) Then go right.. etc...

This could be done adding 3 lines to the engine.ini and renaming the top 3.
The values for the image above would be:

fcollisionangle=25.0
fcollisioncheckdist=8.7
fcollisionsize=5.6
scollisionangle=67.0
scollisioncheckdist=0.0
scollisionsize=2.5

The disavantages for this system are:
1) its hard to adjust the settings, requiring a lot of visual aid to see what areas we are covering
2) not very precise, in the way that its hard to cover one specific area without covering others.

Ok, that's all, i would hope one of these 2, would help solve the whole problem, by having seperate size zones. The cars would stop in time not the hit the front car, and they wouldn't bump on the side of others, but they wouldn't need to swerve off road to avoid them.

JimProfit
04-28-2009, 07:49 PM
I like your style, bazik. Is there a way to change values on a by driver basis? Some drivers seem to be especially prone to ram into you when you brake for corners.. especially Raikkonen I'm thinking. Maybe it's just my imagination though?

I've also got a suggestion for doing something like this collision thing but in reverse for cars you are lapping. As they should be getting out of the way, and they're currently not.

Sida79
04-28-2009, 09:08 PM
I like your style, bazik. Is there a way to change values on a by driver basis? Some drivers seem to be especially prone to ram into you when you brake for corners.. especially Raikkonen I'm thinking. Maybe it's just my imagination though?

What would be enough for me if drivers were different at all! Perhaps just slight differences in how optimal is the way they follow the racing line or smth...
like +1 for "good" ones, -1 for "bad" ones and 0 for everyone else... sure would lessen the chance of currently existing unrealistic 1st and 2nd driver performances through teams.

JimProfit
04-28-2009, 09:17 PM
What would be enough for me if drivers were different at all! Perhaps just slight differences in how optimal is the way they follow the racing line or smth...
like +1 for "good" ones, -1 for "bad" ones and 0 for everyone else... sure would lessen the chance of currently existing unrealistic 1st and 2nd driver performances through teams.
Haha yes. It should be said I really want to turn Piquet's skill level to 0 or below.. as far down as it can go. He's usually quite high up when I'm playing and it's just. not. right. Hehe. But this would be good, different skill levels on the drivers for different things.. driving in the rain, overtaking, turns, braking, driving with damaged car and so on. I love to see the other drivers do mistakes.

edit: Yeah, this is my last off-topic post in this thread. :)

bazik
04-28-2009, 11:42 PM
I like your style, bazik. Is there a way to change values on a by driver basis? Some drivers seem to be especially prone to ram into you when you brake for corners.. especially Raikkonen I'm thinking. Maybe it's just my imagination though?

I've also got a suggestion for doing something like this collision thing but in reverse for cars you are lapping. As they should be getting out of the way, and they're currently not.

Yeah its just your imagination, all the drivers are equal here.

Well maybe we dont need nothing new to get the lapping done correctly. If the car that comes from behind detects a car in front, the game could tell the car in front to move of the way, but that would bring a problem for our non ai driven cars.

Sida79
04-29-2009, 09:25 AM
@JimProfit - wait till you see Piquet take championship while his team mate Alonso is doing.. like... "not so bad" :D

bazik
04-29-2009, 11:30 AM
in other news... this topic is about Fine tunning of collisions, and there's 2 new suggestions for siread in page 1 :P


Ok, i've been thinking about this problem.

The main problem is the use of circles IMO, because i tried to protect the sides, and they crashed frontal, then i tried to protect both, but they swerve too much off the road, because you can't increase the front, without increasing (too much) the sides.

So i thought in 2 possible alternative collisions systems, just as options for siread to think about:

1)
The 1st one that came to mind, is maybe a little bit too complicated to implement now. I thought about rectangles, because you could increase the front without increasing the sides too much.
Something like this:
http://img212.imageshack.us/img212/2681/my412623.png

This could be done like this:

instead of 3 variables in the engine.ini, only 2. frontcollisionsize and sidecollisionsize.
Then we could use the following formulas:
http://img230.imageshack.us/img230/5544/my4scheme.png
For each rectangle:
the B sides would be at 25px from the "hotspot"
the F sides would be at 40+(frontcollisionsize*speed) px from the "hotspot"
Sr and Sl would be at 25+(sidecollisionsize*speed) px from the "hotspot"
Sl and Sr would be at 10px from the "hotspot"

the 1st picture in the post would have the following settings:
frontcollisionsize = 12.6
sidecollisionsize = 2.3

This all would work, and would solve the problem, BUT it has 2 main disadvantages:
1) Its a completely new system, which would take more time to code
2) The computational/math complexity to find if a "hotspot" is inside a rectangular area is much more complex than calculating the distance to one spot like its being done now.

2)
This brings us to my second alternative idea:
That uses the system already in place but with a single differnce, instead one pair of collision balls, 2 pair! Something like a butterfly:

http://img140.imageshack.us/img140/4743/my325875667025.png

This has the advantage of using the current system, with a minor tweak, now the left ball, is really 2 balls. This would be just some extra "OR"'s in the code. If (is in Leftball1 or is in Leftball2) Then go right.. etc...

This could be done adding 3 lines to the engine.ini and renaming the top 3.
The values for the image above would be:

fcollisionangle=25.0
fcollisioncheckdist=8.7
fcollisionsize=5.6
scollisionangle=67.0
scollisioncheckdist=0.0
scollisionsize=2.5

The disavantages for this system are:
1) its hard to adjust the settings, requiring a lot of visual aid to see what areas we are covering
2) not very precise, in the way that its hard to cover one specific area without covering others.

Ok, that's all, i would hope one of these 2, would help solve the whole problem, by having seperate size zones. The cars would stop in time not the hit the front car, and they wouldn't bump on the side of others, but they wouldn't need to swerve off road to avoid them.

jorge
05-19-2009, 10:00 PM
First of all, congrats to Siread for making such an enjoyable and addictive game --- yet simple enough to require only a limited gameplay and time each day (or hour)...

This said, I am also interested in the discussion of the collision avoidance system in NSGP: it messes my "lots of fuel, few pit stops" strategy, as I inevitably end up being swarmed and smashed by cars and have to pit it just to make repairs.

I don't want to change the config files myself, since I prefer to play the game as is. However, I deeply appreciate the discussion going on, so I wrote a few lines in Mathematica to enable a quick visualization of the avoidance circles surrounding the car, when you change the relevant parameters:

(* ---------------------------------------------------------------------------------------------------- \
*)
(* ------------------------ New Star GP Colision Avoidance Circles \
Visualizer ------------------------ *)
(* ---------------------------------------------------------------------------------------------------- \
*)

Manipulate[

r = 16 + collisionchecksize*speed;
d = 24 + collisioncheckdist*speed;

Print[collisioncheckdist, collisionchecksize];

Show[Graphics[{

{Opacity[0.4], Rectangle[{-18, -10}, {18, 10}]},
{Opacity[0.2], Red,
Disk[{d*Cos[collisionangle*Degree],
d*Sin[collisionangle*Degree]}, r]},
{Opacity[0.2], Red,
Disk[{d*Cos[collisionangle*Degree], -d*
Sin[collisionangle*Degree]}, r]}}]],

{{speed, 8.75, "Speed"}, 0, 8.75, Appearance -> "Labeled"},
{{collisionangle, 32.5, "collisionangle"}, 0, 180,
Appearance -> "Labeled"},
{{collisioncheckdist, 6.0, "collisioncheckdist"}, 0, 20,
Appearance -> "Labeled"},
{{collisionchecksize, 5.5, "collisionchecksize"}, 0, 20,
Appearance -> "Labeled"},

Alignment -> Center]

(* ---------------------------------------------------------------------------------------------------- \
*)

bazik
05-19-2009, 10:48 PM
That's really neat, i had A LOT of work to do this in gimp (its like photoshop for linux, but free).

btw since you are interested in the development of the collision system, siread told me that he would think about this in the next update, so lets just hope :)

off topic PS: jorge? portuguese or spanish name.. are you portuguese too? :P

jorge
05-20-2009, 01:03 AM
Yep, portuguese! Long live Tiago Monteiro, world record rookie (18 finished races in first year) and third place (out of six) in the infamous 2005 US GP! --- and otherwise too ill-funded to remain in the F1 circus...

siread
06-05-2009, 04:42 PM
Version 1.09 now features 6 collision balls!

Basically there are 2 in front, 2 at the sides and 2 at the rear. The front and side balls work as normal, the rear ones are used to signal to back markers that they need to move aside when being lapped.

There are some new fields in the Engine.ini...

collisioncheckdist=7.0
This is the distance ahead of the car that the front balls should be.

collisionsize=7.5
The size of the front balls.

collisionangle_front=25.0
Angle of the front balls.

collisionangle_side=90.0
Angle of the side balls.

collisiondivisor_side=0.35
The side balls distance and size are based on a percentage (0.0 to 1.0) of the front balls.

collisionangle_rear=150.0
Angle of the rear balls.

collisiondivisor_rear=0.75
The rear balls distance and size are based on a percentage (0.0 to 1.0) of the front balls.

showcollcircles=0
Set to 1 to view the collision balls during racing.

I'm exhausted from programming all this so please test some variations of the settings for me and we'll get things perfected! :D

bazik
06-05-2009, 09:40 PM
wow, really nice :D

and THANK YOU for the showcircles, i was already imagining me counting pixels again in gimp eheh

bazik
06-05-2009, 10:48 PM
1st impression is REALLY GOOD! i'll keep testing to fine tune, but from what i see this is already very good from scratch!

Now, since the cars no longer hit each other like boxers in a fight, maybe you (siread) could ramp it up on the damage department, and make collisions more costly since they are a lot more avoidable now.

PS: i'm seeing some cars in the grass, trying to swerve, i'll try to reduce that..

bazik
06-06-2009, 12:00 AM
After only about one hour of testing these settings seem to reduce the heavy swearving to avoid collisions, there isn't 100% safety, which is good, i wanted to keep overtaking frequent, and there is still some accidents and contact, but i think their frequency is about nice.

collisioncheckdist=6.0
collisionsize=5.0
collisionangle_front=15.0
collisionangle_side=90.0
collisiondivisor_side=0.42
collisionangle_rear=160.0
collisiondivisor_rear=0.80

Other user inputs are very much appreciated too! Test settings your selves and share your feedback.

PS: i didn't actually tested backmarkers so, the rear balls are just what i think will work, will test it another time.

robbyd
06-06-2009, 01:23 AM
Working fine for me, only criticism is that on Si's original settings the cars seem to swerve a little too violently and a little too late, meaning they sometimes swerve into the line i've chosen to overtake, rather than them creating an open line for you. If the cars could spot the "blue-flagged" racers sooner, then there would be no need for such violent manouvers when getting out of the way.

Can't suggest much in the way of adjustments, I don't really dabble in the technical side of things, more of a track and car man myself.

Alex Reeves
06-06-2009, 02:08 PM
After only about one hour of testing these settings seem to reduce the heavy swearving to avoid collisions, there isn't 100% safety, which is good, i wanted to keep overtaking frequent, and there is still some accidents and contact, but i think their frequency is about nice.

collisioncheckdist=6.0
collisionsize=5.0
collisionangle_front=15.0
collisionangle_side=90.0
collisiondivisor_side=0.42
collisionangle_rear=160.0
collisiondivisor_rear=0.80

Other user inputs are very much appreciated too! Test settings your selves and share your feedback.

PS: i didn't actually tested backmarkers so, the rear balls are just what i think will work, will test it another time.

I've already made the point about AI and overtaking. It seems that the issue is not the settings here, but the excessively cautious approach taken by the AI to avoid hitting a collision zone at all costs if it can. I've been experimenting with setting the collisionangle_side to be <90 (which to me is realistic considering how peripheral vision would work) and this helps a little, but I think there's something more fundamental in how the AI code deals with the side and rear collision balls that is flawed. Try my deceleration experiment to see it in a particularly graphic fashion....

bazik
06-06-2009, 02:11 PM
I've already made the point about AI and overtaking. It seems that the issue is not the settings here, but the excessively cautious approach taken by the AI to avoid hitting a collision zone at all costs if it can. I've been experimenting with setting the collisionangle_side to be <90 (which to me is realistic considering how peripheral vision would work) and this helps a little, but I think there's something more fundamental in how the AI code deals with the side and rear collision balls that is flawed. Try my deceleration experiment to see it in a particularly graphic fashion....

i will say, that im almost certain that if you want the behavior from the 1.08, you absolutely can, just give the same angle and distance to the from balls from the previous ini and set the others to 0.0 (0%), i'm almost certain that AI wasn't changed per say, the car still goes right and left or brakes, like before, but now the areas of test are bigger!

So, maybe you are right about a flawed approach, but the approach is the same than in 1.08, just with bigger test areas!

Alex Reeves
06-06-2009, 02:17 PM
I just had another thought about this - I think the issue is more fundementally that side-balls are not the way to solve the problem. A better (and simpler) way to solve the side-collision issue would be to use a Cone rather than a sphere for the front-collision zone. If the Cone were to extend from the *rear* of the car, then there would be a narrow but sufficient collision zone to either side of the car to provide the side-bashing issue, and not only that, the car in the rear position would be the one to hit the collision zone first, which would simulate a lot more realisitcally the field of vision.

Unfirtunately I'm not a GIMP/graphics guru, but hopefully this makes sense. Should be relatively easy to code a colllision traingle from the rear of the car to the perpendicular to the radius of the collision sphere (I think I remember enough math to do this!).

Thoughts/ideas?

bazik
06-06-2009, 02:40 PM
I just had another thought about this - I think the issue is more fundementally that side-balls are not the way to solve the problem. A better (and simpler) way to solve the side-collision issue would be to use a Cone rather than a sphere for the front-collision zone. If the Cone were to extend from the *rear* of the car, then there would be a narrow but sufficient collision zone to either side of the car to provide the side-bashing issue, and not only that, the car in the rear position would be the one to hit the collision zone first, which would simulate a lot more realisitcally the field of vision.

Unfirtunately I'm not a GIMP/graphics guru, but hopefully this makes sense. Should be relatively easy to code a colllision traingle from the rear of the car to the perpendicular to the radius of the collision sphere (I think I remember enough math to do this!).

Thoughts/ideas?

your idea is nice, and i agree with you, the ball is not the ideal way to do this, but, i think the only problem with it, (appart from having to change the in place system of balls), is the math complexity.

The problem here is calculating if a single point (the central point of the car) is in an area.

calculating if a point is inside a circle:

square root of the sum of the differences between the corresponding coordinates of each dot (the central dot of the car and the central dot of the circle), gives you the distance between them, take that value and simply compare it to the radius of the circle. This is very simple for a cpu...
calulating if a point is inside a triangle.

you can't escape having to use the mathmatical expressions of the 3 lines that make the triangle, plus, the math expressions that define those lines are ever changing with each turn of direction even if the triangle doesnt increase/decrease with the speed of the car.

Alex Reeves
06-06-2009, 03:10 PM
calulating if a point is inside a triangle.
you can't escape having to use the mathmatical expressions of the 3 lines that make the triangle, plus, the math expressions that define those lines are ever changing with each turn of direction even if the triangle doesnt increase/decrease with the speed of the car.


You only care about one line of the "triangle", as the rest of the area is already covered by the circle. Strictly speaking, it's not a triangle at all, but a cone. The "fulcrum" of the cone is a fixed point, all you really need to do is determine the angle from that fulcrum to the perpendicular of the radius of the sphere and base your collision line around that. It's pythagoras theorem and basic trigonometry, if my very rusty maths serves me correctly.

*edit* - Rusty maths comes back - it's even less than that, I think it's a simple trig function

angle = sin(r/(r+c))

where r= radius of sphere and c = length of car (so that it starts from the rear - this may need to extend back some pixels to create the proper fulcrum point).

Once the angle is determined, draw a line on each side at that angle to the intersection point. Done.

bazik
06-06-2009, 03:34 PM
You only care about one line of the "triangle", as the rest of the area is already covered by the circle. Strictly speaking, it's not a triangle at all, but a cone. The "fulcrum" of the cone is a fixed point, all you really need to do is determine the angle from that fulcrum to the perpendicular of the radius of the sphere and base your collision line around that. It's pythagoras theorem and basic trigonometry, if my very rusty maths serves me correctly.

*edit* - Rusty maths comes back - it's even less than that, I think it's a simple trig function

angle = sin(r/(r+c))

where r= radius of sphere and c = length of car (so that it starts from the rear - this may need to extend back some pixels to create the proper fulcrum point).

Once the angle is determined, draw a line on each side at that angle to the intersection point. Done.

you mean this?

http://img291.imageshack.us/img291/3816/cone.png

if this is what you mean, yes.. it could work, is in radius AND is between that angle, yes i believe you are right!

Humm, this is interesting yes.

i have only 2 draw backs to this:

1) there's no left or right side, but i guess that could be done angular wise too, not really hard.

2) having to redo all the system, when you can, with some trial and error, shape all 6 balls to look somewhat like your proposed design.

ps: have you had a run with my 1st try settings? what did you feel? no better than the original settings?

Alex Reeves
06-06-2009, 03:55 PM
essentially, your drawing is correct as far as catching the fulcrum point, but the "cone" would be built based on the perpendicular intersect to the sphere on each side. So the "top" of the cone would not be a pie-slice but a curve.

An attempt with dodgy ASCII Art below :




^ ^
/ \ / \
| | | |
\ /C \ /
\ C /
\C/
.
Assume the left and right things are the spheres, and the line from the dot at the back is perpendicular to the sphere at the intersection point. The fulcrum point at the rear probably doesn't need to be far from the back, nor should it be.

The system shouldn't need side balls at all. Rear balls are only needed for backmarkers, and a simpler system I'm sure can be devised for that.

Does this make sense?

bazik
06-06-2009, 04:08 PM
you mean circles in the front with a cone in the back?

hummm, i dunno man, i think that wouldn't be better from the balls system now in place.

and please answer me this:
1) have you red about how the balls system work, from siread? its in this post, it describes the 1st ball system in place, the one 1.08 and back. because its important to know that the only detectable part of a car is a single dot inside it, located in the center of the front tires.

2) have you tried to feedle with the settings to improve them? i bet if we work together we can tweak this system to the point that we are all happy with it beucase its so much more adjustable

3) tryed my suggestion? any feedback? i will still improve it, and i have some ideas how... so the values i sent are not optimal, but i think they are an improvement.

Alex Reeves
06-06-2009, 05:03 PM
It's not much different, really. Yes I've read Si's explanation, and I understand that. There's no reason that if we have one fixed point, we can't take another fixed point from 180 degrees behind it at a length of (say) 25 pixels and draw our cone line from that.

You're right though, my math is out if there are two balls. In that case the shape you need to draw is more like a heart than a cone. The math gets more complicated, but I'm sure it's solvable without creating too complex an issue. Thinking further about it, maybe a simple cone like your diagram is easier after all... :)




2) have you tried to feedle with the settings to improve them? i bet if we work together we can tweak this system to the point that we are all happy with it beucase its so much more adjustable

3) tryed my suggestion? any feedback? i will still improve it, and i have some ideas how... so the values i sent are not optimal, but i think they are an improvement.

I have and I did. Try my deceleration test on a straight and watch the crowd build up behind you if you're on the racing line. I haven't rolled back to 1.08 to see if this has always been an issue, but even from watching the starts you can see that the AI is acting differently here. I don't think tweaking the settings will solve it, because I set some extreme values and reproduced the same problem. I don't believe balls on the side are feasible - either that or the AI around impacts in these balls needs to be reworked, not the numbers.

bazik
06-06-2009, 05:26 PM
To SIREAD:

hi simon

some notes after more testing and confirming Alex problem in straight lines:
these settings are working well for me

collisioncheckdist=2.5
collisionsize=6.0
collisionangle_front=20.0
collisionangle_side=80.0
collisiondivisor_side=0.5
collisionangle_rear=160.0
collisiondivisor_rear=1.0

But there is a problem, when i proposed you this method i asked for seperate distance controls for side and front and there is a reason for that.
the problem is that, its logical that the check distances increase with speed, and you should look further away for possible collisions, but you are only at max speed frontally not sideways!.. in fact, if you are going in a straight line, your speed is the max, but the sideways speed is nil! In a curb.. speed reduces but sideways speed increases.

Summing all up, the settings i posted above in this post, are very good for a track like monaco, contact is not frequent enough to become annoying, but its not rare enough and there is alot of overtakings in the bends, specially the tight bends, wich was nice since tight bends are a realistic place to overtake someone. BUT if you go to china, to that massive straight line, you will notice the cars wont overtake EVER in that straight line, because the side balls, increase too much, and pertrude too much and the faster cars cant overtake in the straights, just the bends.

so my proposal for a solution is:


Sideballs should have a seperate check distances setting, instead of using a percentage from the frontal since speed and sideways speed are very different and almost reversely proportionate except for those long open bends flat out, like in monza.
Sideballs check distances should not increase with speed, since your "safe lateral space" you need to avoid getting bumped remains about constant
Sideballs size should either be fixed OR decrease with speed. So that straight lines can be a overtaking spot, and bends are safer from that lateral hassle that previous nsgp versions had.

So engine.ini could look like this:

collisioncheckdist_front same has collisioncheckdist now.
collisionsize_front same has collisionsize now
collisionangle_front (unaltered)
collisioncheckdist_side same has collisioncheckdist now but for the sides and constant!
collisionsize_side same has collisionsize now but for the sides and either constant or decreasing with speed!
collisionangle_side (unaltered)
collisionangle_rear (unaltered)
collisiondivisor_rear (unaltered)

I belive this is a MINOR change to your code. And i firmly belive this would be alot better, it would solve the problem described by Alex, it would allow lots of overtaking while not getting repeatedly slamed to destruction in the process
I also promiss to help you in fine tuning ;)

Alex Reeves
06-06-2009, 05:59 PM
Not to disagree with Bazik, but an alternate proposal is this :

Instead of using side-balls, draw a line between the rear of the car and the perpendicular intercept of the front balls. See the drawing attached to crudely explain. Essentially, you'd get a "collision heart" as opposed to a flower arrangement.

This would be a more significant change (and I can't see exactly the calculation to work out the appropriate angle, but I know it's not that hard!) but would more accurately reflect each drivers "cone of vision" and provide a V-Shape on the sides of the vehicles for collision, rather than a circle. The point of the cone is the only adjustable parameter needed here - it is assumed that it will be an arbitrary point 180 degrees behind the front and centre point used for the front collision balls.

I'm not convinced this solves the problem fully, and wonder if just using a cone as opposed to a circle would be more sensible. But the collision picture this creates seems intuitively to fill the gap that was causing side-bashing. Bazik's point that side-room should be constant or decreasing with speed is an excellent one. I really hope one or the other of these sorts out the overtaking issue, which in my opinion is the much more serious one.

bazik
06-06-2009, 06:42 PM
Not to disagree with Bazik, but an alternate proposal is this :

Instead of using side-balls, draw a line between the rear of the car and the perpendicular intercept of the front balls. See the drawing attached to crudely explain. Essentially, you'd get a "collision heart" as opposed to a flower arrangement.

This would be a more significant change (and I can't see exactly the calculation to work out the appropriate angle, but I know it's not that hard!) but would more accurately reflect each drivers "cone of vision" and provide a V-Shape on the sides of the vehicles for collision, rather than a circle. The point of the cone is the only adjustable parameter needed here - it is assumed that it will be an arbitrary point 180 degrees behind the front and centre point used for the front collision balls.

I'm not convinced this solves the problem fully, and wonder if just using a cone as opposed to a circle would be more sensible. But the collision picture this creates seems intuitively to fill the gap that was causing side-bashing. Bazik's point that side-room should be constant or decreasing with speed is an excellent one. I really hope one or the other of these sorts out the overtaking issue, which in my opinion is the much more serious one.

you are welcome to disagree with me :), i think alternative idea exchange is healthy.

I see where you are going, you are aiming for realistic pilot vision. But i think that wont work, and here's why:
The balls are somewhat tied to vision, but not totally, i am for realism too, but realistic driving instead of realistic vision.
I think you are forgetting some things, for example, drivers have mirrors, they can see when they are about to be overtaken, they have pit radios, steering wheels with time differences displays, and as limited movement may be inside a F1 cockpit, they still have necks, and can glance to the sides. Also they are good drivers, even if the car overtaking them is in a blind spot, they know it's there, and they know they cant turn left/right. They actually know stuff that they cant see, and see stuff you are not taking in consideration. So many times we see amazingly tight overtakes (Rosberg to Massa in Monaco this year :blimey:) and rarely they crash even side by side and i think your model doesn't take that in consideration. AI drivers with your model will NOT see you on their sides, they will have no idea you are there.
Drivers also have blue flags, and in your model rear vision would be nil, or very limited no matter how in the back the cone started, and the back-markers problem would come back

Also it doesn't do much for the overtaking issue, you yourself found out. Think about it, if you increase the front balls enough so you can actually have some sense of what is happening on your side, the front balls will be so immense that the car will violently swerve right/left at the slightest glimpse of a car in front. If on the other hand, front circles are reasonably sized, lateral sense is nonexistent, causing AI of NSGP effectively to go back to the 1.08 times and the cars will slam you repeatedly to destruction on bends. This also shows that controlling the area of collision that you proposed, would be hard and not very flexible.

And that's why i think the 6ball system, with the tweaks i suggested would be a better solution, not to mention easier for siread.

Alex Reeves
06-07-2009, 03:35 AM
I can see the merits in both. Hopefully this discussion has helped Si to come up with something better, although I think I was a lot less bothered by the limitations of the older system than others. I don't think the system as it stands is an improvement on the 1.08 AI - it solves side bashing, but the breaking of AI overtaking is much more fundamental to enjoyable and challenging racing.

siread
06-07-2009, 11:30 AM
Great stuff chaps. I will have a play around with your suggestions over the next day or two and see what we can do. :)

bazik
06-07-2009, 02:19 PM
Great stuff chaps. I will have a play around with your suggestions over the next day or two and see what we can do. :)

hope we could help you, cant wait for the changes :)

siread
06-09-2009, 04:56 PM
Ok, new version:
http://download.newstargames.com/Install_NSGP109b.exe

This allows you to change the settings of the side balls precisely. :)

bazik
06-09-2009, 05:50 PM
Ok, new version:
http://download.newstargames.com/Install_NSGP109b.exe

This allows you to change the settings of the side balls precisely. :)

Many thanks :)
do the side balls shrink with speed? (i'm @ work can't test it now)

bazik
06-10-2009, 11:07 AM
well, sideballs dont shrink, BUT kudos to you siread, very nice addition on the side balls, for the ones who didnt' notice, they now have more check distance when curving to that specific side, this is, i'm doing a sharp right, the distances of the right ball is bigger than the left, that makes PERFECT sense :)

i'm now fiddling with all the parameters, trying to find something good, since the default still has that lack of straight overtaking.

bazik
06-10-2009, 12:47 PM
collisioncheckdist_front=4.5
collisionsize_front=3.0
collisionangle_front=20.0
collisioncheckdist_side=1.0
collisionsize_side=5.0
collisionangle_side=65.0
collisioncheckdist_rear=6.0
collisionsize_rear=4.0
collisionangle_rear=160.0

could someone try this out?

robbyd
06-10-2009, 01:12 PM
looks good to me buddy, the AI certainly seems more adept at spotting gaps and exploiting them. I found that if I run wide into a corner, the AI will pounce upon it pretty quickly, making for some pretty good racing.

However, when you overtake the AI seems to slow down a bit to much, making it rather easy to carve them up...

bazik
06-10-2009, 02:06 PM
looks good to me buddy, the AI certainly seems more adept at spotting gaps and exploiting them. I found that if I run wide into a corner, the AI will pounce upon it pretty quickly, making for some pretty good racing.

However, when you overtake the AI seems to slow down a bit to much, making it rather easy to carve them up...

thx for the input, i'll try to have another go at it today.

Dan'on Hill
09-18-2009, 04:38 PM
Ive been reading this thread, its very interesting and theres been some great work done here. Im asking about the settings which are in 1.16 are different then the settings above (2 posts above) had there been something agreed or you guys still working on that.

Ive noticed personally that the ai seem to have trouble/very hesitant at overtaking eachother, ive seen ai cars wiggle behind a slower car not overtaking them at all, especially on straights.

I would like to know how to make the ai a little more decisive at overtaking eachother? (if possible)

This may be a long shot but could be the cause of the hold up of cars i get here http://www.newstargames.com/newstarforum/showthread.php?t=10218

I THINK I MAY OF MISSED THE BOAT ON THE MODDING SIDE OF THINGS ON THIS SUPERB GAME:(:wall::rolleyes:

robbyd
09-18-2009, 11:24 PM
Ive been reading this thread, its very interesting and theres been some great work done here. Im asking about the settings which are in 1.16 are different then the settings above (2 posts above) had there been something agreed or you guys still working on that.

Ive noticed personally that the ai seem to have trouble/very hesitant at overtaking eachother, ive seen ai cars wiggle behind a slower car not overtaking them at all, especially on straights.

I would like to know how to make the ai a little more decisive at overtaking eachother? (if possible)

This may be a long shot but could be the cause of the hold up of cars i get here http://www.newstargames.com/newstarforum/showthread.php?t=10218


I THINK I MAY OF MISSED THE BOAT ON THE MODDING SIDE OF THINGS ON THIS SUPERB GAME:(:wall::rolleyes:

The collision settings and AI awareness have been put to bed for months now; and it's generally agreed that they are as good now as they're ever going to be...