Scirra cog

About Us

We're a London based startup that develops Construct 2, software that lets you make your own computer games!

Archives

Browse all our blog posts

Latest Blog Entries

We love brains!

Join us! Joiiinnn ussss! Mooooree brains!

Multiplayer is coming

by Ashley | 20th, February 2014

One of the most highly demanded features for Construct 2 has been support for making real-time multiplayer online games. While we have supported WebSockets for some time, it has two key barriers to real-time multiplayer: the need to write a separate server, and the guaranteed in-order transmission using TCP. This can create head-of-line blocking and ruin the performance of latency-sensitive games, compared to UDP which can ignore dropped packets and reduce latency. With the arrival of Chrome 32 and Firefox 27, we now have a solution: WebRTC DataChannels!

What is WebRTC?

WebRTC is a new browser feature allowing peer-to-peer connections. Whereas browsers typically connect to central servers to access content like websites, WebRTC is the first technology that allows browsers to connect directly to each other, without going through a server. This allows people to make audio and video calls directly to each other from the browser, as well as creating DataChannels to send arbitrary data, such as chat messages, or in our case, multiplayer game data.

Peer-to-peer connections have the advantage that you don't need to write or even host a separate server! Players can connect directly to each other. However if you would prefer to run a central server, you can still do this - a server is just a special kind of peer.

Peers still need to be able to find each other though, such as to determine each other's IP address to connect to, as well as working around any restrictions imposed by network address translation (NAT), a very common feature of home and office networks. For this a central server is still necessary, called the signalling server. It does not actually host any games - it just allows peers to find and connect to each other. As part of the new multiplayer feature, we are also developing a signalling server to help players find each other in Construct 2 games.

Which platforms are supported?

Currently only Chrome 32+ and Firefox 27+ support interoperable WebRTC DataChannels. However this also includes the mobile browsers and other Chromium and Firefox based platforms, such as node-webkit, Crosswalk and Firefox OS. Hopefully other vendors who have Chromium-based platforms like Blackberry, Amazon and Tizen will also be able to add support by updating the version of Chromium they use. Other browsers such as Safari and Internet Explorer do not have any support yet, but as with all new web platform features, hopefully support will arrive in future.

Features of the multiplayer engine

We are writing our own custom multiplayer engine to best suit the needs of Construct 2 developers. The intent is to make it efficient and responsive enough for latency-sensitive action games. The planned features include:

  • UDP-based transmission for minimal latency and head-of-line blocking, with optional reliable modes
  • NAT traversal to work around connectivity restrictions imposed by common routers and network setups
  • Robust design tested against poor quality links with high latency and packet delay variance
  • Interpolation modes to compensate for lost packets, including extrapolation, to ensure the smoothest in-game motion possible
  • Official signalling server to connect players to each other
  • Authoritative host model to prevent cheating, with local input prediction to minimise perceived latency
  • LAN game support for near-zero latency gameplay, including support for mixed LAN/Internet games
  • Automatic bandwidth controls to reduce redundant data transmission with static objects or players
  • Binary data transmission with control over specific datatypes to minimise bandwidth
  • Latency and packet loss simulation to help make local testing more realistic
  • As many features as possible handled internally by the engine, to help keep the events necessary to make multiplayer games as simple as possible

How will it be released?

We recently put out a new stable update, r163, we plan to dedicate the next release cycle (usually around 6 weeks) to testing and further developing the new multiplayer engine. It is a large and complicated feature which can be tricky to test and needs to handle a variety of network conditions that happen over real connections around the world, so we anticipate it will take some time to get working robustly. During the beta test there may at times be restrictions on the available features (such as the maximum number of players in each game) to ensure stability before we scale things up, and the signalling server availability may be intermittent if it has issues during the beta test. Of course we hope that this will not be a problem at the full release, but please be aware that as it is all in beta that there may be issues.

We will initially make the beta version of the Multiplayer plugin available only with a license, so it will not be available in the Free edition. We will later consider adding a trial version for Free edition users to test.

Additionally, given the scope of the feature and the ongoing running costs, we are planning to introduce a low-cost subscription for the full version of the multiplayer feature upon its final release. This is planned to support extended features, including player logins and data storage (e.g. for players to accumulate inventory, achievements, ranks or experience points in a multiplayer game), leaderboards, location-based matchmaking, and possibly relay servers to help connect users who are behind extremely restrictive NAT and would otherwise be unable to connect. We do hope to support a basic but useful version for existing users with a license. This is still under consideration and is subject to change, but please be aware our priority during the beta is to test it is efficient and robust, and that we may make adjustments to the available features after the beta.

Demos

We are running an initial test of the multiplayer engine here:

