MultiPlayer Tutorial Part I

This tutorial will look at a complete set of menu scripts for a multiplayer game. It will allow the player to start a single player (or skirmish) game with bots as team mates/opponents, create a server game with some or all bot players and to join a game on another computer. The mod we will be using is the Freeze Tag mod but the scripts can be easily and quickly changed to support any other mod. Freeze Tag was chosen because it is a small mod that still is supported by other servers. The media in this tutorial is mostly original, with a few graphics borrowed from the Freeze Tag web site, and it can be used in your menus if desired.

Script Files

The multiplayer menu system consists of two parts, the non-ingame menus and the ingame menus. The non-ingame menu file names are prefaced with out_ and the ingame menu file names by in_. The file menus.txt is used to load the non-ingame menus and the file ingame.txt loads the ingame menus. Let's take a look at these files more closely.

In menus.txt we load the following files :

  • out_main.menu - contains the main menu and the assetGlobalDef section.
  • out_play.menu - contains the play menu.
  • out_demo.menu - contains the demo menu.
  • out_credits.menu - contains the credits menu.
  • out_controls.menu - contains the controls menu.
  • out_setup.menu - contains the setup menu.
  • out_mod.menu - contains the mod menu.
  • out_connect.menu - contains the connect menu.
  • out_quit.menu - contains the quit menu.
  • out_createserver.menu - contains the createserver menu.
  • out_default.menu - contains the default menu.
  • out_error.menu - contains the error_popmenu menu.
  • out_favorite.menu - contains the addfavorite, delfavorite and the newfavorite menus.
  • out_findplayer.menu - contains the findplayer menu.
  • out_game.menu - contains the game menu.
  • out_join.menu - contains the join menu.
  • out_look.menu - contains the look menu.
  • out_misc.menu - contains the misc menu.
  • out_morevideo.menu - contains the morevideo menu.
  • out_move.menu - contains the move menu.
  • out_multi.menu - contains the multi menu.
  • out_password.menu - contains the password menu.
  • out_player.menu - contains the player menu.
  • out_serverinfo.menu - contains the serverinfo menu.
  • out_shoot.menu - contains the shoot menu.
  • out_skirmish.menu - contains the skirmish menu.
  • out_sound.menu - contains the sound menu.
  • out_teams.menu - contains the teams menu.
  • out_video.menu - contains the video menu.
  • out_weapon.menu - contains the weapon menu.

In ingame.txt we load the following files :

  • in_main.menu - contains the ingame menu.
  • in_controls.menu - contains the incontrols menu.
  • in_setup.menu - contains the insetup menu.
  • in_quit.menu - contains the inquit menu.
  • in_addbot.menu - contains the inaddbot menu.
  • in_default.menu - contains the indefault menu.
  • in_game.menu - contains the ingame menu.
  • in_look.menu - contains the inlook menu.
  • in_misc.menu - contains the inmisc menu.
  • in_morevideo.menu - contains the inmorevideo menu.
  • in_move.menu - contains the inmove menu.
  • in_player.menu - contains the inplayer menu.
  • in_serverinfo.menu - contains the inserverinfo menu.
  • in_shoot.menu - contains the inshoot menu.
  • in_sound.menu - contains the insound menu.
  • in_start.menu - contains the instart menu.
  • in_video.menu - contains the invideo menu.
  • in_weapon.menu - contains the inweapon menu.

You will notice that, even though a menu may be identical in both the non-ingame and ingame (the quit menu for example), you can not share it between them. Therefore, the non-ingame section has the quit menu while the ingame section has the inquit menu. The only difference between the two menus is their name but it must be done this way to avoid strange things from happening.

The assetGlobalDef Section

The assetGlobalDef section of our menu system is defined in the out_main.menu file. The settings and assets defined here are used by all the menus, be they non-ingame or ingame.

    assetGlobalDef 
    {
      font "fonts/font" 16
      smallFont "fonts/smallfont" 12
      bigFont "fonts/bigfont" 20
      cursor "ui/assets/3_cursor3"
      itemFocusSound "sound/misc/menu2.wav"
	
      fadeClamp 1.0
      fadeCycle 1
      fadeAmount 0.1
    }
        

There is nothing special defined in this section that wasn't already explained in the Global Asset Definition section. We define the fonts to use, define the cursor graphic, set the item focus sound and set the fade values.

The Menu Style

The style of this menu is similar to most multiplayer games in that you can only access a submenu from a specific menu. This is different than what we used in the Single Player Tutorial, where the major menus were accessable from all menus. Here, you can only access, say, the Credits menu from the main menu and nowhere else. This simplifies the menu system somewhat and allows us to use popup menus as they were designed to be used. We will also be using overlay menus rather than showing and hiding groups of items, like we did in the Single Player Tutorial. This requires us to have many more menus (and menu files) but it does simplify each menu, making them easier to understand.

The Menu Background

The non-ingame menus all share a common background, the swirling smoke, created by the background and smoke items. The ingame menus have no background at all and are overlaid on the view of the game. Those non-ingame menus that consist of only buttons accessing other menus also have a Quake 3 snowflake and mod title, created by the flake and title items, as part of their background. These items are ordinary color and graphic items and are covered in the Backgrounds, Graphics, Text and Models examples, found here.

Part II : Main, Credits, Quit and Play Menus

 

[Part I] [Part II] [Part III] [Part IV] [Part V] [Part VI] [Part VII] [Part VIII] [Part IX] [Part X]

 

Return to Home Page