E-book details

Flash Multiplayer Virtual Worlds. Build immersive, full-featured interactive worlds for games, online communities, and more

Flash Multiplayer Virtual Worlds. Build immersive, full-featured interactive worlds for games, online communities, and more

Makzan Makzan (Mak Seng Hin), Seng Hin Mak

Ebook
Flash virtual worlds are some of the most exciting—and profitable—online business being built today. Using Flash, developers can build interactive environments where users can interact with the virtual world and one another, compete, and have fun. Creating a playful environment on an electronic network presents unique challenges as you combine a fun, upbeat frontend with some serious and complex server logic.

This handy book assists you in building amazing virtual worlds in no time by implementing ActionScripts in a Flash IDE. With this book in hand, you will build virtual worlds that have avatars walking around and interacting with non playing characters, completing challenging quests, and allowing users to link with real-world friends.

The fun begins with first exploring existing virtual world games such as Club Penguin, Mole, Dofus, and World of Warcraft. We will then design our virtual environment. Then we will create avatars and move the avatars in the virtual world. We will add some triggers to add amusement and life to the virtual world. We will allow the avatars to interact with other players and create a buddy list for each user. Then we will integrate buildings and other environment to the virtual world. We will also let the players interact with non-player characters to complete some tasks. Finally, we move on to add interesting quests to the virtual world, which need to be accomplished by the player to gear up to the next level of the game.

