Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Off-Screen Physics Processing #340072
08/31/10 16:28
08/31/10 16:28
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
Hi.

I'm working on a game that requires unique usage of the physics engine in order to work. Here is one example:

Normally, the physics engine makes one simulation step per frame. But the project I'm working on demands more flexibility than this. I need to have the physics engine save states (a state is a complete description of the position, velocity, etc. of every physics object), restore states, and perform any number of physics simulation steps per frame, all of which according to a script or DLL.

Here is a simple scenario:
Suppose you wanted to simulate a physics object. You'd have a green cube, and a blue cube. The green cube is a normal physics object, but the blue cube represents where the green cube will be N frames into the future.

When programmed successfully, here are some things you'd see:
- The green cube's movement would generally match that of the blue cube.
- If the blue cube came to a stop, the green cube would come to a stop and land in the exact same position as the blue cube.
- If the user altered the green cube's trajectory, perhaps by pushing it in mid-flight, the blue cube would suddenly move to compensate for the new trajectory.

Here is how it would be programmed:
For each frame:
The physics engine would simulate the green cube, at state X, for N steps and then go back to it's original state X. The position of the green cube after N steps would be where the blue cube will be rendered.

Lite-C is evaluated on the fly, which makes it slower than a pre-compiled DLL. Therefore I'd need this sort of flexibility for DLL-based behaviors, not just for Lite-C.

Is this possible? Please let me know anything you'd think is helpful.

Thanks,

Steve

Last edited by Zergling103; 08/31/10 17:11.
Re: Off-Screen Physics Processing [Re: Zergling103] #340073
08/31/10 16:47
08/31/10 16:47
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
i think you can do this with A8, because you can calculate your physics with PhysX
i don't know how, but it should work

Quote:
Lite-C is evaluated on the fly, which makes it slower than a pre-compiled DLL


i don't think so, Lite-C is also compiled and no interpreter language


Visit my site: www.masterq32.de
Re: Off-Screen Physics Processing [Re: MasterQ32] #340075
08/31/10 17:18
08/31/10 17:18
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
Originally Posted By: Richi007
Lite-C is also compiled and no interpreter language


So it is compiled into binary instructions, in other words? I need clarity on this issue since this is a fairly intensive project programming wise, and I need to make sure I start working with the right language. I'll look through the forums myself, but I'd appreciate input if anyone has any.

Re: Off-Screen Physics Processing [Re: Zergling103] #340208
09/01/10 20:43
09/01/10 20:43
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
Let me answer my own question.

physX_run() lets you tell the physics engine to run whenever you want it to according to the script. When you use physX_open() the physics engine runs once per frame.

As far as state capturing and restoring, I haven't got that part figured out just yet.

Re: Off-Screen Physics Processing [Re: Zergling103] #340217
09/01/10 22:29
09/01/10 22:29
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
A general suggestion: You could also use the C++ SDK to
run the engine.
This way you know excactly how much control you have
about the engine and data.

---


Anyhow, the command "physX_run" might be interesting for your purpose, to run the simulation outside of "framerendering"

Maybe you can combine this with the engine load/save commands, to
save and restore physics states.


Re: Off-Screen Physics Processing [Re: Damocles_] #340222
09/01/10 23:04
09/01/10 23:04
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
Originally Posted By: Damocles_
You could also use the C++ SDK to run the engine.


I'm planning on using Visual Studio 08 for this. I'm still not 100% sure on how I'd go about doing this but so far it seems fairly clear.

Last edited by Zergling103; 09/01/10 23:05.
Re: Off-Screen Physics Processing [Re: Zergling103] #340566
09/05/10 16:52
09/05/10 16:52
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
But how would you do this? I mean there are endless possibilites with a physic object. I mean, if you drag the object that is existing in the real time, not the future one: How should the future one move? It doesn't know if you drag it around for a few seconds or if you let it drop, so there are endless ways, how should you future object should now what is going to happen?

Or maybe I dont get the point laugh


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Off-Screen Physics Processing [Re: Liamissimo] #340585
09/05/10 20:58
09/05/10 20:58
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
its for the user to see whats going to happen if he leaves everything as is, I guess. propably some sort of prediction stuff


Teleschrott-Fan.

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