Is there work being done to streamline NetSerializers? They are…a bit much, when compared to the old NetSerialize function. Which i realize have their own problems, but you go to implement a NetSerializer and it’s just so much, and its generating a lot of questions for me that the docs and comments haven’t cleared up for me, so hoping to gain some clarity:
For one of my cases the struct looks like this,
`struct FStructWithValueAndDelegate
{
UPROPERTY(EditAnywhere)
int8 Value = 0;
UPROPERTY(BlueprintAssignable)
FChangedEvent OnValueChanged;
};`The old NetSerialize, just made sure I only worried about serializing the Value, and on deserialize would call OnValueChanged. Pretty simple.
I implemented the Serialize and Deserialize, that was pretty painless, and was about to be done, but then it tells me - no sir buddy, you have to implement Quantize/Dequantize, what for?? Why isn’t serialize and deserialize the quantization I want or need? I’d like to understand this, because right now I’m just doing the same work, again, but differently and i don’t understand the benefit, all i see are bug vectors.
Then I have to implement IsEqual, not sure i get why.
Then I keep reading code and Find there’s an Apply I can implement, which says:
Serializers that want to be selective about which members to modify in the target instance when applying state should implement Apply where the serializer is responsible for setting the members of the target instance. The function operates on non-quantized state.
What? I implement Serialize and Deserialize, does the network layer some how stomp the non-serialized data in the struct if i do not implement Apply? I guess I don’t understand what this accomplishes and would like some clarity.
DynamicState - what is it? how do i create it? Why would I create it? I see a lot of cloning and freeing code, but really i don’t understand what kinda dynamic state they’re preserving.
The FNetSerializerRegistryDelegates, this guy is trying to make registration easy, but its mostly just confusing. Like I feeeeel like this could be a lot more streamlined, or even automatic, especially if yall changed the NetSerializers to be UObjects, and just have a virtual to get their SourceType or something.
One of the features I was surprised Iris hasn’t fixed from the legacy system is no TMap/TSet replication. With the range of power the NetSerializers give you, im surprised this one isn’t a thing yet. Is it on the roadmap?
Do the fragment descriptors for serializing structures - do they abide by the UPROPERTY(Getter=X,Setter=Y) functions, or do they only directly write to the underlying property.
Two observation from my two uses of custom NetSerializers thus far are as follows,
1) I’ve been required to not create one, but add types linked to the Ability system to the ‘SupportsStructNetSerializerList’ set. This one is annoying, but I get it. The fact that the original Ability targeting data required all subclasses to implement the NetSerializer really caused an issue for conversion.
2) The two main cases I’ve had for custom NetSerializers came down to mostly just needing to know when net replication happened inside a struct, similar to needing it for OnReps for UObjects. Any chance yall could just implement OnRep calling generated code for structures instead? I mean it would be a hellofa boon to not need to implement custom serialization all so that I could know when some property on a structure changes during replication.