Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,435 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
A6 car question #48826
07/07/05 03:26
07/07/05 03:26
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Hi Marco,

I am changing your car tutorial to multiplayer example and i have some questions.

1. My car is smaller than your's and it is not working good as yours. Which variables, constants i have to change if i scaled your car ?
/ My scale is 20cm=1quant /

2. In multiplayer mode, i have created 2 physics car. And it is working good on server, but on client it does not accept key controls.


Thanks, Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: A6 car question [Re: Olzii] #48827
07/07/05 22:25
07/07/05 22:25
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Quote:

1. My car is smaller than your's and it is not working good as yours. Which variables, constants i have to change if i scaled your car ?



I recommend you start by placing your car somewhere above the ground and let it drop. Try different gravity settings until it looks realistic.
Next, set wheel and body mass to a low value and drive the car around. If the car bounces a lot, increase the mass values. If the car has a tendency to flip over then reduce the chassis mass and increase wheel mass. To adjust the friction settings see if the car slips sideways when in a curve or while the handbrake is set. More friction reduces slipping but can lead to undesirable results if too high- just set it to a low value and work it up. Chassis friction is not too important- if the car is a "low rider" you should set that friction to a very low value, otherwise it can be high.
On a level field the car should not be rolling much on its own. Add wheel damping if it does. If the car becomes unstable at high speeds you will have to reduce the maximum speed by changing the max angular value. Should the car be slow in getting moving or the wheels spin in place then you will have to adjust the wheel torque that is applied.
If your car gets stuck in walls you need to reduce the PH_CHECK_DISTANCE parameter. In my demos I use 0.1 for this. The simulation will generally run better at a higher physics framerate (default:70, 140 is better) but requires more CPU power for that.
For best handling the car should be wide, not too tall, with large tires and a chassis that has some ground clearance; in other words a golf cart will be hard to simulate.

Quote:

2. In multiplayer mode, i have created 2 physics car. And it is working good on server, but on client it does not accept key controls. Please help me to solve this example ? Here is my code


I am sorry, but I can not debug projects, unless they specifically demonstrate a potential bug. If you remove everything that is nonessential to the problem at hand, I will check it.

Re: A6 car question [Re: Marco_Grubert] #48828
07/08/05 02:45
07/08/05 02:45
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Thanks Marco,

I have another questions :

- Is there another method to lift up car without creating hook (like u) ?
Because while i am changing it to multiplayer i have to declare many
pointers for each car.
(in Newton physics it can be done changing chasis position higher and reset
the car transformation matrix)
- Is it better or worse to make all my AI-car to physics car in my car game ?
Can engine handle it if i use more than 20 physics car and some physics
objects ? /I own 6.31.4 PRO edition/

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: A6 car question [Re: Olzii] #48829
07/08/05 07:43
07/08/05 07:43
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
that would be 100 physic-objects, from my testings that wont work good (if its not a very fast pc)
i once tried to built a house out of physic-objects (single stones), but specially at startup it was slower then a slideshow. so i think you should test it and see what happens.

you could try to let the ai-cars only have physics enabled when near to the camera, wouldnt that work?


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: A6 car question [Re: ello] #48830
07/08/05 12:45
07/08/05 12:45
Joined: Dec 2004
Posts: 84
W
wildcard Offline
Junior Member
wildcard  Offline
Junior Member
W

Joined: Dec 2004
Posts: 84
Where can I find the tutorial?

Wildcard

Re: A6 car question [Re: wildcard] #48831
07/09/05 09:50
07/09/05 09:50
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
I currently have 8 A.I vehicles using the physics engine. In total that's 4 wheels x 8 and 1 chassis x 8, which equals 40 active physics objects. This runs at 80 - 90 FPS with just one vehicle and the environment in view(remember all the other karts are racing). My computer has 2GB of ram with 3.0ghz and a Radeon 9800 graphics card. Of course there is thousands of lines of code running on top of this so I cannot give you an estimate of what it would be like with just the barebone vehicles racing(quite a bit better I'd imagine).
Anyways, all i'm saying is its possible to have at least 8 racers. If your going commercial then give the option for 4, 6, or 8 racers in your grand-prix mode and all should be good. Personally, I like racing against 6 vehicles. Also, the framerate increases to 120-130FPS.
Ello has a good idea, but if your using pretty closed circuts(and the vehicles you see vary quickly) theres a possibility for huge slowdown with all the enabling/disabling code. Also, it wouldn't help the playing experience if you seen the A.I kart land a jump like it's floating on air(considering your timing is off for enabling them back in the physics engine).

