thoughtshastra Posted December 2, 2015 Has anyone been involved in developing real-time multiplayer games for mobile platforms (specifically for Android and iOS)? I have recently used Google Play Game Services APIs for implementing real-time multiplayer capabilities in my game developed in Unity game engine. The results with two players playing on the same network (connected to same Wi-Fi router) have been satisfactory. But I was wondering about how are the lags for game sessions, between players who are distance apart, taken care of? Any best practices or generic frameworks for building multiplayer games? The one that I have launched recently, Kung Fu Glory, is available at: https://play.google.com/store/apps/details?id=com.thoughtshastra.kungfufightinggame Share this post Link to post Share on other sites
raygagne Posted December 3, 2015 Just checked your game trailer out. Looks cool. I have zero experience with mobile, but I have tried some stuff out with multiplayer. I have worked using Lidgren/XNA, and now I am looking at Forge Networking. I have a couple of opinions to share, but I am no expert so take them with a grain of salt as I am a hobby developer with nothing to show for my networking research really Networking asset/library 1) Since you are using Unity, you should definitely look at a networking asset (Consider looking into forge networking, photon and bolt) 2) No matter the framework, making a game that works under laggy conditions is very difficult Lag compensation methods On the second point above, there are two general strategies for dealing with lag: 1) The server has all of the true positions, and the client only predicts its future position. The server will correct the player's position if needed (rarely). This is the tried and tested method for FPS games since quakeworld in like 1995 or whenever that was and countless articles have been written about it. Since your game is a fighting game, I don't think this is for you. However, here is an incredible link about how the source engine works in case you are interested: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking 2) Your game seems most similar to a fighting game. Most fighting games use systems like GGPO (Using a netcode technique called "rollback," GGPO puts lag ahead of a player's move which partially hides latency and creates a lagless illusion. The effects examine which players performed the right actions and correct any possible inaccuracies. The program itself can allow players to adjust latency in case of high ping situations; either creating a possibly jerky yet accurate representation or a smoother game with input delay.) https://en.wikipedia.org/wiki/GGPO This is only a small taste, but I strongly encourage reading some articles about what lag compensation method makes sense for your game first, then thinking about how you can design your game for that, then considering which unity asset/library makes sense for you after you know these things. The best thing you can do is test your game under laggy conditions as early as possible if you want it to work. Many of these technologies simulate lag which helps a lot, but live tests are also critical. I hope this does not discourage you. Multiplayer games are amazing. I have countless hours in dota, subspace/continuum, etc because there is nothing better than human competition. Good luck. Share this post Link to post Share on other sites