Please add deterministic lockstep networking for RTS style games

Thanks for the answer !

[= Sweeney;275708]
This is a question that has been raised in every generation of the Unreal Engine, and it is definitely not in the works. Lock-step execution can only work if every engine system on every platform is designed for absolutely deterministic execution. That’s not the case with UE4, as a big engine with a time-dependent game update model and reliance on a wide range of middleware and a wide range of platform and runtime OS-version and API-dependent optimizations. An engine could be designed this way, but UE wasn’t, and it’s not practicable to retrofit it for a special usage case.
[/]

And this also means it’s not really possible, even for AAA developers, to implement this in UE4.

[= Sweeney;275708]
Instead of lock-step determinism, I recommend working with the engine’s network replication framework. This code has fairly good performance and typical internet connections have plenty of bandwidth, so I expect it to be practical for RTS usage.
[/]

Thanks for your “recommendation”, it’s just the only option we can choose :rolleyes: It’s nice to hear you think it’s practical for RTS usage, but most people I have talked with about this topic said it’s not possible to create a RTS with thousands of units with replication. I have not tried it yet since I think it’s hopeless.

[= Sweeney;275708]
Also keep in mind that you can customize the engine’s relevancy checks (which determine whether a given object is replicated to a given client) based on the client’s view of the world, which will usually change fairly slowly in an RTS.
[/]

RTS games usually have a small minimap where you can easily jump immediately to the opposite site of the map with just one click on the minimap. So the clients view can change really fast.

However, I remember this post from an Epic developer (April 2014):

[=John Pollard;9907]

  1. Send RPC’s from each client to server as they take turns to feed their input into a simulator that only runs on the server. Then use standard actor replication to each client, so they see what’s happening.

This would give you more room to decide if the simulator needs to be deterministic or not and easier to support late joins.

  1. Send RPC’s to server for each move, then forward these moves back to each client via multicast RPC’s. This would require a completely deterministic simulation running on all machines. It would also be more difficult to support late join. There wouldn’t be any major engine modifications though.

  2. Same as 2 except send RPC’s to all other machines in full mesh/lockstep fashion. This is probably the closest to the original lockstep model seen in doom but also the one that would be the most difficult and least flexible option. You would need to make some modifications to allow full mesh RPC’s for example.

#1 would be my vote as the engine would nicely support this, late joins are possible, and wouldn’t force you to use a deterministic model. You could still lockstep turns if you wanted but you don’t really need to do that either.
[/]

I find most interesting that he said option 2 would not require “any major engine modifications” while it would be “completely deterministic”. This is virtually the opposit of what you said, . Who is right now? Well, you are the “Master of UE4” so you are probably right, but I just want to have some hope :cool: