Multiplayer TopDown Survival Kit

Hey everyone, only 2 months after the release of this pack, the big update is now live!

At first please notice that there are lot of new features. These have been extensively tested but nonetheless you should expect that there might still be more bugs that need a short amount of time until they’re fixed.

4 more Editor tutorials about the new features have been added. Beside the new features there have been changes made to the existing classes aswell. Therefore some of the existing Editor tutorials have been changed, too. I recommend reading over all again even if you’ve already worked with this pack. I was pretty busy creating this update so I wasn’t able to create more tutorials / documentation but this will follow in the next weeks and I will link them here in the forum.

The changelog will follow soon!

The update v1.2 include a huge amount of new features and changes. I will only list the major ones as listing everything would go beyond the scope.

Changelog

v1.2 (02-14-2017):
New Features

Near game-ready StartMenu
This includes a singleplayer (create new game, load singleplayer SaveGame), a multiplayer (Host new game, Host multiplayer SaveGame, Join game and an options menu (default options for saving, full graphics options). The StartMenu is designed minimalistic just like the user interface and the same widgets are reused as often as possible so you can change the design quickly as soon as you want to.

Game menu
Ingame a player can open the GameMenu by either pressing Esc or F1. The widget used for this menu are the same as that in the StartMenu so the style will automatically be consistent. You can choose if the screen should be blurred while the GameMenu is open. In singleplayer games opening the GameMenu pauses the game.

Multiplayer system
The Multiplayer system uses the Online Session nodes with all functionality these nodes offer. In addition to the JoinSession node a game can be joined by directly entering the host’s IP. The server will load the last status (including inventory, equipment, crafting manager) when a player who’s known to the server connects. The server even differentiates on which levels a player is already known and you can quickly change what variables will be remembered bound to the level and what variables will be remembered bound globally over all levels. Each player can chose some player specific variables combined in a struct when joining a game. This variables are used to define what type of character the player wants to play. Whenever a player respawns these variables will be used to set up the new spawned character aswell.
A player is identified on the server by the playername he chose. There is no unique way to identify a player without an online subsystem. Before releasing the game you will most likely want to replace this with a unique ID of the online subsystem (e.g. steamID).

SaveGame system
The SaveGame system is directly connected to the multiplayer system. Whatever variables you choose to be bound to the level or bound globally bound over all levels will be saved and loaded just like that. In addition the SaveGame system saves and loads the inventory of all actors with an inventory in the level, the transform and remaining burning duration of campfires and the Open/Closed status of all actors that inherit the interface BP_iOpenable (windows, doors). The SaveGame system also saves and loads game specific variables that define the rules of a game (e.g. difficulty, weather). At last it also saves some variables like the current level, date of save and the ingame time.
The options (SaveGame, video options) are saved in a different SaveGame object so these are remembered after restarting the game.

Scoreboard
The template now includes a scoreboard. This scoreboard will automatically display all online player and their chosen name. The scoreboard displays the name of a player, his score, deaths and ping. Score and ping are stored in the player state and (per default) increased whenever one player killed another player / dies. The scoreboard can be sorted in ascending or descending order for each of its attributes. Per default a player can change this order by clicking on one of the buttons of the scoreboard.

Inventory system

  • The inventory system now uses a DataTable to store the information of items that don’t vary between instances of an item. This nicely reduces the memory usage (especially from empty slots) in case of very large levels with many inventories.
  • Items can now be dropped and picked up

Changes

  • The inventory system now only replicates an inventory when a player opens it instead of replicating neutral inventories to everyone. This is the absolut minimum information a client can get from the server and therefore as proof to cheaters as the rest of the template. This does also fix an issue of the inventory system regarding network relevancy that could’ve occured earlier.
  • The template now follows Allar’s style guide as much as the submission guidelines allow it.

Thanks for the update! Do you plan another update package?

Small updates will definitely come in the next weeks. A major update like the one just released takes weeks of full-time work so you should not expect something like that anytime soon. But feel free to suggest possible features for future updates and discuss it here.

In addition the template is now compatible with 4.15.

You did a great job, thank you.
You thought about the clothes? Not changes visual character, if you wear pants, jacket. Also it would be interesting to introduce cartridges for weapons.

Out of curiosity, did you use any assets from the marketplace to create this? Nothing against it, just some functions look exactly like some of the marketplace stuff.

No I did not. Actually I own only one blueprint asset from the marketplace and that one is very different from this one. But I’m curious, which do you actually mean? I don’t see many similarities to any asset on the marketplace.

Since a few days there is an update online that fixes a critical bug in the 4.14 version that could’ve caused a crash of the project and made a few changes of things that were vulnerable to cheaters.

Changelog

v1.2.1 (02-24-2017):
Changes

  • The class BP_InvItem_Buildable is now removed. The campfire and other buildable items now directly inherit from BP_InvItem. They become buildable if both of the buildable variables in the DataTable DT_Items are set.
  • Some Server RPC events are not longer RPC events and start with a SwitchHasAuthority node instead.

Here are 2 tutorials for things I have been asked for lately:

Add a new item:
[SPOILER]

  1. Add a new row in the DataTable DT_Items. Name the row e.g. NewItem. Modify the rows in the DataTable for your item.

  2. Add a new item UObject by inheriting it from one of the abstract item classes BP_InvItem, BP_EquipItem or BP_EquipItem_Weapon. Inheriting clothing from BP_EquipItem_Clothing isn’t strictly necessary but it’s a nice template for warming clothing.
    ChildClass.png

  3. Set the RowName in the newly created blueprint (in this case NewItem).
    SetRowName.png

Now a new item is already created!
[/SPOILER]

Remove the survival part (day&night cycle, temperature, food, water):
[SPOILER]

  1. Remove spawning the BP_WeatherManager in BeginPlay of BP_GameMode.

  2. Remove saving the current time of day in the Save function of BP_GameMode.

  3. Stop starting a timer for updating the temperature in BP_HumanCharacter. You can now also remove the event UpdateTemperature in BP_HumanCharacter and it’s overridden version in BP_PlayerCharacter.

  4. Remove consuming food while running in BP_HumanCharacter. If you want to keep the food but not the temperature, just remove the SetNewBodyTemp macro here.

If you also want to remove food:
5. Remove frequently consuming food in BP_HumanCharacter.

If you also want to remove water:
6. Remove frequently consuming water in BP_HumanCharacter.

Now you do only need to remove the respective part on the widgets and you have a nice Multiplayer TopDown Shooter.

[/SPOILER]

Finished created a first version of the ** User Guide **

Please note that I still recommend to read the Blueprint Editor tutorials that are part of the project files when starting to work this pack. These are more detailed in some parts and other parts still aren’t within the User Guide. For all of you that are already working with v.1.2 of this pack the Multiplayer system chapter will be very interesting.

Multiplayer TopDown Survival Kit is now on sale for 25% off!

The User Guide now comes with a new section for the character blueprints as well as the first part of the SaveGame system. More pages will follow in the next days.

Version v1.2.2 is now online.

Changelog

v1.2.2 (04-13-2017):
Changes

  • The component BP_Inventory now contains a function for resetting the inventory so it can be looted with randomly generated items again. Calling this function will only have an effect if called on the server and when no player does currently has the inventory opened.
  • The type of the attachable equipment meshes is now skeletal mesh.
  • Fixed a bug caused by the editor that resulted in a warning in BP_PlayerCharacter after each editor restart before compiling.

I really like the way you fade out materials/actors when the character inside the house. Can you explain please which blueprints/components to look @ to learn about this feature or maybe some close youtube tuts?

This is rather a bonus to the template but I’m glad you like it anyway. It’s actually quite simple. At first take a look at the roof’s material /Materials/Example/Mat_Roof. There’s a small part necessary to add to the material. The actual logic is inside the component /Blueprints/Example/BP_FadingComponent. This component needs to be attached to the mesh you want to fade out (see /Blueprints/Example/House/BP_House) and set the FadeMaterial in the newly created instance of the fading component. At last, for correct shadow casting, you want to add a duplicate mesh of the mesh you want to fade out to the actor. Set HiddenInGame and HiddenShadow for this duplicated mesh to true.

Now the mesh should be faded out when the player moves close to it. For performance reasons you may also want to set CastShadow to false for the mesh you fade out since this shadow isn’t needed any longer (I assume this improves performance, I’m not so experienced with lighting).

Thank you!

is it possible to save ai to with this save and load system :slight_smile: if yes how woulth be the best way to do so

You may want to look at the functions Save and Load of BP_GameMode. This can be implemented pretty similar to how campfires are saved. For saving you use the GetAllActorsOfClass node and call the respective GetSaveVars function of your AI class. If you have created your own AI pawn class you may want to take a look at how this GetSaveVars function is handled within BP_PlayerCharacter. You add the array of structs for the AI pawns to the FSaveVars_Level struct afterwards. Loading can be done the same way like the campfire is loaded in the function Load of BP_GameMode. You will also need the LoadSaveVars function in the AI pawn class.

Thanks i got it working.:smiley:

how can i savely remove the player when he is dead my ai still attacking the old player when i (player) respawned
when i use unposses i get black screen its not respawning again