Android, IOS, WP8, WEB - Multiplayer :)

Hello everybody :slight_smile:

Me and my team have a task to do. Create multiplayer game.

Image

across nearly all mobile platform. We choose Corona. Im main technical person and I would like to ask about some features and advices from Corona Team. 

I would like to present features and at later ask questions:

  1. platforms: Android, IOS, WP8, WebBrowser

  2. plugin: Facebook - invite friends to play games

  3. plugin: Notification

  4. simple AI to shoot goals in Single Player Mode

  5. resources from servers

  6. DB on mobile side

Problem among my team is that, we dont know yet 3 things.

  1. How to create Multiplayer Layer -

UDP - long development 

TCP - long development

REST - simple and fast but not flexible

WebSockets - its crushing during some period of time. 

 

We can program ServerSide by ourself.

 

  1. Resolutions in multiplayer

Game is simple football 2D - just touch the pawn, move to create force and shoot at ball.

Problem is - when we will send force vector angle, and lenght in PX, will physics engine will calculate it properly or (nearly properly) on the oposite device. Or do we need to make some corrections on oposite player board after a turn ???

Maybe there is such a case in Corona Case Study ??

  1. Corona Web Player is not ready yet - so my friend will try to implement the game in raw style. But I know that Corona is using Box2D physics, so maybe he can use this framework in JavaScript so then physics will behave nearly the same ???

Or is it much better not to mix Web with Mobile Platforms ??

What do you think Corona Team??

Greeting P.Lewandowski

@przelewelo You have described quite the endeavor. I hope your team is ready to spend a lot of time on this project!

Regarding the Web version of the game, may I recommend Phaser.js (http://phaser.io/)??) I used it for my first mobile game (wrapped in Cordova) before moving to Corona SDK. It has a lot of the same core features as Corona including Box2D physics as an add-on. It is presently one of the most popular game frameworks due to it’s ease of use, versatility, and open source nature. It will never compare to Corona SDK in power and features but it should suffice for what you have described.

Regarding the real-time multiplayer aspect, I recommend that you take a look at the now defunct AutoLAN library for Corona SDK. From a functionality stand point, it has most of what you are looking for. I will go into more detail in a moment, but before I do I must caution you. AutoLAN was created and then abandoned a while back so the sample code utilizes the old Graphics 1.0 API and will not run without changes. I was able to get the code working though with only minor changes including enabling graphics 1.0 backward-compatibility. Furthermore, there are two ways to run AutoLAN, one that utilizes a matching server and one that scans the local network. Some of the sample code tries to utilize a matching server that is no longer running. You can fix this in the sample code just by changing client:scanServersInternet() to client:scanServers() wherever applicable.

If you can get past these two code hurdles with one of the samples you will have yourself a very powerful library to use. I am personally planning to use AutoLAN for local multi-player for my upcoming game. Below is a link to the main page for the project as well as a link to an excellent PDF that will get you up and running with the library. The PDF addresses some of the issues you describe, specifically the PDF describes how and why both TCP and UDP are used for the most optimal experience. It discusses the pitfalls of multiplayer games. And it talks about how to use physics to resolve many of these problems. Even if you decide not to use AutoLAN, it’s worth your time to read the PDF.

One last thing, if you do decide to use AutoLAN and you want to utilize a matching server, you will need to implement your own server for that. The AutoLAN download bundle includes a PHP file that acts as a primitive matching server. However, it’s poorly documented and not safe to use as-is in production, so you need to study the code (both the AutoLAN lua library as well as the PHP file) to figure out the best way to implement your own matching. I will not be using a matching server but if I felt the need I would likely use something like Coronium.io (http://coronium.io) for the matching while still using AutoLAN for the real-time multiplayer.

http://www.mydevelopersgames.com/AutoLAN/index.html

http://www.mydevelopersgames.com/AutoLAN/AutoLANDocumentationV100.pdf

Good luck!!

@przelewelo You have described quite the endeavor. I hope your team is ready to spend a lot of time on this project!

Regarding the Web version of the game, may I recommend Phaser.js (http://phaser.io/)??) I used it for my first mobile game (wrapped in Cordova) before moving to Corona SDK. It has a lot of the same core features as Corona including Box2D physics as an add-on. It is presently one of the most popular game frameworks due to it’s ease of use, versatility, and open source nature. It will never compare to Corona SDK in power and features but it should suffice for what you have described.

Regarding the real-time multiplayer aspect, I recommend that you take a look at the now defunct AutoLAN library for Corona SDK. From a functionality stand point, it has most of what you are looking for. I will go into more detail in a moment, but before I do I must caution you. AutoLAN was created and then abandoned a while back so the sample code utilizes the old Graphics 1.0 API and will not run without changes. I was able to get the code working though with only minor changes including enabling graphics 1.0 backward-compatibility. Furthermore, there are two ways to run AutoLAN, one that utilizes a matching server and one that scans the local network. Some of the sample code tries to utilize a matching server that is no longer running. You can fix this in the sample code just by changing client:scanServersInternet() to client:scanServers() wherever applicable.

If you can get past these two code hurdles with one of the samples you will have yourself a very powerful library to use. I am personally planning to use AutoLAN for local multi-player for my upcoming game. Below is a link to the main page for the project as well as a link to an excellent PDF that will get you up and running with the library. The PDF addresses some of the issues you describe, specifically the PDF describes how and why both TCP and UDP are used for the most optimal experience. It discusses the pitfalls of multiplayer games. And it talks about how to use physics to resolve many of these problems. Even if you decide not to use AutoLAN, it’s worth your time to read the PDF.

One last thing, if you do decide to use AutoLAN and you want to utilize a matching server, you will need to implement your own server for that. The AutoLAN download bundle includes a PHP file that acts as a primitive matching server. However, it’s poorly documented and not safe to use as-is in production, so you need to study the code (both the AutoLAN lua library as well as the PHP file) to figure out the best way to implement your own matching. I will not be using a matching server but if I felt the need I would likely use something like Coronium.io (http://coronium.io) for the matching while still using AutoLAN for the real-time multiplayer.

http://www.mydevelopersgames.com/AutoLAN/index.html

http://www.mydevelopersgames.com/AutoLAN/AutoLANDocumentationV100.pdf

Good luck!!