Game Development Community

1.2 Prox Mine help request

by kcpdad · in Torque 3D Professional · 12/17/2011 (8:27 am) · 8 replies

Dear GG community,

My tank game is using the new 1.2 Proximity Mines. I've created two variants, one that freezes the player by ignoring moves for a time and another that allows a player to explode the mine remotely.

There are two behaviors I would like to modify, both are collision related.

1. Currently mines collide with each other so if you try laying a stack of them they pile up. I would like to change that so they don't collide with each other and you could lay a stack of any number of mines in the same place with the same orientation and it would look like one mine.

2. Turn off collisions with Vehicles so that my tanks could drive over a stack of mines without getting stuck or even feeling a bump. I got a suggestion from the helpful IRC community to use onUse and onPickup since the ProximityMine class inherits from Item but I can't figure out how to use that to accomplish what I need. I looked at turning off all collisions between Items and Vehicles but I need that for my Capture the Flag flags which are also Items.

Suggestions and guidance would be greatly appreciated, thanks!

About the author

Hobbyist working on a tank game when time allows. Play the prototype at => http://www.sytrept.com/60tons/


#1
12/17/2011 (12:02 pm)
you could try editing the mines graphics in say 3ds max and change the collision volume to a flat plane, this would allow them to stack better, be driven over and hopefully wouldn't change there behaviour
#2
12/18/2011 (6:16 am)
Thanks for the suggestion. Unfortunately I'm not a modeler so changing a model is a daunting task. I don't see any mine modeling files, am I not seeing them? Or could I import the collada(dae) file into an existing model program? For me that would be milkshape or blender.
I tried to use the shape editor to first remove the collision mesh completely or to flatten the box as you suggested but that didn't seem to work. My tank(vehicle) still would get stuck on them.
#3
12/18/2011 (8:51 am)
You could just perform a radius check on the mine's deploy function for other mines, and stack it on top of the highest mine.

Why not turn off collision with the mines instead? Stacking could still be done by making the mines static in reference to the world location.
#4
12/21/2011 (6:22 pm)
How would I turn off collision with the mines? That is what I'm looking for. Mines that don't collide with vehicles or other mines but should collide with terrain and static shapes(ramps, roads, buildings, etc...).
#5
12/22/2011 (12:51 pm)
Is a plane considered convex for collision mesh purposes?
I guess I can make it very very very slim kcp.

-sytrept.
#6
12/22/2011 (2:30 pm)
I don't recall what update it happened in, but a plane is a valid collision geometry - collision occurs against the normal side. This also means you can use them for lifts, etc, without having to use a full convex polygonal solid.

Actually, now that I think about it that all probably happened with the addition of polysoup collision support.

Are you not wanting them to collide at all with certain classifications of objects? Or just not explode? Ideally the way to do it would be to use a mechanism like collision groups that T2D has, but perhaps there's a way to twiddle with simgroups and onCollision callbacks. I'm not sure on that, have to do some research.
#7
12/23/2011 (6:16 am)
Thanks for the tips Richard.

Yes, I do not want mines to collide with certain classifications of objects.
Specifically other mines, so I can lay any number of them in the same place and not have them stack.
And also no collisions with all Vehicles so the Vehicles they don't get stuck on mines which they now have a tendency to.

My game is a team game with Vehicles so friendly vehicles can drive near or over mines without exploding them.
As far as exploding enemy tanks, collision isn't needed there either because the new prox mines rely on a optimized trigger mechanism to detect nearby vehicles.
I'll do more research myself, I was hoping that there was some easy way to accomplish this that I might be missing which is why I posted in the first place. I will also try the flat or plane collision mesh as suggested, thanks again.
#8
12/23/2011 (8:52 am)
Just a note on collision meshes - try to ensure that there are no degenerate polys in them or you will have issues.