Jump to content
  • Advertisement
Sign in to follow this  
HarrisonPloeg

PhysX buildings

This topic is 4046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!