Announcement

Collapse
No announcement yet.

Ongoing C++ Gameplay Example Series: Making a Survival Game

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

    Got it working in 4.22

    First i needed to update my VS2017

    Code:
     
     WindowsPlatformCompilerSetup.h(22): error C2338: Visual Studio 2017 versions 15.7 and 15.8 are known to have code generation bugs that affect UE4. Please update to version 15.9.
    Solution: Downloaded the Latest VS 2017
    https://docs.microsoft.com/en-us/vis...s2017-relnotes


    Secondly i received compile errors for the Possess() and UnPossess() calls in SZombieAIController.h
    Code:
     
     error C3248: 'AController::Possess': function declared as 'final' cannot be overridden by 'AEnemyAI::Possess' error C3248: 'AController::UnPossess': function declared as 'final' cannot be overridden by 'AEnemyAI::UnPossess'
    Solution:
    I fixed this by renaming them OnPosess() and OnUnPossess() in header and SZombieAIController.cpp which makes them a custom function instead of an Override function

    Thirdly i received several compile errors concerning FCollisionQueryParams TraceParams in a few files
    Code:
     error C2039: 'bTraceAsyncScene': is not a member of 'FCollisionQueryParams'
    I simply commented them out and this allowed me to build the solution.

    Solution:
    Code:
    //TraceParams.bTraceAsyncScene = true;
    Disclaimer;
    Simply a workaround to build project not getting the engine Possess override function and missing a collision call several places. Toms an awesome instructor figured i could help out so i can continue learning as well!

    Comment


      still doesn't work for me... i did exactly what STLWalterSobchyk said but still..... im really need this to work, can anyone help, i tried to use UE 4.21.2 and UE 4.22.2. Any help is really appreciated!

      Comment


        It looks like Tom upgraded the project on GitHub yesterday to work with 4.22.
        Quantum Mechanics: The dreams that stuff is made from.

        Comment


          Ok.. i was able to load the project, but can anyone help me with the retargeting... Everytime i tried to retarget the animation using one of the paragon character, the gun from the original character just move to the place where it is not supposed to be... Plz really need this to work

          Comment


            I need to handle all of the death events my self but I can seem to find where some of the functions are getting called. UnFreeze(), and StartSpectating(), I know they are in the Player Controller, but I cant seem to find where they are getting called from, When running log statments after taking damage it calls onDeath(), Die(), but neither of the those call start spectating. Any help would be great.

            Comment


              i like this alot

              Comment


                So useful work, thank you!

                Comment


                  Hello Tom, I am curious about why in the hitscan code you the tracing twice. Once from the camera position and one then from the muzzle. Like this:

                  Code:
                  void ASWeaponInstant::FireWeapon()
                  {
                       const FVector AimDir = GetAdjustedAim();
                       const FVector CameraPos = GetCameraDamageStartLocation(AimDir);
                       const FVector EndPos = CameraPos + (AimDir * WeaponRange);
                  
                      /* Check for impact by tracing from the camera position */
                      FHitResult Impact = WeaponTrace(CameraPos, EndPos);
                  
                      const FVector MuzzleOrigin = GetMuzzleLocation();
                  
                      FVector AdjustedAimDir = AimDir;
                      if (Impact.bBlockingHit)
                      {
                           /* Adjust the shoot direction to hit at the crosshair. */
                           AdjustedAimDir = (Impact.ImpactPoint - MuzzleOrigin).GetSafeNormal();
                  
                           /* Re-trace with the new aim direction coming out of the weapon muzzle */
                           Impact = WeaponTrace(MuzzleOrigin, MuzzleOrigin + (AdjustedAimDir * WeaponRange));
                      }
                      else
                     {
                           /* Use the maximum distance as the adjust direction */
                           Impact.ImpactPoint = FVector_NetQuantize(EndPos);
                     }
                  
                     ProcessInstantHit(Impact, MuzzleOrigin, AdjustedAimDir);
                  }
                  In general I have seen in different examples that as the origin of the ray different things are used: the camera position, in your Udemy course you use the actor eyes with GetActorEyesViewPoint() function and the muzzle as well. I know that obviously in the case of AI the camera position can't be used, but what's the rationale behind these different approaches?

                  Comment


                    coyoneda It's common to do multiple linetraces, one comes from the camera and does the actual damage, the other comes from the muzzle location of the gun and is used for cosmetic things like tracer effects, making it look like there is a bullet coming from the weapon. This helps with player standing next to a wall or behind cover, if the actual linetrace came from the gun chances are it would get blocked by something, but because it comes from the camera you only need line of sight.
                    FPS Game Starter Kit
                    Retro Game Starter Kit
                    Quiz Game Starter Kit
                    Twin Stick Game Starter Kit

                    Comment


                      Can't wait and I hope there will be more videos,
                      Thanks Tom

                      Comment

                      Working...
                      X