10-16-2012, 08:03 PM,
|
|
charlieg
Member
|
Posts: 98
Threads: 10
Joined: Aug 2005
|
|
RE: New sim code
(10-15-2012, 02:23 PM)NaN Wrote: OK, I am starting to experiment again, not good. Will revert master to the old sim implementation.
I think I'll keep the new code in a separate fork.
What's not good? That you're experimenting? Or the results?
Forks aren't bad things though.
|
|
10-17-2012, 02:41 PM,
(This post was last modified: 10-17-2012, 03:31 PM by NaN.)
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
RE: New sim code
(10-16-2012, 08:03 PM)charlieg Wrote: What's not good? That you're experimenting? Or the results?
Forks aren't bad things though. The new sim has a more correct suspension, driveline and tire contact model but can't keep up with tire response of the old implementation as it is low frequency (90Hz, old code is running at 900Hz). This is noticeable in the handling of high powered cars, to be more exact cars with high torque engines. The solution to run new sim at higher frequency is too demanding if you want to run more than 1-2 cars at 60fps. I've been looking for ways to simplify, speed up the code. But it looks like it might take some time and experimenting (with negative effects sometimes), thus the revert to the old code.
I still would like to mess with the new code as it works great within certain limits.
Edit:
To be honest up to now I've struggled with the tire model (pacejka+beckman). It felt kinda wrong sometimes and I had no idea about the origin/correctness of the parameters.
Now with the real tire data and the more complete pacejka model there is a reference. I feel I should start with the tires and build the simulation around them. Something high frequency with maybe a minimal iterative solver (3 - 4 iterations per simulation step) for the components. It should be fast enough to run 4-6 cars at 60fps on a 2GHz core (16ms per frame).
|
|
10-17-2012, 04:03 PM,
|
|
ghiboz
Junior Member
|
Posts: 44
Threads: 14
Joined: Jun 2008
|
|
RE: New sim code
but the new code that you reverted there's the tire model with the real data or only some fixes and cleans?
|
|
10-17-2012, 04:23 PM,
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
RE: New sim code
(10-17-2012, 04:03 PM)ghiboz Wrote: but the new code that you reverted there's the tire model with the real data or only some fixes and cleans? The tire data and paceka96 code is in a local branch. I've never pushed it. It is more complex and I wanted to compare/profile it against current implementation first to see how much performance it costs.
Additionally the new tire editor script has to be finished and the existing 4? tire configs converted. The parameters are not compatible.
|
|
10-18-2012, 09:52 AM,
(This post was last modified: 10-18-2012, 10:17 AM by NaN.)
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
RE: New sim code
(10-17-2012, 10:34 PM)joevenzon Wrote: Can you run just the tire contact part of your new sim at a higher frequency?
Also, I wonder if there are ways to speed it up by using the GPU...
Maybe something like:
1. bullet rigid body collision/physics step 90Hz
2. suspension response step 90Hz (no contact friction)
3. calculate impulse delta since last step (like in the old sim code)
4. solve driveline and tire contacts at 900Hz, feed impulse delta / 10 as external impulse (like in the old sim code)
Driveline and contact constraints are operating in velocity space, so it might work and should save quite a few body + wheels transform updates and wheel ray interpolation.
The issue I see atm is the separation of suspension response and contact friction. Think of car body roll due to contact friction. There would be a delay by one step(90Hz) till the suspension "notices" the friction effects. But then car mass/inertia might help here. I need to compare it to a full 900Hz version.
|
|
12-08-2012, 02:05 PM,
(This post was last modified: 12-08-2012, 02:07 PM by NaN.)
|
|
NaN
Posting Freak
|
Posts: 2,024
Threads: 120
Joined: Jan 2010
|
|
RE: New sim code
Huh, December already. Progress has been slow in the last months. Just to show that the project is still alive I've upped a AI test video.
http://www.youtube.com/watch?v=3noQ8aSaePs
I am using this ai for sim code testing. It is based on an idea I had for some time already, just never got to implement it. The ai estimates a velocity profile form racing line curvature (up to a minimum/maximum) and uses this information for brake/throttle control. I am using the old(simple) steering logic, so there is still room for enhancements. But it work surprisingly well already.
|
|
12-10-2012, 12:35 AM,
|
|
charlieg
Member
|
Posts: 98
Threads: 10
Joined: Aug 2005
|
|
RE: New sim code
That is pretty awesome.
|
|
|