|
|
Real-time Physics? |
|
|
Mole |
Jun 22 2006, 12:03 PM
|
PW Consultant
Group: PW Developer
Posts: 791
Joined: 11-January 05
From: Beaverton, Oregon
Member No.: 97
|
There are a bunch of physics engines that we could use. The ones that I can think of off the top of my head are the Open Dynamics Engine, OPAL, Havox, NovodeX, Newton, True Axis, and Tokamak and you already mentioned NxOgre.
You are right, if we are going to implement something like real-world physics in PW, then we have to make sure whatever we implement is compatible with everyone. I do not think that limiting ourselves to supporting a single hardware accelerator would be the right idea, but maybe it is. Whatever we do, the game still has to be just as playable, and look just as good, for those people without the physics card.
Maybe a better question would be this: if we implemented real-world physics, what would we use it for? I would like to hear the PW community weigh in on their thoughts on what we could do by implementing this.
It has to be something more than just making the monsters fall over ??realistically? when they are killed.
What do people think?
-Mole
--------------------
Co-Founder & Consultant Project Wish
|
|
|
|
Minthos |
Jun 25 2006, 11:39 PM
|
PW Programmer
Group: PW Developer
Posts: 316
Joined: 12-January 05
Member No.: 198
|
Let me tell you this: Oblivion has quite nice physics, but when stuff dies in that game they suddenly get handed over to the physics engine and it looks utterly weird.
What I would like to see physics used for in our game is destroying buildings and walls, and destroying or moving other obstacles (boulders, trees, etc). We could have a threshold for the amont of force required to affect something, and a threshold for the minimum size of something for it to be affected, to avoid excessive calculations.
Server calculates, using a simplified physics formula, what the effects of the change is to gameplay (I can only think of pathfinding right now), and clients draw some fancy graphics depending on their capabilities (using hardware physics, software physics or very simplified physics), to illustrate to the player what the server already knows.
I played a first-person shooter a few years ago that allowed you to destroy parts of the game world (earth, walls, rock, you name it) with explosives, I don't remember what its name was, but I really liked that feature. It wasn't anything fancy, you just saw an explosion and pieces of wall flying everywhere, and then there was a neat little hole in the wall large enough to crawl through. It also had some huge vehicles that could dig through rock. I've never seen any other game do this, perhaps with the exception of a mechwarrior game where you could make shallow craters in the ground with explosives, but that doesen't really count.
In my opinion we should definitely add physics to our todo list. With a bit of clever mathematics I'm sure we can do basic physics in software without too much cpu load, we just have to simplify the formulas as much as possible and leave out some details.
|
|
|
|
Mole |
Jun 27 2006, 02:18 PM
|
PW Consultant
Group: PW Developer
Posts: 791
Joined: 11-January 05
From: Beaverton, Oregon
Member No.: 97
|
This is kind of a long post and includes replies to a few people... Bear with me here!
[blockquote]Ghedi said:
The most obvious uses would be character and object motion... We couldn't use it for determining if projectiles hit their mark, though, because we'd have to calculate the odds server side to prevent exploits... and we don't want to weigh down the server with calculating trajectories.[/blockquote]
I wonder if we could use the physics engine to determine whether or not a projectile hit its mark. I have not looked at any of the physics engine code so I don??t know if this is possible or not. What if we could use the server to calculate the physics part of the trajectory and then passed the calculation off to the client to render it?
I know you said that we don??t want to weigh down the server with calculating trajectories, but we could always make a physics server that can do the calculations. The server marshaler could send the physics calculations to the physics server. If the physics server doesn??t exist (because we shut it off or whatever) then the client ??calculates? the physics (which is to not calculate any physics). Either way the projectile gets displayed, one just a little more accurately than the other.
With the distributed nature of the server, having various processes to calculate things would be easy to do.
[blockquote]Ghedi said:
One thing that a physics engine could do server side is validate how a player moves, making sure that he's not cheating,[/blockquote]
Wouldn??t this be calculated by the pathfinding algorithms that would calculate how a player moves and to make sure they are moving ??correctly??
[blockquote]Ghedi said:
Other than that, most physics should be done client side for visual effects... good old falling monsters and such[/blockquote]
If this is the only thing that we are using a physics engine for, then I would say to not do it. Falling monsters can all be approximated with a simple algorithm. It may not be very realistic, but it can easily be made to look just like every other game in existence and it wouldn??t take nearly any processing power to do it.
[blockquote]Honis said:
Ex: You have 2 people (X and Y) playing in the same area. X has the $5000 computer that is god like. Y has a $500 computer from Gateway. In the game say X blows up a pile of rocks. This results in bebbles, dust, etc. that needs to be calculated. X sees all this happening and says "Coool!!!" Y sees the pile of rocks and then it disappears (probably can support a explosion type transition),[/blockquote]
Are you saying that this would be a problem? Or are you saying that if we did it this way, then we could have physics for the people who have the processing power and not have physics for the people who don??t have the processing power? I think that if we were to implement physics, then we would have to make sure the people without enough processing power could play the game and still have as much fun.
[blockquote]Minthos said:
What I would like to see physics used for in our game is destroying buildings and walls, and destroying or moving other obstacles (boulders, trees, etc)[/blockquote]
I had an idea to do something like this and it was to allow players to actually cut down trees and have them fall down. This would have the effect of changing the landscape of the game too, and that could be a problem. What would happen if everyone cut down the trees? Would the world run out of trees for a limited time? That might present a whole raft of different problems.
-Mole
--------------------
Co-Founder & Consultant Project Wish
|
|
|
|
Honis |
Jun 27 2006, 05:29 PM
|
Veteran
Group: PW Developer
Posts: 156
Joined: 27-July 05
From: Southern IL
Member No.: 539
|
QUOTE("Honis") Ex: You have 2 people (X and Y) playing in the same area. X has the $5000 computer that is god like. Y has a $500 computer from Gateway. In the game say X blows up a pile of rocks. This results in bebbles, dust, etc. that needs to be calculated. X sees all this happening and says "Coool!!!" Y sees the pile of rocks and then it disappears (probably can support a explosion type transition), QUOTE("Mole")
Are you saying that this would be a problem? Or are you saying that if we did it this way, then we could have physics for the people who have the processing power and not have physics for the people who don??t have the processing power? I think that if we were to implement physics, then we would have to make sure the people without enough processing power could play the game and still have as much fun. I'm just trying to avoid a transition difference. When I played FFXI it looked good and most computers could play it all full settings because it uses simple texturing and use of the same models just dressed differently.
When I played EQ2 the graphics made every character including myself look like clay figures. The buildings looked like blocks and I was still lagging everywhere.
I feel this is the direction the physics engines are going. You'll play a game that looks and runs great on your compy. Then you get a game that has the same primise (MMOs its lvl and collect stuff, FPS its shoot the thing that moves, etc.) but this extra physics capability. It'll look great on a high end, but most people don't have that. So, you have those that don't want to spend $XXX on physic's going back to what looks and runs better on their machine for free.
I would like the physics to just help it look prettier and not effect any gameplay. This will let someone turn it off and keep the game looking pretty.
--------------------
|
|
|
|
Minthos |
Jun 28 2006, 12:03 AM
|
PW Programmer
Group: PW Developer
Posts: 316
Joined: 12-January 05
Member No.: 198
|
And since you asked for more ideas in irc, here's one idea. I'll describe a scenario to illustrate.
A group of players wants to decorate their fortress with trees. They chop down the tree they want to move to their fortress, wait for it to respawn as a small bush, then they bring a shovel and a wheelbarrow and move the bush to where they want it, and plant it there. Simple enough, done by a single player in a few days. I figure a tree respawns after one to three days, takes about a week to reach a size where it could be called small tree, and a month to reach full size.
Okay, so what if they for some reason want to move a small tree, without having to wait for it to respawn? They would need a small cart to move it (ox or horse cart), they would need several people to uproot it and lift it onto the cart. Now, how would the act of lifting and moving a tree performed by multiple players be handled by the game? Here's where the physics engine comes into play. They have a button for "grab", and when they have grabbed the tree they could have one button for lift and one for lower, and one for toss. The players could synchronize their actions on teamspeak/ventrilo, so they all lift at the same time and toss the tree onto the cart at the same time.
What if they want to move something even bigger? Something so big they can barely lift it? Then they would need a ramp to get it onto the cart. In real life such a ramp could perhaps be constructed by placing some sturdy planks from the ground onto the cart. With a physics engine, we could let players do that in the game as well.
|
|
|
|
Minthos |
Jun 29 2006, 12:18 AM
|
PW Programmer
Group: PW Developer
Posts: 316
Joined: 12-January 05
Member No.: 198
|
[quote1151560620=Mole]We would basically have to keep track of every tree. There would be millions of them.[/quote1151560620]
How many millions?
Let's say each tree has a pair(do we need triplet?) of 32-bit coordinates, that's 8(12) bytes. It has an address to its art, that's 4 more bytes. It has a size, that's 1 byte, it has another byte for scorched, a third byte for chopped.. that's 15(19) bytes, let's bump it up to 16(20) for alignment reasons(I'm sure we can come up with something to use that extra space for), add another 4 bytes for its address, then we have 20(24) bytes per tree.
That's 20(24) megabytes of server memory per 1 million trees.
The client would only have to keep track of each individual tree in its vincinity. For trees farther away, the server could just tell the client "all trees in area between x1,y1 and x2,y2 are (insert correct value between 0 - 255) scorched", and client would draw that area as brown/gray/black/orange/yellow (depending on the scorched value) instead of green.
Yes, it would be more work for us. I think it would be worth it :)
|
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Original skin by: b6gm6n | Conversion by: Chris Y
|
|
|