- Home /
Multiplayer UI : What's the best implementation for a waypoint-like system?
Hello! I'm in the process of creating an asset, but I'm trying to find out the best way of solving my last issue... multiplayer compatible UI. I can get everything to work well in a single-player environment, but I don't have any experience in multiplayer development, so any help would be greatly appreciated.
Basically, this is what I want to achieve...
A basic scoreboard UI with team scores and stationary panels (that will be dynamically filled with images, etc.). I'm fine with this scoreboard being identical to every player, though I'm also fine if each player gets its own that can be customized.
Player-unique UI for multiple panels (to be dynamically filled) which will be moved according to a script. Think of a "waypoint" marker that always stays over a target and also stays the same size regardless of distance.
Again, I can get this working with a single player, but I'm not sure of what the best and most performance-friendly method for multiplayer is.
The basic scoreboard is pretty simple, it seems. I guess I can just have one "scoreboard" canvas that will be updated and displayed to everyone (if it's server-based).
But the player-unique "waypoint" system is more of a hassle. I had thought about making each "waypoint" a single "server-based" world-space canvas attached to the target object. But there are two issues I can think of, especially to keep its appearance unique to each player. First, would there be a way to keep the size of the "waypoint" consistent independent of distance? Secondly, to keep the "waypoint" panel rotated properly to each player.
What I'm currently attempting to do is to give each player object its own camera-based canvas. In each player object's Start(), it duplicates the "waypoint" panels from the basic scoreboard UI to its own canvas, also attaching a tracking script to each of those panels.
Is that the best way of doing this?
One issue that I'm concerned about is that each "waypoint" panel is being added to a List, and dynamically updating the images through a script. I'm worried that having too many will hurt performance. Right now, for each "waypoint" that exists, there will 2 server-based and 1 player-based (for each player) panels. One for a ground panel, one for a scoreboard, and one more for each player's tracking. And again, that's not taking into account however many the server/client duplication will add.
For example, if there are 5 "waypoints" in the game, and there are 10 players, there would be a total of 60 "waypoint" panels to update (not counting the server/client duplication).
But again, I don't know much about multiplayer performance issues, so I may be misjudging things.
Thank you for your assistance! :-D
Waypoint location should be locally calculated, there's no need for clients 2, 3, and 4 to know about the waypoint client 1 created to track their location, otherwise every player would have one waypoint per player per player connected. Each player prefab should have a CreateWaypoint child object that is set to be disabled if (!isLocalPlayer)
, and otherwise creates its waypoint on the canvas on Start()
and updates its position based on the position of the other client's player each frame. That way, there's no networked performance cost beyond that necessary to sync the other client's position - everything's handled locally. If the waypoint needs to have information about the player it's attached to (health, score, etc.), it can get all that information locally from the GameObject it's attached to, the scoreboard, or anywhere else the information has already been synchronized between clients.
Your answer

Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
How to Synchronize Buttons in a lobby? 0 Answers
Second Clients canvas won't register clicks? 0 Answers
Networking Help Needed 0 Answers
need some help with this things 0 Answers