Login

russian armor

Possible fixes for Sturmtiger and AVRE collision problems

7 Feb 2021, 19:36 PM
#1
avatar of Olekman
Modmaker Badge

Posts: 208

Prompted by the recent discussion on Sturmtiger, I looked around for workarounds for two main complaints: undershooting when firing from a slope and environment objects blocking shots. Sadly there's no silver bullet, but I still want to share what I found. Maybe other modders will find this useful.

For undershooting on slopes, I found two possible fixes:
1. In Sturmtiger's projectile:
- projectile_ext/artillery/is_artillery - change from "True" to "False".

With that, the shots land almost exactly where you aim them every time. However, this causes the second problem - shots being blocked by objects - to be even more prevalent. As the rocket no longer travels in an arc but in a straight line, if there's pretty much anything in the way (wreck, wall, fountain, well, dead cow...), it will hit that instead. The arc does look a bit nicer too, but I think that having a rocket that always land where it should is more important. Plus, this would allow modifying the rocket's speed, which could be used for further balancing.

2. In Sturmtiger's projectile:
- projectile_ext/artillery/firing_angle_type - change from "low_angle" to "lowest_non_collide_angle".

Again, shots land almost perfectly (although less accurately as in the previous case), but there are 2 big problems with this. First of all, this will allow Sturmtiger to shoot above shot-blockers like buildings. Secondly, it will no longer shoot through line-of-sight blockers like hedges, but instead shoot above them too. If fired very close to hedge, the calculated angle can be super high, causing the rocket to land after several seconds of travel time. In extreme cases, when the game can't find a non-collide angle, it automatically sets it to highest value (89 degrees), which causes the rocket to hilariously fall right in front of the Sturmtiger. All in all, not that great of a fix, but useful info for anyone willing to turn Sturmtiger into a mobile B4 Howitzer.

For environment objects blocking the rocket, things get more finnicky.
First of all, every projectile has a collision_type. Every object (hedge, tree, wreck, building, etc.) has hit_object_ext, which dictates which collision types pass through and which blocked instead. There are exactly 7 collision types in the game: tp_artillery, tp_artillery_inf, tp_artillery_overwatch, tp_homing, tp_homing_inf, tp_sticky, tp_throw. There's no way of adding more. About 95% of all projectiles in the game fall under tp_artillery (mostly artillery, including Sturmtiger and AVRE), tp_homing (mostly tank guns) and tp_throw (mostly grenades). What's important is that there's one collision_type that's literally not used by anything - tp_artillery_inf.

1. Now, one ardours way of fixing Sturmtiger's (and AVRE's, though it has it a bit better because its main gun is located higher) projectiles getting blocked by random objects would be to set its projectile collision_type to tp_artillery_inf and for every object in the game manually set whether tp_artillery_inf should pass through or be blocked. Theoretically it's doable and offers 100% customization. Practically, modifying every object in the game is not recommended and is asking for trouble.

2. Alternatively, tp_artillery collision type stays with Sturmtiger, but a manageable number of notorious blocking objects gets modified to allow that collision type to pass through. It would be far less invasive, but on the other hand it would also affect other weapons (e.g. howitzers, mortars, rocket artillery).

3. One more potentially useful collision type is tp_throw. While it is mostly used for grenades, grenade projectiles have another weird trait to them. They have "use_collision_building_wall_panel_ignore" set to "True", which effectively ignores collision_type settings of buildings. So even though all buildings in the game are set to block tp_throw projectiles, grenades still pass through them. Outside buildings, there are very few objects that block tp_throw collision type. As such, if Sturmtiger's projectile is changed to tp_throw, it would be still blocked by buildings, but would phase through pretty much everything else - hedges, trees, wrecks, dead cows, wells, fountains etc. Sadly, that also includes solid walls like these, which infantry can't vault, but can still lob grenades over them:

Another side effect is that those projectiles would no longer detonate when hitting enemy vehicles. It's only important in rare cases when a vehicle crosses flight path of the rocket - if a vehicle is at or close to the target location, it will still be dealt massive damage and stun as usual.

To sum up - if slope undershot solution #1 is combined with one of the object blockers solutions (preferably #2 or #3), Sturmtiger and AVRE would likely be in better place. I bet that other modders already tried tackling those issues, so there's a good chance that those "fixes" are more problematic than what I could discern, but maybe I'm lucky enough to bring something new to modders.
7 Feb 2021, 22:46 PM
#2
avatar of Vipper

