|
Unity 2 Multiuser Development Kit (Unity 2 MDK) is a complete framework for creating and deploying multiuser applications for Adobe's Flash platform. Unity 2 MDK includes:
 |
Unity 2 Multiuser Server
A server-side development framework and multiuser socket server. (The Unity 2 Multiuser Server is also available separately for use with Unity 2 App Packs and non-Flash clients.)
|
 |
UClient for Flash
A client-side development framework that lets Flash developers create multiuser applications entirely with ActionScript, without writing a single line of server-side Java code. |
See what you can make with Unity 2 MDK in the Unity Application Showcase.
Unity 2 MDK pricing and ordering information is available here (commercial, academic, and artist licences offered).
Unity 2 Multiuser Server requirements:
- Minimum Pentium II, 400Mhz or equivalent processor
- Java 1.3 or higher running on Unix, Macintosh OSX, or Windows
- Ability to bind to a port
UClient for Flash requirements:
- Adobe's Flash authoring tool (version 6/MX or higher)
- Some source files are available in Flash 2004 and ActionScript 2.0 format only
- Flash Player 6 or higher
As an owner of Unity 2 MDK, you will have direct email access to the creators of the product. We will do everything in our power to assist you if you have problems installing or using Unity 2 MDK. The creators of Unity 2 MDK are also highly active on the developers' list, unity-dev. If you have any questions about Unity 2 MDK, feel free to email us at unity@moock.org.
Unity 2 MDK is more than just a "socket server" or a "chat application"--it's a general philosophy for multiuser application development.
Unity 2 MDK was developed over the course three years and thousands of hours by Java expert Derek Clayton and renowned Flash developer, Colin Moock (author of the bestselling O'Reilly books, ActionScript: The Definitive Guide and Essential ActionScript 3.0). Unity 2 MDK is a deeply considered framework for creating multiuser applications.
The theory of Unity 2 MDK is surprisingly simple: all multiuser applications include groups of connected users that communicate by sharing data and invoking methods on each other. Correspondingly, Unity's core concepts include:
- clients (users connected to the server)
- rooms (groups of clients)
- namespaces (groups of rooms)
- room attributes (shareable and storable data pertaining to rooms)
- client attributes (shareable and storable data pertaining to clients)
- remote method invocation (invoke methods on any user, or on the server)
If you're new to multiuser application development, Unity 2 MDK's architecture will give you the guidance you need to create your application. If you're experienced at multiuser application development, you'll save valuable time using Unity 2 MDK--you'll be amazed at how much of the dirty work Unity 2 MDK handles for you.
Here's a high-level look at Unity 2 MDK's feature set. For implementation details and more features, please see Unity 2 Multiuser Server, UClient for Flash, and the Unity 2 MDK documentation.
- Easily build sophisticated multiuser applications entirely in Flash, without server-side or Java knowledge.
- Create any kind of multiuser application (not just games or chat) with a completely generic multiuser toolkit.
- Deploy ready-to-use Flash apps, including: SimpleChat, MultiRoom Chat, and Tic Tac Toe.
- Customize existing samples or develop from scratch.
- Permanently store data in a database or to the file system (MySQL support included or write your own data storage implementation).
- Manage up to 2000 concurrent user connections (depending on application demands, CPU speed, memory, network load, and machine thread limits).
- Group users in different rooms.
- Automatically share data between users, or execute code on other users.
- Kick and ban users via an administration tool.
- Auto-kick idle users (configurable).
- View connected users and rooms in a web-based server admin tool.
- Run multiple applications simultaneously on the same server.
- Debug with extensive, configurable client and server logging.
- Develop clients in Flash, Java, C++, or any other socket-based platform.
- Learn the art of multiuser application development from detailed Flash tutorials and Java tutorials.
A "room" is a place for a discrete group of users to communicate amongst themselves without interfering with other users on the server. Typical examples of rooms include:
- a chatroom based on a specific topic (e.g., snowboarding or computers)
- a chess game room that manages gameplay between two users
- a stock-ticker room that broadcasts server-side updates to all connected clients
Unity 2 MDK represents rooms as objects both on the server and on Flash clients. Here are just some of the room-related features offered by Unity 2 MDK:
- Server automatically synchronizes room list on all connected clients (i.e., notifies clients when a room is added or removed).
- Server automatically sends user list for each room to connected clients (i.e., notifies clients when a user joins or leaves a room).
- Server automatically sends a client count for each room to connected clients.
- Rooms can be predefined in a server config file.
- Rooms can be created and removed by custom server code at runtime.
- Rooms can be created or removed remotely by clients! (Use the built-in UClient ActionScript API or a custom client call.)
- Users can join multiple rooms at a time.
- Multiple rooms can be grouped into separate namespaces for bulk communication and to prevent naming conflicts.
- Room-based data can be stored in "room attributes". Perfect for storing a gameboard, a highscore, the contents of a shared whiteboard, or a room welcome message.
- Room attribute changes can be automatically broadcast to clients in a room.
- Room attributes can be saved to a database and auto-loaded next time Unity starts.
- Rooms can be password protected individually for private interactions.
- Rooms can be temporary (die after last user leaves) or permanent (die only when explicitly removed).
- Rooms can define a maximum user occupancy. For example, a two-player game room could restrict more than two users from entering.
In Unity 2 MDK, a "user" is a single client application connected to the server (also called, simply, a "client"). Users can interact with each other by sharing data or invoking methods on each other. Users can interact with the server by sending messages to it either in Unity's standard format or in a custom format.
User-centric features include:
- Call methods directly on remote users. (Use the built-in UClient ActionScript API or a custom client call.)
- Share user-specific data in "client attributes"; perfect for storing a user name, a user's drawing pen color, the contents of a user's shopping cart, the time of the user's last connection, an avatar position, or a user's game inventory.
- Save client attributes to a database and auto-load them next time the user logs in.
- Private messaging (just one application of the remote method invocation service).
- Register or login users with a single method call. (Use the built-in UClient ActionScript API or a custom client call.)
For more detailed information about Unity 2 MDK, see:
- Does Unity support ActionScript 3.0?
Not yet. An ActionScript 3.0 version of UClient for Flash is under development, and will be released with the theoretical next version of Unity, codenamed Phoenix. No release date for Phoenix has been announced. To be notified when Phoenix ships, please join the unity-news mailing list. Note that we have no plans to provide ActionScript 3.0 support for Unity 2.0. All ActionScript 3.0 libraries will require the Unity 3 (Phoenix) server.
- Will moock.org host my Unity application?
No. But we have made hosting arrangements with other ISPs.
- What's the difference between Unity 2 MDK and Adobe's Flash Media Server (FMS)?
FMS and Unity 2 MDK can both transfer data between multiple users over a persistent TCP/IP connection. However, beyond simple data transfer, there are significant differences between the products:
- In addition to data sharing, FlashCom supports video and audio conferencing.
- Unity 2 MDK uses XML messages to communicate with Flash. FMS communicates with a custom protocol called RTMP, which lets it invoke methods remotely on server-side and client-side objects.
- By default, FMS uses server-side ActionScript for server-side scripting. Unity uses Java. However, both Unity and FMS can communicate with other languages and server-side applications.
- FMS is clusterable (it can be distributed over multiple server machines to balance large loads). Unity applications are limited to a single machine.
- Unity 2 MDK provides a large generic library of classes to manage multiuser application development. This provides object-oriented access to core concepts such as users, rooms, user attributes, and room attributes. FMS doesn't offer a high-level development API, but does provide a series of ready-made components for adding common features (such as a chat window) to an application.
- FMS is intended for use with Flash only. Unity 2 Multiuser Server can be used with any client technology that supports persistent TCP/IP sockets, such as Java or C++.
- When should I use Unity and when should I use FMS?
Price and audio/video are the major determining factors. For example, if your application does not require audio/video sharing and has less than 100 simultaneous users, you can create it with Unity 2 MDK for US$139.99. FMS pricing for a data sharing edition starts at US$4500 (see FMS pricing info). However, if you are creating an enterprise level application that will stream video of, say, IBM's quarterly report to 10,000 stockholders, then you'll definitley need FMS. If you are having a hard time figuring out what multiuser technology to use, feel free to ask our opinion at unity@moock.org.
- Does Unity work with Flash clients only?
No. Like most Flash socket servers, unity works with any client that connects to a TCP/IP socket. By default, Unity expects a zero-byte to indicate the end of a transmission (as required by flash), but that character is configurable.
- Can I connect to Unity securely?
No, XMLSocket in Flash does not provide any encryption, therefore, Unity does not provide encrypted communications. Brian Lesser has an article on logging into a Flash Communication Server application using an HTTPS-issued ticket. His technique applies equally to Unity, though some of the implementation details are different.
- Can Flash clients connect to Unity through a firewall using HTTP tunneling?
As of Flash Player 7.0.19.0, it is possible to connect to Unity on port 80, but Unity does not yet have a special tunneling feature (which would wrap both client and server XML communication in HTTP headers in order to pass through a firewall or packet-sniffer that restricts traffic to valid HTTP only).
In Flash Player 7.0.14.0 or older, Flash's XMLSocket requires a TCP/IP port of 1024 or higher, so it cannot connect to port 80 to perform HTTP tunneling. Some socket servers circumvent this XMLSocket port limitation with polling, where Flash uses XML.load(), XML.send(), and XML.sendAndLoad() to repeatedly send normal HTTP requests to the server, attempting to simulate a persistent connection. Despite the fact that some socket servers call their polling implementation "HTTP tunneling", polling is not the same as a tunneled XMLSocket implementation. Generally speaking, polling adds quite a lot of lag to an application, making it much less responsive than its XMLSocket counterpart. Polling is not suitable for applications that require near-realtime responsiveness, so we do not currently plan to implement it. However, polling can be useful in applications where responsiveness is not critical. We'll, therefore, continue to evaluate it for future releases.
- What's the maximum number of clients that can simultaneously connect to Unity?
The maximum user count is greatly affected by 1) the memory on the machine running Unity, 2) the amount of data traffic in the Unity application, and 3) the thread limit on the machine running Unity. In an average setup, Unity can handle about 500-1500 concurrent client connections (see the Unity load tests). More users can be supported by adding more machines. However, the Unity server is not clusterable, so a client on one machine can share data only with other clients on that machine; clients cannot communicate across machines. Multi-machine Unity applications must be coded to automatically select a server that is not full or to provide a GUI allowing the user to select an available server.
- How fast does a Flash client communicate with the server?
Over DSL, a typical total round-trip time for a Unity message to be sent to the server from Flash (Player 7), received by the server, returned to Flash, and parsed ready for use is about 100ms (ten messages per second). On fast machines with high bandwidth, the round-trip time will be faster; on slow machines and low bandwidth, the round-trip time will be slower. Locally, on a test machine running both the server and the client, the round-trip time is anywhere from 0 to 15ms (test machine is a Pentium4-2.6, with 1Gig ram).
- Can Unity display multiple character sets (i.e., Japanese, Russian, English, etc)
Yes. Since version 6, Flash Player has been able to display most of the world's languages. However, in order to transfer, say, a Japanese character from one user to another, the sender's operating system must support Unicode, the server's operating system must support (and be using) Unicode, and the receiver's operating system must support Unicode. Windows XP and Mac OSX both support Unicode natively, as do most recent versions of Unix/Linux. However, on some *nix systems, Unicode may not be set as the default character set. In such a case, the Unity server can still use Unicode by specifying the character encoding as a startup option, as follows:
-Dfile.encoding=UTF-8
Here's an example startup command that starts the server with Unicode support:
$java -Dfile.encoding=UTF-8
-cp lib/xerces.jar:lib/xml-apis.jar:lib/unity_core.jar:lib/log4j.jar:lib/
jdom.jar
-Dlog4j.configuration=file:ss.lcf org.moock.unity.core.Unity start &
Here's a screenshot showing different languages being used in a Unity Flash client.
- Are there any other server/client frameworks for creating multiuser Flash applications?
Yes. Two products we respect are ElectroServer and Red5.
Other questions? email us.
|