Implementing online connectivity and multiplayer/PVP for a newbie - android

Background
I'm a noob programmer looking to create a simple turn based mobile game as a side project. I've pretty much got the game logic down and am left with implementing the online multiplayer/PVP portion.
More specifically, i'm looking to implementing a system when the player clicks play and will be matched with an opponent in a 1 v 1 format, without any lobbies etc etc.
I'm currently trying to develop my game in android studio(i'm new) but am also open to unity if it makes the development easier.(I have no experience in Unity).
What i want to know
From what i understand,i need to create and host my own server for the multiplayer to run(i.e matching of player to opponent). Do i also need the server to run the game itself or am i able to connect the player to the opponent and simply record the result of the game to my server/database?
Also, how would i go about creating and running/hosting the server? I heard nodeJS is a good choice for writing the server.
Can anyone point me to a good resource/tutorial for creating and running my own server, and if possible free(or cheap) hosting for my server?
Also, is unity a better choice than android studio for my game?
End Goal
I just wanna publish my game onto the app store,IOS store,etc etc.

If you don't have any experience with creating multiplayer games, I'd recommend looking into one of the several ready-made solutions available on the market (Unity Multiplayer is one such service). You could essentially make your entire online game without ever needing to code a server.
Coding game servers is more work than you think. You'd first need to make a working game server, then you'd need to consider hosting, data storage, scaling, ping, etc. The downside is that you'll get less customizability and less security (you'll need to handle much of the game client-side, which means you're susceptible to hacking by modification of the client, known in the android world as "mods"). However, if you're just starting out, a game server of your own will probably do more harm than good.
You should always choose a multiplatform engine for mobile games. You do not want to code your entire game twice. So yes, Unity is a good choice, and it's the de-facto standard for mobile these days. If you're going to be making games, learning Unity is a worthwhile investment.
Last, and this one comes from my personal experience only with no real statistical data to support it, people who implement game servers with node often end up discovering that their server just can't handle the load, which leads to a need for stacking a whole lot of technologies up on one another to scale the server(s) out or squeeze more performance in some way. It'll often prove to be bad choice in the long run. Or then again, maybe the people I know just aren't good with node.

Related

Better solution to my real-time online Android game

I developed a trivia game a while back for Android that allows you to compete head-to-head against anybody in the world that is available, in real-time. This is in real time because you can see what the other player is selecting. Since I was familiar with PHP and MySQL, that is what I chose to use on the server side to handle everything. I know this can't be very efficient since the game is constantly sending/receiving information to/from the database throughout the whole round as fast as it can. This has been working pretty good for over a year now, but I really haven't had a ton of players on at the same time, and I know there has to be a better, faster, and more reliable way. I'm planning on making this a 4 player game and I know the database will be getting hammered and will be harder to keep all of the players in sync.
What would be an appropriate way to do this? Is this something for sockets? Is the method I'm using now ok for real-time play and I just need to concentrate on improving what I have?
Raw sockets need you to handle a lot of issues. Mobile networks can disconnect easily. What you are looking to develop is similar to a chat application where you send data between users. Php by default is not best suited for this.
You could build this around an XMPP server. The key is being able to send asynchronous responses to the clients. If you need more control, you could build this on frameworks like socket.io or SignalR.

Android/IOS Turnbased multiplayer game (like WordFeud/Scrabble)

I've been looking around for some time, but can't seem te find the right answer.
I'm trying te develop a android multiplayergame, later it must also be able to connect to IOS and Windows Mobile 8.
It's a game like WordFeud/Scrabble for up to 4 players per game.
What I want to do is do most of the complex coding like validations, synchronisations of the playboard, stats, etc on my asp.NET server. (since I'm a C# programmer).
So the app on the device will be the GUI and some logic to sync.
Now things like auto-sync(or push), turnbased, find player etc.
How can I do this?
And is this the way to go when I want worldwide thousands of players to be able to play against eachother?
From my reseach using a webservice for the sync/game logic seems a logic option.
I don't feel much for tools like Parse, Skiller, Openfeint, etc.
Since they all cost a lot of money and you are depending on them.
Kinds Regars!

system for bidirectional realtime communication between tablets and server

We are going to build a multiplayer game.
The idea is that every player has a tablet and is connected to a server.
The server should control the game logic, while the clients (the tablets) will only serve as a frontend to the game.
We need to make a decision about the frameworks/programming language we are going to use.
A crossplatform frontend would be cool, but is not mandatory. It has to run on Android devices at least.
The communication between the server and the client must be bidirectional and realtime.
We don't care about a small amount of delay.
Currently we consider an HTML5 client in combination with a javascript server (running upon nodejs) to be the best option.
The communication would be managed by the javascript library socket.io.
The HTML5 frontend can be run either in-browser or as an app (built with PhoneGap).
However we did not decide yet since we want to be sure to make the right choice.
There might be frameworks that can do a better job.
Does anyone know a better solution?
Play 2 is great for this well, but node/socket are great choices too. I would use backbone.js for the front end as it gives you a lot of flexibility and it's easy to keep the views in sync. (there is an example of such an app on my github if you're interested)

