Gamestudio Links
Zorro Links
Newest Posts
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
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 579 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: physics in water #15720
05/25/03 04:34
05/25/03 04:34
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
changing gravity is not a good idea. gravity is a global force. it affects all physics entities in the level.

what happens if you use the second example? what did you use in the demo?

Re: physics in water #15721
05/25/03 04:38
05/25/03 04:38
Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
Phantom88 Offline
Expert
Phantom88  Offline
Expert

Joined: Oct 2001
Posts: 1,407
Helsinki, Finland
Maybe you should chane the "air" friction. Then you would get the effect you want: The terminal velocity would drop, thus speed falling.

~Phantom88~


Programmer, Gamer ICQ #: 157485106 | Xfire: Phantom1988 | MSN: lauri_andler@hotmail.com | AIM: FinPhantom | YAHOO: FinPhantom
Re: physics in water #15722
05/25/03 05:16
05/25/03 05:16
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
you have to simulate the h2o molecules. fill the pool with millions of tiny invisible balls! [Smile]

Re: physics in water #15723
05/25/03 06:19
05/25/03 06:19

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



quote:
You have to simulate the H2O molecules. fill the pool with millions of tiny invisible balls!
YES! YES! YES! Damned, why I didn't tried before, hehehe!!! [Wink]

Re: physics in water #15724
05/27/03 17:21
05/27/03 17:21
Joined: Nov 2001
Posts: 176
M
mss Offline
Member
mss  Offline
Member
M

Joined: Nov 2001
Posts: 176
quote:
Originally posted by DocJoe:
I let fall the following ball on/in a passable block (water). I really get stange behaviour (the ball becomes like a shark, hehehe!) . What do you think about? Is there a way of improvement?


I think i have a code that should do. It works fine for me.

code:
 
var earthgravity[3] = 0,0, -386;
function emit_sphere(); //prototype of the function


sound whamm = <explo.wav>;
sound dump=<dump.wav>;

function shoot_event
{
if (EVENT_TYPE == EVENT_shoot)
{
ENT_playSOUND(MY,whamm,1000);
vec_set(temp,normal);
vec_scale(temp,40000);
phent_addcentralforce ( my, temp );
}

if (EVENT_TYPE == EVENT_friction)
{
ENT_playSOUND(MY,dump,1000);

}

if (EVENT_TYPE == EVENT_Block)
{

if(vec_length(bounce)>100)
{
my.skill41=snd_playing(my.skill40);
if(my.skill41==0)
{my.skill40=ENT_playSOUND(MY,dump,200);}
}

}
// etc. ...
}


function phset() //Normalbahaviour
{
phent_setmass(my, 0.5, PH_Sphere);
phent_setfriction(my, 70);
phent_setelasticity(my, 70,20);
phent_setdamping(my, 20, 20 );

}


function wphset()//Waterbehaviour
{
phent_setmass(my, 0.001, PH_Sphere);
phent_setfriction(my, 70);
phent_setelasticity(my, 70,20);
phent_setdamping(my, 95, 95 );

}



action sphere

{

var speedvec[3];//for waterbehaviour
var onwater=0;
my.metal=on;
my.shadow=on;
my.enable_block=on;
my.ENABLE_shoot = ON;
my.EVENT = shoot_event;



ph_setgravity( earthgravity );
phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setmaxspeed(my,30000, 5000);

phset();
wait(5);

vec_set(speedvec,nullvector);
speedvec.z=1;

temp.x=cos(camera.pan)*cos(camera.tilt)*30000;
temp.y=sin(camera.pan)*cos(camera.tilt)*30000;
temp.z=sin(camera.tilt)*30000;

phent_addforcelocal(my,temp,nullvector);


while(1)
{

if(content(my.x)==2) // Entity on passable Block?
{
if(onwater==0)
{
wphset(); //set Physic-Params for Waterbehaviour
onwater=1;
}
phent_addcentralforce(my,speedvec);
}
else
{
if(onwater)
{
onwater=0;
phset(); //No longer in Water->reset params
}
}
wait(1);
}


}

string mdl_sphere=<sphere3.mdl>;

function emit_sphere()
{
temp.x=camera.x+cos(camera.pan)*cos(camera.tilt)*100;
temp.y=camera.y+sin(camera.pan)*cos(camera.tilt)*100;
temp.z=camera.z+sin(camera.tilt)*100;
temp.z=camera.z+sin(camera.tilt)*100;
ent_create(mdl_sphere,temp,sphere);
}

on_mouse_left=emit_sphere;




Re: physics in water #15725
05/28/03 01:21
05/28/03 01:21

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



@mss: Ooooooops, many thanks for your big code, will try it tonight!

Re: physics in water #15726
05/29/03 02:27
05/29/03 02:27
Joined: Jun 2002
Posts: 328
M
Master_Joe Offline
Senior Member
Master_Joe  Offline
Senior Member
M

Joined: Jun 2002
Posts: 328
coole waffe auf dem screenshot. [Big Grin] [Big Grin] [Big Grin] [Big Grin] [Big Grin]

Re: physics in water #15727
05/29/03 05:08
05/29/03 05:08

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I looked at the demo, but can not help you with the water problem right now, though I do have an idea of what might be causing the explosions.
As for the patch: does reducing the mass help in fixing the problem? I would have thought increasing the mass should be more suitable in that it makes the sphere more resistant to movement (as does increasing the damping).

Some more remarks on the demo:
- no mirror/transparency effect
- the warlock becomes invisible after being shot (is that by design?)
- nice bleeding, though it would be neat if the puddle size was varying
- great ripples, but for some reason the ripples also appear around the player's feet

If you have not done so already, download the Half-Life 2 engine/game video from E3. It's 600MB but well worth it. Many of the physics effects shown there can be reproduced with A6 (buoyancy and "soft bodies" not yet). How about recreating a GameStudio demo with that gravity weapon ? [Wink]

Re: physics in water #15728
05/29/03 08:37
05/29/03 08:37
Joined: Nov 2001
Posts: 176
M
mss Offline
Member
mss  Offline
Member
M

Joined: Nov 2001
Posts: 176
quote:
Originally posted by Marco Grubert:
As for the patch: does reducing the mass help in fixing the problem? I would have thought increasing the mass should be more suitable in that it makes the sphere more resistant to movement (as does increasing the damping).

I have increased the mass to 1 and the speedvector.z to 1000 and it looks a bit more realistic.
Increasing the linear damping is necessary, otherwise the sphere would jumping around the waterlevel.

Re: physics in water #15729
05/29/03 11:46
05/29/03 11:46
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
quote:
Many of the physics effects shown there can be reproduced with A6 (buoyancy and "soft bodies" not yet).
i guess this mattress effect could be done with the new bonerotate commands and some invisible cubes connected with hinges.

quote:
How about recreating a GameStudio demo with that gravity weapon ?
i tried it right after seeing the halflife2 video but it was trickier than i thought. it would be easier if all physics entities (not only constraints) had motors. or do you think i should just turn off physics for the object while holding it with the grav-gun?

Page 2 of 3 1 2 3

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