I am creating ana RTS with Unity/C#, and have noticed a problem synchronising build queues. Is there an ideal solution to handle button prediction?
In my game there is basic networking code which worksI think I may have overengineered the solution. The problem is that.. Presently when the client clicks a button and, it sends a request to the server, which makes a decision. The server validates the request (cost if applicable) and then sends that backreturns the order to create the clientbuild queue item. This lag time is noticable and frustrating Consequently, when the player is clicking onclient clicks a button multiple times to add items tothere's a build queue in real timenoticeable lag.
I am aware of prediction being usedIs server validation for thingsbutton presses, like movementbuild queues, in a client-server environment, and have an idea of how this could be solved, butmodel overkill? What would like someone with experience to guide me.
I assume the simplest way of handling it is that the client will not wait for the server, and instead will check whether the button can be pressed (and purchase order sent) at their end. This sends a build queue item ID to the server, and the server then will respond with an OK or fail outcome.
This works on the assumption the client's verification will be accurate most of the time, and server will only cancel a build queue item if something catastrophic happens. Since the build queue item logic is separate to the question of whether something is spawned (server determines when this happens) it should be okay. But I am likely not getting this right.ideal solution?