Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,135 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Sphere Physics Problem #47199
06/04/05 02:55
06/04/05 02:55
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Has anyone had problems with pushing a ball into a corner and it going through walls in the corner?

EDIT: Nevermind, I figured it out, the sphere model must not be centered in MED vertically. If the bottom of the sphere is on the center mark it doesn't happen.

EDIT2: Actually I didn't figure it out. So the question still stands.

Here is an example of what I am talking about. If you get the sphere forced into the corner it goes through WED walls. I am guessing it has to do with the sphere model, but I am not sure. It seems that anytime that a continuous force is applied by the player on the sphere phent object it will eventually go through the level geometry when it's trapped.

Thanks for any help,
Loco

Last edited by Locoweed; 06/04/05 04:13.
Re: Sphere Physics Problem [Re: Locoweed] #47200
06/04/05 06:27
06/04/05 06:27
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Quote:

It seems that anytime that a continuous force is applied by the player on the sphere phent object it will eventually go through the level geometry when it's trapped.





Have you tried this with a cube phent object? Could be inherit to the system. If so we could tweak some physics parameters and try to minimize it.

Re: Sphere Physics Problem [Re: fastlane69] #47201
06/04/05 13:31
06/04/05 13:31
Joined: Aug 2004
Posts: 34
France
S
Superjeu3D Offline
Newbie
Superjeu3D  Offline
Newbie
S

Joined: Aug 2004
Posts: 34
France
Locoweed hello, I do not manage to open your file zip, I have an error message thus I will try to answer you without your example. I had also this problem with a physical object in cylinder I changed some parameters for phent _ and that functioned very well thereafter. That is all that I can say to you...

@+

Re: Sphere Physics Problem [Re: Superjeu3D] #47202
06/04/05 17:24
06/04/05 17:24
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Hi,

@ fastlane, No I don't seem to have these problems with cube phent objects.

@ Superjeu3D, I did re-upload the file incase it was corrupt.

I can minimize the problem to a degree. In the example I just uploaded again it is quite hard to make the ball go the level gemetry, but still possible if you get it trapped right.

Here's the basic code that pertains to the phent sphere if you still can't unzip the file for some reason. In WED the phent sphere's skills set to Mass = 30, friction = 75, bounciness = 75, bounce min speed = 5, and no_polygon = on.
These can of course be played around with from WED.

Code:
  
// some entity skills and flags
define group_id, skill2;
define mass, skill3;
define friction, skill4;
define bounciness, skill5;
define Bounce_Min_Speed, skill6;

define NO_POLYGON,flag7;

var earthgravity[3] = 0,0, -250;


function Main()
{
ph_setgravity( earthgravity );
.
}

// uses group_id
// uses Mass
// uses Friction
// uses Bounciness
// uses Bounce_Min_Speed
// uses NO_POLYGON
action PhentSphere
{
// set polygon collision on if flag says so
if(my.NO_POLYGON == OFF)
{
my.polygon = on;
}

// if entity has a phent group ID set it
if(my.GROUP_ID != 0)
{
phent_setgroup( my, my.GROUP_ID);
}

my.dynamic = on;
phent_settype(my, PH_RIGID, PH_SPHERE); // sets the object within the physics engine
phent_setmass(my, my.mass, PH_SPHERE);
phent_setfriction(my,my.friction);
phent_setelasticity(my, my.bounciness, my.bounce_min_speed);
phent_enable(my, ON); // enable the phent enitity

}




I am also using c_move(), which shouldn't matter, but might.
Let me know if you see anything wrong in the code.

Thanks,
Loco


Professional A8.30
Spoils of War - East Coast Games
Re: Sphere Physics Problem [Re: Locoweed] #47203
06/04/05 19:17
06/04/05 19:17
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Tweak these settings...see if it helps or hinders....

Quote:

ph_iterations
The higher the value set to PH_ITERATIONS, the more accurate the solution will be (= less jittering) but calculations will also take longer. Try values in the range of 5 to 50.






Quote:

ph_setcorrections (var ERP, var CFM);
Sets global correction factors for the physis simulation. ERP stands for Error Reduction Parameter and defines how quickly misaligned constraints get adjusted. Setting ERP to 0 will have constrained objects drift apart after some time because errors get not corrected. With ERP set to its maximum value any constrained objects that get forced into an unacceptable position/orientation will be corrected within a single frame. This however can cause overshooting and it is thus recommended to use smaller values instead. Constraint Force Mixing on the other hand determines how much a constraint is allowed to be violated. Setting CFM to 0 results in very stiff joints (this will lead to errors though- do not do it). Setting CFM to its maximum value makes constrained objects act as though limited by rubber bands.





Jittering and overshooting are two likely culprits for the behaivior you are seeing. In effect what is happening is that for a frame, the calculation puts the object where it doesn't belong (say past the wall). If this is not corrected by the next frame, then the contact force of having an object embedded in another will cause explosions or the PE it will simply think that it is alright and calculate the next step, possibly sending it deeper into the wall and excacerbating the problem.

Re: Sphere Physics Problem [Re: fastlane69] #47204
06/04/05 22:06
06/04/05 22:06
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Thanks fastlane69,

I will play around with those settings and see what happens. It definately may solve the problem.

I was also thinking that since the example is running at around 200fps, that I might need to sychronize the physics fps with the actual fps somehow. It was a thought that popped into my head. I haven't looked into that yet.

Loco


Professional A8.30
Spoils of War - East Coast Games
Re: Sphere Physics Problem [Re: Locoweed] #47205
06/04/05 22:12
06/04/05 22:12
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
200 fps? Wow no wonder.

Yeah, lock that bad boy at no more than 100...even less if you can get away with it.

Also read Marco's sticky in this Physics Forum. He talks a little about fps rates as they pertain to the PE.

Re: Sphere Physics Problem [Re: fastlane69] #47206
06/04/05 22:17
06/04/05 22:17
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Hehe,

Thanks for the help. It's going to be probably end up being a timing issue then. I didn't see some of these problems with larger projects, thus lower fps, so thats probably it.

Thanks again for professing the obvious to the unprofessed (don't look that up in the dictionary) .
Loco

Re: Sphere Physics Problem [Re: Locoweed] #47207
06/06/05 22:50
06/06/05 22:50
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
Going through walls, or "tunneling" happens for two reasons:
a) the object is moving too fast and located on one side of the wall in frame N and on the other side in frame N+1
b) the object's center is allowed to penetrate the wall and then gets pushed out on the other side

For (a) lower PH_CHECK_DISTANCE, increase PH_FPS_MAX
For (b) modify ph_setcorrections, increase PH_FPS_MAX

In either case be sure to read the stickies and search this forum.

Re: Sphere Physics Problem [Re: Marco_Grubert] #47208
06/07/05 02:44
06/07/05 02:44
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Thanks Marco


Professional A8.30
Spoils of War - East Coast Games
Page 1 of 2 1 2

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