Aily Posted June 26, 2011 Share Posted June 26, 2011 Big scene I have scene with ~1000 dynamic units (trees, buildings, enemies, etc...), each of it at destruction breack to 5-10 parts. Each part is automaticaly disapear after 5-10 seconds. Each part have their body (simple cube). Wat way is the best to store such scene at gameplay? For example building, when it in IDLE state, it have one mesh and one body for collisions. At destroy it breacking on 5 parts, that fall around it by physics. Each part have their own body - box. Issue 1: Store one collection of 5 parts of building in memory, and at destroy any building create "on-the-fly" parts as copyentity() for each, creating body, attaching, and setting position at current destructing building (it's my case now, and here some bug) Issue 2: At each of 1000 units create at loading tyme by same as 1 issue, but hide it, and on destruction building just show it, set all parts bodies mass and add force to them? Does 2 issue can much slowdown CPU? It's because ~1000*5 = 5000 hidden units in scene, and 1000 visible at run time. Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Pixel Perfect Posted June 26, 2011 Share Posted June 26, 2011 I currently use your second method, that is I load all the parts and hide them then position, apply atributes and show them at the point of the expolosion/destruction so I can apply the forces to them. This works fine for me but I'm not using 1000s of destructible objects. Probably the most I have tried at any one time is 80. As I only have so many varients on destructible models there is a lot of instancing going on so I don't imagine the hit is that great. I guess you'll just have to experiment unless someone else can give you feedback on doing this with that number of objects. I do sometimes have issues with instability in the physics when lots of exploding objects interact with each other, as all my exploding objects propgate their forces to items within a given radius and will cause them to explode too. It can result in a lot of random jittery movement of parts long after they should have stopped moving. I intend at some point to modify the way I apply forces as I think this may be contributing to this. Removing these part objects, as you do, might be a solution too as mine remain as dynamic debris after the destruction. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Aily Posted June 26, 2011 Author Share Posted June 26, 2011 Thanks Pixel, i will try that if can't beat my current problems with callbacks Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.