TIC-80
TIC-80 copied to clipboard
Internet Function
Does it a good idea to implement some internet api for multiplayer games?
You could do this with a function for reading a website and one for posting something. Then you would have to have an own website that can store data and send it to the clients or so.
(implement playerio :>)
What about something like a shared RAM that would be synchronized between client and server. It would be a nice pro feature, I think.
Personally I think that ability to do HTTP request would just be interesting for uploading score, tracking users and high latency communication (turn based games).
I see TIC more directed to smaller action games which would benefit from having UDP communication. Still writing proper network code is lot of work so I am wondering if this task cannot be done once in TIC e.g. as @harraps suggested by having shared memory.
I would see it that any client should be able to connect to special TIC-server which would wait until one of the client will start the game. Each client would then be able to modify the common memory. The server would maintain the memory and send all modifications to all other clients. The server would be run and maintained by a developer of cartridge. The server would have to reconcile modifications from all clients - e.g. in custom lua function. The resulting state of the game would then be send back to clients and clients would have specific lua function which should reconcile version of the server shared memory with their own local version. The whole state of the game should then fit into one UDP packet.
I took a look and even UDP communication would need the server for establishing connection for cartridges running in browser (WebRTC).
https://stackoverflow.com/questions/13216785/how-to-send-a-udp-packet-with-web-rtc-javascript I found following JS game using WebRTC - https://github.com/rynobax/jump-game
After the ludum dare, I realized that it is very useful to add a online highscore service for tic-80.
The online score is in issue #362.
I filled #457 to describe how the games can work over network.
Hey everyone. I would like to revive this thread. I would love to have basic HTTP requests to work with some scores/raking.
Does it a good idea to implement some internet api for multiplayer games?
not internet, but p2p would be great!
I want to +1 this ask, but really there are 4 facets here:
- playerio support
- High score saving (public server)
- Internet game loading menu
- generic Internet support (tcp udp and/or HTTP), probably for reasons not described above
What might help is creation of these 4 focused requests as distinct issues, linking them from here, and close this. This ticket likely can not encompass all of the above and still get actioned.
I think some web connectivity would be great. But a simple HTTP lib or websockets would be enough for most games.
For example using https://docs.rs/phyllo/latest/phyllo/ for using Phoenix Channels would enable using Phoenix Framework as a Backend for the Games.
But each developer has their own preferences.
My recommendation would be providing just a plugin like mechanism for TIC and each developer hooks some events in C or Rust and compiles a TIC version with their own extensions.