possible application servers for a chess game (android+web) - android

I'm making a chess game,playable from both, an android device as well as a web browser.I will take input from user in a UI, & processing of that input-updating gamestate should happen at backend/application server.The response from server goes back to UI which displays the new gamestate.
Now my question is, what are possible options for application server I can explore to actually do this ?I'm not asking which is best or likewise....I just want to know what application servers are there which I can use to make my game.
I've made a similar application in netbeans using glassfish,but this time, I want an android device to be able to communicate with server too, so I'm confused how to approach this.
I've already tried google play services,but additional data about player,his statistics,etc needs to be stored client side,which I dont want.
Please suggest some alternatives.

Related

Push data from database to flask web app and Android device

How can I show real time database changes in a flask website?
Like on_update and on_insert, the data will be pushed to the website for the user to see.
I want to get alert from an IOT device and insert it to the database and the users who are subbed to that device should get the real-time alerts.
So I thought
>IOT detects
>HTTP POST to database
>Flask App detects the database change
>push to clients on web app and android
I made a web app that queries the DB with flask-sqlalchemy but thats it, these are supposed to be real-time alerts! I'm so frustrated it's been a week. I am going nowhere and I feel so lost now.
>polling
>web sockets
>SSE
>flask sse
>use AJAX
>use JQUERY
HHHOOOOOWWWWW?????? Most of the examples are for chat apps, and I see NO method where you listen to database changes and send it to clients ;(
A very easy way to implement this is using an event SaaS like pusher.com. This should get you set up in no time. They have examples for many different languages and it should fit your need perfectly.
You mention that you see so many chat-apps as examples. This is pretty normal as they are almost the "hello-world" of event-based systems. And that's exactly what you are looking for. An event happens and you want to trigger something on that event.
For chats, the event is: "The user entered a message" and the triggered action is: "Display it to every connected/subscribed user".
Next to a hosted service like pusher.com, you can roll your own. All the required technology are free and open standards. You could use websockets or WebRTC for this. Websockets is easier but it's trickier if you have many open channels. On the other hand, WebRTC scales but it's a bit more complicated to set up. But you won't need video or audio which makes it easier.
You mention "polling" and I am not sure whether you mean "normal" polling or long-polling as in Comet. That is of course an option. It is the easiest solution, but not the cleanest.
SSE seems like a valid option as well. Although I have no personal experience with it yet. But it seems like it's designed for this use-case.
AJAX and jQuery are less related. AJAX is just an umbrella term for programming using XmlHTTPRequest and is used in all solutions mentioned above. jQuery is just a JS framework and is completely unrelated to the task.
long story short: All your mentioned options allow you to do this. I would suggest looking at pusher.com to get started. And their examples have exactly what you need. Their free plan is already really generous for personal projects. If your application outgrows the free plan you can either pay, or roll your own solution.

How to send text message to Azure Bot?

Totally new to Azure and the services it offers, I face many questions about the "Speech" service and the bots that can be created on the Microsoft platform. Currently developing an Android mobile application I'd like to realize the following behavior:
The user records a voice file from the app (using MediaRecorder), this part is ok
Once the recording is finished, this file is sent to Azure function(via an HTTP POST).
The file is translated into Text
The text is sent (step 7) to the bot which reacts accordingly by executing an HTTP request.
Scheme of the process I explained
First of all I wanted to know if this scenario is possible or if I have to use the Speech SDK on my Android application.
Moreover if this scenario is possible, how do I send the text to the chatbot? I've checked this link but it doesn't seem very relevant to me.
NB: My bot has been completely created using "Bot Framework Composer" for the moment, no code has been written, I just wanted to know if my scenario is plausible and above all possible.
Go through your steps, and I think it can be implemented. If you want to send text to bot, you can refer to this request.
Before that, you may need to start a conversation and get the conversationId.

Creating a Appwarp chatroom and issues in a Android game

I was creating an android app (actually a game) with customised Cocos2d and I was planning to add in a chat feature. kind of like a counter-strike where other players can send short IM to each other (I think the clash of clan's clan chat comes closest to what i want to make, you can get an idea from that)
I was trying to use AppWarp API to do this, but am finding it hard to do so. I liked appwarp because it handles server management on its own. I don't wanna get into implementing a XMPP/Smack customised code where scalability becomes an issue later on, because i dont know server management at all! (although i would love the freedom it gives me). Did i mention that its a two man team? Me and a friend :).
In my game in I need one global room (a static room) and an another special-group room (this will be dynamic, since its only created if the user selects to create the room).
But the problem with creating a dynamic group room in Appwarp is that it doesnt stay alive (remain persistent) after all the users in it have disconnected. According to the current implementation in the API, the dynamic group gets deleted if the last member logs out.
Q1) Is there a way for me to create a persistent/static room from client side? Q2) and if that isnt possible is there some way i can make the dynamic rooms persistent? Basically i'm asking anyone who has experience with Appwarp, If it requires some tweaking with the code can you please point me out in the right direction?, or is it not possible at all?
Q3) Also, i wanted to implement a chat history feature on the chat rooms. Is that already available via Appwarp API? or would I have to write a listener, so that each time a room receives a message it maintains a history file? Again this is only possible if the user can re-connect to the room.. Please guide me for this too.
Also,supposing i have to drop Appwarp idea (Gulp!) Q4) Can you please point me in the right direction to create a group-based chat with a similar api that can be integrated with an android app with cocos2D.
Currently creating static rooms through the API is not possible. However providing such flexibility is part of AppWarp's plan.
AppWarp doesn't maintain chat history on the server side currently. This is again something we are looking in to as it has been requested by other developers as well. Keep an eye on our blogs (http://blogs.shephertz.com) where we announce our updates.
We expect to release these features by early October.

