Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Best architecture for a moba style game?

$
0
0
Hello. I am using Photon PUN for a project, and after some thought, I am wondering what is the best way to architect a moba style game using PUN.

In the last prototype, I applied a PhotonView component to the character of each player, and then added several other components to handle specific things: NetworkTimeSync, SyncedAgentRotation, SyncedAgentPosition, SyncedCombat, SyncedAnimator, and so on and so forth.

Each of these contained an OnPhotonSerializeView, and I added them to the ObservedComponents list on my PhotonView component.

The game is targeting mobile, and uses tap to move/click/attack, as well as a dynamic navmesh, along with the navmesh agents, etc.

Everything is working fine, but I am worried about the overall messages per second and enjoyment of the game, regarding dropped messages, etc.

The questions I have:

1. Although I have 5 Observed components, does this one PhotonView send a single message each 'stream', for example: 10 messages a second, or does it send one per observed component, meaning 50 per second?

2. How do things like SetCustomProperties for both Players and Rooms, PunRPC AllViaServer, etc. come into play regarding messages per room? Is there a different limit or cap regarding this? For example, couldn't I just set some data on my Player, and then update that 10 times per second, or as needed? Or does this use a different pipeline, making it a terrible idea?

3. Would getting rid of my observed components, and instead, go with RaiseEvent, and handle all the data myself be better? For example, with Tap to move, if no one has tapped in 2 seconds, why am I sending 'target position' every 10 times per second? Wouldn't it make more sense to only send that data when it happened, and handle it in a RaiseEvent callback?

Like I said, I'm making a moba style game, the limits are 6 players per 'room', I'll need to be sending at least position(x, y, z), rotation(y), target destination(x, y, z), attacks, health and mana regen 'ticks', npc data, effects like damage over time or buffs, etc. Skill point distribution, etc.

This is a side project, so budget is a concern. I'll be using PlayFab as my BaaS. Any advice or direction is greatly appreciated.

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>