Announcement

Collapse
No announcement yet.

Multiplayer TopDown Survival Kit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [RELEASED] Multiplayer TopDown Survival Kit

    Now available on the marketplace! Marketplace Link



    Highly customizable multiplayer template for creating TopDown or Survival games.

    User Guide

    Features

     
    Spoiler


    FAQ

    Where can I find the tutorials?
    This pack currently has 11 Blueprint Editor Tutorials. These tutorials cover the character, inventory, equipment, crafting and building, weather, food water and temperature and interacting with actors and outlining them, start menu, multiplayer system and the SaveGame system. You can find them under Edit->Tutorials in the level overview or under /Blueprints/Tutorials. These tutorials cover where to find specific logic, how it's set up and explain how things like inventory items, equipment slots or wind speed can be quickly added. If anything remains unclear after reading the tutorials please contact me about your issues. I will always help you to realize your vision and be thankful for all feedback that will help me to improve the documentation.

    Can I play with a friend over the network?
    This system uses the Online Session nodes and therefore you can. Check out the Unreal Engine 4 documentation to find out more about the Online Session nodes.

    Will basic AI (for example zombies) be added to this pack?
    I will consider that in the future but it's not at the top of my list. I will keep focusing on features that are more related to each other first. Such an AI would have nearly no relations to the existing features and would therefore pretty easy to integrate into the template for everyone.

    The widgets stop updating after they have been drag&dropped
    I am aware of this issue but this is an Unreal Engine bug. This issue is documented in the report UE-31777. Epic will hopefully fix that bug in the near future.



    Additional Tutorials

    Drop / Pick up item actors outdated since v1.2.0
    Add a new item
    Remove the survival part (day&night cycle, temperature, food, water)

    Changelog

    v1.1 (12-22-2016):
    - The 12 hour format of the clock wasn't displaying the correct hour. This is now fixed.
    - Fixed a bug that was causing the inventory system for one client not working properly when using a dedicated server.
    - Fixed a bug that was causing the temperature system for one client not working properly when using a dedicated server.


    v1.2.0 (02-14-2017):
    New Features
     
    Spoiler


    Changes
     
    Spoiler


    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.

    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.
    Last edited by Pepeeee; 04-13-2017, 11:07 AM. Reason: Changelog added
    Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

    #2
    Does the Fog of war come with the kit or no?

    Super tempted to pick this up.

    Comment


      #3
      Hehe, no sorry

      The Classic TopDown Fog of War pack was more work than this complete pack and a lot more difficult.
      Last edited by Pepeeee; 12-09-2016, 05:01 AM.
      Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

      Comment


        #4
        I'm having trouble with: "In that event (run it only on server) you spawn an actor of class of the newly created actor class variable. Now you want to remove the inventory item. You can copy paste the last part of the function UseItem in BP_PlayerCharacter to remove it with the correct replication."

        I Don't know how to GET the actor variable and plug it into the new node we created. I Don't know exactly what part i need from the Use Function in player bp. It would be helpful if you can Send some pictures on how to do these steps cause i'm pretty lost.

        Comment


          #5
          Originally posted by gotgrassct View Post
          I Don't know how to GET the actor variable and plug it into the new node we created. I Don't know exactly what part i need from the Use Function in player bp. It would be helpful if you can Send some pictures on how to do these steps cause i'm pretty lost.
          Dropping / picking up items isn't implemented in the game because it's rather unusual for TopDown games. But you can pretty quickly implement it on your own!

          Here is a step by step tutorial how to drop / pick up item actors:

          1. Add a variable of type Actor class to BP_InvItem.

          2. Create the private function DropActor in BP_PlayerCharacter:

          Click image for larger version

Name:	DropPickupActorsTutorial_1.png
Views:	1
Size:	175.5 KB
ID:	1119924

          3. Create an event that runs on server and calls the new function:

          Click image for larger version

Name:	DropPickupActorsTutorial_2.png
Views:	1
Size:	88.6 KB
ID:	1119925

          4. Edit the OnDrop function of BP_UI_MainHUD like this:

          Click image for larger version

