• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Need little help with RealArmour mut

OK, small update.

Reviewed the code once again, this time with a pen and a piece of paper because I can't work on 3D vectors in my memory... Know what each vector means and how it works at last. Nothing unexpected.

Did some experiments with improving things. Armor and penetration tables changed to float, added code to read in-between penetration values (by approximation for intermediate ranges). The table of GetPenetrationProbability changed into a function of AOI (BTW seems some work was done on this lately, but not finished, this not enabled test function was not that bad). It seems to work without problems.

Now after educating a little and discovery of what HitNormal vector is, I enabled debug and did some experiments with better collision detection, by HitNormal. I understand that this function returns normalised vector perpendicular to the plane of collision mesh (or plane normal) at the point of impact, so exactly what I need. Not sure what happens with turrets, which doesn't have collision mesh, only collision box. Would HitNormal return vector perpendicular to collision box surface ?

Well, it seems that RO and/or UT collision detection is it's Achilles's heel... Most times it works OK, but sometimes I get collision detection on the other side of the vehicle, from the inside... :-/ Probably the same happens in stock game anyway, if the collision point is detected on the other side then the HitAngle is calculated wrong too... Only the fact that those walls are parallel anyway and the angle is the same saves the calcs... But this can be problem sometimes maybe that's the reason why sometimes left track is disabled with right side hit :-/ Not sure why this happens, if the projectile is too fast, or what.... has to slow it down and see...
(I'm also not very happy with the fact that track hit from a front makes penetration and destroys it with two hits...)

I'm not sure why I don't get HitNormal readings on Tiger tank's turret. It has collision mesh, so it should work.
Other tanks have only collision boxes for turrets so if the collision detection was resolved, collision meshes should be added later to the rest of the tanks. In fact to use collision meshes with HitNormal information for collision detection, almost the whole ROVehicles would have to be rebuild eventually.The resulting effect could be very good then, if only the problems could be resolved.

Can vehicle models be exportet from the SDK ? (to make collision meshes from them and import them back). The hull collision meshes could be fine tuned too, some parts from sheet metal removed to not cause unwanted ricoshets. (edit: from what I understand from reading this forum, up to now, it's impossible to export skeletal mesh (from anim packs, like tank turret model) from RO SDK, to work with it in 3D program and import it later as collision mesh ? Do I have really to make new turret collision meshes from scratch ??)

OK, now question for those who could/want to answer:

What would be the best way to detect turret hits ? From within vehicle class ? Can I get name of the bone hit, maybe ? It's not a big problem, I already have two alternatives in mind (like hit height and some other) but best would be to check directly what part was hit, hull or turret....

Second question - how to get turret rotation reading from within vehicle class ?? I'm in RoTreadCraft calculating hit detection and armor penetration, and I need data about current turret rotation to recalculate the axes for turret hits. As it is now, only the hull angle counts, so you can angle hull and you get this bonus on the turret as well. Try this - rotate the Panther's turret backwards, and try to shoot at the turret from the front and from the rear. You will notice that now from the turret rear it has full protection, and the turret front is weak. It's because only the hull rotation counts.
So how to read it from within RoTreadCraft ?

rotator (or vector) TurretRotation

TurretRotation = ?

There is something called TurretRot but doesn't seem to be used and type is TexRotator...
I don't want to use mesh collision angle detection untill problems are resolved, so probably simple box collisions will stay for now, but I want to add real turrets to tanks to nex mod relase, the only thing I need is turret rotation info...

P.S. For some reason, after replacing the ROTreadCraft class, I have some HUD elements missing in tanks - the reload "shell" and tank turret graph... any idea why ?? Something is called not properly now ? all seems to work but some hud elements are not there :-/ (edit: yeah I see, the HitNormal vector is 0,0,0 for turret hits... but why? Tiger turret has collision mesh)
 
Last edited:
Upvote 0
This is the ONLY thing I need now - how to check turret rotation from within tank class ?? Relative to the hull or to the world - whatever, by rotator or vector doesn't matter, all can be recalculated.

I could bet it can be read directly, only if I knew how to address this call from RoTreadCraft to it's turret (so probably to tankturretpawn)...

callision was detected by a shell hitting a tank, now we are in RoTreadCraft's function SouldPenetrate called on this tank and we need to check rotation of it's turret (or turret's gun).


local rotator TurretRotation (or vector TurretRotation)

Turret Rotation = ????????????.Rotation

???

or maybe

Turret Rotation = GetBoneRotation(of what ??)


help me with this and you get mut with good ballistic calculations (even most basic function of 1/cos(angle)^1.6 I use currently, without T/D factor, is FAAAAAAR better than the stock table), new reload times for ALL tanks (not only German), separate turret and hull armors !!! (it works already, only I don't have turret rotation info to finish it), floating point armor and penetration ratings with 5% random factor from shot to shot, shell damage with random modifier, and few other nice features (turret exit points to tank roof, less shaking and spreading tank coaxial MGs, can't remember the rest, well, new penetration and vehicle explosion sounds for example).
This is what already works in test mut.

Currently I'm working on internal crew hitboxes (to kill the crew with penetrating hits even without destroing tank), kinetic part of shell damage (based on how much penetration "overkill" the hit has) and some other things (like track health status for example...)

So - to all - if you are not devs (taking offences) and you'd like to see all this soon in game, and can help me with above problem, please do it.

edit: thank you very much, figured it myself at last after whole day...

CannonTurret.CurrentAim.Yaw which works only if there is human player in tank or
HitVehicleWeapon.CurrentAim.Yaw (HitVehicleWeapon variable passed from RoAntiVehicleProjectile as ShouldPenetrate function argument)
 
Last edited:
Upvote 0