Jump to content


Photo

Flox: Analytics/Players/Leaderboards/Cloud Data


  • Please log in to reply
74 replies to this topic

#1 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 20 April 2014 - 12:10 PM

2cda58m.jpg

 

Hi all,

 

I'm working on a port of the fantastic Flox sdk to Game Maker and I thought I'd give others the chance to give it a go, find out what Flox is, possibly even contribute! First of all, what is Flox? Well if you don't mind, I'd like to ask you a few questions first.

  • Ever wanted to keep track of players across devices/installs of your game?
  • Have you wanted players to be able to challenge one another or interact more socially?
  • Do you want players to sync their power ups / game saves across platforms?
  • Or perhaps you just want to know how many people actually make it to the third level?

Flox can do all of this and more, it is a complete back-end solution to your game. Not only that, but it's pay what you use and you get the first 1,000,000 operations for free!

 

It's worth noting at this point that I am in no way affiliated with Gamua, just a fan-boy who uses the service.

 

Getting Started

 

Flox is a service and you must Sign up to Flox in order to use it. Add your game when prompted.

 

There are two ways to get Flox for GameMaker, importing the assets or downloading the marketplace extension. Downloading the marketplace extension is nice and simple, just add all the included assets to your project and you're good to go. However if you want to use the library for free you can! All the code is open source and completely free to use I charge for the marketplace library to recognize the significant amount of work I have done to make this library functional. But I don't want the price point to prevent anyone from using the library!

The first thing we want to do with Flox is to tell it what game we are. This is really straightforward

flox_init("YOUR_GAME_ID","YOUR_GAME_KEY","0.1");

You can find your game id and key on the Game info tab of the Flox control panel. Now of course, what is the first thing you do with any new toy?

flox_log_info("hello world");

You'll need to run this a couple of times and wait a few minutes for the logs to process but soon you will see your logs appearing in the control panel. Cool! 

 

You can save whatever you like to the cloud, either to be shared by a single player across their many devices (iPhone, iPad, Facebook etc.) or with friends across many game sessions. It's really easy! Create an entity and save it;

var saveGame = flox_entity_create("SaveGame");
flox_entity_set(saveGame,"level",3);
flox_entity_save_queued(saveGame);

This will record the level a player has reached and save it to the cloud for later, primo!

 

Leaderboards are nice and simple too! Create a leaderboard in your Flox control panel and it'll give you the id of that leaderboard, then post a score;

var leaderboardId = "my-leaderboard";
var score = 500;
var playerName = "Bob";
flox_leaderboard_post(leaderboardId,score,playerName);

Nice! Bob has a new score of 500!

 

Examples / Tutorials

 

I have made a couple of examples, in each you must swap the credentials used in flox_init for your own.

 

Documentation

 

For the complete API and documentation, check out the wiki page on BitBucket.

 

What's a Callback?

Spoiler

 

Roadmap

// v0.1.1 (20-04-2014) Initial release, Players, Logs
// v0.1.2 (22-04-2014) Fixed callback context, minor bug-fixes
// v0.2.0 (27-05-2014) Entities implemented, save anything to the server
// v0.2.1 (17-06-2014) Queries, why is this a point release?
// v0.2.2 (26-06-2014) With != Where + bug fixes
// v0.2.3 (19-07-2014) Remove the need for flox_list with some fancy tricks + bug fixes
// v0.3.0 (26-07-2014) Leaderboards & scores + major bug fixes
// v0.3.1 (25-08-2014) Date/time corrections + bug fixes
// v0.4.1 (07-03-2015) Completely re-architected for better stability
// v0.4.2 (29-03-2015) Login email / password
// v0.4.3 (20-05-2015) Bug Fixes
// v0.5.0 (03-07-2015) Secure persisted data + api clean-up + better mobile support
// v0.5.1 (29-09-2015) Bug fixes + firstRun and flox_query_ids_only
// v0.6 Add entity type descriptions + conflict handling
// v0.7 Optimisation (Reduce ds_* redundancies)
// ...
// v1.0.0 WINNING

Known Issues / Report a Bug

 

For a complete list of issues or to report an issue with the library, check out the current issues on Bitbucket. If you sign up to Bitbucket, you can watch issues to be notified about when they have been resolved (just click the little eye alongside the issue you wish to watch).

 

Currently there is only one major issue known, a GameMaker bug is preventing the Android platform from working as intended. You can find the bug report here. Make sure to be using GameMaker 1.4.1711, the Android networking bug has now been resolved.

 

Contributing

 

I have Git repo on Bitbucket here, If you want to contribute PM me and we'll work how best to manage things. If you would like to support the project but don't want to touch the code, please donate generously.

 

Happy Game Making, R.


Edited by Rani_sputnik, 19 February 2016 - 08:35 AM.

  • 4

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#2 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 27 May 2014 - 09:11 PM

Version 0.2.0 Released! Entities - Save anything to the server.

 

So many issues fixed! and finally my personal favourite feature of the Flox service is implemented, entities! At the most basic level, entities are just simple maps that you can save to the cloud and retrieve any time. The process of saving an entity couldn't be simpler.

