iOS multiplayer game - what to use for the multiplayer part? - ios

I'm developing a game for iOS that should include the multiplayer. It's not a turn-based, rather a real-time game. I know I can use some different approaches here:
Game Center multiplayer (has matching and searching for matches, gives authentication out-of-the-box, additional are leaderboards and achievements)
As far as I know, OpenFeint also includes some multiplayer helpers
I can also write my own sever code, but woudn't it be reinventing the wheel? I'd also loose all the good stuff from GC...
Any suggestions here? What's the leading market solution, that doesn't take too much to integrate into a game; I'd like to be able to send short bits of data between players (player position + action taken) in a real time. Best would be to reduce the lag :)

personally, i think the easiest way to go is with gamecenter. it was pretty straightforward to integrate it into an existing game - i'd say it took 2-3 weeks. the main problems that we encountered were to do with the game simulation not being particularly suited to multiplayer, rather than anything to do with dealing with gamecenter.

You may also consider Nextpeer (disclosure: I work there). GameCenter is good, but it has the downside of not being cross-platform. We offer a solution that is cross-platform (iOS, Android and Unity3d) and is geared towards multiplayer in casual games. So we provide the hosting, the player-to-player communication, the matchmaking, and Facebook integration.

Related

Developing an iOS app, questions about the API I should use. (thinking of SpriteKit)

