Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, howardR), 472 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Physics ents getting stuck in level blocks.... #24784
03/28/04 12:43
03/28/04 12:43
Joined: May 2002
Posts: 757
NY, USA
GhostDude Offline OP
Developer
GhostDude  Offline OP
Developer

Joined: May 2002
Posts: 757
NY, USA
I've found that it is pretty easy to get a physics entity stuck in the level geometry. All you need is the entity to hit a block at a decent enough speed (usually not all that much) and part of it will becom lodged inside the block, becoming stuck and no longer responding to gravity, phent_addcentralforce, etc. I've tried to eliminate as many thin walls from my game as possible, but the entity has even gotten stuck on reasonably thick walls and floors, so im not really sure what to do here...


Lead Programmer of Realspawn Productions AIM: gh0s7mp630 MSN: [Email]"mpratt630@hotmail.com"[/Email]
Re: Physics ents getting stuck in level blocks.... [Re: GhostDude] #24785
03/30/04 05:51
03/30/04 05:51
Joined: Dec 2003
Posts: 61
Funkytown, USA
feature_creature Offline
Junior Member
feature_creature  Offline
Junior Member

Joined: Dec 2003
Posts: 61
Funkytown, USA

If this is the same problem I was having, it was reduced by setting the object type to PH_POLY -- but not totally gone.

It also seemed to me that there are particular locations where the object was more likely to pass through the wall than others. I think I read something by ventilator about this, saying, "he knew where to look" for the problem.

I have not had good luck with setting correction values higher because this seems to contribute to the problem of the physics object reacting violently to vertex and edge collisions.

Therefore, I have had best results with PH_POLY and low corrections, but I arrived at this by trial and error and cannot really explain whether this is an appropriate way to do physics.




Curious, but not overwhelmed...demlehwrevo ton tub ,suoiruC
Re: Physics ents getting stuck in level blocks.... [Re: feature_creature] #24786
03/31/04 15:58
03/31/04 15:58
Joined: Jul 2002
Posts: 110
TAIWAN
poloman Offline
Member
poloman  Offline
Member

Joined: Jul 2002
Posts: 110
TAIWAN
yes, I've met the same problem , when using c_move, c_rotate , with new collision system and move mode set to GLIDE, there no glide at all , it just stuck with terrian, level entity, model entities.

mmmm.......

Maybe we have to wait for the new Octree culling system ?


PII 1.2 G 256M RAM GForce FX with 128M RAM
Re: Physics ents getting stuck in level blocks.... [Re: poloman] #24787
04/14/04 12:05
04/14/04 12:05
Joined: Dec 2003
Posts: 61
Funkytown, USA
feature_creature Offline
Junior Member
feature_creature  Offline
Junior Member

Joined: Dec 2003
Posts: 61
Funkytown, USA
I tried something today and it really worked great! I was so pleased that something so simple could have such a big impact!

It's just tracing from the model's origin to 100 quants below it's min_z value (min_z is negative in my model).

Here's a code excerpt:
Code:

//Help the physics engine keep models from sticking in the floor
vec_set(temp,my.pos);
temp[2] += ( my.min_z - 100 );

trace_distance = c_trace(my.pos, temp, IGNORE_ME + IGNORE_PASSABLE );

//if the model is in the floor, push it out some
if ( trace_distance < -my.min_z ) {
phent_enable(my,0);
my.z += .75*(-my.min_z - trace_distance );
phent_enable(my,1);
} //if





Curious, but not overwhelmed...demlehwrevo ton tub ,suoiruC
Re: Physics ents getting stuck in level blocks.... [Re: feature_creature] #24788
04/21/04 10:08
04/21/04 10:08
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:

I tried something today and it really worked great! I was so pleased that something so simple could have such a big impact!



The physics engine already does something similar.

The base physics system checks whether an object is inside a wall at the beginning of each frame and then tries to push it outside. If your forces are very large, ERP (first value) is low, or CFM (second value) in ph_setcorrections is high, however, this counter-force to keep it outside the wall may not be strong enough to keep the object in the right spot. Also if your object has a high velocity it might start out on one side of the object and be on the other side of it within one frame.

To prevent this after each frame A6 checks (via a ray trace) whether the entity's center has passed from one side of a wall to the other side and if so puts it back to where it was. Again, with high forces, low ERP, high CFM, the object can get extremely close to the wall until it's squeezed in and then the trace will fail.

As usual, if you have a test level with severe problems please send it to mgrubert@conitec.net for inspection.

Re: Physics ents getting stuck in level blocks.... [Re: Marco_Grubert] #24789
04/21/04 22:15
04/21/04 22:15
Joined: Dec 2003
Posts: 61
Funkytown, USA
feature_creature Offline
Junior Member
feature_creature  Offline
Junior Member

Joined: Dec 2003
Posts: 61
Funkytown, USA
I'm working on extracting the problem into a test level so I can analyze it in a more controlled way. What follows are the issues I plan to investigate, if anyone has already dealt with them then that might save me some time.

When a physics object does enter a block or entity -- it seems to get pushed out at very high speed. By intervening when physics is disabled, the result seems to be that the object behaves much more naturally. This high speed coming out of a block is also a problem if you are using phent_setmaxspeed because the body ends up with zero velocity because it reached the max speed.

The problem seems *much* more apparent when traversing a map entity or model.

I agree that if I can keep the forces and velocity low enough, the problem does not seem happen very much, but in many cases this creates a system where everything feels too slow. Would it help to scale the whole world smaller so that lower speeds seemed faster, or would a smaller object just suffer the problem more easily?

When corrections are high, if the phsyics entity penetrates even a small bit it seems to be pushed away at a very high rate. This seems to happen when passing over an edge like at the bottom of a ramp, or if you run into a vertex.


Curious, but not overwhelmed...demlehwrevo ton tub ,suoiruC
Re: Physics ents getting stuck in level blocks.... [Re: feature_creature] #24790
04/23/04 05:25
04/23/04 05:25
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:

When a physics object does enter a block or entity -- it seems to get pushed out at very high speed.


I fixed a bug a few weeks ago that would cause physics entities to be pushed out of some entities at a very high speed. Do you get the same problem with level geometry, too ? (In that case it is something different)

Quote:

This high speed coming out of a block is also a problem if you are using phent_setmaxspeed because the body ends up with zero velocity because it reached the max speed.


That's a good observation- it explains why sometimes the entity gets stuck in an invalid spot.

Re: Physics ents getting stuck in level blocks.... [Re: Marco_Grubert] #24791
04/24/04 12:17
04/24/04 12:17
Joined: Dec 2003
Posts: 61
Funkytown, USA
feature_creature Offline
Junior Member
feature_creature  Offline
Junior Member

Joined: Dec 2003
Posts: 61
Funkytown, USA
The problem definitely occurs with entities -- I added code to make the player move more slowly when on top of an entity. I found this out using elevators. I kept "sinking into the floor", occasionally getting stuck inside an entity. Usually just thrown off the entity at high speed.

Level geometry is much more stable than entities. With level geometry the problem is more with moving at with higher velocity towards walls. Sometimes the moving entity gets stuck but other times it passes all the way through.

I still want to identify precisely what I think the issues are from my perspective. That way, I'll know if it's a bug or just a question of my learning to use the system appropriately. I appreciate your help very much, Marco.

I'll get to work on my "experiments" (putting on mad scientist costume as I type) and try to be as clear as possible about what I perceive as a problem.

Thanks again.


Curious, but not overwhelmed...demlehwrevo ton tub ,suoiruC

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