[ASSETS] [OPEN SOURCE] Tanks, tracks and N-wheeled vehicles

Super!

Downloading right now…

Then I think it’s a good idea to start from here.
Use the updated source you uploaded and I will implement the CV90 step by step and document and add pictures where necessary.

So looking foreward to this.

I’ve just committed another small update - finally removed unused variables and placed the rest into proper categories. Get a fresh version if you want.

Is it possible to add an Automatic transmission?

I know a lot of them have Automatic transmission nowadays.

But keep also the manual mode since that is usefull for WW2 tracked vehicles

Almost done with my current project. End date is 18th of november. So almost time to start experimenting with your Blueprint.

In the meantime… here’s a wip image of the lower part of the cv90.
Long way to go. But for now I will create a lowres standin from the current hull, en lowres standins for the wheels, sprocket and idler.

At nr 3) You say, Set the vehicle mass. Is this the mass of the body? Or of the entire vehicle?

223357424e3bdd80c3f3598f15e2f6ad6f66b4d7.jpeg

From what I understood, realistic automatic transmission is rather complicated piece of hardware. What can be done is a simple automatic upshift or downshift depending on RPM at specific gear. So for each gear position we would have two values, minimal and maximum RPMs. As soon as engine RPM hits maximum rpm of gear we upshift or downshift if we hit minimum. For this to properly work and not get into upshift and then immediately downshift loop and upshift again loop, we need to check if RPMs are lowering or raising. From there we upshift only if RPMs rising and downshift if they are going down.
In comparison, proper automatic transmission would provide a smoother gear shifting, with trick described above it would be more like instant clutch and instant switch from one gear ratio to another.

Looks good! I like attention to details. Looks very detailed while you still can see that its lowpoly.

It’s a mass of everything but tracks. Mass of threads, sprockets, drive shaft and etc. is taken into account separately in CalculateMomentOfInertia() function. Btw, I think track mass is hardcoded right now, I should make it a variable.

In your case, judging by the front sprocket, you have a rubber tracks, like this M113:


these are easier to simulate by skinned mesh. Regardless, I don’t know their mass but normally they are about 30% lighter than their metal competitor. If I remember correctly, tracks that I use on M113 weight about 200kg and consist of 64 links.

No, the CV90, in my case 35 has Metal tracks with rubber “cushions” , like most (if not all) of the Main Battle Tanks (Leopard2, M1 etc)
I know that there are rubber tracks available for CV90 as I believe Norway used them in Afghanistan to reduce weight.

But I’m going for metal tracks.

For weight I have to see with which one I’m starting.
The CV90 has seperate armour plating that you can remove (and so also reduces weight and fuel consumption).

I made one error , the 2 guidewheels you see on top don’t belong there… the CV9035 does not have them.

How about the automatic transition that is already in UE4? use for Cars etc… is that not usable?

It’s implemented somewhere in C++ in PhysX in vehicle classes. I don’t know how exactly it works and what kind of features are implemented there.

AWESOME work!

What is it licensed under?

The current vehicle component in UE4 indeed has a transmission setup section.

I hope someday they will add something like that also for Tracked vehicles.

I’m not familiar with how it works… but I thought maybe You can use that VehicleMovement component although it’s not meant for tracked vehicles.

83888f4376f494c9f7e42aa98ef353775f5350a1.jpeg

You can use it commercially and you can sell it as a part of other assets on marketplace. I only ask not to blatantly resell it on marketplace.
I would be happy if it becomes a community project but I don’t think we have enough people interested in tanks and N-wheeled vehicles.

To be fair, PhysX has a support for N-wheeled and tracked vehicles. It is simply not exposed to UE4. I know that Arma 3 is using PhysX vehicle and tanks classes and I wasn’t too happy with those either. Plus I need something more flexible and still accessible from blueprints for prototyping.

I’ll add automatic transmission, need to read more about it and come up with some algorithm.

