How do I do TCP/IP Multiplayer? (and more related questions)

0 favourites
  • 4 posts
From the Asset Store
Logo Quiz with 150 prepared logos and answers, automatic question and answer mixing
  • I have a few multiplayer questions.

    I've read through https://www.scirra.com/manual/174/multiplayer and it gives me a sense of how multiplayer works (though not really how to implement it so far, but that's OK for now).

    And then on https://www.scirra.com/blog/142/make-online-multiplayer-games-with-construct-2 I see the following bulleted blurb:

    ...

    "-Support for both peer-hosted games (not needing a server) and centrally-hosted games (using a server)

    -Official Scirra signalling server to connect players to each other"

    Questions to be clarified:

    1. On centrally-hosted games: Can I host my OWN server? Or must I use Scirra's central server? Is it better to just use Scirra's or would using your own probably be faster?

    2. On peer-hosted games: any finished games use this? Is it like TCP/IP? Is it fairly reliable?

    3. How feasible are these things to implement for someone without professional training in programming? I'm pretty thrifty with the C2 scripting system, for the most part, but mutliplayer seems like it must be tough to implement.

    4. Slightly tangential question: It seems possible to have 4 different gamepads hooked up to the computer and use them all in local multiplayer, right? I know C2 has gamepad support, but does it have reliable multiple gamepad support?

    From https://www.scirra.com/manual/143/gamepad

    Multiple gamepad devices can be connected to a single computer. To differentiate between them, most actions, conditions and expressions in the Gamepad object also take a Gamepad parameter. This is a zero-based index of the controller. For example, 0 identifies the first controller, 1 identifies the second, and so on. This allows you to make multiplayer gamepad-controlled games.

    Any guides I missed that expand on that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Still unsolved. Got buried.

  • 1. On centrally-hosted games: Can I host my OWN server? Or must I use Scirra's central server? Is it better to just use Scirra's or would using your own probably be faster?

    Scirra provides a Signalling Server. This is different than a Host Server for your game. The Host Server is people would generally think of as "server" as opposed to "client".

    A Signalling Server is sort of like a directory service Scirra provides, that can point people to the IP of your game's Host Server, or in the case of a peer-hosted game, it would get the IP of the first peer to join and return that IP as the host to subsequent peers.

    2. On peer-hosted games: any finished games use this? Is it like TCP/IP? Is it fairly reliable?

    Packet transmission is handled by UDP. Most games want this. There is also the option to handle packets in ordered and unordered reliable modes, simulating TCP.

    Read more about reliability modes here - https://www.scirra.com/tutorials/892/mu ... e-10#h2a24

    3. How feasible are these things to implement for someone without professional training in programming? I'm pretty thrifty with the C2 scripting system, for the most part, but mutliplayer seems like it must be tough to implement.

    Very feasable. Construct is awesome like that and provides the means for an amateur to put together a multiplayer game. While possible, it definitely isn't easy! Expect to put in considerable extra effort, depending on the complexity of your game.

    For example, anyone can follow the tutorials and make a chat room or pong. How you implement those techniques into your own game is the challenge, but the building blocks are there.

    4. Slightly tangential question: It seems possible to have 4 different gamepads hooked up to the computer and use them all in local multiplayer, right? I know C2 has gamepad support, but does it have reliable multiple gamepad support?

    The section you quoted from the manual seems pretty clear and concise to me, although I haven't used the gamepad object myself. Just use the gamepad parameter in expressions to control the objects in the game - for example gamepad 0 will move player 0's sprite, gamepad 1 will move player 1's sprite and so on.

    Can't comment on reliability there - regardless of your code I think the bigger issue is that there will ALWAYS be hardware issues and bugs out there somewhere on one of the million system configurations in the wild, and you really don't have much control over those.

    I always have trouble getting my DS3 controllers to get recognized by windows through an xinput wrapper, but that doesn't have anything to do with the game I'm trying to get them to work with!

  • Thank you! I'm happy to hear that it's all feasible. I'll figure it out when the time comes.

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