How to implement a fast responding android application

I'm doing an android application much like the gmail app for android. I can see the app is very fast and very responsive.
I'm sure gmail uses local caching for better performance. But I wonder how does gmail does the following use cases.
Lets say i login for first time and the app loads all email and put in sql lite or any other caching.
use case1
every time i delete or add a star it makes an asyncronous server req to server. this is fine.
use case 2.
how does the app get notified in case the user makes changes from another client. (from a browser).
To download the entire mails will be costly. Lets assume a case in which the user adds a star to a already cached email.
How can we implement the api in such a way that to get only updates which made from other clients. Updates like new email, deleted email, star added, etc. I'm considering the scenario when the user doesn't use the background sync.
This is been bothering me for a long time. Request you guys to let me know some tutorials or links to understand the secret behind the gmail app.
Why don't you look at the gmail web app. That will be using the same/similar design principals (gmail web app is also very fast for me). Then you can apply the same principals. With the web app you can look at the web requests using something like firebug with firefox. Under the Net tab it will show the json of what is being sent across the network. It will also show you the way the request was structured. You wont be able to see how they go about optimally returning the data, but that should be fairly trivial.
I would recommend for returning data that you do the following:
1) create a cache for the most recent page of emails.
2) Updates of new emails will be immediately prefetched into the cache.
3) setup a cache for the next page and previous page of emails.
Essentially what I am saying is:
1) You can look at googles web version which is very visible to plain snooping.
2) You can optimize based on statistical usage of how the user would want to see their emails. This can suggest cache improvements.
What you are asking for in terms of links is harder because your question relates to many general concepts and proriatary software.

Game server for an android/iOS turn-based board-game

i'm currently programming an iPhone game and I would like to create an online multiplayer mode. In the future, this app will be port to Android devices, so I was wondering how to create the game-server ?
First at all, which language should I choose ? How to make a server able to communicate both with programs written in objective-c and Java ?
Then, how to effectively do it ? Is it good if I open a socket by client (there'll be 2) ? What kind of information should I send to the server ? to the clients ?
Thanks for your time.
EDIT How massively multiplayer'ed will you game be?
Hi Cyril,
as you noticed, there are two main things two consider:
information sent to the server
information sent to the client
There's only one type of information to sent to the server: the user inputs. If you don't do that, you'll encounter headaches over headaches when rogue client will try to send fake data to your server (like saying "My tank now has 100 000 000 armor").
Then what you sent to the client is up to you but it's totally possible to only sent to the client the other player(s)'s input. This is the way to have the absolute minimum and tinies bandwith usage possible. That is how games like Blizzard's Warcraft 3 are doing it. As a bonus, this makes for tiny replay files (because all you need to do to be able to replay a game is the time (and the input) at which each player's input happened).
The one downsides with sending only the other player's input to the client is that it means all the game's logic is present on every client. For some games, this may be an issue because people may cheat by reverse engineering your game and finding flaws. This issue can be mitigated with careful, controlled, randomization (where in addition to the input+time you send input+time+randomness where randomness cannot be guessed by the client in advance.
Another way to do it is to do some logic computation on the server side. Then, obviously, you need to send the result of the server computation to the client. Done correctly, this has the benefit of both preventing cheats and maky piracy impossible (for example nobody managed to play World of Warcraft in the real economy --that is, on the real Blizzard servers-- using a fake licence key).
Regarding the phone-turn-based game server: just look at one top-selling turn-based game are doing it. Take Uniwar for example: works on iPhone and Android. Game server is written in Java "of course".
The one thing to realize is that a game like the one you plan to write is entirely deterministic: if you can't easily code a replayer or if you can't easily reproduce any kind of scenario leading to a logic bug, you're doing it wrong.
Note that being determistic doesn't mean you can't add what looks like randomness to your players: it's simply that the randomness shall also be deterministic (for example by simply using a different seed for each game + the time at which player inputs are made as a fake random source).
This is a bit lateral solution to the question asked. One of your options is to use Gamooga (http://www.gamooga.com/) so you donot need to worry about the server side, the sockets, the transport logic etc. You can just concentrate on your game logic and just develop that than the required systems stuff.
Gamooga provides you with a realtime communication platform to be used in your games. You can upload your server side message processing scripts to Gamooga's cluster and use its iOS API with in your app to send and receive messages from/to the server side. The server side is auto scaled and managed for you by Gamooga. You can download the SDK and start off with the demos with in the SDK.
Disclosure: I am founder of Gamooga, replying only since its relevant to the question.

Categories

Resources