Iris replication for non Uobject based data.

I want to use ECS as the generic framework for the whole game. I’m going to use either Mass or my own custom Flecs integration. The catch is that the game is a multiplayer, therefore I need entity replication. Current Mass replication implementation doesn’t suit my needs in the slightest. So my question is: Is it possible to use Iris replication for this case? Without hacks like fast replicated arrays on the AInfo actors. Can I make my own fragment, state, bridge etc to replicate any or all specified components of the entity without wrapping Entities in UObjects? If yes, where do I start? from what I’ve seen so far in the source code - Iris is still very UObject dependent, or maybe I miss something?

Just starting to look into this myself but don’t have any answers for the best way to do this yet.

My use case is for level state information where I want an optimized data container representing the state of simple seed generated objects in the world. All client and server generate a deterministic set of objects using the same seed but the collection state of those objects (collected/uncollected) is replicated on a sector by sector basis on the server so objects collected by other players are correctly gone. I see a path where I can make sector actors but I’d rather not and just roll my own system.

So I dug into this and non-actor UObject replication looks viable since at a root level Iris operates on UObjects. UEngineReplicationBridge::StartReplicatingActor is a wrapper over the lower level UObjectReplicationBridge::StartReplicatingRootObject. You can stop here and interface with UObjects over actors, or you can go deeper and look at the area “// Create Protocols”

At this level it looks like everything is Fragments and Protocols. I’m figuring if you wanted you could make a custom protocol and fragment to do whatever. Your mileage may vary because you’d be officially off in the adapter frontier. The ProtocolManager takes in an FObjectKey for some methods so you’d likely need to extend that as well to allow non-Object Protocols.

Yeah, those were my findings as well. At least as a temp solution, I think I’m going to go with the idea of a AInfo manager (or maybe managers on the grid) that create uobject per replicated entity. Uobject would have some relevant entity data and fast replicated array for component changes (preferably referencing actual components via struct views etc and custom net delta serialization, or just copies of the components if former is not possible or bad). Important thing would be to setup custom iris filters to implement relevancy for those objects (grid or distance based etc)

i wrapped the components in the replicated uobject, that way instead of 10000 replicating entities i have 10000 entities with 5 or 6 replicating systems.

it works well but its not true ECS, since fast arrays arent index stable so i cant get Fragment[EntityID]

anyone got a good solution to that? still its good enough for my needs, i might have 1000s of entities not millions

You might want to look at the new Mass/Iris replication coming in UE 6

https://github.com/EpicGames/UnrealEngine/tree/ue6-main/Engine/Plugins/Experimental/MassIrisReplication

bad link? but yes i’m keen. dont know if i want to wait though