Ok, I'm back - with a new feature preview: Online Multiplayer

@“Mhx Ar” Ive tested multiplayer with friends at my school, all of us on school WiFi. I think its the computers Id or something

This is peer-to-peer, I don’t see why you wouldn’t be able to use the same PC @“Mhx Ar”

Also @PixelPizza there are quite a bit of bugs but I haven’t determined if it’s us doing something wrong or someone wrong with the coding,

Bugs I found so far:
Only basic ones which fits the bugs categories you mentioned in the post

  • If a player disconnects from the game it will still remain the player object, that the computer was using.

  • If a player refreshes the page the old object player (that the computer was using) remains in the game, so there can be like 5 player objects and only 2 players playing.

// To reproduce these you only have to refresh your game and you will see your old game object

==========

  • Like CBG said, random numbers are not shared. In the example game you provided, players have different sprites for each computer.
    // You can see this happen by looking at various computer screens in the same game

==========

  • If the internet connection of someone is weaker than yours (example: Someone is connected by a LAN cable and the other one is connected by Wi-fi) the objects tend to stop in one computer but in the other is fine and everything moves. Basically the normal LAG in other online games. The world stops moving but you can still move.
    // To reproduce you need a computer with a bad connection and the other with a very good connection.
    And let the magic happen, I guess.

@PixelPizza Typically peer-to-peer picks the host with the strongest connection.

Can you simplify that

Hey, thanks for all the updates. I expected there to be some glitches at first, but I’ll get them sorted out.

To answer some questions:

The same computer can connect multiple times. Multiple tabs should work, but backgrounding a tab normally pauses it, so it’s better to try using two windows instead of two tabs.

There is no kicking. If it becomes a problem it could be possible to add some sort of vote-to-kick or something.

We can’t really ban players either, since it’s possible to play without having an account.

@CrimsonBlackGames - I wasn’t aware of the attachment issue, but I’ll look into that one. The multiplayer enable/disable/check sounds like a pretty good idea as well.

@PixelStudios - the gif you showed is definitely behaving incorrectly. Can you (or anyone else who cannot connect properly like @Trigger2004 or @CrimsonBlackGames ) send me a browser log when it fails? You can do it like this (in chrome):

  • Open the browser dev tools (menu->web developer->Web Console)
  • Test the game and trigger the failure
  • You should see a bunch of logging in the console. Right click the console area and select "save as"
  • Send me the file: grazer@flowlab.io

Sending me a log will help me understand what’s breaking down with the connection.

@grazer I use puffin browser 99.9% of the time because my lack of computer access. Post-update I am completely unable to edit my games unless Im at school with special permission

It just sits there without the editor showing: I cant see it but I can interact with it

@CrimsonBlackGames - just so I understand: after this update, the editor no longer works in the puffin browser? I can try downloading it and testing myself, is this on android or iOS?

@grazer I think its both but hes on IOS.

Also I cant recreate the error so I cant get a log.

iOS is what I use but android might share the case as well @grazer

@PixelStudios - does that mean it’s working OK for you now?

Cannot wait

@grazer Two windows, not two tabs.

I just deployed an update that fixes a problem with player positions becoming de-synchronized between clients.

Hey @CrimsonBlackGames - do you have this editor problem even with the new networking disabled (max players set to 1)?

Positions are more synced, besides the drag lag when they touch a wall or something and spazz out. I was noticing that occasionally a player won’t spawn for the other one. I’m assuming players are just set to random and that isn’t dictated in this example, but sometimes they show up as the correct character on both screens. Not sure if intended or bug.

a

Yeah, I saw this missing spawned player issue a couple of times when I was testing, I’m going to check that out next.

The players are just randomized - there is no attempt to make them the same across clients.

I’m late to the party, but this is a very nice update! :smiley:

@CrimsonBlackGames You can already give players an unique id when they join your game by increasing the value of a Shared block and then assigning it to a player.

Even though I can’t even make use of this, I have some suggestions:
@grazer I don’t like the way it connects. We should be able to do it ourselves like CBG said, a connect block would be a good idea. It outputs when the client is connected so we can make custom loading screens.

I was also thinking about the ability to create new instances yourself, what about having 3 options in the Connect behavior:

  • Create or join instance with id (this will read the input value as id, this is for more ‘private’ games with friends)
  • Join existing instance or create new one (default, will ignore instances with ids)
  • Always create new instance

We should also have a Disconnect block and Disconnected block which triggers when someone loses connection with the server in any way (reloads page, closes browser, lost internet connection etc.).

Also, why don’t we have an option in mailbox to send it to everyone or only to yourself?

@grazer unfortunately, yes. I tried to open SB2. Couldnt