Name:	DropPickupActorsTutorial_3.png
Views:	1
Size:	178.8 KB
ID:	1119926

          5. Create an actor (for example a medikit) with a static mesh for any of your inventory items and ensure it replicates. You might also want to enable SimulatePhysics for that static mesh.

          Click image for larger version

Name:	DropPickupActorsTutorial_4.png
Views:	1
Size:	8.1 KB
ID:	1119927

          6. Choose an item ( for example the medikit) and set the new actor class variable (created in step 1) to the newly created actor.

          Now you should already be able to drop that item by drag & dropping it anywhere in the world (not on any widget).

          7. Create a new Blueprint Interface BP_IPickupable with a function that returns a variable of type BP_InvItem class:

          Click image for larger version

Name:	DropPickupActorsTutorial_5.png
Views:	1
Size:	63.5 KB
ID:	1119929

          8. Add the interface to the medikit and implement its function:

          Click image for larger version

Name:	DropPickupActorsTutorial_6.png
Views:	1
Size:	68.9 KB
ID:	1119930

          9. Create the private function Pickup in BP_PlayerCharacter:

          Click image for larger version

Name:	DropPickupActorsTutorial_7.png
Views:	1
Size:	165.0 KB
ID:	1119931

          10. Add a hotkey for picking up items under Edit->Project Settings->Input->Action Mappings. Name it Pickup for example.

          11. Create the following 2 events:

          Click image for larger version

