PhysX buildings

Started by
16 comments, last by HarrisonPloeg 16 years, 10 months ago
Buildings are not supposed to collapse in my game when they are placed down. Building I use PhysX and I would like to know how I could hold this building together, they start collapsing immediately after being created. They need to be able to collapse, just not when they are placed on the map. [Edited by - HarrisonPloeg on May 25, 2007 3:13:24 AM]
Advertisement
The frame rate also drops very quickly when it collapses, how can I optimise PhysX?
I couldn't tell you how to solve the problem your having with the building falling apart(never used the library) but I don't think there's much optimizing you can do without going low level into the library code and you'd have to know alot about physics which if that was the case you could just write your own physics library.
Artist 1st - Programmer 2nd(I'll get some material linked here sometime to support these claims, haha)
I haven't used physX yet myself, but you would have to do something along the lines of setting those objects to 'frozen' or something similar

A low framerate would be expected with that many physics objects all coliding at once (especially if you have a low end machine or you're running in debug mode)
Just quick stupid question, but it is a physics library, are you creating your buildings in a physically correct way? It seems in that photo that you have a bunch of square building blocks. If a seam between 2 blocks is not supported, they will fall. Maybe you can add temporary joints between 2 blocks to hold it together (not sure if thats possible with your lib, as I have never used it) and remove the joints to let it collapse (kinda what happens in real life anyways).

Or a quicker way I suppose, have a model of the building and when it is supposed to collapse, stop drawing the model. And put this current version in.

Have a good one!
my blog contains ramblings and what I am up to programming wise.
As has been suggested, you could try freezing the actors and maybe even make them kinematic. Then, when a collision occurs, you can change them to back to dynamic and unfreeze them.

As for performance, one of the most important things to do when using PhysX is to make sure you are using the correct values for sleep linear velocity and sleep angular velocity, as well as the skin width. This allows PhysX to put actors to sleep when they are not part of the action and will greatly improve performance.

Have a read through all of Chapter 0 on devsupport.ageia.com and also Lesson 106.

Regards,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
I might use breakable joints to hold it together, the buildings are created in a seperate editor, how can I test if I should create a joint between two blocks?
I use the default sleep values.
Can the weight of the building cause breakable joints to break?
Quote:
Can the weight of the building cause breakable joints to break?


Sure it can. Building a big struture in real life that can support its own weight in an optimized way is a non trivial task. The same goes for simulations. If you want your houses to break the same way real buildings break you're either going to have to build your house models the same way real structures are constructed or cheat (have a static model while your house isnt falling apart, and then replace it with some fysical model when it does).

The former problem actually makes for some great gameplay. See Pontifex II (though they seem to have renamed it to bridge construction set). Basically you design a bridge and see if it can support its own weight and the weight of trains/cars. Very fun puzzle game.

Well, hope this leads to some insight :)

//Emil
Emil Jonssonvild
Quote:Original post by cannonicus

The former problem actually makes for some great gameplay. See Pontifex II (though they seem to have renamed it to bridge construction set). Basically you design a bridge and see if it can support its own weight and the weight of trains/cars. Very fun puzzle game.

//Emil

I am not even a physics kinda guy, but that is a GREAT GAME!

Quote:
how can I test if I should create a joint between two blocks


Well, you can do what the professionals do and run it in your simulation (as I have seen on Discovery/History channel). If it fails, your joint/structure is not strong enough.

EDIT: As I look more at your screen shot, I see your outside walls more or less intact, its the interior that is failing (your building seems to be imploding), maybe some interior support would help.
my blog contains ramblings and what I am up to programming wise.

This topic is closed to new replies.

Advertisement