Firebase


havana24

  • *
  • Posts: 508
Thanks!

I need an https hosting in order to test, the only one seems to be dropbox but I'm not able to see the html file...
I've uploaded the js folder with the Game.swf, Game.html  and javascriptHX.js but when I click on the Game.html I se only a white page...
I've put inside a <h1>test</h1> and I've noticed that I see the TEST text, but not the swf.
The strange thing is that if I test in local I see the swf.

This is my first time using dropbox, maybe it isn't something like a FTP manager so... what I need to do?

Thanks in advance
Alessandro
My Website: www.havana24.net


havana24

  • *
  • Posts: 508
Ok I will try, but seems it works on my hosting!

BTW first bug, if I try to use the POST to INT_01 passing the block "x of actor" stencyl show:

SceneBehavior: Float should be Int
   from scripts.Design_6_6_SceneBehavior
   line: 161
   columns: 18-24
SceneBehavior: For function argument '_param0'
   from scripts.Design_6_6_SceneBehavior
   line: 161
   columns: 18-24

Even if I put the x of actor inside the "as number" block.
If I post a number directly into the post to INT_01 block it works.
My Website: www.havana24.net

gurigraphics

  • Posts: 690
I did not fix this because I was walking in circles in xml blocks.^ ^

After try change int to float to fix

havana24

  • *
  • Posts: 508
OK i'll wait the fix! :)

BTW I've tried the str post, it works!
I've a question about it, what is the best way to update a character x and y?
Because if I put the POST TO STRING block in a drawing event the games starts to slow down a lot, like 1 fps a second till the actor stops.
My Website: www.havana24.net

gurigraphics

  • Posts: 690
You have to create a movement behavior.

If Left Press -> update speed +1 -> Animation run left
If Left Released -> Left Stop -> speed 0 -> Animation stop left -> slide player to player position x/y (to fix position).
If Right Press  -> update speed +1 ...

But, much more easier is to create point click move.


gurigraphics

  • Posts: 690
Update Version 2.0.1 - Bug fix: Int to Float Number.

havana24

  • *
  • Posts: 508
Thanks!

I've noticed that every time I post something to firebase the game stops for a millisecond, like a little freeze and then goes on...
You noticed that?
My Website: www.havana24.net

gurigraphics

  • Posts: 690
The demo project is so? Here it worked well.
You can not put the blocks in Updating. They update by themselves.
And do not forget to put javascriptHX in footer body, no in the header.
Use inspect element in google chrome and see if there errors.

See this example:
https://youtu.be/3SI6WcXkS3w
http://www.codeproject.com/Articles/1024774/Firebase-Web-Apps-Will-Change-Your-Thinking-WebSoc



« Last Edit: November 06, 2015, 02:34:45 pm by gurigraphics »

havana24

  • *
  • Posts: 508
Thanks for your reply! :)

I've used your template html page, so all is correct.
I use post to str every one second to send coordinates of an actor.
If this actor is moving you will notice this micro freezes every second.
if you put for example 4 post to str every seconds (to send x, y, xspeed and yspeed) freezes are more strong (I'll try soon with only a post to str block and a JSON string).
My Website: www.havana24.net

gurigraphics

  • Posts: 690
Quote
I use post to str every one second to send coordinates of an actor.
Str or Int?
You are sending number as text?

Should be problem of implementation.
Freezing occurs when the frame rate is exceeded.

It must consider that real-time is another logic that is not implemented by Stencyl. You need to do this. If you send data must be sure you are sending only once time per second.(maximum 60 ps.)

For this you need a "keylock". Example:

var keylock = "true"
if (keylock==true){
-> set keylockto false
-> sends the data
}
after 1seg -> set lock ="true".

This ensures that it is sent only 1 time. Because it closed the door and the crowd missed out.

Another thing is that speedy is irrelevant for the second player.
For the second player only matter the position on the screen of player 01.
Only the final result of the calculation, not all of the puzzle pieces.

Or else, only the word "left" to the player move to the left.
Only the trigger of the calculation or logical already programmed.

Between the first and second option, we have less than 60 actions per second available, and 200ms of delay.

« Last Edit: November 07, 2015, 05:02:50 am by gurigraphics »


havana24

  • *
  • Posts: 508
Quote
I use post to str every one second to send coordinates of an actor.
Str or Int?
You are sending number as text?

Should be problem of implementation.
Freezing occurs when the frame rate is exceeded.

STR.

Now I've tried the "post to int" and it seems to work better than str. I will make some test later!

WIth your updated version now I have two extension in my extension panel how to delete the older?
Also maybe you should write the version of the extension in the title of the extension?

Anyway you are speaking about a puzzle game, but if I want to rely on the physics of Stencyl I need x, y, x-speed and y-speed and let stencyl do the rest with is physics engine through clients connected.
I'm using the "Do every 1 seconds" event do send data so it send the right data only one time per second.

I've noticed that in your youtube test the ball doesn't move, so you can't test micro-freeze... Just move the ball and send data of x,y,x-speed,y-speed through 4 "post to int" block in order to see if it make freezes.

I've also asked about JSON parse, and this is the answer: JSON parse via Stencyl.
The problem is that I don't know how to change in-game attributes with data decoded or just how to get data from a structure decoded via this function...

BTW great work so far! :)
My Website: www.havana24.net