**** Web Game Developer Bnk ****

Good Coders Only

IRC Protocol

A little Background on IRC

IRC stands for Internet Relay Chat and is a client/server mechanism to allow users to chat, which in most cases really means keyboard typing of text, on the Internet. The IRC protocol is a text-based protocol, with the simplest client being any socket program capable of connecting to the server. Typically, an IRC server, such as WiRC, often resides on the same machine as the HTTP server (such as IIS). If a user connects to the IRC server via a IRC Client they are able to chat with any other IRC client connected to that server on the same channel. If it helps to make the concept more clear then just think of channels as a “party line socket” dedicated to a particular purpose or topic. Normally what is typed in the IRC client is broadcast to all other users, via the IRC server, on that particular channel. Specific commands also allow private messages on these same channels and the message can be addressed to a specific person on that channel if need be. For more information on the technical specification and commands available to the IRC Protocol see RFC 1459 for which a link is provided at WebGameDeveloper.Com.

On The Subject of Game Bots.

Currently IRC games on the Internet are either ran and controlled by humans in a head-to-head or moderated fashion, or by game bots. What are Game Bots? A game bot is best defined as an IRC Game client which manages game action on a particular channel. Unlike the human clients they can stay on that channel 24 hours a day 7 days a week. When we refer to a Game Bot we are really talking about a automated game client which closely resembles a server but does not deal with the same Winsock complexities that most servers do.

How can IRC be used by Web Game Developers?

The strength of IRC is in it’s ability to host many different types of games on multiple channels at the same time. You don’t have multiple servers as you do in regular client/server games. Just one IRC server which acts as a switchboard or broadcaster for multiple game clients/bots plugged into it. The IRC Server is responsible for handling the communications between clients/bots, not you. This allows tremendous flexibility currently unknown with HTTP servers such as IIS. You don’t design the IRC server you just use it’s communication services by having your client or Bot start up it’s own channel and manage it. Upon startup of the IRC client/Game Bot you are assigned a channel and those who want to play share that channel. Simple? You bet and it’s that simplicity that makes life a whole lot easier on us Web Game Developers! In the design of IRC based web games essentially you have three design options:

(1). Design human only clients. In this mode one of the clients would start up the channel from a users computer and be responsible for managing the channel and the overall game as well as playing it. Each additional client that would join the channel would then be prohibited from closing down the channel or managing it but still be able to play the game. This is an excellent choice for head-to-head style games between players who all come on at the same time and for a relatively short duration. In this option there is nothing on the server machine at all. The Internet or LAN version of DOOM would be a good example of this type game and with the same limitations and strengths.

(2). Design a client which can be toggled to be either human only as above OR a game bot depending upon configuration options. If designated a game bot it would run constantly and be on the server machine. This would be a good choice for wide area games, long duration games or turn based games.

(3). Design a human client and a separate game bot client. While more complex and time consuming to develop this would possibly allow for much smaller human clients since they would not have unused code in them which could be considerable in some cases.

A few drawbacks to IRC

Like every other Internet protocol this one also has it’s drawbacks. For one it’s a text based protocol which means you will have to parse what’s sent to you and what you send out. Parsing will slow things down a bit. Another problem, if you intend to develop game bots, is that not every HTTP server operator has an IRC server. On the other hand IRC servers are relatively inexpensive these days I don’t see this as a major drawback. If the game is good enough they will buy an IRC server if they think it’s worthwhile enough and will draw attention to their web sites. Also important to note is that you will need a IRC server on your bench test computer to test out your IRC game clients. A link to a very good and inexpensive one can be found at WebGameDeveloper.Com.

Summary

When I started the research for this article I probably knew less about IRC then you do. After completing my research I became convinced that this protocol, while not well understood by many developers, is probably the best of the many Internet protocols from the perspective of Web Game Developers and holds the key to Internet Web Game diversity and quality. It offers simplicity and ease of use which is more then can be said for the other protocols or content delivery mechanisms (ie; CGI, ISAPI, etc..) and I highly recommend that you consider it using it for your own web game creations. For more information and resources on the subject just go to WebGameDeveloper.Com.