var savegame = flox_entity_create("SaveGame"); // Create an entity
flox_entity_set(savegame,"progress",0.5); // Set a property on the entity
flox_entity_save_queued(savegame); // Save the entity to the server

Entities have a number of built in properties. Two noteworthy ones are id and type, this is what you can use to load them anytime.

var entityId = player.lastSaveId;
flox_entity_load_type("SaveGame",entityId,scrOnGameLoaded,scrOnGameFailedToLoad);

Loading is asynchronous and you need to callback for the result, the scrOnGameLoaded script may look as follows

// scrOnGameLoaded(savegame)
player.currentSave = argument0;
room_goto(rmGame);

There are more details on entities in the "Complete API" section and you can find more info in the Flox documentation here and here

 

Happy Game Making, R.


Edited by Rani_sputnik, 15 June 2014 - 10:24 AM.

  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#3 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 17 June 2014 - 03:47 AM

Version 0.2.1 Released! Queries - Why is this a point release?

 

Queries are here! Select groups of entities from the server using SQL syntax eg.

flox_query_begin("Tracks");
flox_query_where("team == ?","Team Extreme");
flox_query_find(scrOnTrackLoadComplete,scrOnTrackLoadError);

You can use the special IN keyword to compare properties to a list eg.

// Create a list of friends
var friends = ds_list_create();
ds_list_add("Ryan","Joe","Mandy","Bob");
// Select all matches where opponent == one of my friends
flox_query_begin("Matches");
flox_query_where("opponent IN ?",friends);
flox_query_find(scrOnMatchLoadComplete,scrOnMatchLoadError);

EDIT: Note flox_list is no longer required to use the IN syntax

 

There were also more bug-fixes and optimisations as always, next on the list is leaderboards and scores :D

 

EDIT: How did I not notice I was using with and not where? *sigh* new version coming soon :)


Edited by Rani_sputnik, 19 July 2014 - 05:01 AM.

  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#4 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 26 June 2014 - 10:51 AM

Version 0.2.2 Released - With != Where

 

This version the focus was on bug fixes, and man there were some beauties. I never noticed that flox_query_where was actually named flox_query_with, oh and it didn't work at all :/ But now that's all fixed along with a number of other issues and the new version even includes an example game and a tutorial for said game here.

 

Happy Game Making, R.


Edited by Rani_sputnik, 27 June 2014 - 01:28 AM.

  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#5 Debels

Debels

    GMC Member

  • GMC Member
  • 3029 posts
  • Version:GM:Studio

Posted 16 July 2014 - 11:47 PM

This looks interesting, in what platforms does it work on?


Edited by Debels, 16 July 2014 - 11:50 PM.

  • 0

"Give a man a fish, and you feed him for a day; show him how to catch fish, and you feed him for a lifetime."

(Chinese axiom)


#6 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 17 July 2014 - 12:19 AM

@Debels so far all C++ platforms (Windows, OSX, Android and iOS) Javascript platforms are coming in the next update. It's all GML so it's reasonable easy to support the two :)

 

Cheers, R.


Edited by Rani_sputnik, 17 July 2014 - 12:21 AM.

  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#7 AlienEaters

AlienEaters

    Met Programmer

  • GMC Member
  • 168 posts
  • Version:GM:Studio

Posted 17 July 2014 - 09:06 PM

Also I have an idea why js platforms don't work. In the latest EA version is says it now supports script_exists on js platforms (i never knew it didn't) so because of the callbacks it could not be working. Just an idea though.

Please excuse my typing as I am typing one handed.


  • 0
Elodin - "Where does the moon go when it leaves the sky?"

#8 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 17 July 2014 - 11:42 PM

Thanks AlienEaters,

 

yeah I was aware script_exists wasn't supported and was in the process of removing it from my code... :/ In fact a number of the ds_map scripts work differently on Js targets too.

 

The other issue is some weird issue where the with keyword is causing flox_init to be called over and over, who knows what's going on there. So once all of that's fixed it *should* be good to go. 

 

EDIT: In other news...

 

Version 0.2.3 Released - Goodbye flox_list and all the bugs!

