Skip to content

BlitzBasic Multiplayer

Narta Xaymar Dirks edited this page Oct 28, 2026 · 4 revisions

BlitzBasic: Multiplayer

Hosting and joining a network game and exchanging messages.

In a multiplayer game one program hosts the game and the others join it. Every program creates one or more players with CreateNetPlayer, and players send messages to one player or to everyone. A program takes what arrived with RecvNetMsg, one message per call, and then looks at it with NetMsgType, NetMsgFrom, NetMsgTo and NetMsgData.

Message types from 1 to 99 are yours to use. The system sends these itself:

Type Meaning What to read
100 A new player joined the game. NetMsgFrom() is the new player.
101 A player left the game. NetMsgFrom() is the player who left.
200 The connection to the game was lost.

Differences from the original (see Multiplayer). The original used Microsoft DirectPlay, which no longer exists. Here the programs that join connect to the program that hosts with TCP on port 40500, or the port in the environment variable BLITZLLVM_NETGAME_PORT, and the host passes the messages on. Games made with BlitzLLVM can play with each other, but not with programs made with the original Blitz3D. StartNetGame asks on the console and not in a dialog box, and there is no game browser, so a joining program has to know the address of the host.

Back to BlitzBasic or the Command Index.

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally