Valo

The world was enslaved by darkness and the last light source, Valo, has to fill everything with light again. That's why his journey starts in the forest, which was conquered first by darkness. Valo comes across many dangers and in the end, he has to defeat the darkness.

This beautiful simple game was made with Construct 2.

Try it yourself!

Keep Out

A person is working in a cave. Suddenly the entry collapses behind him and he has to find a way to reopen it. While trying to find an old crate with dynamite the miner hears strange noises...

This intense and atmospheric game was made with Unity 3D

Latest version: 0.1.1 (Development halted)

Edos

Edos was the first Unreal Engine game I worked on. It is a real-time strategy game in first person and it's art style is kept low poly, inspired by medieval times.

It is possible to gather resources by yourself, or to assign your workers to it. The main goal is to build a whole city from the ground up to construct a tavern for your people.

Latest version: 0.2.1 (Development paused)

Sovora

Currently I'm working on my semester project at FH Hagenberg which will be a dynamic combat game. On this blog I will go through some aspects of the development.

Latest version: 0.8.1 (Under development)



Content

  1. Climbing System
  2. Camera System
  3. IK System
  4. Dedicated Server
    1. Prerequisites
    2. Linux Cross-compile
      1. Potential problems on Linux
    3. GitHub
    4. Getting started on Windows
    5. Building dedicated server
    6. Steam dedicated server
      1. Changes to the engine source code
      2. Changes to the project blueprint

Dedicated Server

Prerequisites

Linux Cross-compile (*Can be skipped if only compiling for Windows*)

To be able to cross-compile for Linux under Windows, there are some steps to be done beforehand, which can be seen below.

After adding the necessary variables, “Setup.bat” in the Unreal Engine source folder must be run for installation and last, run “GenerateProjectFiles.bat” to be done. (~ 30min)

There should now be an option to build for Linux in Visual Studio, but if there are any problems, look into this site for a proper tutorial.

Potential problems on Linux (After building the dedicated server)

The server is not starting due to Steam not initializing, this might be caused by a missing steamclient.so! That file should be right next to the server binary, which means it can simply be copied there from the installation root path (32bit), if installed via “steamcmd”. (64bit in the subfolder “linux64”)

GitHub (UE4 Source)

To see and download Unreal Engine source from GitHub, the GitHub account must be added to the Epic Games account page. Once that’s done, it’s possible to see the repository and can now be downloaded as a zip file from GitHub or cloned to the desktop app. On the top left the desired branch can be selected from Unreal Engine 4.0 to current release.

Getting started on Windows (*Admin rights needed*)

To install all dependencies needed for Unreal Engine, “Setup.bat” must be run in order for it to work, this can be skipped if Linux Cross-compile was done before. (~ 30min)

After completing the setup, “GenerateprojectFiles.bat” is used to generate all Visual Studio Project files (Visual Studio 2015 by default) Visual Studio Community 2017: To install for 2017, use “cmd” to go into the directory where “GenerateprojectFiles.bat” is located and type in:

When generating is done, open UE4.sln and wait for Visual Studio to load up the project completely, it says “Ready” in the bottom left corner. (~ 30min)

Below the folder structure and all needed files can be seen.

When Visual Studio is done loading, there are a few settings that need to be changed to match those in the picture below.

After setting up everything correctly, UE4 can be set as a starting project and building it can begin, which might take some time. (~ 60min)

With a successful build, debugging the Unreal Engine Editor can start for the first time. If a dialog pops up, just press “Yes” and wait till “Unreal Project Browser” has loaded. The progress is often not visible, but also if it seems to have frozen, it will open eventually. (~ 10min)

It also compiles shaders after opening, which can take a few moments as well, but after finishing, the custom-built editor should be added to the taskbar for easier access later. That way it’s not necessary to always start it by debugging. (~ 5min)

Building dedicated server

To be able to build a dedicated server in first place, a project with source files must be used, if it only used blueprints before, just create an empty C++ class to let Unreal Engine generate everything necessary, or simply start with a new C++ project.

After having a source folder in the projects directory, all project files can be generated by clicking on the marked entry. Now open “PROJECTNAME.sln”, duplicate “PROJECTNAME.Target.cs” and rename it to “PROJECTNAMEServer.Target.cs”

Insert the following code, (UE 4.19 source specific) changed to the specific projectname, into that file and save it. Visual Studio can be closed after that for now.

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

[SupportedPlatforms(UnrealPlatformClass.Server)]
public class PROJECTNAMEServerTarget : TargetRules
{
	public PROJECTNAMEServerTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Server;
		ExtraModuleNames.Add("PROJECTNAME");
	}
}									

Now the custom-built engine from before has to be selected for the project by clicking the marked entry. When opening the project now, there might pop up a dialog saying it needs a rebuild, confirm with “Yes”.

Important: In case the automatic rebuild fails, it must be done manually by opening the PROJECTNAME.sln and building the project solution, the settings are the same as before. (THIS ALSO FIXES LIGHTING BUILD ERROR)

To finally build the dedicated server for a desired project, the only thing left to do is changing the Visual Studio settings to the ones below and repeat the step seen in the picture above. (For Linux it’s basically the same, just with Linux selected)

Steam dedicated server

Disclaimer: If the dedicated server can’t be seen on the “Internet” tab of the Steam Server Browser, that’s because the ports 27015 and 7777 need to be forwarded on the router and the firewall. (Instead check the “LAN” tab to see if it’s working)

