Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
collision problem after 6.40.5 update #80690
07/08/06 10:26
07/08/06 10:26
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
I´m sorry but i posted this problem in the Physics forum yesterday, but nobody gives some help, so i ask here because i´m stucked right here in my project:
I had this code with version 6.31.4 comm for the ball and the physics was very good and realistic, including collision against models, maps and blocks (geometry).

Code:

PHENT_SETTYPE(MY,PH_rigid,PH_sphere);
PHENT_SETMASS(MY,0.2,PH_sphere);
PHENT_SETFRICTION(MY,75);
PHENT_SETELASTICITY(MY,75,25);
PHENT_SETDAMPING(MY,50,75);
PH_SETGRAVITY(VECTOR(0,0,-386));



However, after the update 6.40.5, even recompiling the maps and the whole level, now the physics is very unstable, the friction and rotation of the ball its not normal, seems to glide on the ground (blocks and sprites).
Sometimes the ball bounces against models, maps and blocks, and sometimes (almost all the time and with more speed), the ball stays close to the model for some time, but rotating on the collision point, and then go back like she was bouncing. I´ve tested with a new level just with a hollow block and a ball with de code above.
It seems to have a delay on the collision response. Please, how can i solve this problem (diferent solution than downgrade the engine)?
Thanks in advance.

Re: collision problem after 6.40.5 update [Re: demiGod] #80691
07/10/06 09:42
07/10/06 09:42
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
Maybe one of your settings is not good. The ball example in the manual uses the following settings:


phent_settype(eBall,_VAR(PH_RIGID),_VAR(PH_SPHERE));
phent_setmass(eBall,_VAR(1.0),_VAR(PH_SPHERE));
phent_setfriction(eBall,_VAR(90.0));
phent_setelasticity(eBall,_VAR(75.0),_VAR(100.0));
phent_setdamping(eBall,_VAR(30.0),_VAR(5.0));
ph_setgravity(_vec(0,0,-500));

(the "_VAR" is for C++ only).

Re: collision problem after 6.40.5 update [Re: jcl] #80692
07/10/06 14:19
07/10/06 14:19
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Hello jcl,
I´ve tested the code example in the manual, and the problem still happens. Above a certain force, the ball stays stucked in walls, maps, blocks and models, rotating until falls down. Btw, i am applying the force using phent_addcentralforce(ball,vector).
I wonder if i am doing something wrong...

Re: collision problem after 6.40.5 update [Re: demiGod] #80693
07/12/06 13:15
07/12/06 13:15
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
I made a downgrade from v6.40.5 to v6.31.4 and the ball physics and collision are great again, using the same level, but recompiled.
I really appreciate that someone could help me on this, or maybe this is a bug, i must have certain about that, because i need the new features of the version 6.40.5 for my project.

Re: collision problem after 6.40.5 update [Re: demiGod] #80694
07/12/06 23:56
07/12/06 23:56
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:

However, after the update 6.40.5, even recompiling the maps and the whole level, now the physics is very unstable, the friction and rotation of the ball its not normal, seems to glide on the ground (blocks and sprites).



The collision detection in 6.40.5 is actually more stable than what is available in 6.31.4, however, forces may have a larger effect than before.
When applying lots of force you can push a phent into solids where it will start spinning. The solution then is to lower your forces. If that is not an option try increasing the ERP/CFM values for contacts so that the entity gets pushed out of solids more quickly, cf. ph_setcontacts()

If you have your level & script for download I can take a look to see where the problem lies.

Last edited by Marco_Grubert; 07/13/06 21:07.
Re: collision problem after 6.40.5 update [Re: Marco_Grubert] #80695
07/14/06 00:06
07/14/06 00:06
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Hi, Marco
I tested your recomendations but the problem persists. So, like you said, i give the link to a simple level test with a hollow cube, a ball and the code for you to examine.
testPhysicsBall
Thanks in advance for spending time trying to help me.

Re: collision problem after 6.40.5 update [Re: demiGod] #80696
07/15/06 09:47
07/15/06 09:47
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Hello, Marco
Did you saw my test level? Any conclusions?

Re: collision problem after 6.40.5 update [Re: demiGod] #80697
07/16/06 10:22
07/16/06 10:22
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
Your level behaves normally here, but this is just chance. I believe that your code won't work properly. For instance:
Code:
 
function applyBallForce()
{
phent_addcentralforce (ball, ballForce.x);
//phent_addforceglobal(ball,ballForce.x,vector(-1000,1000,0));
//phent_addforcelocal(ball,ballForce.x,vector(-1000,1000,-1000));
}

on_f = applyBallForce();


This accelerates the ball in a random way because speed is the product of acceleration and time. But you do not know how long a frame lasts, so your ball gets a random speed, and thus can theoretically end up in a wall despite I haven't observed this with your level. See the ball example in the manual.

Also, your on_f line is not correct - do not use () when assigning a function.

For giving a ball a kick, use addvelcentral. Applying forces is for accelerating during a certain time, like through the rocket engine of a spaceship.

For a kick, apply a velocity, like:

phent_addvelcentral(Ball,vector(100,100,100));

Re: collision problem after 6.40.5 update [Re: jcl] #80698
07/17/06 15:24
07/17/06 15:24
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline OP
User
demiGod  Offline OP
User

Joined: Mar 2006
Posts: 752
Portugal
Hello jcl, thank you for your reply.
I´ve done tests with phent_addvelcentral even with the ball example in the manual, but the problem its the same.
Now, and before eventually close this thread, i ask you just to see the level i made, wich is similar to the other one, but this time uses the 6.40 manual ball example. Because i have problems with monitor refresh rate, using time_smooth=0, fps_max=60, fps_min=20, fps_lock=on, and ph_fps_max_lock=fps_max, the ball doesnt even bounces on the ground, when applying a gravity force more than vector(0,0,-421). Less than this value the ball bounces. BTW, in statistics panel why SRV(time for entity updates and fps_max idling) its so high = 22?
I am sorry for this mess, but i need to be sure that the problem its my work environment or an engine issue. However, in 6.31.4 version i havent saw this problem. Thanks in advance.
testPhysicsBall_changed and _cd

Re: collision problem after 6.40.5 update [Re: demiGod] #80699
07/17/06 17:18
07/17/06 17:18
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
There's a bug with fps_max. Setting fps_max to 60 causes the frame rate to not go any higher than 32 fps. You're not the only one getting this. At least a dozen other users are (myself included).


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

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