Legacy GM A couple of queries about online/database communication

R

Rosieu

Guest
Hi Everyone!

Apologies if this isn't exactly the correct place to ask this question, I was tossing up between posting it here and the 'Game Design, Development, and Publishing' board, but I figured it's slightly more tech-based so I'd stick it here.

Anyway! I'm currently considering an idea for a gameplay mechanic that--at a basic level--requires my game to take a string, send it online to a collection, while also having the ability to receive strings from that same collection. So what I pretty much need, is the ability to send a string to a location, receive a string from that same location, and that location needs to be a collection of said strings (I was thinking either a 1D or 2D array).

I'm a total newbie at networking, so I guess the core of my questions revolves around how I actually do this. Is my collection/array a database, and the sort of thing I need to learn Php or MySQL for? Is there some way I can just have my game communicating with a spreadsheet online or something?

Sorry if these are utterly stupid questions. I've been trying to find answers and info, but I'm not even sure what to do, let alone how, so I figured my best bet would be to actually ask for some more experienced advice on what I should actually be looking for, so to speak.

Any help is greatly appreciated!
 

The-any-Key

Member
I use PHP and SQL.

But to have a shared string database is not that simple. Because you could overwrite what other do.

Got a extension for it here:
https://marketplace.yoyogames.com/assets/5447/webapi

That use a public numeric table. Where people can add or subtract values. An it works with shared data. With strings, you would need to make sure each player only affect one row at a time. Any details what your plan is?
 
R

Rosieu

Guest
I don't have any specifics in mind at the moment, but I was more just kind of conceptualizing how I could go about some kind of 'asynchronous' multiplayer feature.

My thinking was something along the lines of:

For upload:
> have a ds_grid with player stats or values (assigned a unique identifier)
> convert this ds_grid to a string
> Upload this string to a list or array.

For download:
> Pick a given/random string from a list or array
> Download
> Convert string back into ds_grid and interpret it at clientside.

It may not even be feasable, but I was working out my save system for a project I am working on currently (which revolves around converting ds_grids to strings), and was kind of musing about how it could apply to asynchronous multiplayer. By my logic, if it works, it would make a fairly quick and efficient way to transfer information, because you'd be uploading/downloading strings, which are relatively easily controlled.

I feel like assigning said strings uniq identifiers could be helpful for avoiding overwriting.

Again I stress I know next to nothing about this side of things, I'm more just musing about if this idea could work.

Thanks for your help though! I really appreciate it.
 

The-any-Key

Member
You can make slow or turn based multiplayer games with a SQL database. Note that speed is often a issue with http requests. It may take just 50ms or it will take 60000ms.

Best practice is often to have a table with user data that is then downloaded by the users. The problem is often that you need to sync this. Ex. If you upload data to a http server. The http server can't send this back to another player. That player need to manually do a http request and get the data.

You are talking about Id numbers. And that is often a way to go. This way you can track what messages the client has already received. Ex say 3 clients upload data to a SQL table. The SQL will automatically give each message a unique ID number.

Now the clients can request the data. They can then filter out what they already have received and sort away their own messages. Then they can process the messages in order.

Note that you need to save new data in a new row. You mention it a bit. So players that got high ping can keep up.
 
Top