What is the correct procedure when making a multiplayer game?

Hey!

I’m currently working on a project that is supposed to end up as a multiplayer game, but I’m not exactly sure how I should look at building the game.

Do you generally create a single player version first when building, and then converting it to multiplayer, or do you build it as a multiplayer game instantly?

If you build it as a multiplayer game instantly, how would you test/debug changes that you’ve made for multiplayer? Do you need help from a 3rd party or is there some easy workaround I don’t know about?

Sorry if my questions don’t make any sense, I’m still a novice and learning.

Cheers!

Hi YamiBH

You should always setup your project to be networked from the start if there is a chance that networked connectivity maybe required.

Local applications are very forgiving with class relationships. For example, widgets can access the GameModes and GameInstances, GameModes can access a local player controller by using “GetPlayerController Index 0”. Coding projects like this would not work in a networked application since widgets cannot see the server, and the GameMode will have no reference of which player controller, index 0 relates to.

Have a read through this: http://cedric-neukirchen.net/Downloads/Compendium/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf

This guide is a very good start in understanding how you should set up your major game classes and what type of functionality they should be used for.

As far as testing goes, there are 3 options.

1) Play In Editor
This one is very simple. Click the small down arrow next to the “Play” button and check “Run Dedicated Server”. You can also choose the number of clients you would like to simulate.
However, depending on your game, this could cause some problems. Play In Editor will automatically and instantly connect your clients, so if you have some pre-setup required on the server before clients connect, this functionality may not be processed in time.

2) Run Stand Alone as separate processes
Click the small down arrow next to the “Play” button and click “Advanced Settings”. Scroll down to "Multiplayer options and uncheck “Use Single Process”. This will expose some other settings.
Check “Run Dedicated Server”
Set “Editor Multiplayer Mode” to “Play as Client”.
Inside “Additional Launch Parameters” and “Command Line Arguments” add “-log”

272576-standalonewithnetworking.png

Close the preferences.
Now when you run the game from the editor as “Stand Alone”, you will get a console window which represents your server, and a console window and a game window for each simulated client.

**Note: Your clients will not automatically connect to your server, so you must have functionality so they can find and connect to local servers **

3) Create a development build and test your application.
Unreal Engine by default does not come with the facility to package Windows servers and clients separately, so you have to enable this within your engine and your project. Take a look at this guide here: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

I know my explanations are quite rushed, I hope I provided enough information to get you started. Good luck! :slight_smile:

Big thanks! You provided me with more than enough help. Thanks for taking the time writing this!