Problems when player on mobile device goes to background

Idodi

New member
Hi,

Due to the nature of mobile devices and the way that Photon PUN works when a player (playing on a mobile device) goes to background (screen closes by accident/someone calling/need to check something) the game will not report any damage done to this player.

This is because in the current architecture the object that receives damage reports this event back to the network and then the local player adjusts the object health accordingly. When a remote player is in background (using an Android device) the damage and death event will only occur when the player returns to the application.

I've resolved this on my end by changing the way that damage works. Local player now deals damage to a remote player and reports damage events to the remote player. This will allow the local player to "carry on" with the game, while allowing the remote player to come back to the application (and receive all the messages from Photon) and synchronize his state (he's dead now).

Do you see any problem with the local player being the one that reports the damage event?
Do you have another solution to this problem?
 
I think that a lot of it depends on the game design that you are going for. For some game types it makes sense to have the player completely quit the server when the game is suspended, but I can also see the design perspective for your solution.
 
The problem is the current architecture forces a game design decision instead of allowing either options
 
Top