Tank Turret
by Jonas · in Torque 3D Professional · 02/01/2014 (8:16 am) · 8 replies
Hello, hello
I'm currently looking into torque3D for use in a tank game project and seeing if its a good fit.
The issue that i ran into was that of the tank turret, the resources that are out there seem to be either outdated, altogther removed from the net or they don't quite work the way i want it to.
So starting from scratch i had the idea of using what is already there, with minor modifications. Seeing that the issue is mounting a turret object and then having that object moveable and be able to have different barrel attachments i thought why not use the player class for this!
The idea is to use both the vehicle class and the player class in conjunction with each other to get the desired result. The one issue i can think of is that of controls. Controling the vehicle with the keyboard(WASD) and the turret(the player) with the mouse.
So my question is: upon entering the vehicle right now all controls are given to the vehicle. Is there a some what simple way to make it so movement control(WASD) is given to the vehicle, but pitch and yaw control stays with the player object?
Or
Let both objects retain control, and simple change around the movemap so they dont interfere with each other.
Any input on the matter is greatly appreciated.
Best regards
Jonas
I'm currently looking into torque3D for use in a tank game project and seeing if its a good fit.
The issue that i ran into was that of the tank turret, the resources that are out there seem to be either outdated, altogther removed from the net or they don't quite work the way i want it to.
So starting from scratch i had the idea of using what is already there, with minor modifications. Seeing that the issue is mounting a turret object and then having that object moveable and be able to have different barrel attachments i thought why not use the player class for this!
The idea is to use both the vehicle class and the player class in conjunction with each other to get the desired result. The one issue i can think of is that of controls. Controling the vehicle with the keyboard(WASD) and the turret(the player) with the mouse.
So my question is: upon entering the vehicle right now all controls are given to the vehicle. Is there a some what simple way to make it so movement control(WASD) is given to the vehicle, but pitch and yaw control stays with the player object?
Or
Let both objects retain control, and simple change around the movemap so they dont interfere with each other.
Any input on the matter is greatly appreciated.
Best regards
Jonas
About the author
Freelance 3D artist at day scripter/coder on Enduring Life at night. Lover of all things TorqueScript.
#2
02/01/2014 (7:02 pm)
I am working on an airship which has similar needs like what you are describing. I thought that I would need to make a separate set of animation for the player when mounted to the ship. Essentially, I was considering making the arms of the character have a translucence texture (making the arms disappear), mount imagedata arms to the player right before mounting to the ship, and have the keys (that are for airship specific movement) call the animation on the imagedata arms to what movements I needed.
#3
So here is what im thinking having had a few hours to think/look around:
Definitions:
Turret: Player object mounted as a turret to the vehicle
The turret is where most of the action is happening and it needs very fine tuned controls along with that the turret will contain the weapon data which will be needed to achive that level of control. Thus the turret will have to be the control object.
That leaves the movement of the vehicle object. Since the turret is the control object the engine, if i have understood it right, cant send movement data the same way using $mvAction ($mvAction is sent from current control object).
Here i think we can fix two issues at once, tank controls and movement, simply by bypassing the $mvAction system entirely. If instead of using $mvAction which simply applies movement speed to a object we could apply force directly to the wheels.
If 'W' is pressed apply the same amount of force on all the tires, if 'A' is pressed only apply force on one side so the vehicle start a spinning motion(tank controls) instead of turning like a normal car would by moving the front tires.
Once force is applied in the correct direction one would simply have to call the correct animation upon key press.
The two down sides i can see if i can get such a system to work is more bandwidth usage and the controls will be a bit jerky. The jerky controls dosnt really matter all that much since normal tank movement isent very crisp either. Bandwidth usage might be a problem in very large battles i do not know.
I think im on the right track here, thoughts, ideas?
Best regards
Jonas
02/01/2014 (8:29 pm)
@DreamPharaoh if i understand your post right you mean to control the turret object with animation calls? that certainly is a interesting idea but i think one would lose to much fine tune control.So here is what im thinking having had a few hours to think/look around:
Definitions:
Turret: Player object mounted as a turret to the vehicle
The turret is where most of the action is happening and it needs very fine tuned controls along with that the turret will contain the weapon data which will be needed to achive that level of control. Thus the turret will have to be the control object.
That leaves the movement of the vehicle object. Since the turret is the control object the engine, if i have understood it right, cant send movement data the same way using $mvAction ($mvAction is sent from current control object).
Here i think we can fix two issues at once, tank controls and movement, simply by bypassing the $mvAction system entirely. If instead of using $mvAction which simply applies movement speed to a object we could apply force directly to the wheels.
If 'W' is pressed apply the same amount of force on all the tires, if 'A' is pressed only apply force on one side so the vehicle start a spinning motion(tank controls) instead of turning like a normal car would by moving the front tires.
Once force is applied in the correct direction one would simply have to call the correct animation upon key press.
The two down sides i can see if i can get such a system to work is more bandwidth usage and the controls will be a bit jerky. The jerky controls dosnt really matter all that much since normal tank movement isent very crisp either. Bandwidth usage might be a problem in very large battles i do not know.
I think im on the right track here, thoughts, ideas?
Best regards
Jonas
#4
02/02/2014 (3:00 am)
Have you looked at this Tank Vehicle resource? It was helpful to me in making my tank game, 60 Tons. Also there is an older turret resource from Paul Dana which I had used to put a turret on the Buggy as an experiment. Then there is also the Turrets that came with T3D that is worth looking at as well.
#6
I checked out the resource you linked Kcpdad and so far it looks great. Implementing into the new MIT 3.5 version of the engine was not to much work, just a few things had to be fixed.
I do however have a slight issue when it comes to the rigging of the tank vehicle. All of the functionallity is there driving and firing but once the tank spawns and mounts the turret the turret instantly start flying away at terminal velocity.
I am almost certain this is due to a error in the rigging process but i cant find what. I have gone through John's notes a few times now and although they are a bit cryptic to me sometimes i can't find a out right error.
Any ideas on what i've done wrong?
Details:
Turret.Dae has all bones/nodes specified in the sherman_mounting notes.
Tank.Dae has all bones specified in the sherman_mounting notes.
Im using the skeleton that John kindly sent with the resource.
I'm using Blender
Best regards
Jonas
02/16/2014 (7:04 am)
Hello again,I checked out the resource you linked Kcpdad and so far it looks great. Implementing into the new MIT 3.5 version of the engine was not to much work, just a few things had to be fixed.
I do however have a slight issue when it comes to the rigging of the tank vehicle. All of the functionallity is there driving and firing but once the tank spawns and mounts the turret the turret instantly start flying away at terminal velocity.
I am almost certain this is due to a error in the rigging process but i cant find what. I have gone through John's notes a few times now and although they are a bit cryptic to me sometimes i can't find a out right error.
Any ideas on what i've done wrong?
Details:
Turret.Dae has all bones/nodes specified in the sherman_mounting notes.
Tank.Dae has all bones specified in the sherman_mounting notes.
Im using the skeleton that John kindly sent with the resource.
I'm using Blender
Best regards
Jonas
#7
If you want to send me the model you are using and instructions on how to import it into T3D then I can try myself? My email is my handle at yahoo.
02/17/2014 (7:45 am)
Unfortunately I don't have the exact model that matches the tank I'm using. John gave me a milkshape model but I haven't been able to export it to something I can use in game.If you want to send me the model you are using and instructions on how to import it into T3D then I can try myself? My email is my handle at yahoo.
#8
I sent a Email your way with the .Blend and .DAE files.
Thank you for taking time to look into this!
Best regards
Jonas
02/17/2014 (8:32 pm)
Hello, KcpdadI sent a Email your way with the .Blend and .DAE files.
Thank you for taking time to look into this!
Best regards
Jonas
Torque Owner Robert Fritzen
Phantom Games Development
If you figure out a working solution, I'd be glad to hear about it.