Watch these variables:

PH_FPS_MAX_LOCK = 70;
PH_CHECK_DISTANCE = 20;
ph_setautodisable(100,100,100,100); // turn off
time_smooth=0;//dont set at "1", bug with physics engine

They make a huge difference on your performance. PH_FPS_MAX_LOCK when set higher can slow things down alot with multiple vehicles. When PH_CHECK_DISTANCE is lower it will slow down the performance. Do some testing, see what works for you in the balance of performance/stability. I'd reccomend giving the user an option to change the simulation of the physics in the end as well(for higher end users).

P.S - Incase anyone wants to know for the future. I've found a great way to do spinouts(like in Mario Kart) and whatever else you'd like. Just make your real physics vehicle invisible, reduce it's speed accordingly, then create another model and have it do what you want(while following your invisble vehicle). I know this seems like common sense, but I spent an uneeded amount of time wrestling with the physics engine trying to do spinouts and flip effects. It's quite hard to make something in the physics engine do the same thing each time(if not impossible) for an arcade racers spinouts.


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: A6 car question [Re: Olzii] #48832
07/09/05 10:05
07/09/05 10:05
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
About the flipping - Heres some code I made up:

Code:

//Put this on the top of your function
var stop_vanish2;

/*Put this in a while loop, be sure to change the pointer from "kart1" to whatever your main chassis's pointer is, the same goes for the wheels of that chassis/*
.
if(!key_x && !joy_4 || !joy_4 && !key_x) && (kart1 == me){stop_vanish2 = 0;}
if(key_x && !joy_4 || joy_4 && !key_x) && (kart1 == me) && (stop_vanish2 == 0)
{
stop_vanish2 = 1; my.lightrange = 0;
vec_set(temp.x, my.x); temp.z += 30;
phent_enable (kart1_FL,0); phent_enable (kart1_FR,0); phent_enable (kart1_RL,0); phent_enable (kart1_RR,0); phent_enable (my,0);
vec_set(my.x, temp.x); vec_set(kart1_FL.x, temp.x); vec_set(kart1_FR.x, temp.x); vec_set(kart1_RL.x, temp.x); vec_set(kart1_RR.x, temp.x);
my.tilt += 180; kart1_FL.tilt += 180; kart1_FR.tilt += 180; kart1_RL.tilt += 180; kart1_RR.tilt += 180;
my.pan += 180; kart1_FL.pan += 180; kart1_FR.pan += 180; kart1_RL.pan += 180; kart1_RR.pan += 180;
phent_enable (kart1_FL,1); phent_enable (kart1_FR,1); phent_enable (kart1_RL,1); phent_enable (kart1_RR,1); phent_enable (my,1);
}



What it does is temporarly un-enables your vehicle from the physics engine, then flips it using basic pan/tilt/roll and then re-enables it.

BTW - sorry about the double post, I missed this question in the first one...


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: A6 car question [Re: William] #48833
07/18/05 10:02
07/18/05 10:02
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Thanks, William

I'll try your flip code.

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: A6 car question [Re: Olzii] #48834
07/23/05 05:57
07/23/05 05:57
Joined: Sep 2004
Posts: 260
UB,Mongolia
Olzii Offline OP
Member
Olzii  Offline OP
Member

Joined: Sep 2004
Posts: 260
UB,Mongolia
Hi Marco,

I have two question.

1. I said you before my level has scaled /1quant=20cm/.
I couldnot find any information about your car tutorial level's scale.
In Update_speed() function there is one line :
linSpeed= vec_length(vecLin) * 0.091; // convert from quant/sec to kmh
How many meters or centimeters are equal to your level's one quant ?
2. I want to make manual gear transmission for my car. Please give me some
advise how to do it ? Is there any tutorial about gear shifting ?

Olzii


The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
Re: A6 car question [Re: Olzii] #48835
07/25/05 22:41
07/25/05 22:41
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
The usual assumption is that 1 quant= 1 inch= 2.54 cm

In the car demo there's a linear relationship between how much gas you apply and the velocity that you get. I also added a maximum velocity that can not be exceeded. For a manual transmission you would have to implement a maximum velocity for each gear. E.g. the second gear only allows velocities up to 30 kmh. Of course it also affects the amount of wheel torque available for accelerating. In the demo this wheel torque is a constant and you would have to adjust the script to take into account what gear you are in (low gear= high torque, high gear=low torque).

Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1