User Tools

Site Tools


This is an old revision of the document!

Networking/Online Multiplayer

Setting up your game for online multiplayer is considered an advanced topic, so it is recommended that you familiarize yourself with 001 Game Creator in general before attempting to implement this.

An online game generally consists of multiple instances of a game running at the same time, where one instance of the game is considered the server whom hosts the game, and the rest of the instances of the game are considered the clients whom connect to the server.

The mechanism used for network communication is TCP/IP using BSD sockets.


The following is an overview of the procedure of how online multiplayer games function in 001 Game Creator:

  1. Two or more instances of the game are run at similar moments in time.
  2. The server, determined by using a “Comparison Branch” event with the “Is Server” use value, hosts the game using the “Host Server” event.
  3. A client thereafter connects to the server using the “Connect to Server” event.
  4. When the server receives a connection, the “Connection Received” system trigger is executed on the server with a parameter variable “ip” containing the IP address of the connecting client and a parameter variable “id” containing a unique number identifying the client (which can be used in other events).
  5. Once the client realizes that it has made the connection, the left branch of the “Connect to Server” event continues to execute.
  6. The server and client may freely communicate using Network Messages. That is, the server can execute a network message event causing all clients or a specific client to run the script inside. And vice versa, the client can execute a network message event causing the server to run the script inside.
  7. The server, at any point in time may close the connection using the “Close Connection” event; this can be based on the “ip” value provided by the “Connection Received” system trigger. The client, at any point in time may close the connection in the same way.

IP Address

During the development process, you should use the IP address “” for the purposes of hosting and for connecting. This is also called “localhost” and is used to essentially loop-back the connection from one instance of the game to another on the same local machine.

When the game is ready or when you're wanting to play the game across the network, you should use an empty IP address for hosting on the default Ethernet adapter, or use the IP address of the network adapter desired. Clients should then use the IP address of the server to connect.

Client and Server Roles

During the development of your game, 001 Game Creator offers an option for you to execute multiple instances of the same game by using the “Launch instances for network games” option within the testing options. When the value is 2 or higher, the first instance will be considered the server and the second instance will be considered the client. That is, “Launched as Server” (formerly called “Is Server”) use value will return true for the first instance and false for every other instance. However, if you simply execute the same game multiple times on the same computer once the game is built, each instance will be considered a client unless the game is built as a dedicated server.

Regardless of whether the game is launched as a client or server, any instance may either host a game (become the server) or connect to one (become a client). However, this will not change the respective use value. This allows you to setup a game where any user of your game can either be the server or a client, simply by allowing the user to make that choice.

Generally, the server makes final calls about whether a client moves to a particular location, damages another player, and so forth. A client generally receives information about the game/map from the server, and sends general commands or intermittent states to the server to delegate to everyone.


When the server receives a connection from a client, it would probably be wise to have the two communicate a bit before throwing everyone into the game. For example, the server can take this opportunity to validate the IP address of the incoming connection, or wait for a secret password from the client to enter a particular game. It all comes down to how the game designer intends to validate a player and what information the server and client need to know about each other.


Most gameplay elements should be transmitted as they happen or change. However, movement is particularly susceptible to noticeable performance issues because of common network issues, such as low latency situations or bandwidth limitations.

A simple solution for handling movement, is to intermittently have the client inform the server of its current location. The server can simply relay this back to the other clients and those clients can merely use a “Walk to Location” event to that new location. It will look just as good as what the other client probably performance, but reduces the amount of data transmitted over the network.

Security and Cheating

Because 001 Game Creator allows you to design how networking actually functions, there is no particular way for it to prevent cheating or hacking. It is the responsibility of the game designer to script things in a way that is most fitting.

In terms of security, it is best to not transmit plain text passwords - consider using hash or encryption algorithms. And in terms of cheating, it is best to validate the network messages that are received from other clients to ensure that the information is reasonable. For example, if a player reports being in one position, but then quickly in another, unrealistic position across the entire map based on a distance calculation, it would be best to trigger some action that would kick the player or report it to a moderator.

networking.1469466859.txt.gz · Last modified: 2016/07/25 12:14 by Mike