Hi,
(The following is in the context of a UActorComponent)
I want to expose some design data to BP and then use that design data to influence the fixed size of a replicated TArray. To keep things simple, lets say I want to expose an int32 to design data in BP and then grow my replicated array to that size which is then fixed at that point. I’ve tried setting the size of the array through various means like using PostLoad and PostInitProperties but neither are giving me the behavior I’d expect, which is that the CDO/Archetype ends up with N elements in the replicated array and therefore the diff between the CDO/Archetype and the component instance should produce no deltas for the component actor’s creation info bunch.
I’ve tracked this as far as descriptor creation, which looks to use the correct array length when constructing the default state but the fragment creation doesn’t look to do the same. Any thoughts or help on this would be greatly appreciated as it seems very wasteful to replicate any data with respect to these arrays with creation info since there’s been no changes to them at that time.
Edit: To be more concrete, if I subclass my component in BP and set that BP data to say 100: the archetype ends up with 100 elements when using PostLoad / PostInitProperties to initialize the array but I still see 100 elements get serialized over the network with the owning actor’s creation info batch.
Edit 2: I had been thinking this issue was specific to the use case of setting a fixed size array based on BP data, but I just tested a simpler case which is a replicated array exposed exposed to BP directly. Adding N elements to the array in the BP properties panel results in N elements being replicated with the creation info so it would seem that this is actually a more general issue.
Thanks,
Nick