I would love to thank and give credit to the following:
VaRest Plugin - Vladimir Alyamkin (Ufna)
The authors of the free assets that are used in the demo:
Sword Girl model (used only on the demo server, not distributed) - Bunt Games
Inventory icons - Ravenmore
female voices - AderuMoro
male voices - Michel Baradari
You will need Visual Studio and a source-built version of UE4 to use MMO Starter Kit. If you don’t have it yet, follow the official instructions here: https://www.unrealengine.com/ue4-on-github (This guide is for version 4.6.1 )
Note: if the editor tells you that the project was built with another version, choose “Convert in place”. If it fails to convert, right-click on the blue .uproject icon in the folder with the project and choose "Switch Unreal Engine version", choose your engine, then right-click again and choose "Generate Visual Studio project files".
You will also need a webserver with PHP and mysql, it can be the same server where you host your website. The free hosting provider http://www.000webhost.com/ has been reported to work well with MMO Starter Kit if you disable their analytics code. The following instructions assume you already have a hosting provider:
Text to search for
Text to replace with
your mysql username
your mysql database name
your mysql database password
(optional) your mysql server host name, if it’s not the same as the server with php scripts (if not sure, leave it as localhost)
If somewhere it says Connection failed: Can't connect to local MySQL, this means the strings that you replaced in step 2 are incorrect. If instead it displays raw php code with <? and such, this means that the php scripts don't execute properly on your webserver.
Now let’s head over to the editor and test it out!
You only have to do steps 1-3 once. You need this because when playing in editor, the game assumes you have logged in as the character with id 0, allowing you to fully test everything - saving/loading of position and stats, inventory items, etc.
If you want to concentrate on customization and gameplay first, you can skip this for now. Follow these steps if you want to configure the full MMO Starter Kit demo setup (launcher/patcher, dedicated server on Softlayer):
This guide assumes you have the following animations for your model: idle, walk, jumpstart, jumpend, jumploop, combat idle, attack, and death. If you don’t have them all, everything will still work but the t-pose will be displayed in place of the clip that you haven’t specified.
Note: make sure your skeletal mesh has a Physics Asset specified. It is required to be able to click on dead characters. You can create a Physics Assets by right-clicking on a Skeletal Mesh and choosing Create > Physics Asset.
If you want the characters be highlighted on mouse hover, the material of your character’s mesh needs to have a scalar parameter “Highlight Amount” - the highlight effect is up to you, for example you can add an emissive color. If you would like to know more about this you can check out the GuyMaterial located in MMO\NewCharacter. Note that player’s own character is not highlighted on mouse over, only other players and NPCs are.
Chance Of Sound variable determines how often the pain and attack sounds will be played (death sound is always played).
To customize the NPCs you will need to follow the same steps used earlier when learning how to customize the player character. The only difference will be instead of duplicating GuyPlayerCharacter blueprint you will duplicate GuyRoamingCharacter blueprint located in MMO/AI/Roaming.
After you’ve created your new NPC, you can place it on the map and it will appear in game.
Note: The current method of storing the items in the mysql database is not recommended for shipping (though it’s easy to use for internal testing). It stores the full path to the item in your Unreal folder - this results in long strings that take time to transfer, but allows the developer not to worry about ids or where they store their item assets. To optimize the network load you could either implement some id system, or at least store only the name of the item in the db and let Unreal add the path to the folder (and make sure you place the items in one folder).
If you want to edit multiple NPCs or items at once or if you want to edit them individually but there is a lot of them, use the property matrix:
Note: in property matrix you can sort the assets by any property by pinning the property so it shows up in the table and clicking on the column name.
Note: if you want to set up a server that will run 24/7, you could look into ordering a virtual server instead.
A listen server acts both as a server and as a client. Since the focus of this kit is to create a MMO running on a dedicated server, the listen server doesn’t fully act as a regular client (it doesn’t have UI, etc). However, it is very useful for testing standalone builds since there often are differences between Play in Editor and standalone. It is highly recommended to test your builds with Listen Server + Client combination before packaging.
Tip: you can run those shortcuts even when you have the editor open.
A console dedicated server is needed in order to run your game on a virtual/bare metal server (for example, Softlayer or Amazon) which normally have no video cards and to maximize performance.
In order for the clients to be able to connect to your dedicated or listen server, you need to specify the server IP address in mmologin.php. Find this text “'address'=>” , and specify your ip address there.
Note: when the client is being run from shortcut, there should be no -local parameter in the shortcut in order to use the address from the php script.
To remove the default players limit, in your packaged game folder open file Engine\Config\BaseGame.ini and look for “MaxPlayers=”. Set it to the desired number.
At some point you will want to have a server that is online 24/7 and doesn’t interfere with your other activities on your computer. You can maintain this server yourself on a dedicated machine or order it from a hosting provider of your choosing. This guide explains how to order and set up a virtual server on Softlayer, where MMO Starter Kit demo server is being hosted.
If you don't have the dedicated (console) server running, follow this guide first
1. Make sure everything works correctly, then archive and upload to your favorite cloud (for example copy.com) the following :
If your upload speed is not ideal, wait until the files have uploaded successfully before proceeding to step 2.
2. Order a Softlayer virtual server with Windows Server OS through www.softlayer.com . You can order an hourly server first to test things out, then make an image of it and order a monthly server from this image. The lowest virtual server configuration is enough for small-scale testing, though you might want to increase the disk space. With a 25 GB hard drive you will have only around 2.5 gb free space from the start.
When determining which data center to use - if your users are from Europe you could use Amsterdam, and you could choose Dallas for the US. MMO Starter Kit demo server is hosted in the data center in Washington to provide decent ping for Europe and the US both.
You could check the stats at https://wondernetwork.com/pings to have an estimate at what your users' ping will be.
If you have PayPal, you can pay with it instead of a credit card, then your order will be processed instantly. Credit card orders can take longer or even fail if for example you live in Europe and your bank requires a special verification. The website says your order will be processed within 15 minutes. If you don't receive an email from Softlayer in 15-30 minutes, you can contact their live chat directly - they answer immediately 24/7 and are very helpful!
3. Once your order has been approved, you'll receive your login and a temporary password, log in and change the password to a permanent one.
4. Wait until you get the email saying the server has been provisioned and is ready to use.
5. In Windows, Run > Remote Desktop Connection. You might want to pin it for ease of access in the future. In Softlayer control panel, go to Devices, double click on your server and use the ip address, username and password from there for the remote connection.
6. On your server, open up Internet Explorer and go to the cloud where you’ve uploaded the files in step 1. Download all the files that you've put there.
7. On your new server, install the prerequisites located in your packaged game’s folder Engine\Extras\Redist\en-us. Start your dedicated server and chat server. Copy the ip of your server from the Devices page to 'mmologin.php' script. Try to run the game as a client (using the .exe from your packaged game folder) and see if it connects to your new server.
If everything is ok, go to your Softlayer control panel, click Devices, click on your server's name to open a Device Details page then Actions > Create image from device. This will allow you to create new servers that are exactly like the one you've setup (with Unreal already there and dependencies already installed) without going through all the steps again. Making an image can take more time than is estimated, give it around 30 minutes.
After you’ve got your dedicated server running 24/7 you probably will want to ensure that it will restart automatically in case of a crash - even AAA game servers sometimes crash! For this, I’ve found RestartOnCrash free application very handy - it doesn’t require installation, is only 2.5MB and has everything I need including a log file.
There’s a separate documentation for the Launcher/Patcher, you can find it here.
Q: When running the game in editor, I get a crash after I choose a character and try to enter world
A: You can’t enter world from start menu when running in editor, use standalone client+listen server (check Listen Server part of the documentation)
Q: When I open your project in Unreal version *.xx, it crashes
A: Are you using the latest stable version? The “sneak peek” versions and branches can have unexpected behaviour, I recommend you use the latest stable version of Unreal Engine.
Q:When I switch levels, the game crashes with this error: “X not cleaned up by garbage collection!”
A: If you haven’t modified anything in the demo project, check the first question in this section instead. Make sure your persistent classes such as GameInstance(MMOInstance) have no references to the actors in the previous level. Check the log for the information on which classes to look for. You can clear the references by setting them and not attaching anything to the set node. Also, when you create UMG widgets, add to them to an array and destroy the widgets in that array before loading a new level.
Q: The game crashes with BSOD/system reboot, what to do?
A: This is a hardware error, most probably your video card overheats. It can be fixed by running the game with shortcut parameter -VSync (Unreal doesn’t use VSync by default so your framerate can go to 500+ which can cause the videocard to overheat).
Q: I want to customize the main menu but can’t get some of the panels to appear, the “eye button” doesn’t seem to do anything!
A: When MMO Starter Kit was being developed, the editor didn’t yet have the eye button, so I had to use this trick - I set the scale of the panels that I needed to hide to 0. This will be removed in the next update. For now, just set the scale of all the panels to 1 and you will be able to use the eye button as normal.
Q: Where is <some functionality> done in blueprints? I can’t find it.
A: You can ask me on PM/Skype/forum thread, however I recommend you use Edit->Find in blueprints feature to save some time. For example you could search for "Create Widget" to find where the UI is created. :) Note that this search doesn't include level blueprints, except for the currently open level.
Q: When a player character dies, it falls through the terrain
A: Check Using your own map step 6.
Q: I walked off the edge of the map and now my character falls when I play in editor
A: In your mysql database, in ‘characters’ table find the character with id 0 and set their posx, posy and posx to some appropriate coordinates in your map.
Q: When testing things in editor, I can’t seem to block the controller movement/mouse look in the starting map with the menu. SetIgnoreMouseInput and SetIgnoreMovementInput don’t work.
A: Make sure you are running the starting map with Dedicated server turned off and 1 player.
Q: I can’t access a variable from one blueprint in another, but you seem to use that variable just fine!
A: Make sure the variable is marked as public (eye icon). When I was making the kit, sometimes Unreal allowed to use a private variable as public, I guess this was a bug in the editor that was fixed later.
Q: I’ve made a totally new php script and added a request to it to JSONRequests where the other requests are and it doesn’t work
A: You can use php code checker to check syntax in your php script. Also, use Notepad++ or other specialized editor because editing php in regular Notepad sometimes results in errors for me.