I’ve been searching for the best way to implement a tank armour system more specifically how would I define the armour thickness on tanks, I’ve seen all sorts of types UV Mapping, Physics Assets, Physical Materials, etc. but I don’t know the best way, also I am open to C++.
i’d separate the concerns.
have something to detect what was hit, ie front/back/turret (Possibly Physical Materials since you can return it on trace)
have something to define what armor is, ie a struct with type, thickness, damage reduction etc
and finally something to calculate damage, like a function library
Seperating systems is good, depending on how much realism you consider in your game design of systems varies.
To start with you have a weapons system (let’s keep it simple)
- WeaponsSystem
- Helpers (Movement, Equip, Unequip etc.)
- Deployment
- AmmoManagement - > InventorySystem
- Projectile
- Impact
and you have and ArmorSystem. Armor system is listener of the Weapons System and its results.
WeaponSys → ArmorSys
Meaning it shouldn’t be talking directly with weapon but just listening the Impacts and processing them.
So depending on the impact can be many things (depends what you have and design)
- WeaponsSystem
- Impact
- Impact Type
- SingleHit (doesn’t penetrate)
- Penetration (penetrate either with thickness or per surface)
- Blast (Single hit on impact + penetrate either with thickness or per surface)
- Damage Type
- True Damage
- Piercing Damage
- etc.
- Impact Type
- Impact
and armor system
- ArmorSystem
- ActiveArmor
- PassiveArmor
- Steel ( Decreases penetration or blast damage per surface by %x)
- Tungsten ( Decreases penetration or blast damage per surface by %x for Piercing Damage and full protection agains True Damage)
So after these rules simply your Weapons System should behave and talk with armor system accordingly. Sometimes depending on how you design system and deployment of weapons it can be projectile, deployment or impact making these, still its advice to use an abstraction on impacts.
This means a projectile will always hit some objects with penetartion but doesn’t really do something on execution. Which makes system more managable.
If you want something more realistic it needs to resolved in Armor system 1st then callback to projectile again so that projectile can decide whetever they should continue movement or stop destroy(). This aspect defines the “ShouldPenetrate” aspect of the projectile flight but can be done other way as said. It just overlap impacts and ArmorSystem itself can decide what happens since it’s more easier to design, understand, debug and faster calculation.
Ex: You deploy a 50 Cal bullet-> Projectile Flies (True Damage, Penetration, Damage Fall over Distance) → Overlap → Impact()-> ShouldPenetrate → Overlap → Impact() → DestroyProjectile()
There is 2 impacts on some objects
1st lets say active armor
Impact() → BeginPlay()->Object TryDoDamage( TrueDamage, X amount of Damage,Piercing)
2nd lets say passive armor (Tungsten upgraded)
Impact() → BeginPlay()->Object TryDoDamage( TrueDamage, X amount of Damage,Piercing)
Armor System
OnDamageReceived → Explode() → Destoy()
OnDamageReceived → CanDoDamage() → False(Since its Tungsten) ->DoCosmeticBlocking(SFX,VFX etc)
and Penetration mechanics.
This can be just physical material and you can derive density from it with objects bounds. Then you can calculate the amount of travel through this object and how much damage it should loose until it exits and enters next (if can). That would also need to respond to the angle of attack which is impact normal that can influence the armor by maybe with a basic curve with a Snell equation, however this is generally too realistic I find, its too overloaded generally types and damage types will solve it nicely. Unless you are not doing a military simulation.
kind of a cryptic question, doesnt sound like a programming question. To do that, you would have extra static meshes that you spawn and attach to sockets on your tank, than presumably those peices would take damage and fall off, you can set them up as their own blueprints with a static mesh component on them that each have health.
thank you all. I’ve got most of the important stuff working armor penetration (fixed armor thickness for now), spalling, and effective thickness. The only thing I’m missing is regional armor thickness. For example, the glacis might be 80 mm thick and the lower front plate 60 mm, so players would be forced to aim for the lower front plate if their cannon doesn’t have enough penetration. I’m trying to avoid Physical Materials (PM) for this because, from what I’ve seen, I’d need a new physical material for each thickness value (mm), and that doesn’t seem scalable for lots of vehicles with varying armor thickness. What’s the best option?
you could maybe use bones? you just need a way to know what you hit, then in the actor you can have a TMap<hitbone,armorstruct> that you can access via interface
I was thinking exactly this, and I already have a bit of it set up, but I’ve been holding off on going further because I wanted to find the best way to do it. I also thought having a bunch of armor bones in the skeleton and Physics Asset would be messy, but ill give it a go and come back in a few hours to tell you how it went.
Unreal keeps crashing when trying to add physics bodies ![]()
I think all of them are possible solutions by the way. HitRegistration, Destructable Attachments, Bones.
For me it’s all about what this game is in the end.
Destructable plates → Arcade feel, easy to integrate. High playability.
HitRegistration (Penetration Model) → Leans on realism and the most scaleable long term espcially if you want penetration model not just on tank but walls, pawns etc.
HitBoxes (Bones mapping) → Many games use, approved model , would work with tanks too, however needs boneworking on tanks, if there is multiple tanks should be crafted well for each. Easier progression (data driven) if any.
Another nice but shortcut approach just for addition.
When tank get point damage → HitResults()
Array HitResultsPropagation = MultiLineTrace(HitResult()->ImpactPoint , PlayerPosition(Seat or tank origin))
HitResultsPropagation .num / 2 = how many objects in between so you can decrease damage accordingly how many layers of plates(staticMeshes) added to tank on that direction of hit.
It’s a fake model but would work.
I’ve got it, I’m using a penetration model with separate meshes for each big change in thickness and I’m currently using a set penetration value from each mesh, but I might change it to measure the distance from entry to exit so I can have varying thickness through out the armor without a bunch of separate meshes. thank all of you for your help ![]()