Posts: 13476 | Subs: 1

8 Feb 2021, 00:36 AM
#3
avatar of Tiger Baron

Posts: 3143 | Subs: 2

As Vipper said, very nice work with this.

I love that people like you actually take the time and effort to put what's said here to the actual test and I wish I had the same time and motivation to do it as well but honestly as much of a low excuse as it may sound work is sucking everything out of me right now.

Either way I have just 2 questions for you:

1. I believe before the Sturmtiger's projectile could phase through objects and land where the user intended without detonating because of a pebble or fence post that it hit midway through.

Was this achieved through one of the collision types you mentioned or through some other means? Because apart from balancing issues and of course the weird looking rocket coming out of the ground if fired up a slope I think it was brilliant and worked from whay I remember.

2. You mention the firing angle with the low and lowest possible, so what about the high or highest possible angle?

That is all for now, I plan on dwelling in modding when I have a bit more free time on my hands and would very much appreciate your answers.

Cheers.
8 Feb 2021, 07:43 AM
#4
avatar of Olekman
Modmaker Badge

Posts: 208

As Vipper said, very nice work with this.

I love that people like you actually take the time and effort to put what's said here to the actual test and I wish I had the same time and motivation to do it as well but honestly as much of a low excuse as it may sound work is sucking everything out of me right now.

Either way I have just 2 questions for you:

1. I believe before the Sturmtiger's projectile could phase through objects and land where the user intended without detonating because of a pebble or fence post that it hit midway through.

Was this achieved through one of the collision types you mentioned or through some other means? Because apart from balancing issues and of course the weird looking rocket coming out of the ground if fired up a slope I think it was brilliant and worked from whay I remember.

2. You mention the firing angle with the low and lowest possible, so what about the high or highest possible angle?

That is all for now, I plan on dwelling in modding when I have a bit more free time on my hands and would very much appreciate your answers.

Cheers.


I fully understand what too much work means, but finally I've had some free time, so I use CoH2 modding to unwind. Looking what can be done with the limited tools we have is quite fun (if sometimes infuriating). :)

1. I'm not quite sure how it was achieved, but if you say that the rocket was coming out of the ground when fired up the slope, then I'm almost certain it involved turning the projectile from arced artillery to straight shot, as I explained in undershot fix #1. For it to not be blocked by minor world objects, it definitely had a different collision type back then, though I don't know which one.

2."high_angle" setting makes it use highest possible angle to hit a target. So for example, if the target can be hit with either 30 degree angle or 60 degree angle, it will always choose 60. On case there's only one angle (like perfect 45 degrees) then that one will be used. To be exact, the game checks every angle from the highest (which is 89 I think, but I think there's no way to check) and if projectile will hit while shot from that angle, then it goes with that. In general it's used for weapons like mortars and Walking Stuka, as the final angle is usually very high.

If you have any other questions then I'll be happy to answer if it's within my knowledge.
MMX
8 Feb 2021, 14:01 PM
#5
avatar of MMX

Posts: 999 | Subs: 1

first of all, i'd also want to say that is a really well written and hugely informative post. thanks for putting all the effort into this!

a bit unrelated to this, but since you were talking about firing angles a bit i'd be very curious if you have any info how exactly these are calculated or chosen in-game? i tried to do a bit of research into this a while back here, but pretty much hit a brick wall.
8 Feb 2021, 16:19 PM
#6
avatar of Olekman
Modmaker Badge

Posts: 208

jump backJump back to quoted post8 Feb 2021, 14:01 PMMMX
first of all, i'd also want to say that is a really well written and hugely informative post. thanks for putting all the effort into this!

a bit unrelated to this, but since you were talking about firing angles a bit i'd be very curious if you have any info how exactly these are calculated or chosen in-game? i tried to do a bit of research into this a while back here, but pretty much hit a brick wall.


Glad you found it informative and it's not just me venting to the void. :D

I don't know how the firing angles are calculated exactly, but I know that when a projectile has is_artillery set to "True" - which basically means that it travels in an arc, not in a straight line - the value in projectile_ext/speed seemingly doesn't affect projectile's velocity at all.

Now, bear in mind that everything below this line is my guesswork.

