Note About This Book: Advanced Lingo For Games was written by Gary Rosenzweig in 2000 for users of Macromedia Director 7. It is presented here for free on an as-is basis, with no updating. Most of the information and code here can be used in the most recent version of Director. The book has been reproduced from the final editing files archived in 2000, and not the final proof galleys. So some minor differences between this version and the printed version my exist. The entire contents of this book are Copyright 2000, Gary Rosenzweig. No part may be reproduced or copied without written permission. The text here is provided for individual use only.
Want to thank me for making this book available for free? Just buy Special Edition Using Macromedia Director MX and we'll call it even!

Advanced Lingo For Games
by Gary Rosenzweig


Chapter 25 Section 5

Game Variations

This game is only the tip of the iceberg for multliplayer games. Think of every two-or-more player game you have ever played in your life and how it can be adapted as a multiplayer game like this one. Also, think of the possibilities for original games.

To close this chapter, I would be remiss if I didn't go in to the many ways that this game can be improved.

Input Validation

Right now the game doesn't check the player's name or chat lines for valid input. You probably want to make sure that the player entered some sort of name, at least two characters, before letting them join the lobby. You also want to restrict the length of their name, perhaps to 16 characters.

In addition, you also might want to check to make sure the player does not send a blank line of text to the chat room, nor can they send a line of text that is too long. On the other hand, you might want to allow multiple lines of text, in which case you want to make sure the chat text member can handle text lines that wrap.

You also might want to filter the chat text to take out curse words or such. If the site is for children, you might even want to prevent the player from typing text of their own, but instead have them pick from a list of lines like "Hello," "Anyone want to play?", and so on.

Cancellation

One improvement that you can add is to allow the challenging player to cancel the challenge. Just include a "Cancel" button on the "wait" frame that returns this player to the lobby. It also has to send a new message to the player being challenged to let them know that they missed their chance.

Multiple Challenges

The way the game is set up now, more than one person can challenge a single player. You probably want to put a stop to this by noting when a player is being challenged, and when the second challenge message arrives automatically send back a "busy" message.

Better User Identification

Right now, each user is identified by the name they give. What happens if there are two "Bob"s in the room? You want to avoid this at all costs.

One way to do it is to not allow a second person on the server that uses the same name. You could check the server for someone with that name, and then alert the player to pick another name instead.

A better way to handle this would be to use something besides the player's name as their identification on the server. You could use that player's IP address, as obtained by the getNetAddressCookie function. In this case, you want to send along the player's chosen name to the other players, so that this can be listed in the lobby user list. However, you want to store the IP addresses of each user in a hidden list and refer to the players by IP address rather than their username. This can get tricky, but it is the best route for an expert Lingo programmer.