EDIT: Not all the bugs unfortunately :(

 

Easily the most stable version yet, bug fixes galore, optimisations and the removal of flox_list thanks to some fancy magic.

There are a huge number of improvements, but most notably there are the following;

  • Test suite added to play with all core functionality
  • Callbacks are now executed across frames to ensure no performance bottlenecks and to allow failure testing
  • Easier to upgrade versions and debug issues

You'll notice a new section on upgrading + debugging in the OP, make sure to have a read, the hints will real help out if you run into issues.

 

Cheers, R.


Edited by Rani_sputnik, 25 July 2014 - 12:11 PM.

  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#9 Liftyd

Liftyd

    GMC Member

  • New Member
  • 19 posts
  • Version:GM:Studio

Posted 24 July 2014 - 05:10 AM

Exciting stuff, I will check it out this week.

 

Edit: just an fyi, stuff seems to break in 1.4 beta, though the error is seems silly.

 

Pop :: Execution Error - Variable index out of range argument
 at gml_Script_i_flox_create_url (line 7) -     if (argument[i] != flox_null) {...
 
Edit 2.0 I seem to get errors also in 1.3, they all seem to be Variable index out of range argument. With some code manipulation i can get it to run, but only if I set preventPersistentDataSave=true

Edited by Liftyd, 24 July 2014 - 01:46 PM.

  • 0

Icon.350032.png Castle Crooks available on Android


#10 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 25 July 2014 - 12:10 PM

Oooh, okay. I'll take a look.

 

What functions are you using specifically? Do you know? Or is this from running the example code?

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#11 Liftyd

Liftyd

    GMC Member

  • New Member
  • 19 posts
  • Version:GM:Studio

Posted 25 July 2014 - 12:28 PM

Yeah this is from just running the demo on windows (no YYC) in gamemaker 1.3,

 

There are several errors. With a wrong email i get:

FATAL ERROR in
action number 1
of  Step Event0
for object objFlox:

Push :: Execution Error - Variable Get -1.loadingIndicator(100150, -1)
 at gml_Script_scrLoginError (line 2) - with loadingIndicator instance_destroy();

Then if i make it past that screen (via on login success callback). I get this:


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of  Step Event0
for object objFlox:

Push :: Execution Error - Variable Get -1.matchesToDisplay(100158, -1)
 at gml_Script_scrMatchListComplete (line 4) - if ds_exists(matchesToDisplay,ds_type_list) {
############################################################################################

What version of Game Maker has your testing and dev been done with?


Edited by Liftyd, 25 July 2014 - 12:29 PM.

  • 0

Icon.350032.png Castle Crooks available on Android


#12 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 25 July 2014 - 10:59 PM

Version 0.3 Released! Leaderboards!!! ( + embarrassing fixes).

 

So last version I said was very stable, as it happens it wasn't. This version brings a number of fixes + LEADERBOARDS (yay)

With all of Flox's API now implemented, the focus will shift to stability, optimisation, fixes for JS targets and extension packaging (to make it easier to include the library in your project).

 

@Liftyd Thanks so much for reporting, I believe I have fixed all the issues you have mentioned in this version + others that you didn't get to hit. Let me know if you have any more trouble. I am running the v1.3.1347 w Windows Export, I just must never have tested the example game (I do most of my testing in the Tests room).

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#13 Liftyd

Liftyd

    GMC Member

  • New Member
  • 19 posts
  • Version:GM:Studio

Posted 26 July 2014 - 05:46 PM

Sweet it works, I'll start using it in my game later this week and let you know how it goes!

-M


  • 1

Icon.350032.png Castle Crooks available on Android


#14 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 25 August 2014 - 04:22 AM

Version 0.3.1 Released! Dates/times and a marketplace extension

 

Hi all! Another release has finally rolled around and this time it's a bunch of bug fixes and a marketplace extension. First off the bug-fixes.

  • With the release of datetime_set_timezone dates and times have been updated to work correctly
  • Added a 'secure' attribute to objFlox for communication over https (relies on a bug-fix in the next version of GameMaker)
  • Changed map debugging, there should no longer be weird debug properties showing up in your entities
  • Fixed flox_player_logout() issue that deleted a random ds_map

So a few good fixes in there. In this release I have also released a marketplace extension for anyone on the beta channel. Check it out! It's pretty slick (doesn't have the examples packaged, but I will fix that in the next version)


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#15 AlienEaters

AlienEaters

    Met Programmer

  • GMC Member
  • 168 posts
  • Version:GM:Studio

Posted 03 September 2014 - 05:10 AM

I think I found out why it doesn't work.

 

On HTML5 ds_list_mark_as_list/map and ds_map_add_list/map etc... don't exist.


  • 0
Elodin - "Where does the moon go when it leaves the sky?"

#16 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 03 September 2014 - 08:47 PM

Thanks Alien Eaters, you're totally right. There are a couple more issues to solve though too, particularly for HTML5. 

 

For one, the data is never saved between session because the game_end() event doesn't seem to trigger (Fair enough the browser can close at any time)

 

Another is that ds_map_destroy() works a bit differently on JS targets, and so memory isn't correctly freed yet.

 

Thanks for letting me know though, do you need Flox for JS to be sped up at all? Do you have a project you want to use it in?

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#17 AlienEaters

AlienEaters

    Met Programmer

  • GMC Member
  • 168 posts
  • Version:GM:Studio

Posted 06 September 2014 - 04:58 PM

Thanks Rani!

 

Also in your example there are several bugs that do less with the coding and more with assigning the ds_map index from the global.entity

 

After fixing those it runs great!  :)


  • 0
Elodin - "Where does the moon go when it leaves the sky?"

#18 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 07 September 2014 - 12:08 PM

Oooh in the Turn-Based example? I'll get on to fixing those in the next version! 

 

Thanks AlienEaters, let me know if you get stuck with anything.

 

R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#19 fredycc

fredycc

    GMC Member

  • New Member
  • 11 posts
  • Version:GM:Studio

Posted 08 September 2014 - 02:38 PM

Flox not know, but after seeing what you have just achieved, would be an ideal complement to HTML5 too. 
 
Thank you

 

I think I found out why it doesn't work.

 

On HTML5 ds_list_mark_as_list/map and ds_map_add_list/map etc... don't exist.


  • 0

#20 AlienEaters

AlienEaters

    Met Programmer

  • GMC Member
  • 168 posts
  • Version:GM:Studio

Posted 14 September 2014 - 04:19 PM

Thanks Alien Eaters, you're totally right. There are a couple more issues to solve though too, particularly for HTML5. 

 

For one, the data is never saved between session because the game_end() event doesn't seem to trigger (Fair enough the browser can close at any time)

 

Another is that ds_map_destroy() works a bit differently on JS targets, and so memory isn't correctly freed yet.

 

Thanks for letting me know though, do you need Flox for JS to be sped up at all? Do you have a project you want to use it in?

 

Cheers, R.

I missed the game_end () part of your comment.

 

Why not use onbeforeunload method to check?


  • 0
Elodin - "Where does the moon go when it leaves the sky?"

#21 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 18 September 2014 - 07:51 PM

 

Why not use onbeforeunload method to check?

 

That certainly would be an easier option, but one of the biggest problems with the system right now is there is no way to catch errors in GameMaker. If you get an error while running the game, Flox data will still be written to disk, so Flox data can be written in an invalid state. I *think* the best solution to this is to only write data when changes are made (rather than load on game start and save on game end) and this has the roll on benefit of also working in HTML5. 

 

That's just an idea at this stage though.

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#22 curato

curato

    GMC Member

  • GMC Member
  • 52 posts
  • Version:GM:Studio

Posted 02 October 2014 - 11:49 PM

I don't know if it is the market place package or me, but I tried to just play and put this in a project and it wants to load all the scripts in twice.  I was thinking about using working with flox to get away from being tied to the googleplay store for highscores etc.


  • 0

My first game:  Alphabet Acceleration: https://play.google....betAcceleration


#23 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 03 October 2014 - 11:11 PM

@curato that sounds like more of a marketplace bug. When exactly do you hit this issue? When you are importing the library? I think I need more info from you to completely understand the problem.
  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#24 curato

curato

    GMC Member

  • GMC Member
  • 52 posts
  • Version:GM:Studio

Posted 04 October 2014 - 01:15 PM

Yes, when I import the library.  It looks like it is ok if I look to check out what I am importing.  I hit import all.  It tells me a bunch of times that the script already exist and it is creating it as _new, and it does bring the same exact script in twice just once with and _new on the end.
 
 
Also, after I deleted all the "_new" scripts, I tried just a basic test compile with just an empty room for a base line ok everything works before I started playing with it and got the following error:

 

 

Spoiler

 

The non marketplace version compiles without error.


Edited by curato, 04 October 2014 - 02:20 PM.

  • 0

My first game:  Alphabet Acceleration: https://play.google....betAcceleration


#25 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 04 October 2014 - 07:45 PM

Okay, something must have been seriously mucked up when I uploaded the new versions of the library. I *presume* what happened was I didn't remove the existing scripts from the pack before I added new ones so I've ended up with duplicates?

 

I will correct as soon as possible, but I'm afraid I'm pretty tied up at the moment. I'd suggest just using the non-marketplace version for now. Apologies!

 

EDIT: I just updated the marketplace extension and the issue you described should now be fixed, let me know if that isn't the case, cheers!

 

R.


Edited by Rani_sputnik, 05 October 2014 - 01:46 AM.

  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#26 curato

curato

    GMC Member

  • GMC Member
  • 52 posts
  • Version:GM:Studio

Posted 05 October 2014 - 11:58 PM

So, after working with the leader boards for a while, I got them to pull and post properly:

 

to post a score is really easy

flox_leaderboard_post("leaderboardID", 1000, "CurrentPlayerName"); // leaderboardID is from the flox site and currentplayername is whatever the player name is

 

As I discovered it is a little more complicated to retrieve the scores if you aren't used to playing with function that have functions are parmeters etc or ds_maps and ds_list:

 

So what I did was add the flox object to a room and created a leaderboard_obj to control pulling the leader board and displaying it on the screen

 

leaderboard create event

Spoiler

the idea here is to have an arrary to store the scores in so I can dispose of the dynamic storage as soon as I have recovered the data, and to log into flox and grab the leader board data.  The trick here is you need an onComplete and onError functions.  the onComplete is passed all the leaderboard data so there is where I want to handle putting the data in the arrays and and disposing on the dynamic storage.

 

onComplete_Leaderboard

Spoiler

 

Once I got my brain wrapped around that it returned a list of maps it fell to together.  Basically, it just copy each item into the right spot in the array then dispose of the evidence at the end.

 

onError_Leaderboard

Spoiler

 

I went simple here.  I didn't bother reporting back to anything that the leader board failed to pull.  Just told the player about it.

 

From there it is all down hill.  Just to draw it to the screen totally flox free at this point.  Just the leaderboard_obj draw even

 

leaderboard_obj draw event

Spoiler

 

I am sure there is a more elegant way to do this but it does properly pull the all time leader board and display it on the screen when you enter a room with the flox and leaderboard_obj in it.  I will likely polish this some more but this has all the functional parts in it.  Comments are welcome.


  • 2

My first game:  Alphabet Acceleration: https://play.google....betAcceleration


#27 chrono280

chrono280

    GMC Member

  • GMC Member
  • 17 posts
  • Version:Unknown

Posted 15 January 2015 - 04:41 PM

Yes, when I import the library.  It looks like it is ok if I look to check out what I am importing.  I hit import all.  It tells me a bunch of times that the script already exist and it is creating it as _new, and it does bring the same exact script in twice just once with and _new on the end.
 
 
Also, after I deleted all the "_new" scripts, I tried just a basic test compile with just an empty room for a base line ok everything works before I started playing with it and got the following error:

 

 

Spoiler

 

The non marketplace version compiles without error.

Hey, I'm having the exact same error with the latest marketplace version 0.3.4 (GM v 1.4.1474). Any ideas?  Terrific extension otherwise.  Really GM needs more stuff like this for async game support. :-)


  • 0

#28 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 15 January 2015 - 08:06 PM

Hey Chrono, I sent you a PM but it's probably best to discuss this here in case it helps others.

 

Are you just testing an empty room too? What exactly are you running? That will help me narrow this issue down :)

 