Before any calculation is done, all projectiles have the same velocity (value unknown to me). The game checks every angle (between 0 and 89, I think) whether the projectile will land at the target. Depending on firing_angle_type, it will either check from highest to lowest angle (high_angle) or from lowest to highest angle (low_angle and lowest_non_collide_angle, where the latter also checks if there are any shot blockers or terrain in the way). When it finds a suitable angle - search immediately ends, that's the angle it will use, the projectile is fired. However, in case there are no angles that land right on target, the game adds an increment to the initial velocity of the projectile dictated by the projectile_ext/artillery/speed_increment. It then once again checks all angles for one that will land on target. If there are none - repeat the whole process.

There's also speed_distance_multipler variable, which according to description is "Additions to the initial velocity based on distance to the target ms per metre ie inital speed modifier x distance to target". Almost every projectile in the game has this set between 0.1 and 0.3, but Sturmtiger and AVRE have them at -5. I haven't tested this thoroughly yet, so I'm not sure whether it actually affects anything.
8 Feb 2021, 18:44 PM
#7
avatar of gunther09
Donator 22

Posts: 538

uff, thank you for this view behind the curtain
MMX
9 Feb 2021, 02:42 AM
#8
avatar of MMX

Posts: 999 | Subs: 1


I don't know how the firing angles are calculated exactly, but I know that when a projectile has is_artillery set to "True" - which basically means that it travels in an arc, not in a straight line - the value in projectile_ext/speed seemingly doesn't affect projectile's velocity at all.

Now, bear in mind that everything below this line is my guesswork.

Before any calculation is done, all projectiles have the same velocity (value unknown to me). The game checks every angle (between 0 and 89, I think) whether the projectile will land at the target. Depending on firing_angle_type, it will either check from highest to lowest angle (high_angle) or from lowest to highest angle (low_angle and lowest_non_collide_angle, where the latter also checks if there are any shot blockers or terrain in the way). When it finds a suitable angle - search immediately ends, that's the angle it will use, the projectile is fired. However, in case there are no angles that land right on target, the game adds an increment to the initial velocity of the projectile dictated by the projectile_ext/artillery/speed_increment. It then once again checks all angles for one that will land on target. If there are none - repeat the whole process.

There's also speed_distance_multipler variable, which according to description is "Additions to the initial velocity based on distance to the target ms per metre ie inital speed modifier x distance to target". Almost every projectile in the game has this set between 0.1 and 0.3, but Sturmtiger and AVRE have them at -5. I haven't tested this thoroughly yet, so I'm not sure whether it actually affects anything.


wow, thanks a lot for the comprehensive answer! this is pretty much in line with what i've been able to deduce from the description in the editor so far - minus one elemental part: the projectile velocities. it never even occurred to me to check this, but if these are in fact different from the values given in projectile_ext/speed that would explain why my calculations were always a bit off...
if it's the same for every artillery projectile it might even be possible to figure out the exact value for the muzzle velocity experimentally. will give this a try for sure!

anyway, thanks again for the info, this was incredibly helpful. and lastly:

Glad you found it informative and it's not just me venting to the void. :D

don't worry, although i can personally relate to this sentiment very well i can also assure you that there are a lot of people who appreciate this kind of content, even though feedback is usually somewhat limited. i guess one of the reason posts like this tend to kind of stay under the radar is that it's a lot easier to chime in on a balance discussion than it is for more technical topics.

9 Feb 2021, 16:25 PM
#9
9 Feb 2021, 16:34 PM
#10
avatar of Tiger Baron

Posts: 3143 | Subs: 2



I fully understand what too much work means, but finally I've had some free time, so I use CoH2 modding to unwind. Looking what can be done with the limited tools we have is quite fun (if sometimes infuriating). :)

1. I'm not quite sure how it was achieved, but if you say that the rocket was coming out of the ground when fired up the slope, then I'm almost certain it involved turning the projectile from arced artillery to straight shot, as I explained in undershot fix #1. For it to not be blocked by minor world objects, it definitely had a different collision type back then, though I don't know which one.

2."high_angle" setting makes it use highest possible angle to hit a target. So for example, if the target can be hit with either 30 degree angle or 60 degree angle, it will always choose 60. On case there's only one angle (like perfect 45 degrees) then that one will be used. To be exact, the game checks every angle from the highest (which is 89 I think, but I think there's no way to check) and if projectile will hit while shot from that angle, then it goes with that. In general it's used for weapons like mortars and Walking Stuka, as the final angle is usually very high.