http://www.scirra.com/labs/multiplayer/test1/

Please give it a spin and see how it works for you! Note if you've run it before, it's been updated a few times - make sure it says 'Revision 12' in the corner, and refresh if it doesn't. The first user in to an empty room becomes the host, but if they have restricted connectivity you might not be able to join. If you have trouble joining, try one of the other locations, or pick an empty one and host yourself. (The locations are just separate rooms, to encourage people near to each other to join the same games, which should help reduce lag.)

We might run other tests, and we'll need your help to test them! There's nothing like the real-world Internet to see how it fares. If you'd like to get involved, follow our Facebook page, Twitter or Google+ page for announcements about upcoming tests. Note announcements may come at short notice.

Coming soon

This is a major feature and we're excited about what it will make possible. Many simple games gain a whole new level of engagement, excitement and replayability when you can play with other people online! Platformers, shooters, all-vs-all, co-op and more should all be possible. It's traditionally been extremely difficult to make effective multiplayer games, and we aim to make it easier than it's ever been with Construct 2.

Now follow us and share this

Tags:

Comments

12
CampingCarl 1,459 rep

Keep up the hard work, I am loving constuct2 more and more i use it. I wish more engines where this fun.

Thursday, February 20, 2014 at 7:39:40 PM
5
Joskin 6,089 rep

Yes ! Thanks Ashley and Tom !
I'm so excited to work on multiplayer. (Got a game ready for !)

Thursday, February 20, 2014 at 7:42:38 PM
12
cherbert 922 rep

I am bit confused by what you mean by subscription based extended features? Are you hinting that you will centrally host our servers for player data storage and login processing? I sincerely hope that if this is the case that it is purely a value added optional service because I would rather host my own infrastructure for any game that I decide to develop and not have to rely on any third-party hosting service that is out of my control.

Could you clarify and expand upon what you mean by extended features and what the subscription payment will be for?

Thursday, February 20, 2014 at 7:45:47 PM
5
trmilu 1,973 rep

Very good news, i'm thrilled & excited to the max :D

Thursday, February 20, 2014 at 7:46:19 PM
7
Nipponshin 5,353 rep

I'm amazed at how construct 2 is evolving, keep up the good job!

Thursday, February 20, 2014 at 7:48:09 PM
6
jardelbr 4,832 rep

OMG OMG OMG !!!

THIS IS A GREEEEEAT NEWS!!!!!!!!!!!

sorry but im very excited now! ;-)

Thursday, February 20, 2014 at 7:48:52 PM
11
jayderyu 14.9k rep

Wow. I'm am surprised that Scirra is going to the cover so much. I was pretty sure it was only going to support just WebRTC based messaging and we would have to handle most of the latency handling. I am standing corrected.

@cherbert
It's optional to use there singnalling and data storage server for authortive play. You can use your own.

Thursday, February 20, 2014 at 7:49:43 PM
4
Bigheti 15.7k rep

Dude, I try the initial test and... very, very cool.
I want to see more people testing this engine test together...
Waiting!!!
:-)

Thursday, February 20, 2014 at 7:50:37 PM
3
HowieRaisin 4,964 rep

Hooray, multiplayer! I'll be watching this with interest.

Thursday, February 20, 2014 at 8:04:43 PM
3
CarHazy 4,495 rep

Pretty Sweet! Good one guys!

Thursday, February 20, 2014 at 8:16:48 PM
3
jayderyu 14.9k rep

Personally i think this will put C2 ahead of other Gamekits for 2D games. However I wonder why more people didn't use RexRainbow's BottleNeck or why so many C2 user/devs only use official plugins?

Well I'm looking for to 163. it will be the first beta release cycle I use :P

Now the patient wait for modularity....

Thursday, February 20, 2014 at 8:18:01 PM
3
lennaert 12.9k rep

Euuh, .. will this mean we will be tied to your servers ?

We can not host our own servers ?

In the final product, are we tied to using your servers with the fee, or can we host our own without the extra fee ?

Thursday, February 20, 2014 at 8:19:14 PM
7
PixelPalette 8,146 rep

"We do hope to support a basic but useful version for existing users with a license. This is still under consideration and is subject to change"

Confused there. Does that mean the user gets a restricted plugin to use only with your monthly fee service server? Will i still be able to do peer to peer connection in the basic version?

Thursday, February 20, 2014 at 8:29:19 PM
4
russpuppy 8,725 rep

great news. thanks for keeping us updated on the progress

Thursday, February 20, 2014 at 8:35:00 PM
2
gillenew 23.2k rep

very nice!!
the multiplayer room is very good :P

Thursday, February 20, 2014 at 8:50:23 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.