Phobos-developers / Phobos

Ares-compatible C&C Red Alert 2: Yuri's Revenge engine extension
GNU Lesser General Public License v3.0
294 stars 89 forks source link

[Phobos Bug] Trajectory=Straight sudden projectile slowdows #605

Open mevitar opened 2 years ago

mevitar commented 2 years ago

Description

No clue if it's something the engine does and we're unaware of it, or is it a bug with Trajectory=Straight implementation, but i noticed that such projectiles might randomly stop for a very brief moment at any point during their flight, slightly delaying their impact (at least it looks that it is delayed?). I never saw anything like this happen with Arcing=yes projectiles, though.

Phobos Version

https://github.com/Phobos-developers/Phobos/commit/f51baf98a0c28e8777d7010246c30a52cc45f699 (the newest build i tested with, first noticed it with some older non-dev branches)

Expected behaviour

Consistent projectile movement speed,

Actual behaviour

Watch the projectile fired by the Abrams in the middle, a bit over halfway through (Trajectory.Speed= is the same for all visible projectiles).

trajspeed

Metadorius commented 1 year ago

We're unable to reproduce the issue, what are exact condition that make this happen? Also maybe the slowdowns were fixed in latest develop branch builds?

mevitar commented 1 year ago

It doesn't happen every shot. It's completely random, can vary between each attack (sometimes one projectile gets slowed down, then next time it might be another one, or none at all), and it's more noticeable the longer the range becomes (weapons used here all had something around 10-12 range). It happens even if units use the exact same weapons, so it can't be difference in stats.

Newest dev build doesn't change anything, it still happens there.

Starkku commented 1 year ago

It doesn't happen every shot. It's completely random, can vary between each attack (sometimes one projectile gets slowed down, then next time it might be another one, or none at all), and it's more noticeable the longer the range becomes (weapons used here all had something around 10-12 range). It happens even if units use the exact same weapons, so it can't be difference in stats.

Newest dev build doesn't change anything, it still happens there.

I would like further information to help narrow down the potential cause. Any and all related weapon INI code as well as what type of image the projectile use would be helpful. I have not been able to reproduce the issue as shown here (projectile stops moving for a single frame) myself.

mevitar commented 1 year ago

[120mmCannon] Damage=120 ROF=90 Range=18 MinimumRange=2 Projectile=Shell Speed=100 Warhead=APFSDS

Trajectory.Speed=150

[Shell] Image=SHLLNORM Shadow=no

SubjectToCliffs=yes SubjectToElevation=yes SubjectToWalls=yes SubjectToBuildings=yes

Trajectory=Straight Trajectory.DetonationDistance=.75 Trajectory.Straight.SnapOnTarget=yes Trajectory.Straight.SnapThreshold=.75 Trajectory.Straight.PassThrough=no Interceptable=yes Strength=50 Armor=ap_tnks

[SHLLNORM] Voxel=yes

UseLineTrail=yes LineTrailColor=16,16,16 LineTrailColorDecrement=64

Also, to demonstrate the randomness, here's an animation from one of the newest dev builds. Ingame speed was 30 frames (no fluctuations). All tanks use the exact same weapon, listed above (duh, 4 of them are the exact same tank). trajectoryslow15_tanks On 1st volley A3 tank's projectile suddenly slows down. On 2nd volley it's tank B (but it can be hard to spot). On 3rd volley it's A4. On 14th it's A1. On some volleys it does not seem to happen at all. You can also see that, despite using waypoints to make them fire at once, the tanks do not fire at the exact same time, and they desynchronizes the longer they keep firing (the engine adding a random value to unit's ROF after each attack?).

Metadorius commented 1 year ago

As pointed out by @Starkku on Discord, the RoF fluctuation is actually vanilla behavior, it fluctuates by 1-2 frames by design, so you're right it changes a bit.

mevitar commented 1 year ago

The ROF thing was just an observation. And if it bothers you, feel free to remove the "phobos bug" label. I added it only because i didn't see this issue for anything but Trajectory=Straight, but i personally doubt that it has anything to do with Phobos. Most likely it's some kind of position adjusting that's done behind the scenes to all projectiles, but normally unnoticeable because the projectiles couldn't fly straight until now.

Metadorius commented 1 year ago

It's OK, we don't know yet so may keep it as is for now.