Game server infrastructure for two players turn based board phone game

I tried to do my homework in this topic, but unfortunately with no luck, at least the picture not as clear I can start digging deeper or registering for a service etc.
What I am trying to implement: Simple 2 player board game, with CPU or internet opponent. The game is a phone game for all the 3 platforms iPhone, Android, WP7. (please do not harm WP7:-)
One option is go to some cloud (Azure, Amazon) and implement some game server. Sounds reinventing the wheel, but maybe there is an open source implementation. (only ASP.NET because my skills)
My current understanding my other and preferable option is using a service like Openfeint or ScoreLoop (bought (and eaten?) by RIM :-().
Unfortunately it is not clear for me (after reading the two FAQs) if besides of high score lists and maintaining statistics is any of game server is capable to conducting a board game between two authenticated player?
Could anyone point me where to start? (or suggest me a WP7 sample or marketplace game which uses a public game server for two player board game internet gameplay?)
Thx for answers
I also wanted to develop a multiplayer game and examined Openfeint, Scoreloop and Skiller. I ended up using Skiller as my multiplayer engine, since it was the only one that supports multiplayer and it works great.
Hope i helped.
Look at Azure for social games toolkit https://github.com/WindowsAzure-Toolkits/wa-toolkit-games
There as some areas of concern outside of the logic of just the game.
User Identity and Authorizing. (Game Center)
Game Data Persistence and Storage. (Cloud Database like AWS DynamoDB)
Game Match Queuing. (AWS SQS) Don't attempt this with a database using pessimistic concurrency.
Notifications of Match Players are ready for sleeping clients. (AWS SNS to APNS/Google to Endpoint(this mobile device))
Polling or Notification for Next Move. (AWS SQS or SNS) I wouldn't poll a Database for this.
Those services are just example recommendations. I don't work for Amazon, they are the easiest and most affordable to get up and running but there maybe better services out there. I found them with your same requirements in mind. I don't want to commit to 100 bux plus a month if my idea is a boon-dongle.
You could do all that listed above to start out for under $15 a month using cloud services. The best thing is if your idea takes off you simply bump up the thresholds on those with a flick of a switch from an admin portal. Some automatically scale.

Android: Turn based network capable game engine

This may be ambitious, but in stackoverflow i trust...
I am wondering about the capabilities and possible road blocks would be for creating a turn based network capable game engine for the android platform, and would be played in a similiar fashion to games such as "Words with Friends" ect.
This engine would be tailored to a card game and would only require data packets sent between peers every time a player takes his/her turn. Game resources such as images and sounds may have to be downloaded from a central server and stored on the android device's temporary storage in order to reduce the amount of storage that the app would have to permanently have on the device.
Before I invest a lot of time into this project I figured I would ask some initial questions.
What limitations/roadblocks does a seed/turn based network game provide to a developer?
Is integrating an ingame microtransaction based shop using a service such as PayPal a possibility?
Will packets between peers need to be encrypted to prevent cheating?
How is it possible to validate clients from a central server to prevent piracy?
What is the best method for balancing lightweight storage/cpu requirements, while still having crystal clear graphics?
Is it a good idea to learn java seperately from using the android SDK, or just jump right in?
Thanks!
Networking adds complexity; see if you can make single player first
Yes, but frowned upon; Google prefers, and may some day insist, that you use their in-app feature.
Yes, if you substitute "discourage" for "prevent"
Login authentication for the networking to work is one way.
If the UI has 3D graphics, use OpenGL, otherwise, use Canvas or even HTML5
Jump

Categories

Resources