How do I set more than one peer's control on multiplayer?

0 favourites
  • 6 posts
From the Asset Store
A whole set you need to create a gorgeous winter 2d game
  • Hello, everyone!

    Recently I've read a lot about how multiplayer works and have created my own script based on some videos I watched.

    I got a functional peer-to-peer connection, and their controls work fine. Since I want to make a game for 4 player, I tryied connecting more peers in the room. Connection worked, although the player instance of the 2º peer wasn't created.

    I made some adaptations and I the player instance of the 2º peer was being created, but when the 2º peer joined the room, the controls of the 1º peer stopped working. After hours trying to figure out how to make both controls work, I decided to try using different sprites objects for different players. Host works fine, but the peer controls doesnt.

    This is my capx where I'm trying to solve this problem (it's a bit messy, sorry):

    multiplayer.capx

    I really would love to connect 4 players on the game I'm developing. I want to play it with some friends.

    It would be really nice if you send me some tips or a capx that makes more than one peer connection with functional controls. I'm sure someone has already done that. If it wasnt possible, it would make no sense having a maximum peer setup.

    Thanks a lot, my friends!

    Tagged:

  • The official multiplayer tutorials cover how to handle peer inputs from multiple peers in part 4.

    construct.net/en/tutorials/multiplayer-tutorial-real-598

  • Thanks, my friend!

  • The official multiplayer tutorials cover how to handle peer inputs from multiple peers in part 4.

    https://www.construct.net/en/tutorials/multiplayer-tutorial-real-598

    I perceived I didnt put the "for each peer" condition on the peer input config.

    What I got putting it was: the third player connected now moves his sprite and the second player sprite, and the second player has no functional input anymore.

    What Am I missing?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Likely your peerids are not being properly assigned to each object. Will take a look at your capx when I get a chance.

  • Thanks, I appreciate it!

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