Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,507 guests, and 12 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
physics stop working, why? #325297
05/25/10 21:25
05/25/10 21:25
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
Hi!

I just began today playing with the physic engine of gamestudio.
then I got a problem.

I tried to build a house using bricks, which all use this code:

---------------------------------------------
action box()
{
phent_settype(my,PH_RIGID,PH_BOX);
phent_setmass(my,1,PH_BOX);

phent_setfriction(my,100);
phent_setelasticity(my,1,0);
phent_setdamping(my,50,6);
ph_setgravity(vector(NULL,NULL,-800));
}

---------------------------------------------

I found out that if I stack to many bricks on each other, they lose their physics.
they still have their physics if I make the same amount of bricks around the game without them touching each other, but as soon as they touch each other, they lose their physics.

then I tried to make balls with physics touch the bricks, and the balls lost their physic too!

what can be the problem? is there some kind of limit or something? please help.


thanks!


- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: physics stop working, why? [Re: Muhsin] #325301
05/25/10 21:41
05/25/10 21:41
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
gamestudio's physics engine ODE uses an O(n^3) solver by default. this means that performance and memory usage scales cubically with the number of touching physics objects. so the number of physics objects in a stack is quite limited as you can imagine.

in older engine versions a stack overflow caused an engine crash in such cases but now there seems to be some safety mechanism to prevent that. freezing physics isn't that great either though. laugh

other physics engines use algorithms that scale better but you can't really do a house made with thousands of bricks with them either. it still takes to much processing power. additionally many engines only can achieve algorithms that scale better by using cheats that lead to more unrealistic physics (spongy objects, jittering, clamped mass ratios,...).

Re: physics stop working, why? [Re: ventilator] #325305
05/25/10 21:52
05/25/10 21:52
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
so there isn't something wrong with my code, but the way gamestudio uses physics?

ok, thanks.

is there another way to stack objects on each other without making the physics to freeze?

thanks

- Muhsin Kaymak


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: physics stop working, why? [Re: Muhsin] #325365
05/26/10 09:55
05/26/10 09:55
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Yes, use Newton.
It isn`t that hard.



Re: physics stop working, why? [Re: Random] #325374
05/26/10 10:48
05/26/10 10:48
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline OP
Member
Muhsin  Offline OP
Member

Joined: Nov 2008
Posts: 196
the wrong place
ok, thanks I will try that!


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!

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