TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

Internet Function

Open fangzhangmnm opened this issue 7 years ago • 12 comments

Does it a good idea to implement some internet api for multiplayer games?

fangzhangmnm avatar Nov 18 '17 14:11 fangzhangmnm

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.

Jummit avatar Nov 18 '17 15:11 Jummit

(implement playerio :>)

Jaezmien avatar Nov 24 '17 02:11 Jaezmien

What about something like a shared RAM that would be synchronized between client and server. It would be a nice pro feature, I think.

hashalon avatar Nov 28 '17 18:11 hashalon

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.

jahodfra avatar Nov 28 '17 20:11 jahodfra

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

jahodfra avatar Nov 29 '17 06:11 jahodfra

After the ludum dare, I realized that it is very useful to add a online highscore service for tic-80.

fangzhangmnm avatar Dec 10 '17 08:12 fangzhangmnm

The online score is in issue #362.

jahodfra avatar Dec 10 '17 08:12 jahodfra

I filled #457 to describe how the games can work over network.

jahodfra avatar Dec 10 '17 20:12 jahodfra

Hey everyone. I would like to revive this thread. I would love to have basic HTTP requests to work with some scores/raking.

txgruppi avatar Jul 13 '22 20:07 txgruppi

Does it a good idea to implement some internet api for multiplayer games?

not internet, but p2p would be great!

BuoYancYdabl avatar Jul 20 '22 19:07 BuoYancYdabl

I want to +1 this ask, but really there are 4 facets here:

  1. playerio support
  2. High score saving (public server)
  3. Internet game loading menu
  4. 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.

sprive avatar Sep 05 '23 18:09 sprive

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.

clsource avatar Nov 28 '23 19:11 clsource