This is a pretty basic question and doesn't really need much depth for an answer. I was just currently interested in developing an app for iPhones and after learning the swift2 language from the Mac site, i was just wondering which API I should use.
I did some moderate research, and so far spriteKit seems like the way to go (bit of a hassle if I want to port it over to android, but not impossible). But I was just wanting to make sure it's the right way to go.
The app idea revolves around keeping track of some form of progress and being able to use this data to generate graphs for the user? I'd also like to add some image functionality to the application as well. (similar to the health app and how it measures distance walked?)
I know this sounds vague, but would spriteKit be able to do these things? Or is there another API worth having a look into? (I've checked out metal and sceneKit as well, but leaning towards the more 2D type apps)
From my point of view using spritekit for this is overkill.
There are some greats frameworks to do graphs like charts :
https://github.com/danielgindi/ios-charts
Spritekit is more gaming oriented, if you want a "simple" app you don't need it.
I don't think SpriteKit is the right API to accomplish your problems.
SpriteKit is all about moving and manipulating images on the screen. I am quite familiar with the SpriteKit API.
I do not see any help for generating graphs or something like that.
Also it is not the right API to display a proper interface for "serious" apps.

Porting android code into objective C

I have an android game thats basically completed and I want to start porting it to iOS.
I'm completely foreign to objective c and I have no idea where to start. In android I have a surface view, canvas, and a game loop which draws and posts the canvas. What's the iOS equivalent?
First, be very careful of trying to transliterate between languages. You can't just pick up Java idioms and "do the same thing" on iOS in many cases. Many things are done with a completely different approach (threading is a major example; drawing is often done differently as well). You should spend some time learning the platform first or you'll get something that "almost" works and chase bugs and performance problems forever.
That said, the tool you probably want to study is Cocos2D which is a very good 3rdparty toolkit for building 2D games on iPhone. This is generally a much better approach than trying to build it up from scratch and should have a lower learning curve for game dev.
It's difficult to know how you should port without knowing the nature of your game but most iOS games are written in OpenGL which is very extendable. It has some optimization tricks that can play a big role in how you architect your rendering pipeline though.
If you decide to go with OpenGL you should check out this Stanford talk presented by NGMoco on how to do this...
http://www.youtube.com/watch?v=VNr5I3ZRecE

How to translate two languages at the same time without delay for instance: "two online games written in different languages"

I have a question about writing a script which can manage to play online games in different codes. I think the easiest to understand is when I say I need to make a platform on which Playstation as xbox players are allowed to play online Modern Warfare 3 together.
Mathematically it seems it is possible: at the end you have two different screens which project the same. On the platform, Sony and Microsoft players stream their code or screen to the platform and play together. Big problem is that you get it delivered in 2 different codes which you have to translate to one language in less than 0,001 second.
Honestly said I have to get into this stuff but I cannot get much further.
Do you have any tips, other forums or solutions for this problem? Maybe it is writing a new language? (Google is technically using it for Google-translating over the phone)
Depending on the game this might not be possible even in theory. Many console games use a peer-to-peer lock-step synchronization model for multiplayer. Games that use this approach only send each other the player input from the other consoles and rely on deterministic simulation (the same inputs produce the same outputs) to keep the systems synchronized.
This only works when the exact same compiled code is running on the same CPU for all players. Games with this networking model usually have periodic desynch checks to make sure that the different systems haven't drifted out of sync with each other. A desynch failure is usually considered a fatal error and either a bug in the game or evidence of attempted cheating by one of the players.
Other multiplayer games use a client server model and so it would be possible in theory to allow different consoles to play against each other. Reverse engineering the network protocol would be a formidable technical challenge however and it would be a difficult problem to get this to work reliably.
Even if you could solve the technical problems though you would likely have even bigger legal issues to overcome. Sony and Microsoft don't want to allow cross platform play so even though it would be possible in theory to make this work with a client server multiplayer game developers aren't able to implement it. A third party trying to make this work would likely have to deal with legal challenges from Microsoft, Sony and the game developer.

iOS turn-based vs real-time multiplayer connectivity options

I am looking into multiplayer connectivity options for a two player game and wondering what options are available to use. I've read up on a bunch of stuff online but still couldn't figure this out. I've done a tutorial with GKSession from GameKit.h, but I'm confused on whether Game Center and GameKit are the same thing.
What are some connectivity options for both a turn-based and real-time two player game? Are there any benefits for either styles with these connectivity options?
Thank you!
Game Center is the customer-facing name of the services Apple provides. GameKit is the framework that Apple provides for developers to implement Game Center functionality.
Whether or not you make a turn-based or real-time game really depends on the type of game you're making.
Definitely agree with #WendiKidd -- you need to decide what type of game you are making to determine the technology to use. Game Center won't directly solve this for you, it will just provide an API for "extra" that you can hook into.
That being said, turn-based is probably easier to write and has a few more options for implementation. You'll need/want to setup a server in the middle that can act as the central arbiter for the different players. E.g., player one submits a move, which gets sent to your server. Then when player two logs in/plays, the game would check against the server for updates and then affect the game state accordingly.

Can one make real games with XNA and C#?

Can XNA and C# be used to create commercially feasible PC/XBOX games?
Is it the best approach for creating 3D games with C#? If not, what would be?
Actually you can do that but it is a little bit tricky.
You need to pass via an approval process by the "community" (XNA Creators club Online users).
You will also need to pay an Xbox live account plus an Xbox live developper licence.
According to XNA FAQ:
Do I need an XNA Creators Club premium membership to create games?
You don't need a premium membership to make games for Windows or Zune. However, you must be a premium member and in a supported region to create games for the Xbox 360, to release Xbox 360 games to Community Games on Xbox LIVE, or to peer-review submitted games.
Who can peer review XNA Community Games?
A member of the Creators Club whose premium (paid) account is in good standing and is a legal adult (for the countries we currently serve this means 18 years of age or older).
And:
Why does my game have to be peer-reviewed? Why can't I just send it to Xbox LIVE marketplace?
Peer reviewers help creators write better games, and protect game players from experiencing highly offensive or malfunctioning games. Peer reviewers will reject your game if:
Your game contains prohibited content, which is content not allowed on Xbox LIVE services
You misrepresent what is in the game play or in the promotional materials for the game
The promotional content for your game ( for example, the box art, description, banner or title) is not appropriate for all ages on Xbox LIVE Marketplace
The game crashes, it has too many bugs, or it is technically defective in some way
the faq is can be read here
If you want to do it simplier you can play with DirectX directly or even other libraries like SDL (for 2D games). Actually C# is very good for a variety of things and it gets better as the time goes.
A short answer to your first question would be, yes. It is entirely possible to create just about any kind of game with the XNA library. It can be used to make simple 2D platformers, or moderatily complex 3D shooters.
Depending on the game, the amount of logic you'll need to create for your game may vary.
Of course, while creating 3D games, you'll either have to create your own 3D engine, or get your hands on one pre made. XNA in and on itself does not provide an engine that would be fully usable out of the box. It does, however, provide wide variety of tool to help you in the process of making your own engine.
XNA is dedicated primarily to garage games, small projects with small teams, and hobbyists. Also, it's a really good learning tool for game architecture and 3D programming. But for commercial applications, there's a clearly huge gap between the XLA and the XDK.
Using the XDK allows you to access to a much deeper level of hardware, which is definitively a must if performances are an issue. Also, most of commercial game engines are developed for use with the XDK (the Unreal Engine, for example). The debugging and profiling system of the XDK is also an amazing tool which is not available using XLA.
So yes, it is technically possible to make commercial games using XNA, but the real world tends to prefer the XDK.
C# is not that much slower than C++, however C#'s memory management is not really Game friendly (in the AAA style). Never the less rendering is basically the same, as you'll be using DirectX I guess, so there is no reason a very professional game like Gear of Wars couldn't be made with C# (As a game dev my self, I've seen the source code for Gears of War, and can tell you this first hand). But you'll need great artists.
The real roadblock, is if your source is in C#, you have just locked your self out of other Platforms that aren't from Microsoft (Say Sony or Nintendo), but then again GoW is Microsoft bound, ASFAIK.
As for XNA, the best selling Arcade/Community Game Braid, was written in C++, but that's because the author didn't want to lock himself out of other platforms, and he had lots of experience and a large code-base that was already C++ based
XNA saves you a lot of the low level tedium associated with making games. This can be a huge time savings for a handful of people banging out games that don't need to push the hardware to its limit; however, most AAA games require a few people getting down and dirty with the hardware to push the limit as much as they can.
Having said that by no means does your game have to be AAA to be commercially feasible or fun - one could even argue it hurts more than it helps. Technology is rarely the bottleneck of making good games.
I doubt you will create the next Gears of War with it, but XNA works fine for many types of games. Most (all?) of the Community Games on XBox Live are created using XNA.

Resources