Multiple mounted objects & collision... ?
by Josh Moore · in Torque Game Builder · 09/04/2007 (4:08 pm) · 2 replies
Hello, I do believe this is my first thread(post) here in the T2D forums. So I'd like to say Hi to everyone who's had the pleasure of working with this engine.
My dilemma is that I need my objects to be able to hit other objects on multiple(read: 'separate') rendering layers. I hope this kind of stuff is possible as it should only do Collision Layer/Group checks. Would anyone care to help in explaining the finer points of the collision/rigid body systems?
Concept Pic
AS you can see, there's more than a few T2D objects w/ collision polies that are mounted to each other there on different layers(ranging from layer 0 to 3). Now above the wings and below the jets there's two mounted assault craft(on each side, in layer 2 FYI), in what I'd like to call a cargo bay. The thing is that I need to be able to hit all of those parts with different attacks.
Such as in a standard assault run, I would take out the two middle turrets that are on top(layer 0), then destroy the assault crafts before they can take off(layer 2). One immediate problem is having crafts and bullets only hitting the larger, outer collision objects and not ever being able to make a "pass"(lets say, having your fighter fly [u]through[/u] the enemy cargo bay(where you'd only be hitting objects on Layer 2, but you could still be shot by something from any layer. Am I even making myself clear? It seems rather advanced, but I'm still a TGB newcommer.
So whatcha' guys have to say about my situation?
Edit: Captioned version of concept
Think of it looking something like this from the side:
My dilemma is that I need my objects to be able to hit other objects on multiple(read: 'separate') rendering layers. I hope this kind of stuff is possible as it should only do Collision Layer/Group checks. Would anyone care to help in explaining the finer points of the collision/rigid body systems?
Concept Pic
AS you can see, there's more than a few T2D objects w/ collision polies that are mounted to each other there on different layers(ranging from layer 0 to 3). Now above the wings and below the jets there's two mounted assault craft(on each side, in layer 2 FYI), in what I'd like to call a cargo bay. The thing is that I need to be able to hit all of those parts with different attacks.
Such as in a standard assault run, I would take out the two middle turrets that are on top(layer 0), then destroy the assault crafts before they can take off(layer 2). One immediate problem is having crafts and bullets only hitting the larger, outer collision objects and not ever being able to make a "pass"(lets say, having your fighter fly [u]through[/u] the enemy cargo bay(where you'd only be hitting objects on Layer 2, but you could still be shot by something from any layer. Am I even making myself clear? It seems rather advanced, but I'm still a TGB newcommer.
So whatcha' guys have to say about my situation?
Edit: Captioned version of concept
Think of it looking something like this from the side:
Layer: <------------->
0 * |=)____[ ]___
// \______-^^-___|
/--/ | |
_|+++|_____________________________________|___ ___|________
1 \___| | /
\ | +++++__/
\ * |______%\
\ \ ======\
2 \ \--\ ___|
\ _|+++| /
\ |___/ /
\ /
3 \________________________________________________/
#2
10/04/2007 (11:55 am)
Is there anyone with similar example scripts for a system like this? I'm honestly getting lost in this damn collision controller.
Associate James Ford
Sickhead Games
I just did a little testing, it seems like the way to go might be to define the oncollision callback for each of your ship "components" within behaviors. That is, make sure every component of the ship has its own behavior in which an oncollision is defined. But you could also define them by script class names.
The way 2d shooters usually work is, either
1. The bosses don't take hits, instead you just destroy all their components and then they die, or,
2. The boss and its components take hits, but the components stick out the front of the boss or to the sides so they are shootable.
The mid-section of the boss could have no collision, so you can fly through it, but you also cant shoot it. If there are parked planes in the mid-section, collision can be on on them, so they collide with either bullets or both bullets and the player. Then sections to the left and right can have collision enabled and be damagable, plus damageble turrets sticking off them.
The entire ship could be one big staticsprite with no collisions, and you can then position blank scene objects which collide with the player mounted to it, covering only the sections you want to actually crash the player if they run into (if these have a layer then assign that too).