Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Please help. How do I "sync" a data file to be used as a global score system?

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
Hello friends,

I'm looking for a way to "sync" a data file to be used as a global score system.

In other words when the player wants to view the score board, the file would download to be read so the data could be sent to be viewed by the player.

If the player makes the global score board the data would be uploaded.

I'm sure this shouldn't be too difficult except for I imagine some error checking possibly for if the file is in use by another player uploading their score.

I do use the Auto Updater Plugin by SumRndmDde & that seems to be very close to what I need in order to download. However I haven't exactly been successful at editing the plugin. I have got it to download the file and replace the old but it just loops the "Updating Screen".

Thoughts? Does anyone know how to achieve this or if there is a existing plugin?

Thank you for reading. (cool) (icecream)
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
An online data file or a local file? Online data will require you to have a cloud (firebase, heroku) to store and pull data from. A local file is much simpler as your just reading from a local JSON file and saving to it.
 

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
An online data file or a local file? Online data will require you to have a cloud (firebase, heroku) to store and pull data from. A local file is much simpler as your just reading from a local JSON file and saving to it.
Thanks for the reply LTN. (cool)

Online Data to be used globally via the game downloaded with google play, etc.
My thought was I would download a score data file for use whenever the player opened the score board to be used local then read.
When the player gets a highscore I would download & insert their highscore (if needed), then re-upload.
That logic is probably much to simple though, especially as the amount of "traffic" grows. (perplexed)

For the auto-updates I use github but I suppose that differs because I'm not ever uploading from the game.
Could you give more details how to achieve this with firebase or heroku? (cute)(icecream)
 

Xilefian

Adventurer
Xy$
0.00
You're doing a classic XY problem here, where you're asking for how to implement a solution you've imagined for your problem, rather than ask how to solve your original problem to begin with.

Don't download a file, especially with Android (where this will be a permissions nightmare).


I recommend Firebase for MV projects that need online data: https://firebase.google.com/docs/database/web/start

You can use Firebase's database to store your scores (and other cool things). Firebase is pretty much perfect for online components with RPG Maker MV.
 

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
You're doing a classic XY problem here, where you're asking for how to implement a solution you've imagined for your problem, rather than ask how to solve your original problem to begin with.

Don't download a file, especially with Android (where this will be a permissions nightmare).


I recommend Firebase for MV projects that need online data: https://firebase.google.com/docs/database/web/start

You can use Firebase's database to store your scores (and other cool things). Firebase is pretty much perfect for online components with RPG Maker MV.
Excellent advice both of you! Yes thanks I see now.
I've been looking into Firebase much more now, I can see how it will be perfect for this & much more.
So any good example project you can recommend for an MV Firebase project?

I've found this:
http://tm.lucky-duet.com/viewtopic.php?f=5&t=1618

Which I've been picking apart but unfortunately I don't understand too much Japanese. I don't even know how much help this would be.
 

Xilefian

Adventurer
Xy$
0.00
Good job finding that project.

It contains an example of using Firebase to upload player data; https://github.com/krmbn0576/rpgmakermv/blob/master/js/plugins/OnlineAvatar.js
This is actually a rather small code-file - less than 500 lines - which should give you an idea of how easy Firebase actually is.
Check out the first 3 @param values and how they are used; this is how you connect your game to your Firebase database.

You can see how the code reads data from its database in the function starting at line 166.

Read the pages in the Web category on this site here: https://firebase.google.com/docs/database/web/start that will explain to you how to connect to your database with your Firebase account in Javascript and how to read and write data (your player scores) to this database. It will also give you some ideas on what else you could do.

You should watch the Firebase web tutorial videos; https://www.youtube.com/playlist?list=PLl-K7zZEsYLmnJ_FpMOZgyg6XcIGBu2OX
I found these tutorial videos to be the biggest source of help when I first used Firebase (for an Android project).
 
Last edited:
Top