Turn based multiplayer not using multiplayer object.

0 favourites
  • 4 posts
From the Asset Store
112 High-Quality destruction sounds for videogames
  • I want to create a simple, two player, turn based game. Think tic-tac-toe (noughts and crosses), chess or similar. The two players will play over the internet.

    There obviously needs to be some method by which the game can pass details of one player's move to the other player. I tried using the C3 multiplayer object but I can't get it to work when the players are on different computers. I'm told using a TURN server might solve this but setting one of those up looks a bit complicated and/or expensive.

    So, is there a different technique I can use? I have successfully managed to read arrays and text files from a project file using AJAX and JSON objects. I can update either of these with the current game state, but I can't work out how to write the updated file back so that the other player can read it.

    I have a sneaky feeling that there is an easy answer...what is it?

    Thanks, Jim

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Jim,

    I don't know why you abandoned the multiplayer plugin, but turn based can be achieved pretty easily using it. Have you checked out my tutorial here:

    youtu.be/BpnkIL7XvvA

    Simply said, there is a back and forth communication between the host and the peer(s) where the host calculates who's turn it is, querys the peer for its input, processes the input, and broadcasts that input to other peers if there are any.

    Maybe this can still help you on your way?

    Cheers!

  • Thanks.

    I had assumed that if the official chat room tutorial demo project didn't work for me, then nothing would. But there may be a problem with that demo and I might be able to get the multiplayer object to work in a different project.

    I'll take a look at your tutorial and try to do something really simple with the multiplayer object.

  • I have added a TURN SERVER to the multiplayer plugin and now everything works just fine!

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