Hello,
we’ve run into an issue with SubObjects which only contain “InitialOnly” properties.
When creating a SubObject which only contains replicating properties with the condition COND_InitialOnly, we get a crash in FNetBitStreamWriter::InitBytes and when starting PIE the below check triggers.
UE_NETBITSTREAMWRITER_CHECKF((ByteCount >= 4) && (ByteCount & 3) == 0, TEXT("Buffer capacity needs to be a multiple of 4 and at least 4."));
We can make a change in FReplicationInstanceOperationsInternal::QuantizeObjectStateData to also check “Object.Protocol->ChangeMaskBitCount > 0”, and this seems to fix the crash. But we’re not sure if this is the correct way to fix the issue?
Additionally, objects which only contain COND_InitialOnly properties should ideally not be considered for poll (in UObjectReplicationBridge::BuildPollList they still get marked for poll when the owner is marked for poll).
Thanks for your time,
Kind regards,
Céleste
Steps to Reproduce
Create a replicating SubObject with only COND_InitialOnly properties. Then mark a property dirty on one of the properties after object creation.
Hi,
Thank you for the report and the potential fix!
This is a known issue with Iris, although with other bug fixes taking priority, I can’t provide an estimate as to when this may be fixed. In the meanwhile, I’ve included the information you’ve provided here on our internal tracker for the issue.
Thanks,
Alex
Hello Alex,
Thanks for that! But what about the issue where objects which only have COND_InitialOnly properties are still being polled? Is that intentional, or is that also a bug?
Kind regards,
Céleste
Hi,
Apologies for not addressing this in my first reply. I have been able to confirm that FObjectPoller::PushModelPollObject will be called for the subobject, which does seem unexpected.
In cases where a replication condition should apply to the whole object, I believe it is recommended to set this condition when adding it to the registered subobjects list:
AddReplicatedSubObject(MyTestSubobject, COND_InitialOnly);
I tested this out, and I was still able to observe the initial-only object being polled on each update. Despite this polling, I also found that a subobject with this condition doesn’t appear to be replicated to the client at all.
Given that a COND_InitialOnly subobject will replicate as expected in the existing replication system, I’ve opened a new issue for this, UE-289553, which should be visible in the public tracker in a day or so. On that issue, I’ve also brought up how the subobject will be constantly polled.
Thanks,
Alex