rolandzarmy's Forum Posts

  • Well it's the same.

    BUT I succeeded to make it work;)

    This by leaving the current room and joining another one. This way I could use "on peer connected" as I did before.

    Thank you for your time and valuable help!

  • It makes sense. So I changed it in the host part with Multiplayer.PeerIDAt(LoopIndex) instead of peerid. But weirdly enough the problem is the same...

  • It makes sense. So I tried what you said but it doesn't spawn a player for the peers. Though the host can play his player without any difficulties.

    This is what I changed for the host instead of "on peer connected"

    And I left this as before

    If I choose not too use the "on start of layout" condition it produces an infinite amount of players but doesn't seem to associate it to a peer, because the peers can't still control them.

  • bartalluyn I think you do:)

    It's in other words as the peers are already connected I don't know which conditon I can use to create the players.

    So you think the peercount would work in the same way?

  • Hey!

    I'm creating a lobby for the Construct 3 Multiplayer real-time game.

    But here is the catch: when the game is lauched from the lobby and I switch to the "Game" layout, the condition "on peer connected" doesn't work. Because the host and the peers are already connected to the room.

    So this line doesn't work:

    I thought I could make a condition like "for each peer connected" but it doesn't exist.

    Would you know how to make it work?

    Thanks in advance!

  • Thank you;)

  • Interesting,

    Actually I'm not that serious about my game. Is there a simpler way to do it?

  • Great to hear that!

    What do you suggest? Is there a tutorial that can teach me that?

    Thank you it helps

  • Hey!

    Do you guys know how to make an online system to store account names with passwords? So people could retrieve some simple variables when they log in in my game.

    I hope I made myself clear...

    Cheers,

    Roland

  • Try Construct 3

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

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

    Interestingly enough when I try my game in the same settings but with a more powerful computer I have no issues whatsoever. It seems the script is just too much for my older computer. I could actually even experience some minor issues on the real-time example.

  • It really does make sense.

    This is what I've updated:

    I used the same basis as the multiplayer example, but added some few details:

    - The player can run when the Shift key is down

    - "gunnumber" is not used yet (but it is going to be to let the host know which gun the player is using)

    - bulletx and -y is for hit testing as there is a recoil for guns so they don't shoot exactly where the crosshair is (note: there was lag before I made hit this hit testing)

    Maybe it could be that I use the shadow caster function in combination to the multiplayer? Or that my Internet connection is bad?

    Cheers

  • Thanks for that great answer.

    It gives hope! I'm gonna update my code a bit and do some testing. And then come back to this post.

    Yes that's what I understood: I will still need to sync 5 variables and have 6 inputs.

    Does a lot of code/a lot of objects slow down the game? Does putting objects in a container save some bandwidth?

    Kindly,

    Roland

  • Howdy how's it going everyone?

    I'm making an online top down shooter, close to the example project made in the multiplayer tutorial. I experience though that I have just uppgraded a bit the code (and without syncing much more objects) that the multiplayer is already a bit laggy.

    I've read a thread with a similar concern where people pointed out that it could be a flaw with the peer-to-peer or because of too much syncing/inputs.

    Is it so that I can't expect being able to make a more advanced online-game with a relatively big map, shadows, and a more complex system? Maybe it's too much for HTML5?

    Kind regards,

    Roland

  • Thank you for your reply EL Constructorr and eleanorjmorel !

    Both solutions are great. I did as Eleanor suggested to avoid syncing too many objects. In my common group I just use the "Shadow" sprite I made on the Game Layout, and put it to the player position and angle every tick.

  • I've tried to use the expression if Peerid is not equal to multiplayer.myID then destroy, but it seems to destroy the sprites for everyone...

    So I'm really stuck here.