Can I Switch rooms.. or Join while in a room?

Options
carmine
carmine ✭✭
In my game, each square on a map would be a "room" .. It's a space game so people will "warp" to the next area...

If I'm currently in a room... can I simply switch to the new room (assuming it exists already)... without calling leave (waiting for that to be successful) then calling join... and hoping that doesn't go wrong and my user is stuck in some alternate reality.

Thanks!

-Carmine

Comments

  • Tobias
    Options
    Technically, it would be possible to warp instantly but it might break the space-time-continuum over time.
    The space partitioning compensator (a.k.a. load balancer) is tied to a specific warp core (a.k.a. Master Server). To keep all areas within moderately populated galaxies (a.k.a. Game Servers), you have to use the "de-materialize, concentrate, warp" workflow (a.k.a. "leave, join master, join other area").

    In short: To keep things load balanced we highly prefer the model to leave the room, get on the master server and join some other area. Areas might switch from one game server to another and players who would directly warp might miss the others accidentally.

    To speed up things you can skip using the lobby. Set autoJoinLobby to false and implement OnConnectedToMaster to join the other area.
  • Markus
    Options
    SPAM SPAM SPAM
    I just can not resist but give my colleague a "high five" for this answer!
  • carmine
    Options
    Tobias wrote:
    Technically, it would be possible to warp instantly but it might break the space-time-continuum over time.
    The space partitioning compensator (a.k.a. load balancer) is tied to a specific warp core (a.k.a. Master Server). To keep all areas within moderately populated galaxies (a.k.a. Game Servers), you have to use the "de-materialize, concentrate, warp" workflow (a.k.a. "leave, join master, join other area").

    In short: To keep things load balanced we highly prefer the model to leave the room, get on the master server and join some other area. Areas might switch from one game server to another and players who would directly warp might miss the others accidentally.

    To speed up things you can skip using the lobby. Set autoJoinLobby to false and implement OnConnectedToMaster to join the other area.

    **** Best response from Tobias ever!

    Couple more questions...
    - "OnConnectedToMaster" is called right when they get back to the server so I could immediately call join there?
    - How often to room properties get updated on clients (who are in the room and in the lobby)?
    - Is there anyway to force it to poll or push more often?
    - Is there a safer way to call create and join where it won't make an error if the room already exists? (something I can ALWAYS call instead of sometimes calling create and sometimes calling join...

    Thanks!
    (I can't wait to show you guys this stuff when I'm done)...
  • Tobias
    Options
    - "OnConnectedToMaster" is called right when they get back to the server so I could immediately call join there?
    Yep.
    To make things more flexible, you can even do sharding for your areas. Instead of using a fixed name and no limit in players, you can create rooms with a max of (let's say) 30 and no name. The name is then generated. To join a room for any area, add a property "a" (for "area"). Then JoinRandom(... expectedProps { "a", 51 }. This means you join by matching the props but could have more than one instance per room, if one is full. As always: Create the room if joining fails.

    - How often to room properties get updated on clients (who are in the room and in the lobby)?
    I think the interval is 5 seconds. We skip the "updated room info" callbacks, when nothing changed.

    - Is there anyway to force it to poll or push more often?
    Nope.
    There are big benefits to doing it this way. We only need to have one list of updates, serialize it once and send that to everyone interested.

    - Is there a safer way to call create and join where it won't make an error if the room already exists? (something I can ALWAYS call instead of sometimes calling create and sometimes calling join...
    We got a join option which creates the room if needed. You can't set room properties this way (as it's a join, not a create). This is not yet exposed in PUN.
    I think the joinRandom + create-on-demand variant is not much slower or very complicated. It also allows you to set room properties and lobby-listed properties.
  • carmine
    Options
    This is Captain Carmine posting from the year 2560. The Leah Brahms propulsion system is in place. Through trial and error (mostly error) we have been successful at completing several warp jumps. Ships can see other ships warping in and out of space.

    At this time, the ships crews are not surviving the jumps (only the Captain), however we believe this will be functional in the next few days.
  • Tobias
    Options
    Captain Carmine, this is Starfleet Command.
    Continue with the exploration of unknown space using the new warp drive. The new ISS Photon will be the first ship with warp-air-bags, disposed to safe the crew.
  • On an utterly insignificant little blue-green planet far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the galaxy, a Photon developer is deeply impressed by these incredibly cool, rocket-science features...

    You guys rock! :lol:
  • carmine
    Options
    If anyone is curious, my game is here:

    http://quintet.us

    The warping around stuff will come in an update in the next couple of weeks...
  • Markus
    Options
    Thanks for the info - looks nice! Keep it up.