If you have any other questions then I'll be happy to answer if it's within my knowledge.


Thank you for the reply.

Yeah I'm guessing it indeed was a different collision or something which again makes me wonder why they removed it.

So for the high angle I suppose that's how it can be turned into a longer range SPG then as Sander's comment explained from the other topic?

I'd really be interested to see that being done, provided you have the time of course.
9 Feb 2021, 17:00 PM
#11
avatar of Olekman
Modmaker Badge

Posts: 208

https://clips.twitch.tv/ModernKitschyCurlewHeyGuys

Space Missle

Part 2
https://www.twitch.tv/tenshisc2/clip/DepressedCrazyHummingbirdMau5


Dame Germans, pioneering ICBMs during WW2! :D

I wonder what causes that behaviour, because I'm convinced that live version of Sturmtiger uses lowest possible firing angle and that seems as if it was set to highest or as if it was set to "lowest_non_collide_angle" and there was some object in front of it.

Perhaps the engine bugged out and for some reason the lowest angle it could find ended up being 89 degrees.
9 Feb 2021, 17:34 PM
#12
avatar of Olekman
Modmaker Badge

Posts: 208



Thank you for the reply.

Yeah I'm guessing it indeed was a different collision or something which again makes me wonder why they removed it.

So for the high angle I suppose that's how it can be turned into a longer range SPG then as Sander's comment explained from the other topic?

I'd really be interested to see that being done, provided you have the time of course.


Sure, it's quite easy.

First you want to clone Sturmtiger's projectile and change firing_angle_type from "low_angle" to "high_angle" like so:


Then clone Sturmtiger's weapon and set its range into something more artillery-like:


Finally, clone Sturmtiger's rocket attack ability and set the range to the weapon's max range:


It's quick-and-dirty implementation, so it has no scatter and the aiming reticule doesn't change its radius according to distance from target, but it works like an SPG.

Note that the projectile's animator - armies\common\projectiles\rocket_heavy\rocket_heavy - seems to disappear after about a second of travel time. I assume it's because the devs didn't plan for it to be used in such way. The flaming "tail" is still there, so it's not like the shot is completely invisible, buuut it does look a bit off.
11 Feb 2021, 15:42 PM
#13
avatar of Tiger Baron

Posts: 3143 | Subs: 2



Sure, it's quite easy.

First you want to clone Sturmtiger's projectile and change firing_angle_type from "low_angle" to "high_angle" like so:


Then clone Sturmtiger's weapon and set its range into something more artillery-like:


Finally, clone Sturmtiger's rocket attack ability and set the range to the weapon's max range:


It's quick-and-dirty implementation, so it has no scatter and the aiming reticule doesn't change its radius according to distance from target, but it works like an SPG.

Note that the projectile's animator - armies\common\projectiles\rocket_heavy\rocket_heavy - seems to disappear after about a second of travel time. I assume it's because the devs didn't plan for it to be used in such way. The flaming "tail" is still there, so it's not like the shot is completely invisible, buuut it does look a bit off.


Thanks again.

I'll try to make sure to try it out next time I fire up the mod tools when I have the time and motivation for it.

I also hope you don't mind if I send you an update or questions as well.
11 Feb 2021, 19:12 PM
#14
avatar of Olekman
Modmaker Badge

Posts: 208



Thanks again.

I'll try to make sure to try it out next time I fire up the mod tools when I have the time and motivation for it.

I also hope you don't mind if I send you an update or questions as well.


Of course I don't mind. I firmly believe that the more modding knowledge is in community the better.
11 Feb 2021, 22:16 PM
#15
avatar of Tiger Baron

Posts: 3143 | Subs: 2

jump backJump back to quoted post11 Feb 2021, 19:12 PMOlekman


Of course I don't mind. I firmly believe that the more modding knowledge is in community the better.


Agreed.

And thank you once again.
1 user is browsing this thread: 1 guest

Livestreams

United Kingdom 159
unknown 7
United States 2

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

565 users are online: 565 guests
8 posts in the last 24h
17 posts in the last week
137 posts in the last month
Registered members: 45023
Welcome our newest member, resilientmind
Most online: 2043 users on 29 Oct 2023, 01:04 AM