Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 959 guests, and 8 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
adding force to object (demo added) new question #15581
05/09/03 14:43
05/09/03 14:43

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



I just got A6 and have been playing with the physics but Im having a problem. I want to add to the force of the object in the direction its going, but I cant seem to get it to go anywhere but along a fixed axis. What it needs to do is increase in speed when it hits a certain object.

Any ideas?

EDIT: Also, is there anyway to constrain the object on one axis, for example if I dont want it to move on the Y axis or z axis?

Re: adding force to object (demo added) new question #15582
05/10/03 00:21
05/10/03 00:21
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
do you use phent_addforcelocal?

Re: adding force to object (demo added) new question #15583
05/10/03 04:38
05/10/03 04:38

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Ventilator,

yeah thanks, I think I got it somewhat working using that, I think I just wasnt applying enough force (seems you have to really add to the force to get it to move with one hit). However, sometimes it will hit the object and not go faster, sometimes it will hit it several time in a row and jet off the screen.

Is there a way to limit the force of an object? and a way to limit it so it wont move in the Z pos and jump off the screen?

Re: adding force to object (demo added) new question #15584
05/10/03 05:51
05/10/03 05:51

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



OK, I decided to upload a compiled demo of my physics test so anyone can try it. Its based off my pinball tutorial I did, I just wanted to apply real physics to the ball. You can can test it and see where Im having the problems.

The most obvious, which was the same in the tutorial, is that the flippers tend to move inside the ball causing it to go in wierd directions (I am using Ent_move as suggested by conitec).

Second, the ball doesnt always seem to get the same force applied to it when it hits the bumpers, sometimes it will jut bounce and other times it will take off in a flash.

Third, when you lose the ball each time it restarts (you press S to restart) it starts faster and faster.

I added some lights and sound effects to make it better to test. It plays fairly well considering the problems, though I think it could be a lot better, especially if I can fix them.

Any comments are welcome.

Physics Pinball Test Demo

Re: adding force to object (demo added) new question #15585
05/10/03 06:51
05/10/03 06:51

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



The amount of force on an object can not be limited, but you should set its speed limits to avoid explosions. If possible don't apply one huge force for the duration of a single frame- instead apply smaller forces of the duration of a few frames.

When objects suddenly jump off it's usually due to collision detection problems (edge on edge) or by forcing the object in unnatural positions (such as ent_creating a new model inside a physics object). In case of the flippers I think the problem is that even after an impact the flippers still keep rotating. The ball has not had a chance to get moved out of the way yet the flippers keep rotating towards it and end up inside the ball. Try halting the rotation for a few frames after hitting the ball.

Re: adding force to object (demo added) new question #15586
05/10/03 07:11
05/10/03 07:11
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
quote:
...but you should set its speed limits to avoid explosions.
how can i set speed limits?

Re: adding force to object (demo added) new question #15587
05/10/03 07:46
05/10/03 07:46

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



that helped a little bit. The collision with the flipper is still horrible. I even tried making them passable for a short time and then decreasing the angle so they didnt go into the ball, I even tried slowing them down to pan += 1, but no matter what I do I cant get anything close to realistic action on them. I thought maybe the physics engine would make this a lot easier, but its turning out to be just as hard to code a realistic pinball game.

Re: adding force to object (demo added) new question #15588
05/10/03 07:55
05/10/03 07:55
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i guess the flippers will behave better with the new collision system which comes with the next update. currently non physics entities still use a bounding box which doesn't rotate with the entity. this isn't very suited for flippers.

btw. marco if i try to retrieve the physics bounding vertices with phent_getbounds the position of these vertices doesn't seem to update when the entity moves. could this be a bug?

Re: adding force to object (demo added) new question #15589
05/10/03 08:10
05/10/03 08:10

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



quote:
Originally posted by ventilator:
how can i set speed limits?

With the function phent_setmaxspeed which has not found its way into the manual [Frown]

quote:

phent_setmaxspeed(entity, var maxLinear, var maxAngular);

If an object moves faster than the specified limit it will be stopped (its velocity gets set to 0).
If an object rotates with an angular speed faster than the specified maxAngular limit, it will stop spinning (angular velocity will be reset to 0).

By default objects have no speed limit assigned to them, which can lead to problems of an object leaving the level or showing other unintended behavior. Setmaxspeed acts as a safety net to reduce this problem by halting an object if it goes beyond the specified speed limits. Because it will be halted abruptly, do not use this command for slowing down an object, for that purpose use phent_setdamping / phent_addforce instead.



Re: adding force to object (demo added) new question #15590
05/10/03 08:16
05/10/03 08:16

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



guess Ill have to wait for the next update to see if that helps. Ill try something else for now...

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