Tom Krcha's FlashRealtime

Hey amigo!
I am Tom Krcha, Gaming Evangelist at Adobe. These are my notes

P2P Gaming Libs from my MAX 2010 session

November 24th, 2010

Update 3/18/2011: Source-code is available here:

Update 11/28/2010: Library now accepts variable group name, so you can create more instances. Download updated library below. Example: var game:P2PGame = new P2PGame(serverAddress,groupName);

Lot of you guys are asking for libs I’ve used in my Adobe MAX 2010 session Building P2P Multiplayer Games.

It’s still work in progress, but you can basically grab SWC libraries here with example.

I don’t want to publish source now as it needs several changes, refactor, comments, etc. But source-code should be available soon :)

This library has been used for MAX Racer without no change. So it’s kickass tested stuff! But not completely finished and documented yet. So this is the disclaimer, I do not provide any guarantees.

If you want to start playing with it, go ahead. Comments are highly welcome!

This engines creates a full mesh network via DIRECT_CONNECTIONS NetStreams among all connected users. Thanks to that, you get lowest latency possible and it’s highly suitable for realtime gaming.

Read the rest of this entry »

Flash Media Server 4 released at IBC

September 9th, 2010

Hello from Amsterdam! We have just launched the new version of Flash Media Server at IBC conference in three different versions: Streaming, Interactive and Enterprise. See comparison matrix (help me choose).


The features I am personally most excited about are:

- 64-bit support which brings tremendous streaming power!

- P2P/RTMFP support with server-side API, you get the same access to P2P network like Flash Player client, plus you can create a stable point from the server, very useful for distributed objects and databases. Next to that, you don’t need to use Adobe Stratus rendezvous-server and you can start building your own commercial P2P apps.

- Multicast support - stream multicast in H.264/on2 VP6 right from the Flash Media Live Encoder as well as control and manage multicast streams from the server. This also brings new possibilities to IP only multicast and multicast fusion (combination of application-level multicast and IP-only multicast).

- CentOS support

- Absolute timecode - to sync audio and video from different channels + combined with multibitrate streaming

- HTTP streaming - new delivery choice

and more…

Check Flash Media Server homepage for more details.

Read about other things we are launching at IBC.

Kevin Towes-launch fms4 - IBC 2010
Photo: Kevin Towes launching Flash Media Server 4 at IBC 2010

Multicast Explained in Flash 10.1 P2P

July 1st, 2010

Multicast is one of the features of Flash Player 10.1 and it enables you to distribute NetStreams across the peer-to-peer mesh. It can be audio, video or even pure data stream (AMF3) - the data stream can be very handy for games, it’s much better for such purpose (like sending realtime positions, directions) than using Posting as Posting is more optimized for large number of senders to send something - like chat, status change and so on.

Difference between Unicast and Multicast

Unicast simply delivers streams from a server to n clients. For this purpose you can use Flash Media Server and TCP protocols such as RTMP/T/S/E or HTTP protocol. Unicast also costs you a lot of resources -> 1 MBps stream delivered to 1000 clients means 1 GB upstream from server - which is CPU demanding and network transit is also huge.

Read the rest of this entry »

Basics of P2P in Flash

May 31st, 2009

This videotutorial explains the basics of working with P2P (peer to peer) in Flash Player 10.

I made this tutorial with focus on simplicity of this fantastic feature of Flash. There are bunch of articles and examples in the world showing how to create your own P2P app, but most of them are very complex or hard to catch.

In this tutorial you’ll get idea how to connect two different peers and exchange data between them with ActionScript 3.0 and Flex only.

- familiarity with ActionScript 3 and Flex Framework
- Flash Player 10 Debug version installed download
- Flex Framework 3.3+ download

P2P in Flash

Videotutorial: (20 min.) 
Try: P2P demo (run in two browsers, explained in video)
Source: download

Note: Programatically the main P2P logic is not to connect peers together just via NetConnection, but by defining peerIDs to NetStream.
PS: don’t forget to change your Flex Compiler settings to use Flash Player 10
Btw: nice P2P Mill Game done by my friend Pavel Šimek 

Good Luck!