Jump to content

FIX candidate: Repair gun visual bug


Suspiria

Recommended Posts

Oh snap,

I hunted some more and found the true cause.
Renaming this topic from "Work-around" to "FIX candidate".

*** WARNING ***
For demonstration purposes only. Do not implement directly.
Talk to Hande for how to do it safely.

Spoiler

In Rx_Weapon.uc inside ChangeVisibility:
Replace:
    Primitive.SetHidden(!bIsVisible);
With:
    if (ParticleSystemComponent(Primitive) == None)
        Primitive.SetHidden(!bIsVisible);

CLEANUP
In Rx_Controller.uc: delete all calls to "ResetRepGunEmitters" aswell as the function itself.
In Rx_BeamWeapon.uc: delete the Tick() function in its entirety.

Done.

Should be gone for good now.

Honorable mentions: @JeepRubi and possibly others far into the past

Edited by Suspiria
added mention and warning
  • Thanks 1
Link to comment
Share on other sites

  • Suspiria changed the title to Definitive FIX: Repair gun visual bug
  • Totem Arts Staff
6 minutes ago, Suspiria said:

They have included it in the latest patch notes but not in the code itself.
I was too late for this week's rollout, meh.

I don't see it anywhere in the newest patch notes. The particle bug is far more broad than just the repair gun itself.

Link to comment
Share on other sites

  • Suspiria changed the title to FIX candidate: Repair gun visual bug
12 minutes ago, NodSaibot said:

I don't see it anywhere in the newest patch notes.

I do:

Quote

Fixed the well-known issue with the particle effects a.k.a The Particle Bug

It is completely gone on my SDK and comes right back whenever I revert my fix.
I'm pulling my hair out lol.

Also this fix, as you can see, works on the deep level of ChangeVisibility inside Rx_Weapon and specifically addresses the particle system. So not just the repair gun.

Wouldn't be surprised if this would fix "the" particle bug.

Edited by Suspiria
Link to comment
Share on other sites

  • Totem Arts Staff

You're *almost* right however. The prominent particle bug was related to Repair Gun sort of. The weapon produced too much particle system that it overloaded the pool in the engine. 

What I did was making it so that instead of generating one system per tick, it would only generate one per firing session. After that,  our testers haven't discovered the bug as of yet

That fix would be in Rx_WeaponAttachment, the one responsible for the effects

Link to comment
Share on other sites

10 minutes ago, Handepsilon said:

You're *almost* right however. The prominent particle bug was related to Repair Gun sort of.

I think I may still be right in regards to the repair gun issue.

Because:

  • right now since patch rollout the repair gun bug is still there
  • Rx_Weapon's ChangeVisibility code sets the ParticleSystemComponents to visible (which descend from Primitive; this is why it was easy to overlook) when only the weapon itself was intended to be
Edited by Suspiria
Link to comment
Share on other sites

Just now, Handepsilon said:

Are you referring to the part where Repair Gun beam pops in despite not being fired? We haven't fixed that one at all

Yes!
The age old bug. 🙂

It occurs on vehicle exit in first person,
after one has first fired their repair gun with both fire modes within that game.

Link to comment
Share on other sites

  • Totem Arts Staff

Unfortunately I find some possible holes in the script you edited (aside from the tick removal, which yes, was admittedly dirty)

That being said, it did help with isolating the issue : that particle deactivation does NOT in fact kill the emitter. It's the emitter's issue rather than the weapon's issue. Setting the particles to Kill on Deactivate solved the problem entirely

Link to comment
Share on other sites

5 hours ago, Handepsilon said:

Unfortunately I find some possible holes in the script you edited

Care to elaborate on that?
Does not killing the emitters and instead setting them to hidden introduce some sort of significant memory leak?

5 hours ago, Handepsilon said:

it did help with isolating the issue

That was my primary intention.
And simply put I just want this bug out of the way before FS.

5 hours ago, Handepsilon said:

Setting the particles to Kill on Deactivate solved the problem entirely

One of the many other possibilities to solve this problem, yes.
Even more perfect since the emitters are not retained.

Nice find!

Link to comment
Share on other sites

  • Totem Arts Staff
Quote

Care to elaborate on that?

Because it will affect all particle emitters on all weapons, and ChangeVisibility happens in more cases than just getting in and out of vehicle. For example, third/first person camera switch. This might cause problems where particle emitters do not get hidden when switching perspective, and not just the beam emitters from beam weapons.

Link to comment
Share on other sites

4 hours ago, Handepsilon said:

Because it will affect all particle emitters on all weapons, and ChangeVisibility happens in more cases than just getting in and out of vehicle. For example, third/first person camera switch. This might cause problems where particle emitters do not get hidden when switching perspective, and not just the beam emitters from beam weapons.

I can see how it may well have introduced some new issue.
That's why fix candidates are semi-professionally tested before being included. Nice catch!

That being said, the purely graphical side of things have never been my specialty per se.
So you now did the necessary next step in this process. Good!

And in the same way I could ofcourse see traces here and there of people who tried before me.
Who's attempts pointed me in the right direction a bit.🙂

I've simply continued on that path with you, and arrived at what should be its final destination.
Soon, this bug will be no more. And I hope that will serve this community.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...