Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (TedMar, AndrewAMD, dr_panther, 1 invisible), 1,186 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Why are Lite-C Physics slow? #148618
08/17/07 08:10
08/17/07 08:10
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline OP
User
MrCode  Offline OP
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
Hi, all, I'm using the Lite-C free version and A6.60 Commercial.

I don't know why, but I have to put in massive values for my physics forces if I want them to work properly.

I don't know if this is due to my objects being too massive or not.

Could it be because I'm compiling my levels with A6? It might be the rendering tree that's causing the problems. I don't know.

Here's my Code:

#include <acknex.h>
#include <default.c>

action phys_obj()
{
phent_settype(me,PH_RIGID,PH_BOX);
phent_setmass(me,2,PH_BOX);
phent_setelasticity(me,10,5);
phent_setfriction(me,35);
}

action phys_ball()
{
phent_settype(me,PH_RIGID,PH_SPHERE);
phent_setmass(me,5,PH_SPHERE);
phent_setfriction(me,70);
phent_setelasticity(me,10,5);
phent_setdamping(me,0,0);
while(1)
{
phent_addcentralforce(me,vector(1000 * (key_cul - key_cur),0,0));
phent_addcentralforce(me,vector(0,1000 * (key_cud - key_cuu),0));
camera.x= my.x;
camera.y= my.y + 100;
camera.z= my.z + 100;
camera.pan= -90;
camera.tilt= -40;
wait(1);
}
}

void main()
{
video_mode= 8;
video_screen= 1;
level_load("line3d_etst.wmb");
wait(3);
ph_setgravity(vector(0,0,-300));
ph_fps_max_lock= 75;
ent_create("earth.mdl",vector(100,0,0),phys_ball);
wait(1);
ent_create("dummy.mdl",vector(-17,0,0),phys_obj);
ent_create("dummy.mdl",vector(17,0,0),phys_obj);
ent_create("dummy.mdl",vector(0,-17,0),phys_obj);
ent_create("dummy.mdl",vector(0,17,0),phys_obj);
ent_create("dummy.mdl",nullvector,phys_obj);
}



Last edited by MrCode; 08/17/07 08:37.

Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: Why are Lite-C Physics slow? [Re: MrCode] #148619
08/17/07 16:30
08/17/07 16:30
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Defing "massive" and "properly".

There is no fixed value that the physics engine should work at, only that which works for you. Hence if it works it works.

I'm using A6 physics and have no problems with it which is why I ask to better define your problem to see if it IS a problem.

Re: Why are Lite-C Physics slow? [Re: fastlane69] #148620
08/17/07 21:02
08/17/07 21:02
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline OP
User
MrCode  Offline OP
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
I have my phent_setmass really low, and yet I have to multiply 1000 with (key_cuu/cud - key_cul/cur) in my forces (phent_addcentralforce).

I don't remember having to put that much force on physics objects before.

I'll probably have to kick myself if it's the ph_setgravity being too high.


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}
Re: Why are Lite-C Physics slow? [Re: MrCode] #148621
08/17/07 22:20
08/17/07 22:20
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
I usually put forces in the thousands as well... don't really think anything of it.

But if this is different you might want to bring it up on the "ask conitec" or "bug report" forum so JCL/Doug can comment.

I'm not using c-lite yet so I have not noticed any difference in using A6.6 physics.

Re: Why are Lite-C Physics slow? [Re: MrCode] #148622
08/18/07 13:29
08/18/07 13:29
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Noticed in A7 with Lite-C Test Run, the physics are different than running a compiled version.


smile
Re: Why are Lite-C Physics slow? [Re: D3D] #148623
08/25/07 00:15
08/25/07 00:15
Joined: Mar 2004
Posts: 281
England
frescosteve Offline
Member
frescosteve  Offline
Member

Joined: Mar 2004
Posts: 281
England
To be consistent with standards you should use kilograms as the unit of mass. The conversion factor from pounds (on Earth) to kilograms is 1 lb. = 0.45 kg

Force accelerates entities according to the Newton formula speed = time * force / mass. Thus for higher acceleration or heavier entities you have to use a stronger force or apply them during a longer time.

Re: Why are Lite-C Physics slow? [Re: frescosteve] #148624
08/25/07 07:50
08/25/07 07:50
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
When you dont make programming mistakes the speed and forces are exactly the same in A7 lite-C or in A6 C-Script. This is only a different language but its the same physics engine. I converted my physics program with no problem.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | 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