Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Carsimulator

Author
Message
Bluedeep
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Finland
Posted: 15th Apr 2003 13:46 Edited at: 15th Apr 2003 13:59
I´m making carsimulator based to real physics.
I´v only done little of it, but there are some good formulas if you are interested. (specs are from corvette c5)
Bluedeep
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Finland
Posted: 15th Apr 2003 14:06
And can someone tell me topspeed, because i programmed part of code here in school, so i cant test it. (i just need topspeed).
ou and any comments?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Apr 2003 16:22
Hi,

I have no idea about car physics, but I like the concept.

Why don't you take it one step further and load the car parameters from a file. Then you could build different cars from different files and load them into the application. Suddenly, it becomes a whole lot more useful and configurable!

Thanks in advance.
All the Best,
StevieVee
TRS80Model1
21
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 15th Apr 2003 19:11
I got 240km/h but doesn't stay at top speed, goes up and down and shifts to 5
TogaMario
21
Years of Service
User Offline
Joined: 30th Jan 2003
Location:
Posted: 16th Apr 2003 06:51
Wow, very nice, good job

P.S. This is what the alphabet would look like if Q and R were eliminated.
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 16th Apr 2003 07:37
TRS80Model1, normally a car wouldnt just get stuck at 240--less there was a governer or something-- because you wouldnt use the statement: IF spd > 240 THEN spd = 240, as normally there would be many conditions stopping a car from going over a certain speed.. friction, engine rpms, and transmission settings...

im gonna look at the code..can never get enough car sims lol...

The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Newsgroup : http://groups.yahoo.com/group/DBMag/
Bluedeep
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Finland
Posted: 16th Apr 2003 12:01 Edited at: 16th Apr 2003 12:02
Yes, i´m going to make file of car specs and such, but first i must finnish physics, there is allways something i havent noticed.
My slip calculations and breaking was wrong, i allso chance little of allmost everything. Now i get topspeed of 272Km/h. x-d
272Km/h is close to real, but it´s not perfect yet,example i must make inertia of wheels and axels.

I make another kind of graphics that show torque/hp curve at given rpm and rpm/speed/acceleration curves at given time.
Jerico2day, car can and normally stuck to topspeed if there´s no slopes on the road and if we wont turn wheel.
Reason why speed goes up and down is that when gear is 5 then car accelerates slowly and then gear chances to 6, what comes to gear 6 is that the gear ratio is so small that engine can´t produce enought power to keep car accelerating, speed and rpm starts to come down and some point gear chances back to 5 and car accelerates.
I don´t know if this is foult of my code or is it just the car that sucks.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 16th Apr 2003 14:23
is this for pro or classic cause i have classic and it doesnt seem to be working
Bluedeep
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Finland
Posted: 17th Apr 2003 12:26
I made it for classic, and i know there was errors like "no such array dimension" and maybe others, because i wasn´t able to test it in school, but you can fix thoes errors.
I advice you to not take that code serius, because i noticed that it sucks. I making new better code, lot better.
This is my plan(i dont show formulas yet):
rpm=angvelocity/gear ratio/differential ratio
enginemaxtorque<--torque at given rpm from curve
enginetorque<--enginemaxtorque/gaspedal%
driveforce<--drivetorque/wheelradius=enginetorque/gear ratio/differential ratio/transmissionefficiency
tractionforce<--driveforce/fdrag/frr
tractiontorque<--tractionforce
totaltorque<--tractiontorque/drivetorque/breaktorque
totalinertia<--wheelinertia/cshaftinertia
angacceleration<--totaltorque/totalinertia
angvelocity<--angacceleration
slipratio<--velocity/angvelocity
tractionforce<--tractionforce/tractionconstant/slipratio
acceleration<--tractionforce/mass
velocity<--acceleration
position<--velocity

I´m not sure if you understand this, but anyway.
Zigma
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 17th Apr 2003 16:48
Hey
Looking forward to this,I'm new to programming and i'm so sick of "rpg" "shooter" code.

ps. Talar ni Svenska?
Chiwawa
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 18th Apr 2003 02:59
zigma..its ... more physic than programming..
Zigma
21
Years of Service
User Offline
Joined: 5th Feb 2003
Location:
Posted: 18th Apr 2003 09:04
Quote: "
Chiwawa say:
zigma..its ... more physic than programming..
"


:-s So
An object moving like an car on a screen, yea it's alot of physics.
There is many sources out there fore good physic simulaitng, but mostly for C/C++. So i realy looking forward to see Bluedeep's work
Chiwawa
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 18th Apr 2003 23:53
yeah im agree with you...but in fact to understand his code..you should firstly understand car's physic...then you should maybe searsh ...some documentation on car's physic...before programming ..it it was just a...comment
TheCyborg
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 19th Apr 2003 05:43
I ran this in Pro got same results.. swinging from 225 - 241...
Nice job...

Bluedeep
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Finland
Posted: 22nd Apr 2003 10:08 Edited at: 22nd Apr 2003 10:11
I have little problem whith my slipforce calculations.
I used Paceijka´s formulas to make slip, this is imbortant because slipforce is force that moves car forward, and i can´t get it work.
Here is the page where i found those formulas:
http://www.racer.nl/reference/pacejka.htm
Propaply i have to find other way to make slip.
Bluedeep
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Finland
Posted: 22nd Apr 2003 10:15
Or... i think i make this work, if not good then bad.
that is so good formula that i can´t just dump that.
Eric
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location:
Posted: 27th Apr 2003 14:43
hi,
Im making a car simulator with dbpro based on physics too
I started 4 months ago but should be interested
to exchange with other people who work in the same way

Cheers
eric.felgines@cooperativesystem.com

OzBot
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: Sweden
Posted: 27th Apr 2003 17:53
If you are interested in programming car physics I recommend you take a look at the following link, scroll down to the section on car physics.

[href]http://www.gamedev.net/reference/list.asp?categoryid=28

Regards,
OzBot.
Eric
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location:
Posted: 29th Apr 2003 18:45
thanks OzBot

does anybody know which force feedback
driving wheel + gear + brake + accelerator
works well with dbpro ?

thanks a lot...

(I currently use logitech momo but force feedback does not work...)

Elite Gaming
21
Years of Service
User Offline
Joined: 10th May 2003
Location: Isle Of Wight, UK
Posted: 14th May 2003 04:36 Edited at: 14th May 2003 04:38
Hi, i hope BlueDeep doesn't mind, but i'm currently expanding on his code, and only a couple of lines have been added, and many deleted, but it shows his code in 3d, currently going to add more code to allow for turning, and rewriting his code for other purpose's such as increased weight for more passengers in the car, weight transfer on turning etc, but have a look.

Edit - i have also changed the specs to those of a Dodge Viper

Login to post a reply

Server time is: 2024-11-24 05:04:29
Your offset time is: 2024-11-24 05:04:29