DelayedFire bugged animation since a specific commit
Description
Until this commit with SHA f96a3e82afd183811f945122ea32cc112f55fd57 DelayedFiring worked very well with this 2D vehicle (I don't know other cases). Now when firing the unit stay paralized few frames then the weapon is fired and continue the firing animation.
Before that commit:
Since this commit I mentioned:
Phobos Version
Develop branch
Conditions to reproduce
Use latest commit available if you want because it started since commit f96a3e82afd183811f945122ea32cc112f55fd57 Then use a DelayedFire weapon you have animation etc and attack something.
INI code
[CenturionLaserFire]
Damage=85
ROF=135
Range=9
Speed=100
Warhead=FSSuperBlueWH
LaserInnerColor=0,0,255
LaserOuterColor=0,0,255
LaserOuterSpread=0,0,0
LaserDuration=15
Projectile=LLine2
IsLaser=true
IsBigLaser=true
Anim=CBLUELASERMUZZLE
MinimumRange=3
DelayedFire.Duration=19 ; integer - single or comma-sep. range (game frames)
DelayedFire.SkipInTransport=true ; boolean
DelayedFire.OpenToppedAnimation=CBLUELASERMUZZLE ; Animation
DelayedFire.AnimIsAttached=true ; boolean
DelayedFire.AnimOnTurret=true ; boolean
DelayedFire.CenterAnimOnFirer=false ; boolean
DelayedFire.RemoveAnimOnNoDelay=false ; boolean
DelayedFire.PauseFiringSequence=false ; boolean
DelayedFire.OnlyOnInitialBurst=false ; boolean
[LLine2]
Inviso=yes
Image=none
AA=no
AG=yes
SubjectToCliffs=yes
SubjectToElevation=yes
SubjectToWalls=no
[CBLUELASERMUZZLE]
Image=BLUELASERMUZZLE
Rate=460
Report=HeavyLaserSound
Note: BLUELASERMUZZLE has 11 frames.
Steps to reproduce
- Set the Delayed fire weapon like in the previous example that worked since the beginning of this logic.
- Fire & watch the animation. ...
Expected behaviour
The unit does the attack animation and after the specified frames the weapon is fired.
Actual behaviour
Stays paralized and the firing weapon is desyncronized with the animation:
Additional context
No response
Checklist
- [x] The issue happens on the latest official version of Phobos and wasn't fixed yet.
- [x] I agree to elaborate the details if requested and provide thorough testing if the bugfix is implemented.
- [x] I added a very descriptive title to this issue.
- [x] I used the GitHub search and read the issue list to find a similar issue and didn't find it.
- [x] I have attached as much information as possible (screenshots, gifs, videos, debug and exception logs, etc).
Sounds like this unit doesn't have FireUp= defined. Everything works fine if the vehicle has FireUp=.
That build specifically changed so that shp units without FireUp= behave like they used to in YR. Reverting any of it back would make rapid fire weapons unusable again.
If anything, this is specifically an issue of DelayedFire.PauseFiringSequence= set to "no" not working unless the vehicle has FireUp=. But then, the documentation never said anything about this tag working for vehicles, only for infantry. I think it would be sufficient to just add a note that vehicles can properly use DelayedFire.PauseFiringSequence= only if they have FireUp=.
Through communication with the commit author and testing of other flags that affect FireUp behavior, such as Burst.FireWithinSequence, it was found that DelayedFire does not interact well with these logics, and resolving this issue may be quite complex.
This can be attributed to DelayedFire keeping the vehicle in a state where it can fire but isn't actually firing, causing an infinite reset of the firing animation frame.
In fact, it can also cause issues where certain firing animation frames are played repeatedly.
Isn't it intentional that the sequence loops until firing if it is not set to be paused? How else should the game handle the case when sequence total duration is shorter than firing delay? Play once and wait until the weapon fires? I think that would look even weirder.
Plus, I can see cases where someone deliberately wants the sequence to keep looping while the weapon is charging, so if this is to be changed, it should be made customizable by a tag like DelayedFire.LoopFiringSequence=yes/no.
Before the introduction of the “Vehicle FireUp” feature, the vehicle's firing animation always played after the weapon had finished firing.
If restored to the original YR mode, this animation will only be permitted to play after the firing delay has ended.
Sounds like this unit doesn't have FireUp= defined. Everything works fine if the vehicle has FireUp=.
That build specifically changed so that shp units without FireUp= behave like they used to in YR. Reverting any of it back would make rapid fire weapons unusable again.
If anything, this is specifically an issue of DelayedFire.PauseFiringSequence= set to "no" not working unless the vehicle has FireUp=. But then, the documentation never said anything about this tag working for vehicles, only for infantry. I think it would be sufficient to just add a note that vehicles can properly use DelayedFire.PauseFiringSequence= only if they have FireUp=.
Nah, Any value in FireUp does weird animation things like doing the attack animation 2 times before firing in a stand pose. _ also tried with lower values like FireUp=0 or FireUp=1 & makes nothing so what values are recommended? Anyways I still think this FireUp should be optional & disabled by default for not breaking other logics :-/
Anyways I still think this FireUp should be optional & disabled by default for not breaking other logics :-/
I agree, and that was the purpose of the changes in that build - if FireUp is not defined the behavior should be like it was before.
I didn't see any issues myself, so i think your problem is because you were using DelayedFire logic to prevent the unit from firing instantly, and clearly that is breaking everything now. But you don't need to use DelayedFire for that anymore, just get rid of it and use FireUp= instead.
Nah, Any value in FireUp does weird animation things like doing the attack animation 2 times before firing in a stand pose. _ also tried with lower values like FireUp=0 or FireUp=1 & makes nothing so what values are recommended?
I assume the purpose of making this weapon use DelayedFire logic in the first place was to synchronise the moment of firing with the animation (otherwise the weapon fires on the first frame). If that indeed is why you did it, you don't need to it anymore. You can get rid of DelayedFire completely and give it sufficiently high FireUp=, the effect should be the same.
From DelayedFire.Duration=19 i guess you should give it FireUp=19 (but that is just my guess, don't know if the firing animation of this unit is long enough for that).
If you are willing to send me the shp on discord i could try to make the frames sync ingame, and i'll send you the code if i succeed.