Changes to the engine source code:

There are some problems with the basic Online Subsystem Steam, which appear as warnings in the log files. Those are caused by too long tag names. (Steam game tags can only contain 128 chars) Avoiding them is easy and can be done by changing the following, but don’t forget to adjust the whole files accordingly to the modifications.

OnlineSessionAsyncServerSteam.cpp

(~ Line 20)

//#define STEAMPRODUCTNAME "unrealdk"
//#define STEAMGAMEDIR "unrealtest"
//#define STEAMGAMEDESC "Unreal Test!"
#define SPN "unrealdk"
#define SGDIR "unrealtest"
#define SGDESC "Unreal Test!"		

(~ Line 344)

SteamGameServerPtr->SetModDir(SGDIR);
SteamGameServerPtr->SetProduct(SPN);
SteamGameServerPtr->SetGameDescription(SGDESC);

(~ Line 775)

FCStringAnsi::Strncpy(Filters[NumFilters].m_szValue, SGDIR, ValueSize);

SteamSessionKeys.h

(~ Line 20)

//#define STEAMKEY_SESSIONFLAGS "SESSIONFLAGS"
//#define STEAMKEY_OWNINGUSERID "OWNINGID"
//#define STEAMKEY_OWNINGUSERNAME "OWNINGNAME"
//#define STEAMKEY_BUILDUNIQUEID "BUILDID"
#define STEAMKEY_SESSIONFLAGS "SFLAGS"
#define STEAMKEY_OWNINGUSERID "OID"
#define STEAMKEY_OWNINGUSERNAME "ONAME"
#define STEAMKEY_BUILDUNIQUEID "BID"

Define SETTING_SERVERNAME to be able to edit the name of the server shown in the Steam Server Browser afterwards from within the blueprints. Initialize the server settings to be visible on the Steam Server Browser. (Those values can be edited in the blueprints later as well) The define SETTING_NUMBOTS is used to set the player count shown in the Steam Server Browser when players join or leave the associated game.

OnlineSessionSettings.h

(~ Line 32)

/** Custom setting used for SERVER in Steam Server Browser */
#define SETTING_SERVERNAME FName(TEXT("SERVERNAME"))

(~ Line 317)

//Custom Example usage of settings
Set(SETTING_SERVERNAME, FString(TEXT("SERVERNAME")), EOnlineDataAdvertisementType::ViaOnlineService);
Set(SETTING_MAPNAME, FString(TEXT("MAPNAME")), EOnlineDataAdvertisementType::ViaOnlineService);
Set(SETTING_NUMBOTS, 0, EOnlineDataAdvertisementType::ViaOnlineService);
//Set(SETTING_GAMEMODE, FString(TEXT("GAMEMODE")), EOnlineDataAdvertisementType::ViaOnlineService);

By changing the AppID, the dedicated server can be found in the Steam Server Browser under the correct project name. (MAIN AppID must be used, not the dedicated server TOOL AppID, otherwise when the game was launched through Steam, it won’t find the dedicated servers)

Important: To get an AppID from Steam, the instructions for Steamworks must be followed and all requirements must be fulfilled.

OnlineSubsystemSteam.cpp

(~ Line 343)

int RelaunchAppId = AppID;

To get a proper name shown in the Steam Server Browser, it’s necessary to change the following lines in the source code. (Those defines can also be changed through blueprints afterwards as seen before)

Alternative: The server name can also be set another way, but it’s not that good, because the name in the Steam Server Browser and the one in game will differ.

OnlineSessionAsyncServerSteam.cpp

(~ Line 413)

//Custom Session->OwningUserName = Session->OwningUserId->ToString();
Session->SessionSettings.Get(SETTING_SERVERNAME, Session->OwningUserName);

(~ Line 156) (Alternative)

//Custom Session->SessionSettings.Get(SETTING_SERVERNAME, ServerName);
FString ServerName = "SERVERNAME";
ServerName = Session->OwningUserName;
SteamGameServerPtr->SetServerName(TCHAR_TO_UTF8(*ServerName));

After all those changes were made, it’s necessary to manually build the project again. Before doing so however, the “DefaultEngine.ini” must be adjusted accordingly, so that the project gets packaged correctly. Otherwise NOTHING will work! ([Core.Log] Part not needed, but useful)

[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=AppID

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

[Core.Log]
LogProperty=Verbose
LogOnline=Verbose

Changes to the project blueprints:

The following setup is used to update the player count in the Steam Server Browser after a player has joined or left the server.

GameMode Blueprint (*)

Same concept as above, just the slight changes with decrementing the player count.

This is a simple and very basic setup in the “EntryMap” level blueprint for hosting and joining dedicated servers, this could also be extended to work with in game server browser and so on.

The most important project settings, for this setup to work, can be seen below, all other settings don’t really matter in that case. (GameMode Blueprint (*))

To have global access to the same field values, a structure was used for simplicity reasons, but any other global variable could be used. (Useful to change only once and update every reference)

Offenlegung

Offenlegung gemäß §25 Mediengesetz
Inhaber der Website: Christoph Weidlinger
Aktuelle Anschrift:  Softwarepark 106, 4232 Hagenberg

© Copyright 2015-2018, alle Rechte vorbehalten!