FAForever / fa

Lua code for FAF
227 stars 233 forks source link

Tanks vs Walls #150

Closed Kalvirox closed 9 years ago

Kalvirox commented 9 years ago

Forum Link http://forums.faforever.com/forums//viewtopic.php?f=3&t=8934

VoRGoR commented 9 years ago

Interestingly, it seems since 3636 went live all t1 tanks can also shoot through walls. Related?

Sheeo commented 9 years ago

As has been tested, this is a persistent issue across all FA versions.

It's related to the simtick frequency, and the way projectile collisions are done.

aeoncleanse commented 9 years ago

We cannot do anything about this, I've tried everything I know and so have many others.

Sheeo commented 9 years ago

A way to go about it is to subdivide the wall entities with a bunch of collisionboxes that all take HP away from the wall entity. This way we increase the chances of high speed projectiles colliding with a box on its way through the wall.

But we probably don't want to make walls impenetrable, rhino vs walls is already a murderparty, and gameplay wise I think they're already more than powerful enough for what they do.

aeoncleanse commented 9 years ago

The problem isn't with the walls though, it's with the PD! The bug is primarily that the shot goes over the first wall (As is should), through the PD (Wut?!), and hits the wall behind. I don't know why this happens. Some have said it's because the projectile speed is fast and the hitbox is small, so it passes right through the zone in between simticks and therefore detection events, but that doesn't make sense to me, else a single PD on its own would see the same problem, and it doesn't...

Kalvirox commented 9 years ago

Yes, I always wondered why when you shot at t1 pd with bricks you had to kill the back wall first before you could hit the PD.. That is another bug that has been around for ages but I assumed you already knew about it.

If/when you fix this, do check the frequency of tank shots that hit the PD afterwards and make sure it is not too much. "(As it should)" . Actually it shouldn't more often than not. I don't care if the way it was not originally designed this way but the game play element that this adds makes the t1 phase in 1v1 interesting even up to t2 stage, t1 PD with walls is still very solid.

Sheeo commented 9 years ago

I investigated further.

Rhinos never shoot over the first wall, from any distance. What happens is that the projectiles pass right through the wall because of their really high velocity (100). Given the size of the wall (1), in any given simtick, the Rhino projectile can pass through 10 wall sections. This confirms that the engine doesn't interpolate projectile positions in between sim ticks, to calculate collisions -- this is the real bug.

The width of the PD hitbox is half of the wall section, so it's even more likely for the rhino projectile to pass through the PD and hit the back wall.

Any projectile with a velocity higher than 1/tick (Not sure if bp values are given in length/tick or length/s) will exhibit this behavior for wall sections, and funnily enough, projectiles with extreme velocity may pass through even larger structures.

A couple of things to take away from this:

aeoncleanse commented 9 years ago

Sheeo, I tested Rhino VS a line of 10 walls, and it never made it through the 2nd for me. Do you get the same result? I suggest this means it is interpolating, but only down to 0.5, or 0.1, or something which still allows it to go through the PD.

This may be the cause of Sniperbots missing against certain targets too! I'll also add that the hitbox fixes are almost all enlargements, and should help with this issue in a general sense. For example, I bet Snipers have trouble hitting Othuum from the side right now (Teensy width on the box), and that gets fixed there.

FYI I and others have tried increasing T1 PD hitbox size in the past for the walls issue, and it doesn't work out because the walls are so close.

Sheeo commented 9 years ago

Sheeo, I tested Rhino VS a line of 10 walls, and it never made it through the 2nd for me. Do you ?get the same result? I suggest this means it is interpolating, but only down to 0.5, or 0.1, or something which still allows it to go through the PD.

This will depend on where you aim it. My video proves that no interpolation is done.

This may be the cause of Sniperbots missing against certain targets too! I'll also add that the hitbox fixes are almost all enlargements, and should help with this issue in a general sense. For example, I bet Snipers have trouble hitting Othuum from the side right now (Teensy width on the box), and that gets fixed there.

Potentially yep.

FYI I and others have tried increasing T1 PD hitbox size in the past for the walls issue, and it doesn't work out because the walls are so close.

Increasing the size of the PD hitbox by xyz += (0.25, 0.2, 0.25) helped the rhino to hit it quite a bit. Indeed the top bone of the PD's pop out of the hitbox slightly.

Sheeo commented 9 years ago

Also to be noted, the problematic value for PD's is muzzlevelocity > 50, since the width/length of the hitbox is 0.5

aeoncleanse commented 9 years ago

Then there's more to it. The ACU has the troubles too, with the blast going through the PD and hitting the rear wall, and the MV on all ACU is 35...

EDIT - Thinking about this, and what we see ingame, it's clear to me that 50 MV is 50 range units per second. ACU has 35 range with gun upgrade, and it takes about a second from firing until impact. With this in mind, and sim at 0.1s, if this theory were correct then a muzzlevelocity of 5 would be the limit for a 0.5 size hitbox, and a MV of 35 like the ACU would only very, very rarely impact the such a small hitbox... but we know this is not true. It never goes through a PD on its own, ONLY when there are walls. Additionally, it doesn't go through units like T1 tanks, which are much, much smaller than 3.5 units.

Sheeo commented 9 years ago

There may well be more parameters, but they certainly aren't doing full interpolation from previous to current location in between sim ticks, which is what it should be doing.