Sign In Register

How can we help you today?

Start a new topic
Answered

RealTime Script for one player

How to avoid a restrict of "2" of the minimum players count in the game?

 

I want to use Realtime Script as server side. I want to process packets in RTSession.onPacket for any count of players

 

P.S. How to debug real time script?


Best Answer

Hi Vsevolod,


A minimum of two people is needed in order to start a Real Time Session. They only way I could see this being achieved as the platform is currently would be to match two people, then as you have there set the Drop In/ Drop Out option and drop one of the players. 

A better way might be have your game run local only while it's looking for a match and only begin the Real Time once you have a matched player.


A real time session can be debugged using the realtime.log and RTSession.getLogger().debug(new Date().getTime()); then in cloud code. Hope this helps.


Kind regards,

 - Steve


Hi Vsevoldod,


There is no point in having a Real time session with less than two people, any server side logic you need with a single player could be achieved with events, there would be no need to transmit the player position data as there is no other player online to receive it. When you have two or more people transmitting for example player position data then it would make sense to have a real time session as both these players will need the most up to date location of the other player. You could of course use a fake player to start a real time session but again any server side logic you need for a single player could probably be achieved using events rather then a real time session.


Hope this helps,

 - Steve

"A minimum of two people is needed in order to start a Real Time Session."

Why? If I use fake user to start Real Time Session, it will cause any problems?


Answer

Hi Vsevolod,


A minimum of two people is needed in order to start a Real Time Session. They only way I could see this being achieved as the platform is currently would be to match two people, then as you have there set the Drop In/ Drop Out option and drop one of the players. 

A better way might be have your game run local only while it's looking for a match and only begin the Real Time once you have a matched player.


A real time session can be debugged using the realtime.log and RTSession.getLogger().debug(new Date().getTime()); then in cloud code. Hope this helps.


Kind regards,

 - Steve

Login to post a comment