Showing posts with label multiplayer. Show all posts
Showing posts with label multiplayer. Show all posts

Tuesday, November 20, 2012

How to make a multi-player game – part 2

Hello and welcome back to my blog! This is part 2 in the series where I talk about making a multi-player game.
Last time we built a TCP socket server in node.js and we’re able to send and receive complex types. Read the first article if you’ve not already done so here.
Here is a live version of the game I’m describing in this series:

Clock synchronisation

It’s important that both the client and server’s clocks are synchronised because if there is any time based interpolation, you want both server and client to agree on what time it is and therefore at what position your interpolated object is.

Asteroids on an interpolation orbit
I use this technique in 2D Space MMO to ensure the orbiting asteroids are in the same position across all clients and on the server. The asteroids are actually interpolating on an orbit around a central location – there are no update messages getting sent to correct their positions, the only thing which keeps them synchronised is having the same time value across all clients and server.
Before we can try to synchronise clocks, we need to be sure we’re using the same concept of time on both server and client. We want to calculate the number of seconds since 1970/01/01, which is the same in both javascript and actionscript:
Read more: How to make a multi-player game – part 2

Wednesday, April 25, 2012

My ActionScript Game Server with 15,000 Concurrent Connections

Goal

Create a game using ActionScript for both the server side game server and the client side game with the ability for high concurrent (10,000+) socket connections. Make sure memory and performance of the application are up to the task.

What am I talking about?

This blog post will explain how I was able to create a socket server running on a Amazon EC2 ubuntu server with more than 15k+ concurrent connections. This socket server has all the game logic for a game called SpellTraction, which both the server and client are written in ActionScript.
Server: Game built in ActionScript 3 and run as a shell process using a modified redtamarin build. The modified redtamarin has a libev based socket server.
Client: Client game built with ActionScript 3.
To check out a running version of the client go to either:
http://renaun.com/serveras/test/ - this version is driven by other Amazon EC2 instances that are running test scripts to create the 15k+ connections.
or
http://renaun.com/serveras/spelltraction/ - the game with any other player looking at it right now.

Here is a screenshot of the game [...]
Read more: My ActionScript Game Server with 15,000 Concurrent Connections

Friday, January 21, 2011

Cirrus January 2011 update

Cirrus January 2011 update:

Regarding the latest info from Michael Thornburg (Adobe) Codename Cirrus got refreshed and you can now leverage new two features.

One of them is sending developer key as as a second parameter of connect method, which improves security as key is not transmitted via URI.

So now you can call:

   var nc:NetConnection = new NetConnection();
   nc.connect("rtmfp://p2p.rtmfp.net", "000000000000000000000000-000000000000");

Second feature enables you to send direct relayed messages to clients, this can be helpful for some kind of signaling or init. We highly recommend to use this only one or twice per connection as it consumes much more resources on Cirrus than P2P introduction.

  // on sender peerID 9876 sending to peerID 1234
   nc.call("relay", null, "1234", "INVITE");
 
   // on receiver peerID 1234, this callback happens
   nc.client.onRelay("9876", "INVITE");

Original post here.

Tuesday, January 4, 2011

RedDwarf Server

RedDwarf Server:

RedDwarf Server is a horizontally scalable application server for low latency applications such as online games, virtual worlds, and social networking applications.  It is the official community fork for Project Darkstar, previously sponsored by Sun Microsystems, Inc.  RedDwarf is a server side technology written in Java that radically simplifies the development of online games and lowers the barrier to entry into the MMOG market [...]