Forums Gallery LOGIN |REGISTER

Community Archive is read-only - Here you can view content recorded up until February 2017. To join the latest discussions visit our new forums


Tutorial: Setting Up A Multiplayer Online Game

Gameplay Setup, SP/MP Logic, Audio Setup, AI Logic, Entity Usage, etc.


 

User avatar dwhite4@umassd.edu
Skilled Developer
Skilled Developer
 
Posts: 616
Member since: 09.12.2013, 01:50
Location: America
Likes: 198

Tutorial: Setting Up A Multiplayer Online Game

Postby dwhite4@umassd.edu » 16.03.2015, 09:30

Hi guys, this is a tutorial on setting up a multiplayer/online game using CryEngine Free SDK (easily extendable to EaaS). I hope you find it useful. :)

Overview:

Start by copying all CryEngine game files to each computer that will partake in the multiplayer game. Choose one computer to act as the server (preferably one with good specs). This computer will host the multiplayer level. Basically the server computer will constantly run a program called the Dedicated Server. This program will handle sever-client interactions. By running this program we allow other client computers to connect to the server and begin playing the multiplayer level. Now that we have a broad picture, let's take a closer look...

Image

Key Terms:

Server Computer:
A computer which acts as an administrator over several client computers.

Client Computer:
A computer which acts as a user. It can request services from the server computer.

Server-Client:
An architecture in which a server mediates transactions and synchronization between several client computers.

Local Area Network:
LAN for short. A small network such as that seen in a home or office.

Wide Area Netork:
WAN for short. A large network. Often used to describe the Internet.

IP Adress:
A unique address used to locate a computer/device in the Internet.

IP Format:

Code: Select all
XXX.XXX.XXX.XXX


Server Setup:

Step 1:
Open the Dedicated Server program under CryEngine/Bin32_Dedicated/DedicatedServerSDK.exe.

Image

Step 2:
Wait until the Dedicated Server program completely loads before proceeding.

Image

Step 3:
Enter the following commands...

* Other useful commands:
http://docs.cryengine.com/display/SDKDO ... yer+Server.

Code: Select all
sv_bind XXX.XXX.XXX.XXX             # XXX.XXX.XXX.XXX is the IP address of the server computer.
sv_port 64090                       # 64090 is the port to be used for communication.
g_minPlayersForRankedGame 0         # Optional.
sv_gamerules InstantAction          # Defines the game rules.  I chose "InstantAction".
r_colorgrading 0                    # Renders the game in color as opposed to black and white.
map Forest                          # Sets the map.  I have chosen to use the default "Forest" map.


Client Setup:

Step 1:
Open the CryEngine Launcher on each client computer under CryEngine/Bin32/GameSDK.exe.

Image

Step 2:
In the Launcher, navigate to Multiplayer > Join Multiplayer (this is crucial).

Image

Step 3:
Press the ~ key to open the console.

Image

Step 4:
Enter the following console command to connect the client to the server.

Code: Select all
connect XXX.XXX.XXX.XXX:64090       # xxx.xxx.xxx.xxx is the IP address of the server computer.
                                    # 64090 is the port number.
Image
User avatar chernecoff
Junior Dev
Junior Dev
 
Posts: 236
Member since: 24.04.2012, 14:04
Location: Russia, Tambov
Likes: 109

Re: Tutorial: Setting Up A Multiplayer Online Game

Postby chernecoff » 16.03.2015, 10:39

Hi, good tutorial. Upload my settings (when I host my own server for "Simple Multiplayer Game")
Code: Select all
sv_servername = Official test server [Ru-Moscow]
sv_bind 127.0.0.1                               
sv_port 64090                                   
sv_gamerules TeamInstantAction                   
sv_maxplayers 32                               

g_minplayersforrankedgame 0           
g_minplayerlimit 0                                   
g_roundlimit 0                               
g_scoreLimit 0                               
g_revivetime 5                                 
g_timelimit 0                                 
g_deathCam 1                                     
g_gameRules_preGame_StartSpawnedFrozen 0         
g_gameRules_skipStartTimer 1
g_gameRules_startTimerMinPlayers 0
g_gameStartingMessageTime 0
g_killercam_disable 0
g_modevarivar_disableSpectatorCam 1
g_mpRegenerationRate 0
g_restartWhenPrematchFinishes 0
g_switchTeamAllowed 0
g_useNetSyncToSpeedUpRMIs 1

map airfield s


to client connects:

1. Set only mp
Image

2. Use console
Code: Select all
cl_serveraddr = 127.0.0.1
cl_serverport = 64090
connect


Good luck


p.s. You can use c++ and server.cfg file. Enjoy
Code: Select all
int CGameStartup::Run( const char * autoStartLevelName ) Function in GameStartup.cpp

#if   defined(DEDICATED_SERVER)
   gEnv->pConsole->ExecuteString( "exec server.cfg" );   
#else
   gEnv->pConsole->ExecuteString( "exec autoexec.cfg" );
#endif
I came back from the army. Ready for work. On all questions write - chernecoff@gmail.com
User avatar BlackSatur
Just getting started
Just getting started
 
Posts: 17
Member since: 24.06.2016, 21:03
Likes: 0

Re: Tutorial: Setting Up A Multiplayer Online Game

Postby BlackSatur » 03.11.2016, 18:43

How can I connect without going into 'Multiplayer > Join Multiplayer'?
Is there a way to initialize automatically the map after the connection?