Hello, I recently made ('thanks' to the lockdown) my comeback to Gideros after many monthes without coding.
I'm really happy to see that the community is still active. I hope everyone is safe and take care.
So, let's go back to my subject. When I installed latest Gideros, I discovered the export option to facebook instant games. Tried it and was really surprised to see that my games works well in the html5 context. The export was really fast, the result quite convincing so I said to myself "Let's have a try and publish a game to facebook !"... The rest of the story is made of headaches, sweat and tears.
So I decided to take a little time to share my state of the art, hoping that it will help others and, may be, gaining some answers or tips.
Here we are ! I am quite familiar with the insane facebook UI when you consider doing a pro activity with it. Multiple authentifications, thousands of parameters with names that sucks, accounts to verify every 2 clicks and roles to dispatch... a long long journey for a solo user in search of simple answer to his only one question : is it possible to manage alone a game activity on facebook ?
So, in unsorted manner, here are the points I'm stucked in today:
- some validation process at facebook are 'handmade'. As they are in lockdown state,
- I need an active Apple dev account to publish my game on facebook... It cost 99$/year, require a recent Mac or Iphone, etc... an ethic/cash obstacle that I am working on. If someone have experimented an alternative way...
- I didn't found any gideros tutorial on how to use facebook Instant game API calls. Does the calls have to be made in JS outside of Gideros ? I'm not a dev and any sort of starting point to put me on the right way will be welcome. I have to admit that a simple example on "how to display the Player's profile picture in a gideros app" or "How to manage multiple langage" could be awesome.
- my first test app on facebook is stuck on the loading screen. I found in
another thread on the forum (and in a lot of other forum on the www) that I'm not alone with that problem. I'm not worrying about it. In the background, behind the loading screen, my game seems functional.
- In the Gideros documentation, I found some explanations on installing a Gideros player on FB to help in the test process. I was naively thinking that I could export my game, upload it and tadaaam. I now understood that the facebook API will require a more optimised configuration.
see u in the next episode !
Comments
Do this at the end of your main.lua - before the game event system really starts, it will remove the loading indicator - the bit you are stuck at:
Likes: hgy29, jimlev
https://deluxepixel.com
Likes: jimlev
https://deluxepixel.com
Likes: jimlev
https://deluxepixel.com
I'm not sure to understand everything in all your answers. But, here is where I am now, after testing, reading and adding some of your tips to my recipe...
On facebook, I created a new app called 'Player' and uploaded a zip version of the html5 player which came with the latest install of gideros.
Note that, at the upload,a facebook alert (see below) asks to add a config file in the zip. So I added one with the simplest content.
"You must include a bundle config in your upload. To create a bundle config, please refer to: https://developers.facebook.com/docs/games/instant-games/sdk/bundle-config".
I switched it in 'test mode' and achieved to access it from the Gideros Studio but with the need of lots of refresh of the browser tab and restarts of the Studio*. The 'Player' app was, at that time, a classic facebook app. I switched it to the 'Instant Games' type. Then, it stay stucked on the loading screen. The studio detects it, the start button is available but it does nothing probably because the app doesn't achieved her total loading state.
Could someone answer me about the WebGL option in facebook. Does it needs to be activated for the gideros html5 apps ?
Now, I will try to understand your code example and test them in a simple context before integrating them in my first game. I will be back with answers, I hope, to share with the community (despite I'm not sure that some many people could be interested in FB instant games implementation, lol).
*I have observed that the Brave browser seems a bit reluctant to loading gideros content... @sinisterSoft, for example, I didn't achieve to play your zombie game on deluxepixel. It works very nicely on Edge but, on Brave (shields down, of course), I saw a brief part of the loading and then, everything is white in the smartphone screen.
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
You then use the instant games tab in your app to set the instant games settings and also upload the zip or 7z to the hosting system and then set it as the test version of your game. (In facebook instants you can pick two files, one release, one test)
https://deluxepixel.com
(it worked fine with an older version of Brave)
https://deluxepixel.com
So, may I ask 2 questions about it :
- what are you keeping in the "pirate" var ?
- my first version of my game stored all the datas in a local file (with table.save, etc.). The datas were made of a table containing tables. Do you recommand to 'explode' that structure to make a simple pair association like bestscore:{100}, besttime:{12},etc... ?
Concerning the webGL toggle in the settings of the instantGames, I saw no differences when it's on or off... so strange. The investigation continue.
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
On Android the load settings is synchronous, on facebook instants it starts off the asynchronous load.
I usually load in the data, then convert it to a table of values that may already have default data in them.
Likes: jimlev
https://deluxepixel.com
It seems that you manage a lot of things I have to think about (eg. the "privacyOk" param)
Even if it's a bit laborous, I make some progress. The leaderboard is 'on the road', but I still have to manage the graphical part (so sad that facebook do not provide a standard UI look like for the addShorcut function). I will post some screenshot if it interest someone !
Likes: SinisterSoft
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
https://deluxepixel.com
On my game, the trouble comes in 2 ways :
1-the game, in html5, seems a little bit laggy but nothing really alarming.
2-the 'Start game' button is a lot more worrying. When played on the studio player, everything is smooth. On Instantgames fb, when I click the button, it takes 4-5 seconds before the game's scene appears.
I will look forward this problem later... I have suspicions : to many png to display at a time, to many var to initiate, etc. another adventure for later
Likes: SinisterSoft
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
https://deluxepixel.com
https://deluxepixel.com
About the optimize's subject, I have 2 newbies questions
1. I use many textfields. So, I have many fonctions to create these textfields and, in these functions, a lot of "local myFont = TTFont.new blabla bla"... Is it a better practice to declare my fonts in Globals at the start of the game ? or using a 'lot' of Locals in each of my fonctions ?
2. In my game, I use a class for creating animated rolling dice. The class starts with table declarations like etc. I, later, use these images to make a movieclip of my dice. If I want to pre-load these image, do I have to make Globals of these tables in, for example, main.lua ? Do I need to use an 'addChild' on these to make the preload effective?
As you can see, I'm always afraid of using Globals... I agree that, for some kinds of game, it's a very good idea to do so. A very good taste of melancolic memories of a not-so-old-but-far-period
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
https://deluxepixel.com
I will meditate that. I have to admit that it is unbelievable for me... I will probably ask for details if you accept
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
The only events that I add/remove are for the SceneManager. That simply goes 'on top' of the game. I use a state machine to decide if the game display is running or not and what state of play it's in.
It's as close as I can get it to how everything used to work in the old days:
(When possible) I used to code the game to run on the vsync interrupt, with the stack being reset at the beginning of each game loop - using a state machine to keep track of everything. It's a trick Nintendo used to keep everything to the 60hz frame sync. Anything that doesn't really matter is done last - and skipped if the game goes over a frame every so often.
In Gideros I have different things going on on different frame numbers - keeping sprite movements, etc and other things the user will notice at every frame.
https://deluxepixel.com
https://deluxepixel.com
https://deluxepixel.com
Likes: SinisterSoft
I'll be back with some screenshot soon.
Likes: SinisterSoft, MoKaLux
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
I have access (and achieve to display) the player profile pic but, when I get leaderboard data, I can't find a way to the pic url... Anyone succeeded at this task ?
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
Likes: SinisterSoft
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
https://deluxepixel.com
https://deluxepixel.com
On this facebook journey, traps opens just in front of my feet, day after day...And as I have no Apple dev account (and doesn't plan to take one), I already know that all of this will be of no-use... lol
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”
🤔
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game