tranek / GASDocumentation

My understanding of Unreal Engine 5's GameplayAbilitySystem plugin with a simple multiplayer sample project.
MIT License
4.27k stars 789 forks source link

Added note about AttributeSet being Transient. #70

Open zompi2 opened 2 years ago

zompi2 commented 2 years ago

This is something me and my team encounter lately. When someone was playing a game in the editor - values inside AttributeSet changed. Then, when a character blueprint was duplicated - these changed values were moved to a new character blueprint (but as a default values). This was leading us to some very strange and difficult to track issues. Creating objects, that are not components inside of actor's constructor is very risky and unsafe anyway, just like binding delegates inside the constructor. The best way to mitigate such issues is to set these properties to be Transient, so they won't serialize themselves during gameplay.

I'm not sure if the written note is descriptive enough, but I think it is a good idea to note about this problem, as designers usually love to copy-paste blueprints ;)

tranek commented 2 years ago

I don't think I'm following what you're saying.

That sounds like it's working as intended since any changes to Attributes shouldn't be saved to the CDO BP when PIE stops. I'm reading this as:

zompi2 commented 2 years ago

I had to remind myself what issue I had have in a first place, because it was some time ago.

I made a description unnecessary overcomplicated. The issue is actually more trivial. This is how it was:

And now the magic happens

Making AttributeSet Transient fixes this crash.

I'm trying to figure out how to describe this in the document.

tranek commented 2 years ago

That sounds like the duplicating BP Actor bug https://github.com/tranek/GASDocumentation#troubleshooting-duplicatingblueprintactors and the UE Issue https://issues.unrealengine.com/issue/UE-81109. Does that sound like what you're describing?

zompi2 commented 2 years ago

Oh... It looks like this is it, actually. I haven't noticed this section for some reason. Ok, so the issue is already covered :D

Anyway, making AttributeSet Transient seems to fix the problem too. I haven't noticed any problems that could be caused by Transient in my project so far.

May I write about it in the section 9.4?

SalahAdDin commented 1 year ago

@zompi2 yes, please!

zompi2 commented 1 year ago

Reviving the dead pull request :D

@tranek @SalahAdDin - I modified the notes that should better fit the document. I divided the 9.4 section into 9.4.1 and 9.4.2 where I present two possible workarounds for this issue.