DF-21 Forums Forum Index DF-21 Forums
The Dark Forces Community
 
DF-21.net Home | FAQ | Search | Memberlist  | Register 
Profile | Log in to check your private messages | Log in

Feature request: Newtonian physics

 
Post new topic   Reply to topic    DF-21 Forums Forum Index -> Feature Suggestions
View previous topic :: View next topic  
Author Message
Darth Oosha
Trandoshan

Joined: 24 Sep 2003

PostPosted: Mar 19, 2008 03:11    Post subject: Feature request: Newtonian physics View user's profile Send private message Reply with quote

I imagine there'd be little actual use for this; for one thing, a lot of players would probably just be frustrated to start a new level and suddenly find that standard DF physics don't apply. But it'd be moderately fun to play with (maybe as a cheat code?), and furthermore I don't actually know how hard it'd be to write (or to allow room for someone to write it), so I'm throwing it out there.

klasodeth
Trandoshan

Joined: 03 Mar 2008

PostPosted: Mar 19, 2008 04:24    Post subject: View user's profile Send private message Reply with quote

I don't think that's a bad idea. It might even make the gameplay more interesting if explosives can send powerups flying. There would probably also be a lot of modding possibilies too. I think it would be a great addition to the extended feature set.

lucius
DarkXL Developer
DarkXL Developer

Joined: 17 Feb 2008

PostPosted: Mar 19, 2008 06:43    Post subject: View user's profile Send private message Send e-mail Reply with quote

While this would be an interesting feature, there are many issues to solve. For example, automatically making volumes out of sprites so we can give them volume, mass, center of mass, intertia tensor (helps to determine how an object rotates about it's center of mass), etc. How to show orientation and motion properly with sprites. How to make the physics match DF physics well enough to make existing levels beatable - assuming we worry about this.

Of course there are some cases where limited physics may make sense, though. For example if I ever implement real vehicles, they can be made more believable using physics.

So I'm not saying no... but this isn't something I'd think about for a while. Many other features would go in first.

Anyway thanks for the suggestions, it's certainly not a bad idea - just an idea for much later Smile

_________________
DarkXL....http://darkxl.wordpress.com

The MAZZTer
Death Star
Death Star

Joined: 25 Sep 2003

PostPosted: Mar 19, 2008 12:55    Post subject: View user's profile Send private message Send e-mail Reply with quote

Havok has recently been or will be soon release free-to-use for anyone to incorporate into their engines.

Might be worth a look, though I imagine being commercial-grade it won't be too simple or easy (or it might be very simple).

_________________
http://www.mzzt.net/ | I am a respectable admin with a respectable sig.

lucius
DarkXL Developer
DarkXL Developer

Joined: 17 Feb 2008

PostPosted: Mar 19, 2008 17:12    Post subject: View user's profile Send private message Send e-mail Reply with quote

There are other options as well such as Newton Game Dynamics and PhysX. I could easily use a free physics engine. The only reason that this is a feature for later is that the "hard" part is the integration with DF gameplay and DF style sprites. These engines tend to want you to format data the way they are setup and use them for collision detection and response. This means making character/NPC controllers and all that. Not to mention special handling so the physics engine sees a coherent view of the world - which isn't always the case with DF (rooms can be on top of each other for example). This stuff is clearly possible, like Portal, but a fair amount of work to get robust.

Certainly something I can explore down the road though Smile

_________________
DarkXL....http://darkxl.wordpress.com

The MAZZTer
Death Star
Death Star

Joined: 25 Sep 2003

PostPosted: Mar 19, 2008 17:47    Post subject: View user's profile Send private message Send e-mail Reply with quote

You don't need to use them all the time... for example for best compatibility any extra physics would be disabled.

I imagine you could invoke the physics engine to act on only specific events, for example, an explosion scattering powerup items.

Although you shouldn't be able to blow around "mission critical" items because that would allow you to easily screw up some of the existing levels by blowing away keys to some inaccessible ledge.

_________________
http://www.mzzt.net/ | I am a respectable admin with a respectable sig.

Darth Oosha
Trandoshan

Joined: 24 Sep 2003

PostPosted: Mar 20, 2008 05:13    Post subject: View user's profile Send private message Reply with quote

klasodeth wrote:
I don't think that's a bad idea. It might even make the gameplay more interesting if explosives can send powerups flying.


It would at that. I was actually only thinking about how the player should realistically inherit the momentum of the surface they're on when they jump, and how projectiles should inherit the player's momentum.

Emon
Ree-Yees

Joined: 10 Aug 2007

PostPosted: Mar 22, 2008 04:33    Post subject: View user's profile Send private message Reply with quote

lucius wrote:
Not to mention special handling so the physics engine sees a coherent view of the world - which isn't always the case with DF (rooms can be on top of each other for example). This stuff is clearly possible, like Portal, but a fair amount of work to get robust.


I'm not sure what you mean. Portal doesn't do anything like overlapping sectors at all. The portals are just shaders and player teleportation trickery.

I'm not sure how similar DF is to JK, but existing physics packages couldn't work for JK's rewrite, Sith2 (which is in alpha and never completed) because of overlapping sectors.

klasodeth
Trandoshan

Joined: 03 Mar 2008

PostPosted: Mar 22, 2008 05:15    Post subject: View user's profile Send private message Reply with quote

I don't think he meant that portal used overlapping areas, but rather that Portal required physics calculations that would never occur in a normal simulation of the real world. Courtesy of the portal gun, a moving object can suddenly find the direction of gravity changing several times versus its own orientation. Plus you can't make assumptions about distance based solely on start and end points. The distance could change depending on how the portals are placed.

Dark Forces wouldn't suffer from those exact same issues, but with the ability of sectors to overlap, a point in worldspace could refer to two or more points in the level, depending on how sectors are arranged.

lucius
DarkXL Developer
DarkXL Developer

Joined: 17 Feb 2008

PostPosted: Mar 22, 2008 08:43    Post subject: View user's profile Send private message Send e-mail Reply with quote

Standard rigid body physics relies on the notion that space is a continous volume of 3D space. In order to simulate portals, physics objects must be duplicated and interactions of one duplicate must be replicated to the other one. Or you must implement "bubble" physics where you treat both sides of the portal as a continuous space but then must handle physical reactions between the continuous 3D world and this "bubble." My point is that portals are more then just a graphical affect because it must interact with the physics. This is an obviously solvable but non-trivial problem - atleast to make it robust.

Now we consider Dark Forces with overlapping sectors: assume you have two overlapping rooms (in x, y and z) with an adjoin in the middle of the room that allows you to "move" between rooms - even though you exist at the exact same physical position all the time. See the Perplexion level as an example of this. Now to handle this with physics you'd have to treat each room as a seperate continuous space and the adjoin as the portal between those spaces. This is where the comparison to the portal game comes in - it's the same idea and some of the same problems (not all of them since your momentum or orientation doesn't change direction).

Now as I said before, this is a solvable problem. In fact I could use similar solutions as Portal. However it is non-trivial and certainly more then just plugging in a physics engine which was my point Smile

_________________
DarkXL....http://darkxl.wordpress.com

The MAZZTer
Death Star
Death Star

Joined: 25 Sep 2003

PostPosted: Mar 22, 2008 15:57    Post subject: View user's profile Send private message Send e-mail Reply with quote

Portal uses the first solution you described (duplicating physics objects) FYI.

_________________
http://www.mzzt.net/ | I am a respectable admin with a respectable sig.

Display posts from previous:   
Post new topic   Reply to topic    DF-21 Forums Forum Index -> Feature Suggestions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group