Made before Griffpatch's MMO tutorial, but works mostly the same way as it was inspired by his video about how he shattered the cloud limit. Small improvement idea: If you're using clones for the players - which I am not - you can use the "glide to x y 0.1 seconds" block to smooth out movement a bit. Disclaimers: -This is an interactive demo, not a game. You can make your own by remixing! -This is a generally overcomplicated approach for a simple multiplayer game. You can certainly use it, with little downsides, but as I mentioned: It is more complicated than necessary. -Unfocused tabs will be flagged as a phantom player. (not shown on screen) How does it work? This MMO Cloud Multiplayer has a theoretical player limit of 200000 players - that's insane! Of course, Scratch's cloud servers are a tad slow and setting cloud variables has a rate limit of around 10 changes per second per client I believe. Each player sends a packet to a random cloud variable (if they've been in the project for at least 4 seconds to prevent spam.) Each cloud variable gets read at every player's instance, and stored in a list using the packet sender's "virtual username" as their Player ID. -Why not their regular username? -Because multiple players with the same account won't work if I'd do that. You can remove the virtual username and tinker a bit with the code, if you'd like one player per account max. Their packet gets decoded for every instance, and if the virtual username is already recorded, look at the item ID of said virtual username, and update every part of the list using that item ID. If it doesn't exist, simply add everything sent in that packet to the end of the lists. - Limitations: -Just like each cloud variable, packet length limit is 256 characters. That is 128-((var amount in packet)x2) readable characters. -An actual (still unknown) player limit of more than 130. Some project of @griffpatch got that amount and I am using a similar approach. -The 10FPS cloud limit, you can only set a cloud variable every 0.1 seconds.
Please give credit if you're using this engine! I sacrificed my sleep for this... Thanks :D Has some aspects mentioned in @griffpatch 's YouTube video about his Minecraft-ish MMO. This is what inspired me to make this project. All code except for his en/decoder are by me. This is a small demo, remix this instead. https://scratch.mit.edu/projects/843769644 Created on 30 April "23, cloud semi-finished at 00:15, on the 1st of May. ~6 hours later. Later on May 1, after my precious sleep, I wrote some documentation inside the project, cleaned the code a bit and fixed a lot of bugs. I also added multiple costumes, to create faces. Later that day, I added a update system, that would kick each player if their game was outdated, without consuming a cloud variable. Clicking "See Inside" will stop sending and receiving cloud variable updates until you refresh the page.