Announcement

Collapse
No announcement yet.

Announcing Section #1 for Survival Game - Third-person Player Setup

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

    #76
    Originally posted by Gibdion View Post
    I had a thought, based on outline material, how does one fix it so different types of objects have different color outlines?

    I assume we create a MID maybe for types of objects. A bomb type for example could have a red color, Food would be yellow. Then in the ray cast, we create the MID and assign the color from the object? I've not worked much with MID, so am I even on the right path?

    Just not sure how to access the blendable material in the PP volume through code
    That doesn't work for multi-color objects in a single post-process pass. the effect uses a single channel depth value from CustomDepth. By default can't encode any kind of objecttype data into this buffer and therefor can't apply different colors to different objects.

    One user made a mod to the engine that allows custom tags to be used https://github.com/Temaran/UnrealEng...ustomTagBuffer that effectively enables the use of multi-colored outlines.
    Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

    Comment


      #77
      I've been trying to learn from this and testing in multiplayer.

      After I built the SUsableActor > SPickupActor > SConsumableActor and Use() functionality in my own project I noticed the "PickupSound" was playing pefectly on my Server viewport, but no "Pickup Sound" would play on my Client viewport -- all the other sounds replicate to the client window (ie SBombActor), so Im confused...

      I've created an Attenuation and have assigned it to the PickupSound cue. But that didnt solve the problem for me.


      After playing with it a bunch, I think it only plays in the server window due to the following line, but this is how the tutorial does it.. so Im confused:
      Code:
      void ASCharacter::Use()
      {
         // Only allow on server. If called on client push this request to the server
         if (Role == ROLE_Authority)
         {
            ASUsableActor* Usable = GetUsableInView();
            if (Usable)
            {
               Usable->OnUsed(this);
            }
         }
         else
         {
            ServerUse();
         }
      }
      I can swap some lines around and design the function similarly to SetIsJumping() or SetSprinting()
      Code:
      void ASCharacter::Use()
      {
         ASUsableActor* Usable = GetUsableInView();
         if (Usable)
         {
            Usable->OnUsed(this);
         }
      
         if (Role < ROLE_Authority)
         {
            ServerUse();
         }
      }
      and that can play the sound fine on the Client, but Im guessing its not the right way to do it.


      Anyone else know what might be going on? The tutorial game version functions correctly, but mine doesn't, and Im not sure what Im doing differently.

      Comment


        #78
        Originally posted by berserkturtle View Post

        Anyone else know what might be going on? The tutorial game version functions correctly, but mine doesn't, and Im not sure what Im doing differently.
        Hi turtle,

        One way to handle this is to locally (client side) check if the pickup will succeed (in this case we can perform a trace on the client and see if we find a usable item) if that returns an object we can play the sound immediately. THEN send the request to the server to do the actual pickup logic.

        The other way or dealing with this is to have the server send a respond back to the client if we indeed successfully picked up the item, but keep in mind that it will cause a delay because of the round-trip and in turn, makes the game feel less responsive.

        The first example is "safe" because we only played a sound locally, and did not execute any real pickup/use logic on the client. If you have different types of pickup/use audio per item, you can use the same logic, and fetch the audio file from the returned Actor when calling GetUsableInView() on the client and play that file on the client before sending the request to the server.

        Now for the implementation...

        What I like to do it to split the real logic from the local client code when the key is pressed (as you can see we did with sprinting etc.) so you could add a function OnUse() which is bound to the "E" key and handles the above example of tracing locally before sending the request with Use(). This way we don't have to check inside Use() if we should play the sound by checking if we are the owning client or remote server, etc.

        Hope that clears things up!

        - Tom
        Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

        Comment


          #79

          i can't find the "bomb gray edge" realization,how to do this?

          Comment


            #80
            Originally posted by liXiang View Post

            i can't find the "bomb gray edge" realization,how to do this?
            Im on work and I get the url bloqued by a proxy, but i think he is using this:
            http://www.tomlooman.com/ue4-evolves...e-post-effect/
            pd: Excuse my English.

            Comment


              #81
              thank you very much!!!I found it!

              Comment


                #82
                Originally posted by Alexarg View Post
                Im on work and I get the url bloqued by a proxy, but i think he is using this:
                http://www.tomlooman.com/ue4-evolves...e-post-effect/
                What you need is the post processing volume in your new level. Under "Blendables" we assigned our own post-processing material. If you need you can copy/paste the volume from one level to another. If you are creating a new volume in your level, then don't forget to check "Unbound" in its properties to make sure the volume is always active regardless if we are overlapping or not.

                https://docs.unrealengine.com/latest...cts/index.html

                - Tom

                EDIT: The quoting got messed up, but I see you got it working!
                Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                Comment


                  #83
                  I was hoping to compile this with 4.9.1 due to limited space on an SSD.

                  I'm getting the error
                  Code:
                  1>M:\Dev\Unreal Projects\Survival Series\EpicSurvivalGameSeries-Section-1\SurvivalGame\Source\SurvivalGame\Public/SCharacter.h(72): error C3668: 'ASCharacter::OnLanded' : method with override specifier 'override' did not override any base class methods
                  This is the line it refers to.
                  Code:
                  void OnLanded(const FHitResult& Hit) override;
                  Just in case its not possible to do, what version was this made with originally?

                  Thanks a lot for this series, its going to be a great help. Its very much appreciated!

                  Comment


                    #84
                    Originally posted by Mordynak View Post
                    I was hoping to compile this with 4.9.1 due to limited space on an SSD.

                    I'm getting the error
                    Code:
                    1>M:\Dev\Unreal Projects\Survival Series\EpicSurvivalGameSeries-Section-1\SurvivalGame\Source\SurvivalGame\Public/SCharacter.h(72): error C3668: 'ASCharacter::OnLanded' : method with override specifier 'override' did not override any base class methods
                    This is the line it refers to.
                    Code:
                    void OnLanded(const FHitResult& Hit) override;
                    Just in case its not possible to do, what version was this made with originally?

                    Thanks a lot for this series, its going to be a great help. Its very much appreciated!
                    This function was changed during the API updates of 4.7. The source on Github is updated to 4.9, so all you need is the latest from the master branch. (The section specific branches were made with 4.6 I believe)
                    Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                    Comment


                      #85
                      Ok cool. As soon as my VDSL100 is up and ready, i will start planing this.

                      Looking forward to your example game since a Survival Game was my first "project" i did in UE4 (:


                      Comment


                        #86
                        Hey, i just started to go through the example code and this may be a stupid question.. but why do you prefix all your classes with "S"?
                        I thought "Classes that inherit from SWidget are prefixed by S." ?^^
                        At this point i didnt read through the doc to teach myself the meaning of the SWidget class, so maybe im missing something.

                        Comment


                          #87
                          Originally posted by Desoxi View Post
                          Hey, i just started to go through the example code and this may be a stupid question.. but why do you prefix all your classes with "S"?
                          I thought "Classes that inherit from SWidget are prefixed by S." ?^^
                          At this point i didnt read through the doc to teach myself the meaning of the SWidget class, so maybe im missing something.
                          S is my project prefix from "SurvivalGame" much like Unreal Tournament uses UT as their class prefix. SWidget is purely a coincidence.
                          Game Developer @ LODZERO - My Twitter | tomlooman.com UE4 samples & tutorials | C++ Survival Game (Open-Source)

                          Comment


                            #88
                            Originally posted by Mordynak View Post
                            I was hoping to compile this with 4.9.1 due to limited space on an SSD.

                            I'm getting the error
                            Code:
                            1>M:\Dev\Unreal Projects\Survival Series\EpicSurvivalGameSeries-Section-1\SurvivalGame\Source\SurvivalGame\Public/SCharacter.h(72): error C3668: 'ASCharacter::OnLanded' : method with override specifier 'override' did not override any base class methods
                            This is the line it refers to.
                            Code:
                            void OnLanded(const FHitResult& Hit) override;
                            Just in case its not possible to do, what version was this made with originally?

                            Thanks a lot for this series, its going to be a great help. Its very much appreciated!
                            Refactor 'OnLanded' to just 'Landed' and that will fix the compile error if your trying to compile section 1 on version 4.9.

                            Comment


                              #89

                              Comment


                                #90
                                I really have some problems understanding a few things in this project...
                                I cant find anything which explains the use of classes like "Local Player", "Player State", "Spectator Pawn".

                                And where do you specify where to spawn the player at the start of a game? There are 6 "PlayerStart" objects but only 2 of them, inheriting from
                                your custom "SPlayerStart.h", are used. Even when i start it for 3 players.

                                EDIT: K i figured out the playerstart thing.. for those who want to know: it is used in SGameMode

                                But here is another question: When is "ChoosePlayerStart(AController* Player) called? I guess it uses the Controller spawned for the new player?
                                Last edited by Desoxi; 11-08-2015, 01:57 PM.

                                Comment

                                Working...
                                X