ugh… no the Tank and vehicle physics in ArmA 3 are horrible… and I can know… am an ArmA player since the first release :smiley:
We still play an OP every week. But when it comes to tanks I play Steel Beasts Pro. There is no better tank sim out there, and that kinda pushed me in this direction as I would love to develop a tank sim with better visuals then Steel Beasts currently has.
I know it is not their priority as it is used as it is by the military to train…
But I have seen some nice results with PhysX on the net for tracked vehicles.

So the vehicle physics is just one (important) part.
Hit detection and armour penetration is the next.

This is a nice test btw

It’s a test the developers did From IL2 - Battle of stalingrad to test and show the dynamics in their engine… looks pretty good.

I watched some of their videos. They did a great job! One of the tricks they use is some kind of noise height field on the landscape. It effects tanks and landing gear of aircrafts. Adds extra details on flat parts of the landscape.
I’ll how to add something similar. The easiest is to check material that you get on spheretrace of suspension and then add some nice world aligned perlin noise to offset “collision” of the wheel.

this is very promising thanks alot

Ok I began moving lowres versions of my wheels, etc into the blueprint.

The first sting I did was

  1. Duplicate the M113 blueprint and renamed it CV9035
  2. changed the static wheel mesh to my own wheel mesh

this is where I noticed something in the current setup.

The wheels you used are the same front and back.
My wheels have a different front and back, so in the blueprint I have to rotate the wheels 180 degrees on one side of the vehicle to make them look ok (180 in Z)
The problem that gives is that the wheels you rotate 180 degrees now rotate backwards when you drive forward. It’s cosmetic because it does not affect the driving. I’m sure it’s a simple fix. Where can I change the rotation animation of the wheels?

Two ways to solve it:
First is to overload WheelAndSprocketAnimation function of master blueprint in your new blueprint - you could simple copy/paste code from original and add correction for wheel rotation.
Second is to import left and right side wheels separately as two different static meshes. The assignment of the wheels is done in such a way that all of your wheel can have unique mesh.

Thanx,

I think I’m going for a unique mesh for left and right for now.
A good idea would be to add a checkbox in the Constructor > PositionAndAnimateDriveWheels function that reverses the rotation.
And same for the Animate Sprocket or Idler function.

I’ll see if I can add that myself… good exercise :slight_smile: , as my blueprint knowledge is limited atm.

Currently implementing a lowres hull mesh, and adding the extra wheels.

What is the relation between Suspension and Wheels? Are they somehow connected?
They are currently in line with the wheel in the Z axis… which makes sense, but do they have to be inline or does it have no effect if they are offset from each other?

Ok,

I have all the wheels, sprockets and idlers in the Blueprint.
Added suspension handles (M113 has 5 wheels/side, CV90 has 7)

For now I did not tune the Stiffnessforce and Dampingforce.
The Hull weight is still at what the M113 is (10 ton)

The CV90 is around 28 Ton total , and fully armed with extra armour plating even 35 Ton.

I also have to lookup the Engine specifications and torque curve if I can find it.

What are the steps I need to do to modify the spine track?
How do I add point to the spine and hook them up?

I pretty happy with how it goes… it pretty straight foreward to setup.

I’ll go through the entire process for the lower part of the CV first before writing it down (or record a short setup video of how I did it)

So the function which is responsible for animating drive wheels is PositionAndAnimateDriveWheels.
fe5e47877ff8a7a41a2221b2a91660325b762e39.jpeg

I takes position and rotation of the suspension and places wheel at the end of suspension length. Which is kind of a line from suspension root along the Z axis at the distance of current suspension length.

Now I’m thinking what is the best way to handle this. We should set default rotation of the wheel ether by rotation of the wheel static mesh component or maybe inherit it from suspension.
Anyway, let me add into the Feature List one thing for sure:

  • ability to flip wheel 180 degrees as boolean parameter to PositionAndAnimateDriveWheels()