Skip to content

Multiplayer

Narta Xaymar Dirks edited this page Nov 1, 2026 · 4 revisions

Multiplayer

The multiplayer commands (StartNetGame, HostNetGame, JoinNetGame, StopNetGame, CreateNetPlayer, DeleteNetPlayer, SendNetMsg, RecvNetMsg and the rest) used DirectPlay in the originals, which is no longer available. In BlitzLLVM the programs that join a game connect to the program that hosts it over TCP, on port 40500. The host passes messages on to the other programs.

  • Games made with BlitzLLVM can only play with other games made with BlitzLLVM. They can not join, or be joined by, a program made with Blitz3D.
  • Every package on a connection, whichever kind, is at most 64 KB. A message for SendNetMsg can therefore carry at most 65526 bytes of data, and SendNetMsg gives 0 for a bigger one without sending it. A program that sends a bigger package over a connection is disconnected. The same goes for a program that keeps sending while the other side does not call RecvNetMsg: once more than 64 KB of messages of one of its players are waiting, its connection is closed, and its players are gone for the others (the host sees them leave, a program that joined gets the message that the session was lost).
  • The port can be changed with the environment variable BLITZLLVM_NETGAME_PORT. Every program of a game has to use the same one, and the host needs it to be open in its firewall.
  • StartNetGame shows a dialog that asks whether to host or to join. When joining, the address of the host is asked on the console.
  • The environment variable BLITZLLVM_DIALOG_ANSWER presses a button of a dialog without showing it (0 is the first button), which is meant for automated runs. It answers RequestFont and RequestColor the same way: 0 accepts what they start with, anything else cancels them.

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally