Jump to content
The Dark Mod Forums

Hl2 Havok Physiks


Darkness_Falls

Recommended Posts

Well, from a professional physics system anyways. Before HL2, I don't recall seeing any video game that could do this without some pre-written script or cutscene prerendering. Maybe I just haven't been observant enough.

Link to comment
Share on other sites

I checked out ODE which is an open source physics engine. I think it is used in Stalker or some other upcoming high profile game. Even this physics engine can do this. It's not really much what is shown. Some blocks are falling and occasionally a wheel or barrel. All this is pretty slow movement anway so it is not that hard to do. I don't know if Havoc can do high speed physics as well, but I assume so. High speed physics is much harder to code because it creates much more problems. For example: Firing a bullet and let it ricochet correctly and then create such a cascading system. That would put a physics engine more to the test. As I understood D3 physics can do this, but it wouldn't correctly handle this scenario from this movie (maybe).

Gerhard

Link to comment
Share on other sites

Just to clarify the reason why high speed physics is more problematic:

 

Normally the phyiscs engine is called in each frame to calculate the new state of the objects. This has to include collision detection obviously. If the movement of an object is below the framerate (or ticker that is used inside the game) this is not really a problem, because a collision should always be detected. If the speed gets above the ticker, it means that collisions have also to be detected when they are already past the point where they should have occured. Physics is time based. You shoot a bullet and it starts moving. It the bullet moves with a low speed, you can test in each frame if it hit a surface and the surface is in place because both objects don't move faster then the ticker allows.

 

Suppose you are shooting at a wall which is 3 units thick. In the first example the bullet moves with a speed of 2 units per tick. No matter how far you are away from the wall, the bullet will always end up right inside a wall with a tick. The position is calculated and is either one or two units before the wall. Since it moves with only 2 units per tick the next calculation will move the bullet inside the wall and the collision is detected.

 

If you have a faster bullet which moves at 5 units per tick, in the same situation the bullet could be 1 units before the wall in the first tick, and in the next tick the new position would be 1 tick after the wall. Such a collision may not be detected by many physics engines.

Gerhard

Link to comment
Share on other sites

Well, in video games (aside from HL2), I still haven't seen tires realistically wobble and roll like that and impact an object like that; metal walls fall and react to impact angles off of ledges as shown; a small mass hitting a large mass and slowly toppling the large mass realistically like that; a teeter-totter being hit and catapulting an object into another object and impacting it like that, etc.

 

STALKER isn't even out yet, so that doesn't compare very well. What game prior to HL2 demonstrated these physics?

 

I don't remember Doom3 having this advanced of physics in the actual game. That's not to say it's not capable of doing it, but HL2 demonstrated this stuff throughout the entire game.

 

Oh well, it's still cool to see this HL2 presentation ;)

Edited by Darkness_Falls
Link to comment
Share on other sites

Well, in video games (aside from HL2), I still haven't seen tires realistically wobble and roll like that and impact an object like that;

 

All games can do this which use the Havoc engine. :) Just check out Painkiller and you can see similar things. Big construction vehicles with realistic swinging chains and biog hooks attached to them. At one level you can shoot at a big tanklike structure and the round lid toples correctly over and rolls down, depending on how it falls down. Also when you shoot vases and all this stuff they also move very realisticly. So this is not a domain of HL2, because other games also use this. But no game made so much fuss about it so people seem to think that HL2 is the one and only. :)

 

STALKER isn't even out yet, so that doesn't compare very well.  What game prior to HL2 demonstrated these physics?

 

ODE Physics

 

This is a list of projects using it. Many of them seem to be community or private projects, but Blood Ranye 2, Pedal to the Medal, Stalker and Softimage XSI are high profile professional projects, so the engine can not be THAT bad. :) But if you don't believe it you can download it and check out the demos where you can play around with the engine. I don't know if there are precompiled binaries available so you may have to compile them yourselve.

 

I don't remember Doom3 having this advanced of physics in the actual game.

 

It never featured this. And judging from the demo maps they provided (when you look into your installation folder you should find the maps) it can not do this. I'm not sure if Havoc can do highspeed phsyics as described above. D3 should be able to do it. Id simply had no reason to include this into D3 and because of their deveklopment philosohpy they didn't want to add more licenced code than absolutely was neccessary. The nice thing with D3 SDK is though that you can replace the full physics engine with your own. You can throw out the entire physics from Id and replace it with Havoc, or any other one of your choice and you could still play the original game with it. You can not do this with HL2, because Havoc is part of HL2 and you can not replace it with your own.

 

Oh well, it's still cool to see this HL2 presentation ;)

 

Sure. IMO the physics provides the most fun in the game and I'm sure that future games will incorporate more and more physics as well. That's why I always proposed to also include as much realistic physics as possible in TDM, because this really provides a lot of opportunites and fun for the players. It may sound stupid but I even enjoy playing with the demos from ODE even though they are just small demos. :)

Gerhard

Link to comment
Share on other sites

There's already a thread about that at D3world:

http://www.doom3world.org/phpbb2/viewtopic.php?t=10730

 

As far as Doom 3 doing this I wouldn't expect it to work out of the box for the reason Lloyd mentioned above.

 

Doom 3's physics rely on collisions alone so if any single domino came to rest without toppling it's neighbor the chain would be broken whereas in real life the combined weight of all the dominos would force the chain to continue.

 

At any rate, with some modification to the physics code it would be possible although I'm not sure it's very practical.

Link to comment
Share on other sites

How hard would it be to implement ODE into the engine anyway? It can't be as simple as just slapping the code into the SDK, but how much effort would it take?

 

Now that I think about it it'd probably require all the coding lying in the SDK to fit alongside the new physics engine...it'd be cool, but probably too much work for us to do alone.

Link to comment
Share on other sites

Fitting the ODE physics engine into D3 is doable, but it is a lot of work. Obviously the designes are very different so it's not as if you could just slap it on. The major reason why I didn't pursue it was because of the missing high speed capabilities. It might work for our project because I don't think we have such fast moving objects, but it's not an urgent problem because the Id physics works so far.

Gerhard

Link to comment
Share on other sites

I think in game physics will really improve when Physics Processing Units (PPUs) start to appear on the scene - a few years off yet from mainstream computing, but check out these links:

 

PPU white paper

 

http://www.theinquirer.net/?article=21648

 

 

 

Hopefully we will yet see the fast physics problems solved...

 

AGEIA website

Link to comment
Share on other sites

Out of interest, can D3 handle soft body physics at all? Or could you make a hack that roughly simulates it?

 

It is good that D3 can use physics engines interchangeably, the Novodex Physics SDK from AGEIA should be easy to incorporate when it becomes available (not that I imagine it will be in many peoples price range for a few more years...

Edited by obscurus
Link to comment
Share on other sites

What do you mean by "you have to pay for it"? Are you refering to a licencing fee, or just the cost associated with the hardware, or some other problems - aare you saying it would compromise some other aspects of the game engine?

 

Hmmmm

Link to comment
Share on other sites

Ahhh.... I see. That will probably delay PPUs for a while longer, if they are charging for the software as well as the hardware... game developers might think twice about it when they can use open source software physics engines for free, even if they aren't as powerful as hardware physics. Still, it will be good when it eventually happens...

Link to comment
Share on other sites

The only way I can see hardware driven physics taking off on the PC woul be if MS will issue "DirectPhysics 1.0", such that there is a standard interface and the implementation will become a matter of choice.

Link to comment
Share on other sites

A lot of the subtleties they talk about in the white paper can currently be faked to a degree of believabilty that I think its more worthwile doing it that way rather than wasting resources doing it realistically.

 

However, I think the biggest step that "true physics" will bring to gameplay, is real-time destruction (and construction, for that matter). How many times, in a game like - say, battle field 1942, when you saw a bomb or rocket slam into the side of a house, did you wish to see the wall get blown away, rather than be this invincible solid thing that will never get the slightest crack in it.

 

That will open up whole new ways of playing games. Maybe you hear someone on the other side of the wall, and you analyse the wall and decide that its weak enough to try this next step - you quietly pull out your rocket launcher, get yourself a goodly distance away from the wall, and shoot it. The explosion breaks the wall, and the resulting destruction is enough to kill the enemy on the other side :)

 

Or how about this - through constant assult, a tower is starting to look like its going to fall. Incedently, there is a tank on one side, and you fire your rocket launcher at one of the remaining supports on that side of the tower. The tower slowly starts to topple and break apart, and happily falls down right on top of the tank in a huge pile of crashing rubble and dust.

 

Or even this - there is a row of soldiers firing at you over a rise, but you see a whole pile of boulders on the hill behind them. You fire your rocket launcher into it, and it starts a small avalanche, which buries your enemies :)

Edited by Domarius
Link to comment
Share on other sites

The only way I can see hardware driven physics taking off on the PC woul be if MS will issue "DirectPhysics 1.0", such that there is a standard interface and the implementation will become a matter of choice.

I think you are right there, they would be better off just incorporating it into Direct X 10 or 11...

 

Actually the way X Box 360 works (three processing cores running dual threads each = effectively 6 processors, plus a GPU) means that developers for this console can offload physics onto one processing core, ai to another and so on. The industry seems to be gearing up towards paralellism rather than ever increasing clock speeds, so things could change dramatically over the next five years or so...

Link to comment
Share on other sites

However, I think the biggest step that "true physics" will bring to gameplay, is real-time destruction (and construction, for that matter). How many times, in a game like - say, battle field 1942, when you saw a bomb or rocket slam into the side of a house, did you wish to see the wall get blown away, rather than be this invincible solid thing that will never get the slightest crack in it.

Hey Domarius - Check out the upcoming Age of Empires 3 game. It's using a modified version of the Havok physics engine and there will cool destructions of buildings and stuff. I don't think construction will be quite as cool, but thought I'd mention anyways. Yes, it's an RTS game... but still. Pretty amazing graphics.

Link to comment
Share on other sites

The industry seems to be gearing up towards paralellism rather than ever increasing clock speeds, so things could change dramatically over the next five years or so...

Which is much better anway. With parallel CPUs you can do much more than with just one multithreaded app.

Gerhard

Link to comment
Share on other sites

Darkness, those ARE pretty amazing graphics. That first one, I thought I was surely looking at some promo artwork, with all those buildings stretching off into the distance like a movie, but then I saw the caption "Actual in-game screen shot". I read that they have the new concept of a "home city", so maybe they cut some special corners to make it look so huge like that (fixed viewing angles or something), because the rest of the screen shots I saw were at 45 degree angles.

 

With parallel CPUs you can do much more than with just one multithreaded app.

Like what? I'm curious.

Link to comment
Share on other sites

The speed of a CPU is limited. Also context switching is expansive, so running multiple CPUs will be slower then running the same number of threads on multiple CPUs. Assuming the hardware can keep up with it. I guess synchronzing multiple CPUs is easier to code then synchronizing with multiple threads (from teh coding perspective).

 

So you can assign one CPU for gfx, one CPU for physics and one for AI. Since currently a single CPU already does all this, this should yield pretty fast speeds. :)

 

And there is a good example for this. in the 70ies and 80ies they already built machines with multiple CPUs for arcade machines. Since the existing CPUs were pretty slow they used one for sound processing and the other for the game. The result was quite impressive and some of the games were extremly high-end even though they were built with slow hardware.

Gerhard

Link to comment
Share on other sites

Ah, yes. The mysterios distinction between the Super Nintendo games and the games I had on my 286 PC.

 

Me and my friend agreed that PCs were much more powerful than consoles, after all, who had ever seen a full blown 3D world with rolling hills and houses to go into, etc. on a console?

And yet, there was some kind of exciting, in-your-face-ness that console games had that I just couldn't imagine my computer ever doing.

 

And years later (when my technical knowlege grew) I learned.

 

The SNES had chips dedicated to drawing huge colourful sprites, so it could throw heaps of them around the screen without skipping a beat, making for games like Street Fighter and Rival Turf.

 

It was very strange, not being able to understand why my computer couldn't do the same thing when looking at games like Wing Commander with its 3D space battles around capital ships, and Harrier Jump Jet with its voxel landscape, and Magic Carpet, with its real-time land deformation.

 

Also the SNES had a good sound chip capable of, I think 8 digital sounds at one time, so the music sounded heaps better than the SoundBlaster card in my computer, only capable of 1 digital channel and 9 FM voices, which sounded fairly weak in comparison.

Edited by Domarius
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...