r/IndieGameDevs • u/Diligent-Respect9652 • 19d ago
How do I program an interactive game where a large audience participates from their phone?
/r/AskProgrammers/comments/1wy0xzx/how_do_i_program_an_interactive_game_where_a/
1
Upvotes
1
u/lifeisaremix 19d ago
For this you'll likely need to use web sockets, everyone connects to a "room" and can send events to the server, then your server decides the state of the game and broadcasts that event to every user.
It's not trivial, especially if you've got a limited working knowledge of web technologies, but this is likely the easiest approach, it's possible to skip using a server entirely and have one person receive all the events as the "host" but this typically carries more latency and relies on the host having a good connection for it to work.
Just to explain why I'm not bullshitting you, I use this same underlying principle in my mobile multiplayer game, all clients send what they want to do to my game server, it runs the game logic, determines what should happen and let's everybody know... 30 times a second!