Name:	DropPickupActorsTutorial_8.png
Views:	1
Size:	206.7 KB
ID:	1119932

          You can now drop and pick items up!


          In TopDown games you might want to check if the distance between the player character and the hit actor is smaller than a specific value in the function Pickup. And additionally send a LineTrace from the player character to the hit actor in order to ensure the player can't pick up actors behind walls. Please note that on the example map you have to choose a trace channel that isn't blocked by the roof of the house (and it's hidden mesh that ensures correct shadow casting) or change the collision presets of those 2 meshes.

          In FirstPerson games you want to replace tracing from the camera into the cursor position by tracing from the camera into the camera direction (CameraManager->GetActorForwardVector). Because the GetActorForwardVector is normalized (has length 1.0) you want to multiply it with a float value that defines your maximum "pickup range".
          Last edited by Pepeeee; 12-12-2016, 07:51 AM. Reason: Removed typo
          Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

          Comment


            #6
            I Can't drop items for some reason. The event "Drop Inv Item" gets called, but when i drag an item out, nothing happens. The string gets printed, but thats about it.

            BP_UI_MainHud
            Click image for larger version

Name:	On Drip.png
Views:	1
Size:	324.9 KB
ID:	1119959

            DropInvItem
            Click image for larger version

Name:	Sketch (1).png
Views:	1
Size:	129.6 KB
ID:	1119961

            Drop Item Function
            Click image for larger version

Name:	Sketch.png
Views:	1
Size:	463.5 KB
ID:	1119960


            What am i doing wrong? I Can't get the item to drop.

            Comment


              #7
              Please make the custom event DropInvItem Reliable. This event is important to gameplay so it should be reliable in order to ensure it's been replicated.

              If this is still not working, please test with PrintString what is the last node that is been executed. Your function looks correct what works on my end.

              Do you have set the ActorItem variable of the item you're trying to drop to the actor you created?
              Does this actor have a static mesh so you are sure you will see it when it's spawned?
              Is the item removed from the inventory and only not spawned?
              Last edited by Pepeeee; 12-12-2016, 02:49 AM.
              Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

              Comment


                #8
                I enabled "Reliable" and it still isn't working. It prints the string and thats it. Nothing gets removed from the inventory. Heres a video of what it does: https://youtu.be/x-dDuZn3jEs

                Comment


                  #9
                  Originally posted by gotgrassct View Post
                  I enabled "Reliable" and it still isn't working. It prints the string and thats it. Nothing gets removed from the inventory. Heres a video of what it does: https://youtu.be/x-dDuZn3jEs
                  Can you check if the branch that checks if Actor Item IsValidClass is True? Using a PrintString node for example. You might haven't set this variable in the items you want to drop. I guess you could've missed something in step 6.
                  Last edited by Pepeeee; 12-12-2016, 07:52 AM.
                  Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

                  Comment


                    #10
                    Originally posted by Pepeeee View Post
                    Can you check if the branch that checks if Actor Item IsValidClass is True? Using a PrintString node for example. You might haven't set this variable in the items you want to drop. I guess you could've missed something in step 4 or 5.
                    That worked lol the actor i was trying to drop didn't have it's actor class set. I'm gonna follow along the rest of the tutorial and tell you if i run into any problems.

                    Comment


                      #11
                      Thank you!!! THIS IS AMAZING!! I've just finished it. It's awesome. You should include this setup in your system optionally. Or, you should sell the inventory and crafting system seperately, cause this is amazing. It's the reason why i bought this system, and you really saved me here. I Couldn't thank you enough for this system!

                      Comment


                        #12
                        Originally posted by gotgrassct View Post
                        Thank you!!! THIS IS AMAZING!! I've just finished it. It's awesome. You should include this setup in your system optionally. Or, you should sell the inventory and crafting system seperately, cause this is amazing. It's the reason why i bought this system, and you really saved me here. I Couldn't thank you enough for this system!
                        Also, i'm using this system on Mobile, so i can't right click to use items. Is there anyway i can double tap the items to use them? and if not, is it possible to create another inventory slot, and whenever i drop the item in the new inventory slot, it uses the item? if any of these are possible, could you explain how to set it up? thanks.

                        Comment


                          #13
                          Originally posted by gotgrassct View Post
                          Thank you!!! THIS IS AMAZING!! I've just finished it. It's awesome. You should include this setup in your system optionally. Or, you should sell the inventory and crafting system seperately, cause this is amazing. It's the reason why i bought this system, and you really saved me here. I Couldn't thank you enough for this system!
                          Thank you for your kind words, glad you enjoy it!

                          Originally posted by gotgrassct View Post
                          Also, i'm using this system on Mobile, so i can't right click to use items. Is there anyway i can double tap the items to use them?
                          I can't tell you about the double tap because I don't have mobile development experience but I would wonder if there isn't a way.

                          Originally posted by gotgrassct View Post
                          and if not, is it possible to create another inventory slot, and whenever i drop the item in the new inventory slot, it uses the item? if any of these are possible, could you explain how to set it up? thanks.
                          This would be super easy. Not an inventory slot but just create a new widget. Override the function OnDrop. In that function cast the Operation to BP_InvItemDrag, if that is successful call the function UseItemInSlot Of BP_PlayerCharacter with the Inventory and Slot variables of the BP_InvItemDrag operation. You will also need a GetPlayerCharacter node and cast it to BP_PlayerCharacter in order to be able to call the function UseItemInSlot. Now this should already work.
                          Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

                          Comment


                            #14
                            Originally posted by Pepeeee View Post
                            Thank you for your kind words, glad you enjoy it!



                            I can't tell you about the double tap because I don't have mobile development experience but I would wonder if there isn't a way.



                            This would be super easy. Not an inventory slot but just create a new widget. Override the function OnDrop. In that function cast the Operation to BP_InvItemDrag, if that is successful call the function UseItemInSlot Of BP_PlayerCharacter with the Inventory and Slot variables of the BP_InvItemDrag operation. You will also need a GetPlayerCharacter node and cast it to BP_PlayerCharacter in order to be able to call the function UseItemInSlot. Now this should already work.
                            I'll try it now

                            Comment


                              #15
                              Originally posted by Pepeeee View Post
                              Thank you for your kind words, glad you enjoy it!



                              I can't tell you about the double tap because I don't have mobile development experience but I would wonder if there isn't a way.



                              This would be super easy. Not an inventory slot but just create a new widget. Override the function OnDrop. In that function cast the Operation to BP_InvItemDrag, if that is successful call the function UseItemInSlot Of BP_PlayerCharacter with the Inventory and Slot variables of the BP_InvItemDrag operation. You will also need a GetPlayerCharacter node and cast it to BP_PlayerCharacter in order to be able to call the function UseItemInSlot. Now this should already work.
                              It works! but it also drops the item if the item isn't usable.

                              Comment

                              Working...
                              X