This example-rich, hands-on guide sequentially develops a multiplayer virtual world—the platform, the environment, quests, avatars, non-playing characters, and interaction between them.
  • Flash Multiplayer Virtual Worlds
    • Table of Contents
    • Flash Multiplayer Virtual Worlds
    • Credits
    • About the Author
    • About the Reviewers
    • Preface
      • What this book covers
      • What you need for this book
      • Who this book is for
      • Conventions
      • Reader feedback
      • Customer support
        • Errata
        • Piracy
        • Questions
    • 1. Developing Flash Virtual World
      • What is a virtual world?
        • Using virtual world for business
        • Using virtual world for education
        • Using virtual world for game
      • Background
      • Benefit of using Flash to build virtual world
      • Connecting players in a virtual world
        • A brief introduction to transport protocols
        • Peer-to-peer
        • Client-server network
          • Polling
          • Socket-based connection
      • Socket server
      • Available socket servers for Flash
        • SmartFoxServer
        • ElectroServer
        • Flash Media Interactive Server
        • Red5
        • Writing your own socket server
        • Choosing the right server
      • Application architecture of a virtual world
      • The whole picture of virtual worlds
      • Common features in virtual world
        • Avatar
        • World to explore
        • Home
        • Items
        • Quests
        • Non-player characters
        • Social features
      • Casual game design versus MMOG
      • Existing virtual world games
        • Club Penguin
        • Mole
        • Dofus
        • World of Warcraft
      • Summary
    • 2. Installing the Servers
      • Comparing SmartFoxServer Lite, Basic, and Pro
        • SmartFoxServer Lite
        • SmartFoxServer Basic
        • SmartFoxServer Pro
          • Modifying the behavior of server
          • JSON/Raw data protocol
          • Accessing the database directly
        • Comparing different package options
      • Developing and deploying virtual world environment
        • Adjusting server setting for the deployment environment
          • Hosting SmartFoxServer, web server, and database in one server
          • Hosting SmartFoxServer in dedicated standalone server
          • Benefiting from setting up SmartFoxServer, web server, and database in different machines
        • Setting up the development environment
      • Installing Java Development Kit
        • Installing JDK On Windows
        • Installing JDK on Mac OSX
        • Installing JDK on Linux
          • Installing for General Linux
          • Installing for Ubuntu Linux
      • Downloading SmartFoxServer Pro
      • Installing SmartFoxServer Pro
        • Installing on Windows
        • Installing on Mac OSX
        • Installing on Linux
      • Running the SmartFoxServer
        • Starting SmartFoxServer on Windows
        • Starting SmartFoxServer on Mac OS
        • Starting SmartFoxServer on Linux
      • Using embedded web server and database
        • Running the embedded web server
        • Running the embedded database server
      • Downloading third-party HTTP and database server package
        • Installing WAMP on Windows
        • Installing MAMP on Mac OSX
        • Installing LAMP on Linux
      • Connecting SmartFoxServer and MySQL server
        • Downloading JDBC Driver for MySQL
        • Setting up the JDBC driver
      • Configuring the server settings
      • Configuring MySQL server connection in SmartFoxServer
        • Restarting the server
      • Running examples
        • Loading a simple chat application
      • Setting up the administration panel
      • Logging in to administration panel
      • Locating the Flash Client API
      • Summary
    • 3. Getting Familiar with SmartFoxServer
      • Configuring a basic SmartFoxServer
        • Overview of the configuration file structure
        • Configuring the server
          • Automatically binding all available IP addresses to server
          • Listening port for connections
          • Setting policy load data from machines in other domains
          • Setting timers for idle user logouts
          • Blocking bots connections
          • Setting administrator login and password
          • Limiting access of the administration panel to specific IP addresses
          • Displaying zone information before connecting to the server
          • Defining the information separator in raw protocol
        • Configuring the Zones and Rooms
          • Configuring a zone
            • Naming your zone
            • Assigning default names to users
            • Broadcasting the user count
            • Limiting the users that can connect to a zone
            • Limiting numbers of rooms in a zone
            • Limiting the number of rooms a user can create
            • Getting all room variables along with room list requests
          • Setting moderators for the zone
          • Creating rooms
            • Regular room
            • Game room
            • Limbo room
          • Properties of a room
            • Comparing the available properties of each room type
      • Introducing the events of rooms
        • Comparing the available events of each room type
      • Debugging in local machine
        • Downloading the latest debugger version of Flash player
        • Creating the mm.cfg file
        • Testing the debugger log
        • Locating the Flash log output file
        • Reading the Flash logfile
          • Open the flashlog.txt in web browser
          • Using a Firefox add-on to read the Flash logfile
            • Reading the log with FlashTracer
            • Reading the log with FlashBug
          • "Tail" the trace log file in terminal
      • Flash Security Sandbox
        • Configuring master socket policy server
        • Configuring SmartFoxServer to send socket policy
        • Loading policy file from Flash client
        • Enabling the network access for the Flash document
        • Keeping updates to Flash player security policy
      • Creating a Flash document to connect to the server
        • Logging into a zone
      • Creating a cooperative drawing whiteboard
        • Testing the cooperative whiteboard
      • Summary
    • 4. Creating Map and Ground in Isometric View
      • Comparing different game views
        • Top-down perspective
        • Side-scrolling view
        • 3D view
        • Isometric game view
      • Getting an isometric projection view
        • Isometric coordination
      • Making an isometric map
        • Creating the base tile of an isometric map
        • Creating a basic isometric tile map
        • Drawing seamless shore border
        • Texturing an isometric map
        • Texturing a big map
      • Converting between screen coordination and isometric map coordination
      • Building a map editor
      • Summary
    • 5. Creating Avatars
      • Designing an avatar
        • Determining the direction numbers of avatars views
        • Rendering avatars in Flash virtual world
          • Drawing an avatar using vector animation
          • Rendering avatars using bitmap sprite sheet
          • Rendering avatars using real-time 3D engine
          • Rendering avatars using 2D bone skeleton
        • Drawing an avatar in Flash
          • Drawing the idle and walking animation
        • Creating an avatar class
        • Logging in SmartFoxServer with avatar
        • Using user variables in virtual world
        • Adding name to the avatar
      • Customizing your avatar
        • Customizing different styles
        • Customizing the color
        • Adding customization to avatar class
        • Designing a customization panel
        • Making our customization panel
        • Integrating the customization into SmartFoxServer
      • Summary
    • 6. Walking Around the World
      • Creating the world
      • Holding states of the player
      • Moving the avatar
        • Movement synchronization
        • Making avatar able to walk
        • Walking by keyboard
      • Introducing path finding
        • Implementing A* search
        • Understanding the heuristic function
        • Balancing between accuracy and speed
      • Walking by mouse click
      • Broadcasting where you walked
      • Scrolling the world
      • Saving the position for next time
        • Creating an avatar database table
        • Creating a new zone in config.xml
        • Programming our first server-side extension
        • Saving and loading last position
      • Summary
    • 7. Creating Buildings and Environments in the Virtual World
      • Placing buildings on the map
        • Outputting building from 3D software
        • Loading the building map data
      • Ordering the buildings
        • Ordering the movie clips in Flash
        • Determining an object's location and view
        • Shaping the buildings
          • Rendering z-order for l-shaped buildings
          • Rendering z-order for rectangle buildings
          • Rendering z-order for square buildings
        • Creating a loop to sort the z-order
      • Designing a big virtual world
        • Dividing the big world
          • The pros and cons of the seamless world
        • Partitioning the world into rooms
        • Connecting rooms with portals
      • Adding sound to the virtual world
        • Mixing art-based background with tile-based map
      • Building map editor for buildings
      • Summary
    • 8. Creating an Inventory System
      • Classifying items in the virtual world
        • Different types of items
          • Items for avatar
          • Weapon
          • Tools
          • Riding
          • Entertainment
          • Material item
      • Collecting items
        • Collecting items that appear in the open
        • Collecting items that are hidden
        • Getting items after archiving some quests
        • Buying items in virtual shop
        • Trading items with other players
        • Buying from real shop
      • Displaying items in different forms
      • Defining the data structure of inventory items
        • Setting the item ID
      • Implementing inventory in the SmartFoxServer
        • Coding the server-side extension
      • Implementing the item panel
        • Loading the item definition
        • Loading the items list from the server
        • Moving items
        • Implementing the item operation in RAM
        • Creating items
      • Exchanging items with other players
      • Introducing the economy in virtual world
        • Balancing the items virtual economy
          • Setting the price of the items
          • Preventing the inflation
          • Hosting special event
          • Adding fatigue to items
          • Limiting the total amount of high-level items
        • Preventing the virtual economy from affecting the real world
          • Trading with real money
          • Government policy on virtual items
        • The responsibility to maintain a good economy system
      • Summary
    • 9. Communicating with Other Players
      • Communicating using several methods
        • Sending public messages
        • Sending private messages
        • Sending group messages
        • Communicating in real-time voice
          • Potential problems of using voice communication
            • Consumes a lot of server bandwidth
            • Message filtering problem
            • Number of users limitation
            • Logging and revisit problem
      • Chatting with public messages
        • Showing chat bubble
          • Scaling the chat bubble
      • Implementing the buddy list
        • Creating buddy list panel
        • Knowing others with profile panel
        • Dispatching custom event in ActionScript 3
        • Creating an advanced buddy list
          • Adding buddy mutually
          • Introducing the buddy variables
            • Offline buddy variables
        • Creating custom buddy list persistence class
        • Summarizing buddy list configuration setting
      • Sending private messages
        • Capturing private message in server-side with internal event
      • Sharing object data between players
        • Making the trading items system
      • Summary
    • 10. Interacting with NPC
      • Running virtual world smoothly with NPCs
        • Classifying different roles of NPC
      • Placing NPC in virtual world
        • Putting our first NPC in the virtual world
        • Preventing the NPC from disconnecting
        • Resolving a potential problem of using provided NPC feature
      • Advanced SmartFoxServer extension technique
      • Controlling NPC movement
        • Controlling NPC to walk in predefined path
        • Directing NPC to walk using path finding algorithm
      • Talking with NPC
        • Communicating with NPC using text parsing
          • The advantages of text parsing conversation
          • The disadvantages of text parsing conversation
        • Menu-driven conversation
          • The advantages of the menu-driven conversation
          • The disadvantages of the menu-driven conversation system
        • Keyword-based conversation
        • Choosing the right conversation system
        • Designing the characteristic of the NPC
      • Trading with NPC
        • Buying items from NPC
        • Selling items to NPC
      • Summary
    • 11. Designing Quests
      • Introducing quests
      • Triggering quests
        • Getting quests from NPC
        • Getting quests from reading documents
        • Getting quests from collecting items
        • Getting quests from the last quest
      • Setting up server environment for quests
        • Setting up database
      • Designing the quest panels
        • Displaying available quests
          • Getting available quests in server-side extension
          • Displaying the quests in different statuses
        • Displaying quests for the avatar
      • Running daemons for quests
        • Managing quest daemons
        • Creating our first quest Tom's Question
      • Introducing achievement
      • Completing quests
      • Rewarding the players when finishing the quests
        • Rewarding gold
        • Rewarding items
        • Rewarding avatars advancement or experience
      • Extending the quests with mini games
        • Creating the duck shooting game
        • Implementing the duck shooting quest daemon
      • Making the quest system better
        • Avoiding linear quests
        • Indicating the availability of quests
      • Summary
    • 12. Social Community
      • The benefit of using social network features in virtual world
      • The complicated data flow
      • Integrating Facebook platform
        • Setting up Flash Facebook API
        • Registering the virtual world in Facebook
        • Putting the virtual world as a Facebook application
          • Using FBML rendering
          • Using iFrame rendering inside Facebook
      • Authorizing a Facebook account
        • Getting the profile name and picture from Facebook
      • Getting friends list from Facebook
      • Update the Facebook status
      • Sending news feed to Facebook
      • Reading news feed into the virtual world
      • Capture a screenshot and share to a Facebook album
      • Integrating the Twitter platform
        • Publish latest virtual world news in Twitter
      • Choosing the right social network service
      • Summary
    • 13. Deploying and Maintaining Flash Virtual World
      • Hosting the virtual world
        • Hosting that supports SmartFoxServer
        • Hosting SmartFoxServer in dedicated server
        • Hosting SmartFoxServer in cloud service
        • Comparing the hosting solution
      • Scaling up the virtual world
      • Earning money from the virtual world
        • Google AdSense
        • In-game advertisement
        • Monthly subscription
        • Point-based subscription
        • Selling virtual items and virtual currency
      • Operating the virtual world
        • Tracking the cost of maintaining a Flash virtual world
          • Paying the hosting fee
          • Licensing the Socket server
          • Hiring customer service
        • Losing players
          • Losing players at sign up process
          • Losing players at a certain level
          • Losing players after updates
          • Losing players due to the low quality
        • Product lining
      • Analyzing players actions on a virtual world
        • Tracking players actions with funnel analysis
        • Data mining
          • Gathering useful information
          • Logging the data
      • Rapid development with OpenSpace
        • Editing with advanced map editor
        • Raising the avatars from the flat platform
        • Creating custom tile events
      • Updating and patching the virtual world
      • Keeping an eye on the virtual world industry
      • Putting our virtual world in mobile
        • Small screen size
        • Low RAM
        • Relatively slow CPU
        • Limited network bandwidth
        • Benefit of porting virtual world into mobile
      • Extending the virtual world to other platforms
        • Apple iOS
        • .Net and Unity
        • Java and Android
        • Ajax
      • Summary
    • Index
  • Title: Flash Multiplayer Virtual Worlds. Build immersive, full-featured interactive worlds for games, online communities, and more
  • Author: Makzan Makzan (Mak Seng Hin), Seng Hin Mak
  • Original title: Flash Multiplayer Virtual Worlds. Build immersive, full-featured interactive worlds for games, online communities, and more
  • ISBN: 9781849690379, 9781849690379
  • Date of issue: 2010-08-16
  • Format: Ebook
  • Item ID: e_3asp
  • Publisher: Packt Publishing