ScratchData LogoScratchData
Back to TimMcCool's profile

☁️ three-variable cloud engine (32 players, backend-served) by TimMcCool

TITimMcCool•Created April 15, 2024
☁️ three-variable cloud engine (32 players, backend-served) by TimMcCool
234
179
3553 views
View on Scratch

Instructions

This cloud engine uses ONLY 3 CLOUD VARIABLES! It supports up to 32 players (can be increased if necessary). I made this cloud engine to add cloud multiplayer to Cloud Blocky. It has been implemented there. (link: https://scratch.mit.edu/projects/408348083 ) ⚠️ This cloud engine is backend-served. This means you can't take the code to another project - IT WILL NOT WORK. You have to run the server's Python code in the background. I think it's pretty impressive that this cloud engine needs so few cloud variables and can still handle so many players! It also has a good update rate (10 cloud updates per second) and a justifiable latency. Why make a backend-served cloud engine? I need this engine because in Blocky, most cloud variables are used up by the cloud requesting system. While other approaches would need at least 9 cloud variables to support more than 30 players, this approach can do that with only 3 cloud variables and is still running extremely smooth, especially when there are many people connected. Normal MMO cloud engines start glitching when there are many people online, but this one doesn't. The trick that allows for this to work: While the Scratch project only has access to the current cloud variable value every 1/15 seconds, the backend listening to the websocket can see ALL cloud variable updates. How this project works: All players send their data to one TO_HOST cloud variable, the backend collects all player data updates, summarizes them in one value and sets a FROM_HOST cloud variable to this value every 0.1 seconds The latency is not that bad considering that MMO engines have a much lower cloud update rate than this. However, a disadvantage is that this cloud engine only works when the backend is up.

Description

⚠️ This cloud engine is backend-served. This means you can't just take the code to another project - IT WILL NOT WORK. You have to run the server's Python code in the background. This engine is not suitable for most use cases. If you need a cloud engine for a game, use @Cloud-Multiplayer's 10 player cloud engine: https://scratch.mit.edu/projects/334885506/ If you need a MMO cloud engine for more players, use my MMO cloud engine: https://scratch.mit.edu/projects/440516876/ The backend code for this project is available on GitHub: https://github.com/TimMcCool/Backend-served-cloud-engine-for-Scratch

Project Details

Project ID1001411666
CreatedApril 15, 2024
Last ModifiedApril 16, 2025
SharedJuly 23, 2024
Visibilityvisible
CommentsAllowed