Optimizing multiple views and rpcs

Options
Hello!

I am currently building a game for iOS and android and need help figuring out how to optimize my game network-wise.
First, I'll explain what I have and need for my game.
We have 30 players, each with 10 characters moving around quickly and eating static mobs.
The players and mobs are object pooled. Therefore, when a player needs to be instantiated, a RPC is called and the object is initialized and placed at a certain position. Same thing with mobs.

We have 11 network views per player and 1 network view per mob (with 350 mobs in the map). When a player eats a mob, he calls an rpc that removes the mob from the game. A few seconds later, another rpc is called to replace the mob in the map. With 30 players, we can assume that around 60 rpcs are called every second for this use case.

Every player character (11 per player) has a networkview that serializes these attributes OnPhotonSerialize :
int
int
int
Vector2 => position
Vector2 => velocity

I get an average of 15 fps on an iPhone 4s, but our goal is to hit 30 fps with the current rules (30 players, 10 characters, 350 mobs). Please note that when a player hosts the match on ios, he gets 30 fps, but when he doesn't, he gets ~15 fps. This is logical if sending RPCs and data is faster that receiving RPCs and data.

When profiling, I get DispatchIncomingCommands having 30-50ms (40% of the CPU). I was wondering if that was caused by the multiple rpcs being called when a player eats a mob; if it was caused by the data I send from OnPhotonSerializeView; or both...

Do you have any hints for me?

Thanks a lot,
- Sam :)

Comments

  • Tobias
    Options
    You also mailed us recently, right? Please help us help you and let us know you posted this question somewhere! Mailing AND posting makes our lives harder and won't get you an answer earlier.

    Thank you.
  • blattepop
    Options
    Hi Tobias.

    Sorry for posting my question at many places. I did e-mail you and received the answer I needed. Sorry for not keeping you up to date on my issue.


    - Sam :)