ID:243962
 
Redundant
Applies to:Dream Maker
Status: Redundant

This feature has already been implemented, or is already achievable with existing methods.
A challenge faced with making single player games is the integrity of the save files that when using dream maker we are forced to store on the user's computer. If they could communicate with a central server it would be great, this way they can play locally, taking advantage of everything their computer has to offer and also provide security and probably additional functionality as a game experience can be built to be a network of worlds.

I thought it would be only logical to be able to use the built in Export() procedure to communicate with any world, hosted or local but after hours of trying to find out if I was just that daft, I realized it's just not currently possible. So the request is to allow game worlds to communicate with other game worlds, whether hosted or local.
I think your doing it wrong. You need both Export() and Topic() to have communication between servers. Also look into Import() for transferring data. If your having trouble setting this up you should move this post to the "How-To" section.
I am not. I can almost assure you that they do not work. The local game can Export to a server, however a hosted game can not export to a local game.
Chris is right, you cannot send information to a BYOND world unless it is being functionally hosted. On top of that, Topic() currently has such a broken success rate, that it is not nearly reliable enough to be considered for anything that is even remotely important, like managing player save files.
So a server needs to be hosted in order to connect? Hm I never knew..
Why not export to a PHP file and store the ip port in MySQL? There is a way In PHP to export back to the client which was posted on the forums... I think I still have it on my laptop... You can easily store the players info in a MySQL table.... You can use this system on any free host really...
Or alternatively you could use the MYSQL lib on here... It was either by Deadron or DanTom
@A.T.H.K - There's usually always a workaround to the issues we have with BYOND (i.e pixel movement before native), but I personally don't like to use them, especially since BYOND's major redeeming factor is the networking, giving us a easy online multiplayer environment, I don't think just because i'd like to make something a little more sophisticated that I should not be able to rely on the built in functions.

@Falacy - I've been using it, but I don't have the larger player counts as yet, if it really becomes that bad, added to being unable to have a safe single player [without much workaround], meh... The future is bleak here.
In response to Falacy
Chris Gayle wrote:
A challenge faced with making single player games is the integrity of the save files that when using dream maker we are forced to store on the user's computer. If they could communicate with a central server it would be great, this way they can play locally, taking advantage of everything their computer has to offer and also provide security and probably additional functionality as a game experience can be built to be a network of worlds.

Unless they're not connected to the internet while they're playing the game. You can find safe ways to store data on the client's computer. It's a much better solution and it's something you can implement.

Falacy wrote:
On top of that, Topic() currently has such a broken success rate, that it is not nearly reliable enough to be considered for anything that is even remotely important, like managing player save files.

You can build a reliable protocol on top of an unreliable one. All messages sent between computers are unreliable.
@A.T.H.K - You linked back to this post :S

@Forum_account - Safe ways such as? I'm open to suggestions in that regard. Either way that would be great but what if I want saves to migrate from multiplayer to single player? and visa versa.
In response to Forum_account
Forum_account wrote:
You can find safe ways to store data on the client's computer. It's a much better solution and it's something you can implement.

Agreed. You can ascii2text(), text2ascii(), and even hash it. For more security measures you can also add some random values in the data and remove them when loading.


In response to Chris Gayle
Chris Gayle wrote:
@Forum_account - Safe ways such as? I'm open to suggestions in that regard. Either way that would be great but what if I want saves to migrate from multiplayer to single player? and visa versa.

You can allow the client to upload their save to the server. Although, I do think the client needs to manually save their data if this method is used.
In response to Chris Gayle
Chris Gayle wrote:
@A.T.H.K - You linked back to this post :S

@Forum_account - Safe ways such as? I'm open to suggestions in that regard. Either way that would be great but what if I want saves to migrate from multiplayer to single player? and visa versa.

Use the client.Import() and Export() procs. The server can access the savefile stored on the client so the player can easily transition from server to server or play offline and always use the same saved data. The only drawback is that you can't easily switch computers (you'd have to move the savefile manually).
In response to A.T.H.K
A.T.H.K wrote:
There is a way In PHP to export back to the client which was posted on the forums...
That is the broken part of BYOND's processing, it doesn't properly receive incoming Topic()s

Forum_account wrote:
You can build a reliable protocol on top of an unreliable one. All messages sent between computers are unreliable.
Hardly. I have written a system in PHP to handle things, since BYOND couldn't. That PHP system connects with BYOND, and BYOND servers communicate with each other. The PHP aspect of the system has had a 100% success rate over the past few months, BYOND's is barely 50%, if even that.

Use the client.Import() and Export() procs.
Using these are flunky, since you can't properly save a player when they logout. That same issue seems like it might effect this entire concept.

Regardless, you shouldn't be making a single player game in the first place!
In response to Falacy
Falacy wrote:
Forum_account wrote:
You can build a reliable protocol on top of an unreliable one. All messages sent between computers are unreliable.
Hardly.

http://en.wikipedia.org/wiki/Acknowledgement_(data_networks)

If one server needs to send a message to another, have it try sending the message once per second until it receives an acknowledgement. The receiving server sends an acknowledgement every time it receives the message. With a 50% chance of messages being received it'll take, on average, four tries for the message to get through and for the sender to receive confirmation that it was received.

Use the client.Import() and Export() procs.
Using these are flunky, since you can't properly save a player when they logout. That same issue seems like it might effect this entire concept.

Games don't have to save when the player logs out. Most BYOND games do work that way so people may think that's how it has to be done, but you can save a player's data at any time.

Regardless, you shouldn't be making a single player game in the first place!

I don't think it's about making single player games, but making it so a person can use the same saved data whether they're playing on someone else's server or running the game locally. When you host a game yourself it starts out as a single player game.
In response to Forum_account
Forum_account wrote:
If one server needs to send a message to another, have it try sending the message once per second until it receives an acknowledgement.
In my attempts to accomplish such a system, it could often take over 100 exports before a message would even be received. When the concept is to determine whether a server is even online, that kind of eliminates the entire point.

Games don't have to save when the player logs out. Most BYOND games do work that way so people may think that's how it has to be done, but you can save a player's data at any time.
Its not really a BYOND thing, but an online game thing. However, games in general benefit from an auto-save of all progress at any time type system, especially for computer games which can unexpectedly be ended.
What do exactly want, Server to server communication? Then for that use world.Export() in the client, if you want Client to server and wise connection in the client you do world.Topic() and in the Topic() of the server you do "return" + things to be returned.

I've made an example in your thread.
What I want to setup is a network in essence, games exist on separate computers but still function on some level as if grouped, so some communications from things like guilds/factions would be shared. Save files also hop from location to location making the experience seamless.

So it's a mix of server->server, client->server, and server->client. That's pretty much the final goal, however it doesn't seem like that's going to happen that easily for now.
MYSQL can easily do this ...

You can store anything in a MYSQL table from saves to guilds to text to numbers ....

I linked you back to my post for a reason ..

If the user is offline you can easily save it locally hash it protect it as much as you wish then when they are online update the database with what they have done...
Page: 1 2