Just FYI, there hasn't been a release in a while but it's because I've found a far more stable way to persist data and so it's going to be quite a big change. Looking forward to releasing that though, it should fix a bunch of these issues :)

 

R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#29 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 07 March 2015 - 12:16 AM

Version 0.4.1 Released - Rearchitecture

 

Something that has bothered me right from the start was how hard Flox would collapse if errors were encountered. NO MORE! I have completely rewritten the library with a new architecture that functions FAR better than previous versions. Previously every time the game ended, data would be persisted, regardless of what had happened in the session. If the game ended on an error this could mean persisted data would be written in an invalid state. Now data is persisted at the end of the step if required. This ensures that the system has time to catch any errors and shut flox down, BEFORE the nasty data is written.

 

This release is a breaking change. I changed a couple of semantic things that were bothering me (Figured better now than later down the track). The changes include;

  • flox_get_player renamed to flox_player_get
  • all constants are now prefixed with fx_ rather than flox_
  • flox_entity_save and flox_entity_refresh now make a copy of the entity they are saving.

Trust me though, it's worth upgrading, this new release is far better than anything to date and will only get better going forward. 

 

One last thing that changed is I'm now charging for the extension. The library will always remain free, and you can still download the library independent of the marketplace as before, but to help support the project, the extension is now available at a price. I hope you'll agree this is fair and just.

 

Happy game making!

 

R.


Edited by Rani_sputnik, 07 March 2015 - 12:18 AM.

  • 1

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#30 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 29 March 2015 - 04:33 AM

Version 0.4.2 Released! - Email + Password login!

 

Another exciting feature added to the flox arsenal, login with email and password! This completes the range of login options and allows for complete communities to be created and managed in GameMaker, so exciting! Your login options now include;

 

  • Login as a guest - Login is not required! You can also combine this option with any of the others to allow players to get straight into playing and sign up once they're committed. They wont lose their data either, it's a win-win.
  • Login with key - Perfect for logging in with a third party service such as Facebook / Google, just pass the players unique id for the platform, flox will make sure they have access to their data on any device.
  • Login with email only - A nice and light option. The first time a player logs in with their email they're granted access immediately. If they then login on another device, they are sent an email and asked to confirm, only then can they download their data onto the new device.
  • Login with email and password - A classic, everyone should know how this works by now :)

There is one know issue right now, the "loginOnly" parameter doesn't work, it always counts as false. This is caused by GameMaker not really having a concept of a boolean type, but I'm contacting the flox guys to see if they can fix this on their end.

 

Special thanks to Jeff on this one, he spurred on the progress of Flox by emailing me with some code he'd written for the new feature. If anyone else would like to contribute, flick me an email (ranisputnik at gmail dot com) and we can work out how best to match your talents to the project. Also if you use git, the repo is there to be forked :)

 

So there you have it! Hope you enjoy, happy game making!

 

R.


Edited by Rani_sputnik, 29 March 2015 - 05:05 AM.

  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#31 lillbubs

lillbubs

    GMC Member

  • GMC Member
  • 187 posts
  • Version:GM:Studio

Posted 18 April 2015 - 02:40 PM

works flawlessly! money well spent :) 


Edited by lillbubs, 19 April 2015 - 12:58 PM.

  • 0

#32 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 19 April 2015 - 09:15 PM

Hey thanks Lillbubs, good to hear you like it! 

 

I saw in my email you were asking a few pretty good questions, so I thought I'd share some answers in case you were still interested.

 

 

On flox homepage it says that its easily integrated with ios/gamecenter by logging in the player to gamecenter and then binding that user to flox. is this something that is possible with this extension or planned for the future? 

if yes then take my money!  :lol:

 

also how does connecting friends work? for example how would one show a highscore list with gamecenter friends. 

 

Both of these are totally doable with the library as it is today. I must admit I'm not very familiar with gamecenter, however I believe the process is very similar to connecting with Facebook.

 

As you say, you must first log the player into gamecenter. Once that's done you should be able to access a players gamecenter "identifier string", you can pass this string to flox_player_login_key to "bind that user to flox". For example, if you call achievement_login() at the start of the game, then you can add the following to you're social async event;

var ident = ds_map_find_value(async_load, "id");
if ident == achievement_our_info
{
    var gamecenterid= ds_map_find_value(async_load, "playerid" );
    flox_player_login_key(gamecenterid, scrOnLoginComplete, scrOnLoginError);
}

Because the key is tied to the gamecenter account, if the player logs in on another device with the same gamecenter id, they will get the same Flox player handed back to them... Cool huh!?

 

Now friends is a little trickier, after you've logged in (perhaps in the scrOnLoginComplete script) you'll want to save you're id to the player like so.

var player = flox_player_get();
flox_entity_set(player,"gamecenterid",gamecenterid);
flox_entity_save_queued(player);

What you will then do is build a list of friends ids using the achievement_load_friends() function. In the social async event, use the following;

var ident = ds_map_find_value(async_load, "id");
if ident == achievement_friends_info
{
   var friendids = ds_list_create();
   var numfriends = ds_map_find_value(async_load, "numfriends");
   for(var i=0; i < numfriends; i++;)
   {
       var friendid = ds_map_find_value(async_load, "Friendid"+string(i));
       ds_list_add(friendids,friendid);
   }

   // TODO do something with friendids
}

Once you have the friends Game Center id's, you can query them like so;

flox_query_begin(".player");
flox_query_where("gamecenterid IN ?",friendids);
flox_query_find(scrOnFriendsFound, scrOnFriendsError);

You can see we are using the gamecenterid property in the query, it reads as "where gamecenterid is IN list of friendids". This will load every flox player who has a gamecenterid that is part of that friendids list we created earlier. In scrOnFriendsFound you'll be handed a massive list of all these players where you can do whatever you want with them. 

 

One last thing you'll need to do to make this work! Queries only work with indexed properties, to set this up go to your Flox dashboard and select indices on the left hand side. Click the 'Add Index' button and select the following options;

 

Entity Type: "Player"

Property 1: "gamecenterid"

Property 2: // leave this blank

 

So that happened! Crash course in social connect with Flox. Hope you find that useful!

 

Cheers, R.


Edited by Rani_sputnik, 21 April 2015 - 08:21 PM.

  • 1

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#33 xaveri

xaveri

    GMC Member

  • GMC Member
  • 63 posts
  • Version:GM:Studio

Posted 24 April 2015 - 03:15 AM

@Rani_sputnik

 

Thanks for your hard work. This works great on PC, but have you tried to use it on Android or Windows Phones?

 

In Android it gives a connection error and nothing goes to Flox or comes from Flox. On a Windows phone it straight up crashes the game when I try to load the leader board.

 

Again, on PC it works great, and you can see the interactions over at the Flox website, but everything that is not PC, just does not work.


  • 0

#34 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 24 April 2015 - 06:11 AM

Hi xaveri,

 

Yeah I'm getting a few reports about this, I've opened an issue here. I was hoping to address this soon, if you go to that issue and click on the eye then you'll get emailed once I update the issue. Thanks for letting me know!

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#35 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 20 May 2015 - 05:09 AM

Version 0.4.3 Released! Such Bug Fix!

 

No new features this time around just a whole tonne of bugs squashed! Here are the issues that have been resolved;

The biggest improvement is now iOS is working all flawlessly. Android is a different story, it appears there are a number of GameMaker bugs with http_request for Android that I need to track down but once they're resolved I'll get another release done. Please report any issues you find here. Happy Game Making!

 

Cheers, R.


  • 1

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#36 namlunthkl

namlunthkl

    GMC Member

  • GMC Member
  • 24 posts
  • Version:GM:Studio

Posted 03 July 2015 - 06:48 AM

