by date
A tank! My lego collection for a tank!
A tank! My lego collection for a tank!
| Name: | James Steele | |
|---|---|---|
| Date Posted: | May 30, 2006 | |
| Rating: | 4.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for James Steele |
Blog post
Actually...never mind. I've got it covered.
Looking back at my older posts, I think it's fair to say that tracked vehicle dynamics have been featuring quite prominently on my posts. I needed tracked vehicles (well..tanks more specificaly) for an idea that I had, so I looked around for a quick and easy sollution.
Like many other people, I found the Brave Tree Tank Pack and decided to give it a go. Despite it being an excellent add-on, it didn't quite do what I wanted. It faked the motion of a tracked vehicle without using any sort of rigid-body dynamics. This was something of a requirement for me, so I decided to see what else could be done.
The first attempt...
Given my previous experiences in implementing vehicle dynamics in games, I figured it wouldn't be too hard to implement some sort of tracked vehicle ontop of the existing vehicle dynamics frame work. I started out fairly well, but about the time I was ready to implement the constraints code for the tracks themselves, I realised that perhaps this wasn't the right way to go about it.
My goal, which I had lost sight of, was to get a rigid-body vehicle that behaved like a tracked vehicle. Not to actually have a proper tracked vehicle dynamics. If my previous experiences had taught me anything it was that; rigid-body simulation does not equal gameplay.
Unfortunately, it was about this time that work started demanding more of my already scant free-time. It was also becoming very stressfull, and the last thing that I wanted to do was to sit down and code after very gruelling 60+ hour weeks.
Then in October of last year, I moved half-way across the world again, back to Europe. The move put a big halt on any free-time programming activities until my stuff arrived in February this year. Up until recently, much of my spare time had gone into setting up a home, work and climatising myself to living with somebody.
Then not long ago, things had settled enough for me to go back to my pet-project....
The second attempt...Rusty has an idea
I started my project from scratch. I was going to approach it in a slightly different manner this time, and implemented some fairly cool things (turrets, dialogs etc.) before I moved onto my tracked vehicles again.
As I mentioned earlier, I realised that I had gone about implementing tracked vehicles the wrong way. So how should I go about it?
Torque already has a pretty good wheeled vehicle tool-set. Although it lacks some features, it's flexible and easy to set-up. The more I thought about it, the more I realised that with a little modification, I could just use the wheeled vehicle class to FAKE the behaviour of a tracked vehicle.
The idea...
The general idea, was that I could just use a wheeled vehicle that doesn't show the drive wheels. That is, the WheeledVehicleTire class used, would not have a shape assoicated with it and would use a radius defined in script.
The inner wheels/tank tracks would just be eye-candy. They would just deform to the terrain, but not provide any actual suspension support or drive forces. Instead, all of those are provided by the unseen normal wheels.
Prototyping...
So I set about prototyping my idea. In order to fake the tracked vehicle behaviour, I needed to be able to do the following.
* Make the rear wheels steer in the opposite direction, at some extreme angles to mimic the turning behaviour of a tracked vehicle.
* Let the wheels have fairly large traction budgets to mimic the "infinite traction" that caterpillar tracks seem to have.
I was more interested in prototyping the driving behaviour at this point, and not how the the candy would look. Besides, I was fairly confident that any problems with the eye-candy could be gotten around quite easily.
So I modelled a quick tank like shape with normal hub nodes in Blender, and exported it to Troque. I then created a new class called TestAPC and added it to my mission.
My first test went okay. The steering worked as intended with no source alterations, but it just didn't feel like a tank. It would slide around too much when turning, and it had very little traction when climbing or braking.
I spent the better part of two hours messing about with the traction, power, suspension and other settings in script. All of a sudden I had something that behaved sort of like a tracked vehicle, and with no source changes!
It had some issues with control though, as the wheeled vehicle class uses the pitch/yaw inputs for steering and acceleration. I wanted the wheels to instantly steer to the left or right if the appropriate key was pressed and center themsleves if the key had been released.
A quick hack in the wheeled vehicle class did the trick for that. So now I have an extremely fun "tracked" vehicle running around my test missionm using rigid=body dynamics.
It has one or two minor issues though;
* The vehicle jitters for a few seconds when it comes to a rest - This has somethig to do with the extremely large forces I use on the drive wheels. I think I probably have the traction dampending term a little too low at the moment, as it looks like a spring system that is osscilating a little until it comes to a rest.
* [i]The vehicle can become "hung-up" on edges. Despite having eight wheels, they're a little far apart, and if the vehicle drives slowly over and extreme edge (i.e. the ramps used in the racing example) it becomes stuck. There are several sollutions to this problem;
1. Have more wheels that are closer together.
2. Implement a moving sphere routine instead of relying on a ray-cast so that I'm checking for contact on the entire radius of the wheel, instead of a single contact point below the wheel center.
3. User bigger wheels
What next?
Last night, I started rigging my tracked vehicle for the track/inner wheels. It's exported into Torque and works just fine with my existing source.
So now I have to create a new class derived from WheeledVehicle which will also deform the inner-wheels with the terrain. I also need to remove my debug wheel geometry which was used for the drive wheels, so I could easily see what was going on with the drive forces.
This should all take a couple of evenings, girlfriend allowing.
I'll post some screenshots when I have more to show, along with another update in my progress.
Looking back at my older posts, I think it's fair to say that tracked vehicle dynamics have been featuring quite prominently on my posts. I needed tracked vehicles (well..tanks more specificaly) for an idea that I had, so I looked around for a quick and easy sollution.
Like many other people, I found the Brave Tree Tank Pack and decided to give it a go. Despite it being an excellent add-on, it didn't quite do what I wanted. It faked the motion of a tracked vehicle without using any sort of rigid-body dynamics. This was something of a requirement for me, so I decided to see what else could be done.
The first attempt...
Given my previous experiences in implementing vehicle dynamics in games, I figured it wouldn't be too hard to implement some sort of tracked vehicle ontop of the existing vehicle dynamics frame work. I started out fairly well, but about the time I was ready to implement the constraints code for the tracks themselves, I realised that perhaps this wasn't the right way to go about it.
My goal, which I had lost sight of, was to get a rigid-body vehicle that behaved like a tracked vehicle. Not to actually have a proper tracked vehicle dynamics. If my previous experiences had taught me anything it was that; rigid-body simulation does not equal gameplay.
Unfortunately, it was about this time that work started demanding more of my already scant free-time. It was also becoming very stressfull, and the last thing that I wanted to do was to sit down and code after very gruelling 60+ hour weeks.
Then in October of last year, I moved half-way across the world again, back to Europe. The move put a big halt on any free-time programming activities until my stuff arrived in February this year. Up until recently, much of my spare time had gone into setting up a home, work and climatising myself to living with somebody.
Then not long ago, things had settled enough for me to go back to my pet-project....
The second attempt...Rusty has an idea
I started my project from scratch. I was going to approach it in a slightly different manner this time, and implemented some fairly cool things (turrets, dialogs etc.) before I moved onto my tracked vehicles again.
As I mentioned earlier, I realised that I had gone about implementing tracked vehicles the wrong way. So how should I go about it?
Torque already has a pretty good wheeled vehicle tool-set. Although it lacks some features, it's flexible and easy to set-up. The more I thought about it, the more I realised that with a little modification, I could just use the wheeled vehicle class to FAKE the behaviour of a tracked vehicle.
The idea...
The general idea, was that I could just use a wheeled vehicle that doesn't show the drive wheels. That is, the WheeledVehicleTire class used, would not have a shape assoicated with it and would use a radius defined in script.
The inner wheels/tank tracks would just be eye-candy. They would just deform to the terrain, but not provide any actual suspension support or drive forces. Instead, all of those are provided by the unseen normal wheels.
Prototyping...
So I set about prototyping my idea. In order to fake the tracked vehicle behaviour, I needed to be able to do the following.
* Make the rear wheels steer in the opposite direction, at some extreme angles to mimic the turning behaviour of a tracked vehicle.
* Let the wheels have fairly large traction budgets to mimic the "infinite traction" that caterpillar tracks seem to have.
I was more interested in prototyping the driving behaviour at this point, and not how the the candy would look. Besides, I was fairly confident that any problems with the eye-candy could be gotten around quite easily.
So I modelled a quick tank like shape with normal hub nodes in Blender, and exported it to Troque. I then created a new class called TestAPC and added it to my mission.
My first test went okay. The steering worked as intended with no source alterations, but it just didn't feel like a tank. It would slide around too much when turning, and it had very little traction when climbing or braking.
I spent the better part of two hours messing about with the traction, power, suspension and other settings in script. All of a sudden I had something that behaved sort of like a tracked vehicle, and with no source changes!
It had some issues with control though, as the wheeled vehicle class uses the pitch/yaw inputs for steering and acceleration. I wanted the wheels to instantly steer to the left or right if the appropriate key was pressed and center themsleves if the key had been released.
A quick hack in the wheeled vehicle class did the trick for that. So now I have an extremely fun "tracked" vehicle running around my test missionm using rigid=body dynamics.
It has one or two minor issues though;
* The vehicle jitters for a few seconds when it comes to a rest - This has somethig to do with the extremely large forces I use on the drive wheels. I think I probably have the traction dampending term a little too low at the moment, as it looks like a spring system that is osscilating a little until it comes to a rest.
* [i]The vehicle can become "hung-up" on edges. Despite having eight wheels, they're a little far apart, and if the vehicle drives slowly over and extreme edge (i.e. the ramps used in the racing example) it becomes stuck. There are several sollutions to this problem;
1. Have more wheels that are closer together.
2. Implement a moving sphere routine instead of relying on a ray-cast so that I'm checking for contact on the entire radius of the wheel, instead of a single contact point below the wheel center.
3. User bigger wheels
What next?
Last night, I started rigging my tracked vehicle for the track/inner wheels. It's exported into Torque and works just fine with my existing source.
So now I have to create a new class derived from WheeledVehicle which will also deform the inner-wheels with the terrain. I also need to remove my debug wheel geometry which was used for the drive wheels, so I could easily see what was going on with the drive forces.
This should all take a couple of evenings, girlfriend allowing.
I'll post some screenshots when I have more to show, along with another update in my progress.
Recent Blog Posts
| List: | 08/05/08 - More friendly console objects 06/07/06 - "Tanks for all the memories" 06/06/06 - Troublesome Tanks! 06/06/06 - PS3 not so broken after all... 06/05/06 - Getting more tank like every day... 06/01/06 - Tracked vehicle update 05/30/06 - A tank! My lego collection for a tank! 05/19/06 - turrets, turrets and more turrets... |
|---|
Submit your own resources!| Justin DuJardin (May 30, 2006 at 15:38 GMT) |
:)
| Jesse (Midhir) Liles (May 30, 2006 at 19:24 GMT) |
| Willbkool (May 31, 2006 at 01:15 GMT) |
You must be a member and be logged in to either append comments or rate this resource.


4.0 out of 5


