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 (), 16,302 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
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 | 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