How do I combine multiplayer controls and LAN?

0 favourites
  • 3 posts
From the Asset Store
Have you tried to create realistic and at the same time casual tank movements? You found the perfect solution!
  • Greetings to all!! I am currently intrigued with a multiplayer concept i want to test and would like to know how to go about it in C2.

    The idea:

    Local multiplayer game, played on a single computer where up to 4 players battle each other out. Rather than utilizing a single keyboard for all or connecting extra gamepads for players 2-4, i want the controls to be accessible through mobile devices. Making it one single game, everyone playing on the same layout in player 1's PC and players 2-4 will use their mobile device as a controller through local Wifi. When connecting a mobile device it will get linked to a player, show the particular layout with the touch controls in the mobile screen and allow the actions performed in the mobile device on player 1's screen/pc.

    I'm reading on local multiplayer, local preview, gamepads, and touch controls in order to find the proper way to achieve this. I'm pretty sure that with the current touch controls and multiplayer plugin is more than enough to get this going.

    Help me out guys:

    How do i set up a multiplayer LAN game? I understand that the multiplayer plugin connects devices on the local network automatically but how do i go about joining two instances of a game through LAN?

    Can i make it so that there is only one game (player 1's) and be able to connect the mobile controllers? (maybe through a downloadable app made in C2 with just the controller support for the game)

    Is there a way to set a LAN preview that allows me to play in my PC and on my mobile simultaneously on the same game to test the idea out?

    Any and all help will be highly appreciated, if i get it running i will most probably upload a capx for others to try the same mobile controller method. Thanks in advance.

  • I have meddled a bit more but usually end up with a mess of faulty and confusing code. I'm getting familiarized with the multiplayer plugin and trying to get the idea going but i'm not sure if when my peers are connected i'm in local or internet.

    I'm trying to send the controller data from another layout which is not the game layout, not sure if sending info this way will give me problems or is the reason it's coming out faulty. I suspect i should create a different game/app which connects to the same room and has the controls and just send input from there.

    I'm still a bit confused with object syncing and client input/update. I pretty much just need to receive the none host peer input without having to rely on syncing the host's game with the controller game that much's just a controller, everyone is watching the same screen.

    Will keep at it, any suggestions and clarifications would be awesome.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    Got the basic up with two characters, player 1 is controllable through my PC and player two is controllable by my phone. I did a set up where if not on mobile, it goes directly to the server and creates a room, making player one the host. If in mobile, it sends you to layout where it connects a few seconds later into the same room and just displays the control buttons which sends on/off type input to client values. The host game receives that and simulates controls for the 2nd player.

    Is this efficient? could i do this easier and/or better with some sort of syncing and direct movement rather than client values?

    An issue that seems to be forming here is responsiveness. Keyboard and mobile will never play/react the same so this might add some sort of unfairness into the game...not sure how to set it up as best as possible for the keyboard and mobile to react as close as possible. Mobile screen with buttons is bigger than keyboard arrows, touch sensitivity is different than keypressing, keyboard data goes directly to the game while mobile data is going through wifi. This factors combined with screen size and playing style will most probably make the game feel different for players. So i might need a solution for this. Maybe ditching keyboard, everyone needs a mobile phone...but then why make it a PC game? Mimicking the desired response in the not equally responsive method is another idea. Or just keep optimizing the multiplayer inputs to get it there.

    I need to know how the client inputs and LAN affects the incoming data. The whole precision, 2 byt/4 byt, linear, thing has me confused and i suspect it could help me out greatly to get it working fluently. If anyone cares to explain, it would be HIGHLY appreciated.

    I need to add 2 extra players as well, that will probably stir things up for sure, need to sync extra mobile phones and make it so that controllers connect to the correct LAN game/room.

    Still would love some advice, guys!!

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