Package and Play Over a Network

Complete Create the Main Menu and Lobby first. The demo now plays from its menu in the editor. This chapter packages it as a standalone Windows game and plays a match between two copies over the network.
1. Prepare the project
Section titled “1. Prepare the project”- Compile and save every Blueprint, and save both maps.
- Select the Sein Level Volume in
LVL_Game, press Bake Level Data, and save. The cook takes the baked navigation, minimap and fog data from it. Every player must run a build cooked from the same bake. - In Project Settings > Packaging, add
LVL_MainMenuandLVL_Gameto List of maps to include in a packaged build. The cook follows everything those maps reference: units, abilities, effects, widgets, meshes and materials.
2. Package for Windows
Section titled “2. Package for Windows”Use Platforms > Windows > Package Project, configuration Development, into a folder outside the project’s source tree. The same build from the command line:
& "<Engine>\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -project="<Project>\SeinDemo.uproject" -noP4 -platform=Win64 -clientconfig=Development -build -cook -stage -pak -archive -archivedirectory="<Output>" -unattendedRead the end of the packaging log for BUILD SUCCESSFUL and check it for errors; an executable in the output folder does not prove the cook succeeded.
The cook stamps a hash of the simulation content into the package. When a match starts, every player’s hash must match, so all players run the same package.
3. Play against the computer
Section titled “3. Play against the computer”Run Windows\SeinDemo.exe from the output folder. The menu opens. Host, set slot 2 to Computer, Ready and Start, then play the whole loop:
| Action | Expected |
|---|---|
| Start | A Barracks, three Soldiers and 500 Minerals |
| Select and move | A drag selects units but never buildings; white markers under the cursor show where they will stand |
| Mine | Soldiers face the rock and fire at it; +5 Minerals every 1.5 seconds per Soldier |
| Train Soldier | 50 Minerals; a Soldier appears at the Barracks |
| Research Training, then Motor Pool | 150 and 100 Minerals; Soldiers move and train 30% faster; Build Factory unlocks |
| Build Barracks or Factory | A Soldier walks to the site and builds it; the building rises out of the ground |
| Train and load a Truck | Soldiers board; Unload sets them down in a row behind it |
| Minimap | Click or drag to move the camera; right-click sends the selection there |
| Fight | Soldiers face their targets and fire tracers; units die, health bars show damage, the AI attacks in groups of four |
| End | Victory or Defeat, then back to the lobby |
4. Play two copies over the network
Section titled “4. Play two copies over the network”Run two copies of the same package, on one machine or on two machines that can reach each other:
- The first copy clicks Host. On another machine, allow the game through the host’s firewall (UDP port
7777). - The second copy enters the host’s address (
127.0.0.1on the same machine, the host’s LAN address otherwise) and clicks Join. It takes slot 2. - Both click Ready; the host clicks Start.
Play to the end. Check that both copies agree: the same units die, Minerals and production stay in step, transports carry the same passengers, and each player sees only their own fog. Only orders cross the network; each copy runs the same deterministic simulation, and a periodic checksum confirms they agree.
Then leave, host again and play a second match: a working first connection does not prove a complete loop.
5. Shipping
Section titled “5. Shipping”Once the Development build passes, package Shipping and repeat the menu-to-match test on both copies. Keep the Development package and its logs for investigating problems; Shipping strips most diagnostics.
Checkpoint
Section titled “Checkpoint”- The package opens the menu and plays the whole loop against the computer.
- Two copies host, join, play a match to its end, and return to the lobby.
- Every player runs a build cooked from the same level bake.