Flox error: Server Unreachable... How can I fix it?? :(


Flox error:
Flox Server Unreachable
****************************

:( How can I fix it???


  • 0

GML Code Challenge:  -----> HERE <-----
My Blog, Tutorial, Example, Resources, Game Assets: -----> HERE <-----

banner.png


#37 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 04 July 2015 - 08:40 AM

Hey namlunthkl,

 

I need a bit more information I'm afraid as that error can be caused by a number of things. The most common is if the device is offline, in which case this is the intended behaviour :)

 

What platform are you using? Was there anything in the console before this message? What Flox function were you using? Any information you provide will help me help you.

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#38 IngeniousBastar

IngeniousBastar

    GMC Member

  • New Member
  • 3 posts
  • Version:GM:Studio

Posted 05 July 2015 - 02:55 PM

Hello,

 

Same here.

As soon as i tried to run the demo i get in the logs: 'Flox: Failed to save persistent data'

 

And if i try to login by clicking in the button, i get a 'flox server unreachable'

I've been running those tests on PC platform.


Edited by IngeniousBastar, 05 July 2015 - 02:56 PM.

  • 0

#39 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 08 July 2015 - 07:09 AM

To run the any of the demos you will need to add your Flox credentials to the flox_init function. Have you done this? Which demo did you mean? 


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#40 IngeniousBastar

IngeniousBastar

    GMC Member

  • New Member
  • 3 posts
  • Version:GM:Studio

Posted 08 July 2015 - 01:10 PM

Yes, i have done that.

I got my Key and ID from Flox administration panel and updated the Flox_ini function.

 

For the demo, i was talking about the Async Multiplayer V0.5 that i downloaded directly on BitBucket. 

When i tried to run it after updating the credentials, i directly got the 'flox server unreachable message' after trying to Log In.

 

I also did try to see if my firewall wasn't blocking GM, but this doesn't seem to be the case :/ 

Funny thing is that i have data showing up on the Flox Analytics, but impossible to log in for the matchmaking.

 

------------

For information, i do have the same problem in earlier version too (0.4.3). 

I'm going to try tomorrow on another laptop, with other network settings, i'll let you know.

 

Meanwhile here's the output of the console once i set up the logs level to fx_log_silly

 

Flox: Data { "authentication": { "id": "tiy4bWUBCHyY0h5s", "authType": "guest" }, "installationID": "rL7CXw0qHwnIXjRl", "session": { "numErrors": 0.000000, "log": [ { "time": "2015-07-15T22:06:29Z", "type": "info", "message": "Game Started" }, { "time": "2015-07-15T22:06:30Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" }, { "time": "2015-07-15T22:06:44Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" } ], "firstStartTime": 42197.915689, "startTime": 42200.921175, "duration": 14.033333 }, "currentPlayer": { "updatedAt": 42197.915689, "publicAccess": "r", "ownerId": "tiy4bWUBCHyY0h5s", "createdAt": 42197.915689, "id": "tiy4bWUBCHyY0h5s", "type": ".player", "authType": "guest" }, "serviceQueue": [ { "path": "logs", "method": "POST", "authentication": { "id": "tiy4bWUBCHyY0h5s", "authType": "guest" }, "data": { "deviceInfo": { "resolution": "1366x768", "os": "Windows" }, "languageCode": "en", "installationId": "rL7CXw0qHwnIXjRl", "startTime": "2015-07-12T21:58:35Z", "gameVersion": "0.1" } }, { "path": "logs", "method": "POST", "authentication": { "id": "tiy4bWUBCHyY0h5s", "authType": "guest" }, "data": { "lastLog": [ { "time": "2015-07-12T21:58:35Z", "type": "info", "message": "Game Started" }, { "time": "2015-07-12T21:58:36Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" }, { "time": "2015-07-12T21:58:41Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" }, { "time": "2015-07-12T21:58:46Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" } ], "lastDuration": 10.866667, "deviceInfo": { "resolution": "1366x768", "os": "Windows" }, "languageCode": "en", "installationId": "rL7CXw0qHwnIXjRl", "firstStartTime": "2015-07-12T21:58:35Z", "lastStartTime": "2015-07-12T21:58:35Z", "startTime": "2015-07-12T22:04:02Z", "gameVersion": "0.1" } }, { "path": "logs", "method": "POST", "authentication": { "id": "tiy4bWUBCHyY0h5s", "authType": "guest" }, "data": { "lastLog": [ { "time": "2015-07-12T22:04:02Z", "type": "info", "message": "Game Started" }, { "time": "2015-07-12T22:04:02Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" }, { "time": "2015-07-12T22:04:05Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" }, { "time": "2015-07-12T22:04:09Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" } ], "lastDuration": 7.466667, "deviceInfo": { "resolution": "1366x768", "os": "Windows" }, "languageCode": "en", "installationId": "rL7CXw0qHwnIXjRl", "firstStartTime": "2015-07-12T21:58:35Z", "lastStartTime": "2015-07-12T22:04:02Z", "startTime": "2015-07-14T15:45:17Z", "gameVersion": "0.1" } }, { "path": "logs", "method": "POST", "authentication": { "id": "tiy4bWUBCHyY0h5s", "authType": "guest" }, "data": { "lastLog": [ { "time": "2015-07-14T15:45:17Z", "type": "info", "message": "Game Started" }, { "time": "2015-07-14T15:45:18Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" }, { "time": "2015-07-14T15:45:22Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" }, { "time": "2015-07-14T15:45:25Z", "type": "info", "message": "Flox server not reachable (device probably offline). HttpStatus: 0" } ], "lastDuration": 7.366667, "deviceInfo": { "resolution": "1366x768", "os": "Windows" }, "languageCode": "en", "installationId": "rL7CXw0qHwnIXjRl", "firstStartTime": "2015-07-12T21:58:35Z", "lastStartTime": "2015-07-14T15:45:17Z", "startTime": "2015-07-15T22:06:29Z", "gameVersion": "0.1" } } ], "serviceCache": { } } 

 

 

Thanks a lot for your help,


Edited by IngeniousBastar, 15 July 2015 - 10:22 PM.

  • 0

#41 bate7a1

bate7a1

    GMC Member

  • New Member
  • 13 posts
  • Version:GM:Studio

Posted 11 July 2015 - 11:07 AM

Use for Android
Error: FLOX server unreachable
It has no such support android
but on PC it works very well

Edited by bate7a1, 11 July 2015 - 11:10 AM.

  • 0

#42 echa

echa

    GMC Member

  • New Member
  • 8 posts
  • Version:GM:Studio

Posted 14 July 2015 - 10:41 PM

Same error :( I've tested it on PC.

Screenshot: https://www.dropbox.....33.55.png?dl=0


Edited by echa, 14 July 2015 - 10:41 PM.

  • 0

#43 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 15 July 2015 - 08:54 PM

Hmm there seems to be quite a bit of hit or miss here. Those who have posted they're getting "Flox server unreachable" - that can be caused by a number of different problems. Could you please do two things for me;

  • In your objFlox object change the log_level variable to fx_log_silly
  • Edit your post (or post again) with the output in the console.

I am not getting the same issues, so I'll need more information before I can fix the problem. 

 

In the meantime, the older versions of the library are still available in the Bitbucket downloads section. These issues may have been introduced with version 0.5, so try there and see if you have any more luck.

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#44 bate7a1

bate7a1

    GMC Member

  • New Member
  • 13 posts
  • Version:GM:Studio

Posted 16 July 2015 - 01:51 AM

Image Android testksiF4rp.png


  • 0

#45 bate7a1

bate7a1

    GMC Member

  • New Member
  • 13 posts
  • Version:GM:Studio

Posted 27 July 2015 - 01:51 AM

Help me

Use for Android
Error: FLOX server unreachable
image in post

Edited by bate7a1, 27 July 2015 - 01:51 AM.

  • 0

#46 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 28 July 2015 - 06:26 AM

Hi @bate7a1

 

Unfortunately there is a problem with some Android phones (and laptops) at the moment. I don't have a device to test on right now, but hopefully I'll be able to take a stab at fixing this tomorrow.

 

Sorry for the delay.

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#47 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 29 July 2015 - 09:45 PM

Hi all!

 

I have found an issue with making network requests on Android, I have created a bug report here.

 

Once that issue is resolved, Flox should be completely supported on the Android export.

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#48 mnuriev

mnuriev

    GMC Member

  • New Member
  • 8 posts
  • Version:GM:Studio

Posted 04 August 2015 - 08:17 PM

Hi,

i have added all files from leaderboard-0-5-0.gmx to my project

The room is first.

But when i run it - i get error

You have created more than one objFlox instance, you do not need to include this object in your rooms, it will be instantiated for you

 at gml_Script_flox_die (line 12) -     show_error(message,false);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_flox_die (line 12)
called from - gml_Script_i_flox_assert (line 11) -     flox_die(message);
called from - gml_Object_objFlox_CreateEvent_14 (line 4) - i_flox_assert(instance_number(objFlox == 1),"You have created more than one objFlox instance, you do not need to include this object in your rooms, it will be instantiated for you");
 
1)if i click Ignore in Error Window- then it continues executing
2)if i run my project in debugger with breakpoint in objFlox CreateEvent then first time - it stops, second...i can't understand what is the call stack
3)i run my project in debugger with breakpoint in objFlox CreateEvent
Then i want to go step-by-step with original  leaderboard-0-5-0.gmx 
So then i run in debugger original project  leaderboard-0-5-0.gmx  with the same breakpoint.
And now i immediately have error in original project.
 
