CodingDoug/firebase-tic-tac-toe

Laggy?

Jonovono opened this issue · 4 comments

I have noticed that sometimes there is a fair amount of lag from the time you press the button and the time the circle/x show up on the screen - especially if I send a lot of events to firebase with move commands that may not be valid :p .

Is that expected? I am guessing sometimes the functions take a bit of time to run after the path has been written to? I am also on the free trial, would that be it?

Damn, I was just about to start using firebase.
But typically the client should disable interaction when it is not your turn, like you cant click it in the first place. Assuming you behaved (only valid commands) :P is it still laggy?

@msqaddura we have been able to make optimizations to make it pretty smooth! We are using it in production in this app if you wanna see what's possible :p https://itunes.apple.com/us/app/bunch-group-video-chat-games/id1294869021?mt=8

Pretty Awesome! I dont use iphone but it hella looks pretty awesome!! I recommended it for my friends.
So you went for same services as this tutorial? RealTimeDB & Cloud Functions?

hah thanks! It's written in react native so hopefully android coming soon :p

Ya, we followed that pretty closely. Built onto it a bit but works pretty much the same -> clients write commands to a path, which trigger a cloud function that does something. Client may update asap so it doesn't have to wait until function finishes.

Feel free to reach out for any questions! We built a friend system, presence system, and some real time games using this architecture with some modifications and have been pretty happy with it!