[REQUEST] Multiplayer multi-instance plugin and multi room

0 favourites
  • 13 posts
From the Asset Store
Buildings - Isometric view - PNG transparent - multi styles, multi fonctions buildings
  • Ashley

    Thanks for creating the multiplayer plugin. It's got the nice juicy gooey goodness that is so yummy scrumptious to sink my watering mouth onto. However I have a few requests based on the current options that are presented.

    1. The plugin needs multiple objects of itself. Similar to Arrays, Dictionaries....

    This is required for multi connection purposes. For myself as an example:

    I would like to use the Scirra signalling server to provide Host/Client connectivity for active play and messaging. However I don't want to go through the Host for any important persistent data or values. I would like to keep special rewards, character online saving, special randomiser only active on my Server computer.

    2. Multiple rooms(or as some call them Channels)

    One room design is fine for straight forward games. However larger community based gaming is different. Even connecting to a single server for community gaming would require 1 connection to the Host/Play room, 1 connection to say a Guild Chat Channel, 1 Room for server event messages and so on.

    While the multiple plugin instance could work for multiple rooms. This would require extra error checking and logging in so on etc. Please i would very much appreciate that the current work is well scalable to larger and more complex game networking design.

  • 1. I don't see why you'd need this from the Multiplayer plugin itself - it's designed to run the actual game, and if you want to handle data via a different server, wouldn't an ordinary WebSocket serve just fine for that?

    2. I don't understand why you need to be in multiple rooms at once for this. Why not do everything through the same room? For example the real-time game example runs both chat and multiplayer data in the same room.

  • Ashley

    Addressing 2 first.

    When the chat is handled for the room itself then yes this works 100% fine. There is no need to support any other connection for any game play elements dealing with the active dungeon, battlezone, pokertable....... however stepping outside of that particular small instanced game design the Plugin doesn't handle so well.

    Let's examine a larger game world structure design. We/I/Someone creates a game where the player can actively travel from game room to game room. Each game room is a section of some larger world and each game room is Hosted by a browser tab on a game companies computer; not by an actual player. The player travels to each section of the world by reaching zone edges, portals and other such stuff. The game world isn't inhabited by just 4-10 friends, but is in inhabited by say 400+ players at one time.

    Players can congregate into groups who travel zone to zone with each other.

    Players can form friends and have friends lists.

    Players can form into guilds.

    Player Groups can go into instanced "dungeons" where the "dungeon" is hosted by a player.

    Under the current structure that the Plugin provides in relation to this large persistent world of numerous players there are no some road blocks.

    1. Players can only speak to other players in the current zone/room/layout.

    2. Friends cannot Tell/Whisper any one on their friends in list outside of the current room because this requires a communication channel to another room.

    3. Players cannot Guild chat with there guild because all communications can only be handled by the room.

    In a more robust game structure design where gameplay is more than isolated instances the developer should have access to the communication tools requires.

    Moving back to 1.

    Why not use WebSockets?

    It is true that WebSocket can be used for the chat, loot drops so on etc. However the big aspect of C2 having a full robust plugin and more importantly the WebRTC. Is that any browser can now act as a Listen server. This allows us to write server logic on the fantastic C2 language and IDE.

    I'm snipping this line from a well written tutorial <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Developing multiplayer games is difficult, even though Construct 2's Multiplayer object takes care of many of the complexities for you. In the same way the events to every game are different, the way multiplayer messages and data are handled will depend on the type of game you are making. As a result the Multiplayer object has relatively abstract general-purpose features so you can make best use of it for your particular game.

    [I highlighted the part that I believe as the most relevance, but almost the entire paragraph as relevance.]

    What I am finding is that the Plugin as it is now isn't designed to be relatively abstract featured for best use of my particular game. In fact I'm coming head on to game play elements that go out side of this single design base; which is.

    * Player Hosted room of real time game play where all data is handled by the Host.

    Providing I stick to that model there is no problem in fact it's fantastic, but that's not the model I want to create a game in. I would like to leverage the Multiplayer Plugin and the C2 language to create a more robust game world. I could use WebSocket, but then that requires not using C2 toolkit. I can program in Java, C/C++, C#, JS, Lua.... but I don't want to I'm selfish. It seems the current design requires that the entire community abandon this plugin if we want any more game play than the definition above. This is unfortunate as using the C2 Plugin makes making multiplayer games so much easier. And that is the point of C2; to lower the bar to making games and not telling the developers to go and program in another traditional language.

    I've seen some one put up a sample starter of a MP game a few days ago. Similar to other 2D MMO actions games. Very likely he's preparing for the MP plugin and doesn't want to use another language to code the other server aspects. Well the MP plugin as it won't let him. http://roracle.x10.mx/ Maybe I'm wrong about this game, but the reference of (off)line is indicative to me of a game that will go online. Also the game has numerous trappings of game play that belongs to a larger game world. The dev can still make the game providing the dev doesn't provide any game play features that requires interacting outside of the current layout-zone-room.

    At this point I addressed why multiple rooms are wanted and why we want to use C2(I selfishly want to code in C2) and not go back to writing in another language. Let's go on to the last part.

    In the world structure sample I previously wrote about started, I started with zones that were run by a company hosted on Tabs. I also mentioned that the "Dungeon"(actually for me it's derelict spaceships) is a Host instance. The Player Host will handle the room activity of the Dungeon. The reason for this is because I would like to take the opportunity to use WebRTC to handle one section of game play. monster handling, player movement. However during the course of play I want players to Whisper/Tell to there friends who are outside the room, I want players to chat with guild mates who are outside the room, and more importantly I don't want the player Host to handle anything in regards to random loot drops or persistent server character storage. that should be handled by server.

    So yes. We could use WebSockets. I don't want to I admit to being partially selfish, but also the fact that other developers who want to design a more robust game will need more than the current Plugin provides. To me the idea of writing the the character server in another language doesn't leverage the benefit of a Plugin where the player can program a server. It comes down to that the Multiplayer Plugin can be a Host of a game, but can't be a server of information.

    I'm willing to Concede to an extent. I'm willing to skip on the multi-room aspect in favour of just being able to have multiple instances of the plugin. I can work around not having multiple rooms. but I can't work around not having Multiple instances of the Plugin.

    If I could at least have 2 MP Plugin at the same time; I could at least have

    MP-RoomPlay uses Signalling server

    MP-Character uses personal company server(that never goes through scirra signalling, direct connect)

    MP-Play handles all the interaction with game play world. Moving in the layout, moving to another layout/room. getting MP-Play Id's and working with them in a game play fashion.

    MP-Character handles on the non room play aspects

    Chat outside of the room(tag: chat, message: [alias]-hey, want to travel together?)

    Character persistent storage(tag: save, gear-1jvj93ng39 )

    Loot drops( tag: loot, [npcid]-weapon11235, coin-12,.....)

    Special randomized elements.

    It would be great to have rooms, but it's not needed if we have multi instanced plugin. So please reconsider the idea of the Plugin only being singular global. Plus i would like attach instance variables to the plugin as an awesome extra added feature. How hard would it be to switch the plugin over? As I understand it's mostly just an option param in the SDK.

  • A "room" in the Multiplayer object doesn't have to correspond to a "room" or "zone" in your game. Why not just put everyone in the same room?

  • Ashley (do I need to include the name every post for discussing with someone)

    Yes, I'm conceding that when it comes to chat channel, persistent save state and other server information that multi room isn't required. Nice, but not mandatory at all.

    I don't feel I'm expressing my self clear enough as the replies are about rooms where as the main point is about multiple connections. I'll try to change up how I'm communicating. I understand my written English is poor so maybe in a point form would be better.(my wife complains about my writing all the time )

    1. Multi rooms are nice, but let's take that off the table. They can be worked around. They are convenient, but they are not required.

    2. My last post was more a focus on multiple connections not multiple rooms.

    3. I want to focus on the networking structure of larger games not single action instances.

    I can't say that my or any of our games will have 1000 players at one time, but let's just for theory say that the game I want to build has 1000 players at once any given time.

    The big reason to support multiple connections is load balancing large number of players across computers. This is the reason the Scirra Signalling server doesn't host game play. Could you image the Scirra signalling server also required to handle the game play?

    The game I want to make isn't an XBox Live game or a PSN game. Those games run on clients hosting the game data. This is how Scirra's Signalling server works. By acting as a convenient room finder.

    The primary structure I want however is more like Phantasy Star Online not Live or PSN. PSO servers acted as a signalling and there was PSO server host that acted as a HUB world for numerous players. And at that point I only need 1 room. However once the players gathered and went to the dungeon the gameplay logic was handled by the Host player not the PSO servers.

    All the players were connected to PLAYER HOST and DATA SERVER. This requires that 2 ports were in active use. The PLAYER HOST handled NPC, authorized collisions with the environment, handled translating postional data of the players. However the PLAYER HOST did not handle item drops, chatting with the guild or saving the character.

    This distinction is important for persistently. If some major loot dropped it was the DATA SERVER that knew what dropped and who picked up. It was the DATA SERVER that also saved the character information. So if the HOST PLAYER disconnected or rage quit the DATA SERVER still knew what was happening.

    The design of a multiple connections(not rooms) is important for authoritative security and persistence while letting PLAYER HOSTING handle games.

    Battle.net has PLAYER GAME HOSTING, but all character data is handled by the Battle.net DATA SERVERS.

    So I'm asking and hopefully better this time. That the request is mainly towards Mutliple Instances of the Multiplayer plugin not rooms.

    1 Connection to a Signalling server like Scirra's to connect Player to Player

    1 Connection to my company server to handle important data with security away from the Host player.

    or more for some other reason.

    Your replies have only address multiple rooms. convient, but not required.

    If I'm wrong and the plugin can play on the host AND the peers(non host) can still do important data on a separate server; with use of the plugin. Please let me know how and layout an example around structures I have poorly explained.

  • For the multiple zones, you could group them in a sector -which is the server- where you keep track of a lot of people. In the end it'll be the same data transmitted and received.

    Although that has everything riding on one host and if that goes down it affects everyone. I know it's a beta now but reconnection and shoving everyone back in the same room without losing too much might be an issue with a larger playerbase. Splitting it up among different server zones would provide more stability. Especially if only 1 instance had a crash in 1 zone you could accommodate for that. If you split all that up into different rooms, you could potentially do that by ending connection to one and then enabling to another based on layout variables telling you which room to go to.

    Although it is possible to do all that without 2 servers and that there might be more specific things like websockets that would be better for implementation for a centralized global chat, the execution of the product may not want to rely on a central server other than the signaling one for connections. This offsets the load and as long as there's a host you could have a global chat on one object connection, and have the game on another object connection. This way no matter who's the host (if dev controlled or random peer), it'll have dynamic scailability, allowing more people to talk and play, as well as help organize groups of players easily.

    I don't feel that allowing multiple multiplayer objects is a bad thing, although I do understand that it may make people forget that websockets exist when they have perfectly fine uses. Perhaps a mention of them and demonstration of their use along with a disclaimer about too much traffic = bad or w/e for relying on the WebRTC stuff for everything, especially if you are hosting it locally. I do feel it's at least a quick start in getting things working, as playerDB stuff on the C2 engine would be laggy for hundreds of players, but for a few players it wouldn't show it's bottleneck and be acceptable. If programmed around that, that limitation can be avoided (although doesn't let you expand and get more people, just scale the operations of what you have)

    If multiple connections/objects do come in, I know I'd set up a chat connection for the chat and lobby, and have another connection for the game rooms

  • As Thndr said and well put. I have no problem programming the server side Websocket if I could, but browsers don't allow WebSocket.listen(). So server programming is done traditionally. Where as the Multiplayer Plugin does support C2 server side programming

    I still don't feel it would be all that difficult to change the Multiplayer Plugin from single to multiple.

    Can't we just remove

    "flags": pf_singleglobal

  • jayderyu

    It might not only change the flag.

    The synced instances are registered by object-type. The multiplayer Plugin will control them automatically.

    If you try to set the control-source of these instances (in the same object-type) by different multiplayer plugin, it might need a tag on these instances to identify, might be channel-name.

    ( I though "channels" is better then muti-room for explained)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • rexrainbow

    Actually your right it's not a small change. I went into the plugin a little while ago.

    mp.js

    mp-net.js

    mp-client.js

    Each of them registers them self as a window object and are well written to support only one line of communication.

    I like the term channel better myself to. Room is to evocative of a location where as Channel says line of communication. I only used the term room to maintain the language in use.

    This plugin looks like it will function well for quick style games, but not so well for larger in scope game worlds. However it is important to note that the plugin is still in beta. Other features maybe on the way and Ashley only wanted to start releasing the current plugin so we can start working with the plugin and find bugs.

  • Multiplayer plugin has potential, I would like to develop this add-on is not ended only on the bugs correcting

  • That's why I'm thinking Ashley hasn't really mentioned anything about multiple instances of the plugin. Maybe that's the plan and we just don't know that. So let's just wait and see.

  • Hi! I just searched for multiple rooms and found this topic. I wanted to create a "lobby" where all players are for matchmaking purposes to find other players even if they are currently in singleplayer mode so you dont have to wait a long time in a "waiting for other player" screen. But when I put all players (like in the MMO example above) in one HUGE room is it still possible to connect only a few of them (e.g. for joining a dungeon group) and only these players are sent there (on a new layout)?

    I just started to work with the MP plugin but I thought you need to have all players of an active game session in a "room" but if hundreds of players are all in one room how can you let only pairs of 2 or 4 play together?

    btw: If you create an MMO(styled) game with hundreds of players in one room and everyone is constantly sending updates about locations (everyone can be on different layouts/zones, right?) and what they are doing/casting will this work without much lag?

  • Bl4ckSh33p

    Part of larger more robust systems say guild wars/ WoW will also use partition trees such as quad trees. These can also be used in the network to determine who get's messages and who needs to recieve messages. C2 super duper easy to use system however sacrifises flexibity for ease of use. However you can still use C2 MP core functionality to continue to do so.

    For me the MP did not do the required job. So I work around it. I also structured my game to work more like a PSO rather than WoW. Where there is a shared lobby, but when the players advenure together then it's changed. This is pretty easy stuff. Players leave Room and join Team Leader Hosted room when they enter the dungeon.

    I found a lot of work arounds that I'm happy with. So I have no blockers to create MMO's, however this does require more work than just simple click and drag.

    My Derelict Project(sig) goes into this. When I have the time to work on it. It's been a couple of months. but I will be back. The server system is down so you can't click and try. plus people need to actually be playing to really see MP work maybe someday.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)