What else should I check/try?
Thank you in advance.

  • 0

#49 Rani_sputnik

Rani_sputnik

    GMC Member

  • GMC Member
  • 482 posts
  • Version:GM:Studio

Posted 05 August 2015 - 11:40 PM

Hi Mnureiv,

 

I wonder if this is another bug with GameMaker? Here's what you can do in the meantime;

 

Go into objFlox, open up the script titled "Internal Setup" then on line 4, replace the == with a <=

// Make sure there isn't more than one flox instance
i_flox_assert(instance_number(objFlox <= 1),"You have created more than one objFlox instance, you do not need to include this object in your rooms, it will be instantiated for you");

If you find this fixes things then yay! We found a bug with GameMaker (instance_number returns wrong values in the create event of an object).

 

If it doesn't fix anything then you should just comment out that line. I don't think it will break anything, simply reduce performance. If you could let me know which of these ends up working that'd be great! Then I can work on a fix.

 

Cheers, R.


  • 0

My games - In DecemberBoy Goes to Space

Utilities & Extensions - FloxGM, Destroyable Terrain

Check out my website: ryanloader.me, or follow me: twitter.com/RaniSputnik


#50 mnuriev

mnuriev

    GMC Member

  • New Member
  • 8 posts
  • Version:GM:Studio

Posted 03 September 2015 - 07:58 PM

thank you Rani, the second solution helped me


  • 0