Sharing data between instances (Web platform)

What I’m trying to do is something I’ve seen only in a flash game (name isn’t important). When player has lost, other players were informed in the title screen in news channel-like scrolling bar along with their final score. How would I do something like that in web platform?

I think GD have everything needed to do that.

You just need your own full-time running server to store the data to be reached from any instance at any time.

I know so much, just how to achieve that technically (in GD).

GD can perform url requests, so if you have a server with a custom API that receives those url requests you send and store data in the server and all the instances of the game can read it via the same API.

Or you can use an already made system with an API. For example gamejolt.com offers data storing, multiple score tables and achievements per user using its API. The only problem here is that gamejolt uses MD5 hash code verification in his url requests to the API and it’s a bit hard to calculate a MD5 hash code from inside a GD game (at least by now).

If you’re interested in use the gamejolt.com feature to store user data, achievements and scores tables online (and eventually read that data from any instance of your game) I can show you. But you will have to resolve how to calculate the MD5 hash code.

Maybe, you can make a small application in C# to pre-calculate the MD5 codes and store them in a XML file (for your game to read it later), then distribute this application with your game as a “gamejolt logger”, I can explain you how to calculate MD5 hash codes and store it to XML in C#.

That’s what I can do… to be honest I don’t have idea how to program a fully functional web API with PHP and Java, so I can only explain you how to access the gamejolt one.

Let me know if you’re interested.

I don’t want to store, I want to share data between instances. Why would I want to store data on every people who died when I just want to tell players that “JoeSchmoe just died at level 5! What a loser!”?

This kind of feature starts to be supported by some browsers using WebSockets and wrappers like Socket.io
Still you need a server (with Node.js preferably) that will be used to transfer the sockets (= “messages”) from clients to clients.

With the solution proposed by erdo, you can still have a simple server storing the messages for some time and erasing it like 1 or 2 minutes after, and have each client sending request to the server from time to time to know what happened in the last minute.

Because there is not other way to share that data.

Exactly…

… any system that share data between two instances of a game uses a server to permanently or temporary store data (at least it is a one-to-one system in where you know the exact IP of your partner).

The different instances of the game can’t just guess the IP of the instance of the game that have data to share, and that specific instance of the game can’t just guess the IP directions of all the other instances of the game that are being played in another PC’s around the world.

So, there have to be a fixed site from where all the different instances of your game reads data or store data (for others to read). That’s a server.

For example, you can set your game to read the first five entries of a score table stored in the server every 15 seconds and then update the score table displayed on screen. And when you die (or when you had broken the historical upper score, that can be another insteresting parameter) then your games stores some data in the server for the others instances of the game to read.

And all the gamejolt.com business that I mention before is just a way to use an already made web API system that’s public and store game data. The MD5/XML/C# things I say before responds to some technical issues we need to solve in order to get a a score system (like the one you’re propossing) running under the gamejolt.com web API.

But it’s not impossible, it just will take some work and a little external application (that we have to program) distributed with your game :wink: