Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Destroyable Buildings

Author
Message
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 10th Mar 2003 08:32
Ok, I am wanting to make a building that can be stood on, slammed into, & take a beating before collapsing. I would also like to make it so that the walls can be partially destroyed & a player can hide in the building (Mecha Style Game). But if the player is inside when the building colapses, I want him to die.

Well, here is the question. How would I go about doing this & what code snippets do I need to look at to figure this out? I really want to add this to the game, & any help would be appreciated. I just want someone to start me in the right direction to make my code work like it should.

I am using CShop to make my levels, so if anyone can tell me how to go about making the walls do what I want, or provide the start of a code to get me going, it would really be helpful (I only want the start, as I am learning, I want to try to get the code right without having someone else completely do it for me.)

Thank you,
drdespair
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location: Switzerland
Posted: 10th Mar 2003 12:15
Hmm.. I dont think this is possible with BSP, I am not shure.. but I think that the effeciency on BSP is in that the geometry of the scene actualy doesnt change a lot.. thats what keeps it effecient. The only way I can think of achiving what you are talking about is vertex by vertex math manipulation, basicaly we are talking about mega computations per "shot", thats why you dont see this effect in most commercial games. I think the only one that had something like that was Red Faction.. but even there not everything was destroyable. I think your best solution is to have something like a DLOD (Damage Level of Detail) which would change the actual model displayed based on the damage to the building or a part of the building.. any way.. thats how most of the games work today anyway. Dont forget if you wanted a fully manipulative geometry.. we are talking about a lot of faces per model.. and in your case if you place these models into a city for your mech game.. we are talking about a huge ammout of polys per frame.. and you detonate a bond and require all that geomtry to change.... .... .... ... ... ...

D.

Shadow
21
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 10th Mar 2003 13:06
You could have a building made up of lots of objects which can split up when smashed into (you'll need to use physics on them all though - could cause speed problems).
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 10th Mar 2003 14:30
yeah, i side with shadow, thats the only way i can think od doing it, make building made up of loads of objects, when i think objects i don't think of blocks, more like cracks so in-game you've got all the different objects detecting for a collision (as few objects as possible for fps reasons) and when you get a collision either you hide the chunk or have some kinda fx or animation etc

everyday of life is a new chapter that has already been fortold but is up to the soul to capture.
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 10th Mar 2003 16:37
Good idea shadow, but how do I go about starting it out? I have my level editors, & was wondering if it would work best if the map was in BSP or X? Also, is there something like a destroy command, so I can execute the level adjust? I think if I knew the main command, I could possibly make the code myself, as I have a bit of expeirience on code, but not too much.

If they map would be in .x, is there a tutorial on getting a .x file into a game as a level? I could use one about now.

Thx,

Shadow
21
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 10th Mar 2003 19:16
I guess you would just load your .x files with load object "filename.x",objectnumber. As for removing them, it would probably be best to just hide them, (and move them outside of the level so they don't do collision detection). You wouldn't want to use delete object, because the frame rate would speed up as you destroyed the buildings. Does this help?
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 10th Mar 2003 20:16
well if you set frame rate to say 40 or 60 or whatever the most it csn speed up by is 5

some other tips rember to link object as a limb and the position the object not its linked base to build your buildings....

another idea to keep a mind off is to set a function that checks a array, have that array store a 1 or 0 for every piece of the building. then when you hide destroyed objects set its array postion for that object to 0, and do you colision on/off via the arrey then even invisible you can pass throug hthe object fine as it wont have collision on

Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 10th Mar 2003 20:32
>some other tips rember to link object as a limb and the position the object not its linked base to build your buildings...<

Well, I understand this, but I dont, how exactly do I make it a limb? I had this problem with another engine & everyone started hating me on it for asking about it. So how exactly do I do that?

Thx, I think I understand how to do everything else,

LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 10th Mar 2003 22:21
from my game alpha
`temp player, the ship
load object "whatever.x", give me a ID number
scale object ID,X,Y,Z
glue object to limb ID,Target Object ID, Limb number
position object ID,x,y,z
rem position above is for adjusting the limb placment on the root
hide limb target object,limb nober
rem from above's glue comand

Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 11th Mar 2003 07:06
Thanks for the help, I didnt even think a glue command would even exist in a game making tool. That must have been my problem.

Anyway, as soon as I get some models or walls, I will test this out & come back later if I need more help. Do you think I could use this code, plus some of my own, to make HALO Style Vehicles? It would be nice if I could, even though I think that is kinda an ironic question.

Thanks again, I may be back,

Superbeest
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: Netherlands
Posted: 11th Mar 2003 13:33
I might have another idea of making that wall. Perhaps you can create a wall and when it hits, just create a few extra object (maybe plain objects or other shapes to simulate bricks or so) en alter the texture of the wall. this might look a bit less realistic, but if you create a sound sample with it, it might be acceptable.
Just a thought.

Magister Mundi sum!
LLX
21
Years of Service
User Offline
Joined: 17th Feb 2003
Location:
Posted: 11th Mar 2003 19:25
well you could change the texture the problem is that you would need to use pixel cordinate collision math so you could "turn off" sections

Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 12th Mar 2003 07:49
Did you consider just using a matrix, pull it up into a building shape in matedit or something, texture it with bricky stuff then make the heights change when you bash it?

Depends how realistic you want it, I made collapsing buildings floor by floor with seperate limbs for windows once. and with enough smoke/rubble it's convincing.

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 12th Mar 2003 07:50
what am I saying, if you have dbpro you can do vertex animation.

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.

Login to post a reply

Server time is: 2024-09-19 23:05:28
Your offset time is: 2024-09-19 23:05:28