Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 1,592 guests, and 4 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 2 of 2 1 2
Re: Player Physics? [Re: fastlane69] #20004
01/09/04 07:59
01/09/04 07:59
Joined: Apr 2003
Posts: 111
france
seb_dup1 Offline
Member
seb_dup1  Offline
Member

Joined: Apr 2003
Posts: 111
france
Quote:

The newton engine is free (?) and is compatable with A5 (?). I put question marks cause I'm not 100% sure on both those facts, but if you want physics without the 3DGS PE, you should look at the Newton Physics Engine threads.





The Newton engine is free and compatible with A5.51, A5.551 and A6.xx,all comercial version or better.

NB: Newton wrote :"I did not test it on versions lower than comercial but it should work fine" .

Re: Player Physics? [Re: fastlane69] #20005
01/16/04 00:50
01/16/04 00:50
Joined: Aug 2003
Posts: 275
Germany
kopitzki Offline
Member
kopitzki  Offline
Member

Joined: Aug 2003
Posts: 275
Germany
would like to pick up your thread, fastlane,
my player code includes
while(1)
{
phent_enable(my,0);// disable physics
inputmove();//ent_move player, can be replaced by addforcelocal after phentenable
anime();// defining the animating frames of the model
phent_enable(my,1);// enable physics
wait(1);
}

all works fine, even ent_move when physics are disabled - but:
the model shows fine smooth physics behavior only with ph_type SPHERE (some force constantly pulling down the feet), with a ph_type BOX set it starts getting shakybumpingbouncy - especially with collisions - like a BOX. When set to SPHERE it doesn't fit through doors anymore. So how do you make the model stick firmly to the ground while running its animation frames and moving it?

Re: Player Physics? [Re: kopitzki] #20006
01/20/04 02:30
01/20/04 02:30
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
Hmmm, there are alot of things to consider re: the workings of the Physics Engine before we go too indepth into your code:

a) what is your gravity set to? (ph_setgravity)
b) what is your elasticity set to? (phent_setelasticity)
c) do you have any of the corrections set and what to? (phent_setmasspeed and ph_setcorrections)

Perhaps in answering this question and messing with these parameters you get more stable behaiviour. Otherwise, post you settings (or lack thereof) and we can take it from there.

Re: Player Physics? [Re: fastlane69] #20007
01/21/04 23:53
01/21/04 23:53
Joined: Aug 2003
Posts: 275
Germany
kopitzki Offline
Member
kopitzki  Offline
Member

Joined: Aug 2003
Posts: 275
Germany
In Antwort auf:


a) what is your gravity set to? (ph_setgravity)
b) what is your elasticity set to? (phent_setelasticity)
c) do you have any of the corrections set and what to? (phent_setmasspeed and ph_setcorrections)





gravity is set to nullvector (the model being pulled down by phentaddforcelocal to feet: no other way because the other models have no gravity), elasticity to 50,10, (because I want the player to bounce off walls) and the corrections to default, and maxspeed to some feasible limits (I guess 500 and 500);
Do these settings have any terrible effect on my model's behavior?



Re: Player Physics? [Re: kopitzki] #20008
01/22/04 04:19
01/22/04 04:19
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
It's been my experience that simulating gravity using phent_addforce IS NOT the same as setting your grav_vec.

I was trying to remember where I saw your behaiviour in my code and this was it; when I manually set grav (using phent_add), I too got that shaky bouncybehaiviour when I "landed" on the gound. My final conclusion was that the Physics Engine kept trying to pull the object down to the ground and this set up all kinds of nasty instabilitys with bouncing and shaking. In other words, I was unable to have an object stabling pushing on another surface. You could set your elasticity to 0 and this would stabilize your gravity, but as you said, then you wouldn't be able to bounce off walls.

Some things to try out:

1) play around with ph_setcorrections. Make it unforgiving (ie a high correction value) and it might stabilize your movement. If using the physics engine, it's good to familirize yourself and optimize the ph_setcorrections since the default values ofter aren't good enough for our projects.

2) You might want to turn on gravity to have your player be smooth and then apply a phent_addGLOBALforce (needs to be global since gravity is global) pointing up (opposite the direction of your grav_vec) to all other object to counteract gravity and thus simulate null grav. This way, your player will be the only one to fall under gravity, but your other entities should move as it there was no gravity. Not sure about this method though

Re: Player Physics? [Re: fastlane69] #20009
01/22/04 06:27
01/22/04 06:27
Joined: Aug 2003
Posts: 275
Germany
kopitzki Offline
Member
kopitzki  Offline
Member

Joined: Aug 2003
Posts: 275
Germany
Your second idea seems to be it, thanks a lot!

Page 2 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