Announcement

Collapse
No announcement yet.

4.13 Transition Guide

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

    4.13 Transition Guide

    Dear Community,

    Here is a thread where you can share all of your learnings as you upgrade your projects to 4.13!

    Here you can ask questions about strange compile errors, issues after upgrading a c++ project, and also share things you discover!

    ~~~


    Online Subsystem 4.13

    Critical And Easy Multiplayer Fix


    For anyone having trouble with OnlineSubsystem in 4.13, our lovely community member [MENTION=29846]Blue man[/MENTION] has posted a fix!

    https://forums.unrealengine.com/show...l=1#post590210

    Originally posted by Blue man View Post

    1: Go to your project's Build.cs and replace this
    Code:
    // Uncomment if you are using Slate UI
    		 PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
    		
    		// Uncomment if you are using online features
    		 PrivateDependencyModuleNames.Add("OnlineSubsystem");
    		 if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
    		 {
    				if (UEBuildConfiguration.bCompileSteamOSS == true)
    				{
    					DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
    				}
    		 }
    with this
    Code:
    // Uncomment if you are using Slate UI
             PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
    
            // Uncomment if you are using online features
             PrivateDependencyModuleNames.Add("OnlineSubsystem");
    
            // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true

    2: Open your project's .uproject file and add this
    Code:
    ,
    	"Plugins": [
    		{
    			"Name": "OnlineSubsystemSteam",
    			"Enabled": true
    		},
    		{
    			"Name": "OnlineFramework",
    			"Enabled": true
    		}
    	]
    [MENTION=552]Rama[/MENTION] I think you should add this to the first post so users that have this problem can easily find a fix for it


    ~~~

    Tickable Object World

    One change I'd like to draw to your attention as a C++ programmer:

    Gameplay Framework

    Originally posted by Our Lovely Friends At Epic
    All Tickable Game Objects should implement the virtual "Get Tickable Game Object World" function to indicate which World they should be ticked with, otherwise they will be ticked after all Worlds as part of the set of tickable game objects that do not belong to a world.
    ~~~

    Level Streaming Kismet ~ Load Level Instance

    My most exciting contributions in 4.13 are the the BP exposure of the Cheat Manager and Load Level Instance in LevelStreamingKismet:

    Code:
    /**  
     	* Stream in a level with a specific location and rotation. You can create multiple instances of the same level!
     	*
     	* The level to be loaded does not have to be in the persistent map's Levels list, however to ensure that the .umap does get
     	* packaged, please be sure to include the .umap in your Packaging Settings:
     	*
     	*   Project Settings -> Packaging -> List of Maps to Include in a Packaged Build (you may have to show advanced or type in filter)
     	* 
     	*          [MENTION=209895]param[/MENTION] LevelName - Level package name, ex: /Game/Maps/MyMapName, specifying short name like MyMapName will force very slow search on disk
     	*          [MENTION=209895]param[/MENTION] Location - World space location where the level should be spawned
     	*          [MENTION=209895]param[/MENTION] Rotation - World space rotation for rotating the entire level
    	*          [MENTION=209895]param[/MENTION] bOutSuccess - Whether operation was successful (map was found and added to the sub-levels list)
     	*          [MENTION=82295]r[/MENTION]eturn Streaming level object for a level instance
     	*/ 
     	UFUNCTION(BlueprintCallable, Category = LevelStreaming,meta=(WorldContext="WorldContextObject"))
     	static ULevelStreamingKismet* LoadLevelInstance(UObject* WorldContextObject, const FString& LevelName, const FVector& Location, const FRotator& Rotation, bool& bOutSuccess);
    My github on this node:
    https://github.com/EpicGames/UnrealE...ull/2320/files



    Rama

    Pics of my Load Level Instance function:

    Click image for larger version

Name:	LoadLevelInstance.jpg
Views:	4
Size:	151.4 KB
ID:	1192530

    Click image for larger version

Name:	LoadLevelInstance2.jpg
Views:	4
Size:	136.2 KB
ID:	1192531

    Click image for larger version

Name:	LoadLevelInstanceBP.jpg
Views:	4
Size:	292.6 KB
ID:	1192532
    Last edited by Rama; 09-18-2016, 01:43 PM.
    100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

    UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

    Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

    #2
    Depricated on 4.13:
    Code:
    FClassIconFinder::RegisterIconSource(StyleSet.Get());
    Unreal 4.13 now registers custom editor classes' icons automatically! Awesome


    Depricated on 4.13:
    Code:
    virtual FName GetPaletteIcon(FLinearColor &OutColor) const override;
    Now must be:
    Code:
    //virtual FName GetPaletteIcon(FLinearColor &OutColor) const override;
    virtual FSlateIcon GetIconAndTint(FLinearColor& OutColor) const override;
    
    FSlateIcon GraphNode::GetIconAndTint(FLinearColor& OutColor) const {
    	//return TEXT("GraphEditor.Macro_16x");
    	return FSlateIconFinder::FindIcon("GraphEditor.Macro_16x");
    }
    Last edited by BrUnO XaVIeR; 09-01-2016, 02:33 PM.
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      #3
      Originally posted by Rama View Post
      Originally posted by Our Lovely Friends At Epic;
      All Tickable Game Objects should implement the virtual "Get Tickable Game Object World" function to indicate which World they should be ticked with, otherwise they will be ticked after all Worlds as part of the set of tickable game objects that do not belong to a world.
      How should the implementation of this look like? I can't even find the function you're referencing.

      Comment


        #4
        Hey in 4.13 this no longer compiles what do i have to do differently?
        DeathAnimDuration = GetMesh()->AnimScriptInstance->Montage_Play(DeathAnim1P, 1.0f);

        2> C:\Program Files (x86)\Epic Games\4.13\Engine\Source\Runtime\Engine\Classes\Animation/AnimBlueprintGeneratedClass.h(15): note: see declaration of 'UAnimInstance'
        2>F:\Users\dark5\Documents\Unreal Projects\darkstorm\Source\darkstorm\darkstormCharacter.cpp(3791): error C2227: left of '->Montage_Play' must point to class/struct/union/generic type
        Cepheus Protocol
        recruitment@halcyonwinds.com

        Comment


          #5
          Tickable Object World
          I didn't look into this yet, but what does that means for us? Does the default behavior is not already set to run as in previous UE version?

          I bet this is a way to handle "rendering" of world on the background to display 3D character in UI or to manage Replay functionality. Any other usage of this?

          Thanks

          Comment


            #6
            Originally posted by Dark583 View Post
            Hey in 4.13 this no longer compiles what do i have to do differently?
            DeathAnimDuration = GetMesh()->AnimScriptInstance->Montage_Play(DeathAnim1P, 1.0f);

            2> C:\Program Files (x86)\Epic Games\4.13\Engine\Source\Runtime\Engine\Classes\Animation/AnimBlueprintGeneratedClass.h(15): note: see declaration of 'UAnimInstance'
            2>F:\Users\dark5\Documents\Unreal Projects\darkstorm\Source\darkstorm\darkstormCharacter.cpp(3791): error C2227: left of '->Montage_Play' must point to class/struct/union/generic type
            Try include:

            #include "Animation/AnimInstance.h"

            Comment


              #7
              Get Tickable Game Object World

              Dear Community,

              In regards to the questions about GetTickableGameObjectWorld():

              There are not that many examples in 4.13 code base, presumably because game objects are your role, not Epic's, Epic is just providing the system for you to use to craft your own game objects

              Here's some 4.13 source code to check out!

              See Tickable.h

              Code:
              /**
               * This class provides common registration for gamethread tickable objects. It is an
               * abstract base class requiring you to implement the Tick() method.
               */
              class ENGINE_API FTickableGameObject : public FTickableObjectBase
              {
              	//...
              
              	virtual UWorld* GetTickableGameObjectWorld() const 
              	{ 
              		return nullptr;
              	}
              };
              Some examples:

              Code:
              AIPerceptionSystem.h
              virtual UWorld* GetTickableGameObjectWorld() const override { return GetWorld(); }
              
              ActiveMovieSceneCaptures.h
              virtual UWorld* GetTickableGameObjectWorld() const override { return ActiveCaptures.Num() != 0 ? ActiveCaptures[0]->GetWorld() : nullptr; }
              
              LevelBounds.h
              /** FTickableGameObject interface */
              virtual void Tick(float DeltaTime) override;
              virtual UWorld* GetTickableGameObjectWorld() const override { return GetWorld(); }
              virtual TStatId GetStatId() const override;
              virtual bool IsTickable() const override;
              virtual bool IsTickableInEditor() const override;
              So for the most part what I am seeing in the 4.13 code is that you'd probably just want to return GetWorld(), what I find rather odd is that Actor.h doesn't seem to do this.

              I am sure Epic can explain this better than I can



              Rama
              Last edited by Rama; 09-02-2016, 03:40 PM.
              100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

              UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

              Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

              Comment


                #8
                Code:
                ViewAPlayer(1);
                called from within the playercontroller::UnFreeze method is no longer working for me to get a player to specate another player. It always tries to spectate its own playerstate.
                This was working fine in 4.12 so not sure what the correct way to get a player controller to view another player is?
                Last edited by SinZero; 09-02-2016, 04:55 PM.

                Comment


                  #9
                  Hi,

                  I have a problem if I declare a UPROPERTY inside a UE_SERVER or WITH_SERVER_CODE preprocessor like:

                  Code:
                  #if WITH_SERVER_CODE
                  UPROPERTY()
                  FString StringVariable;
                  #endif
                  And the error message is : "UPROPERTY inside this preprocessor block will be skipped"

                  Well if someone have a workaround for this, I will really appreciate

                  Comment


                    #10
                    AAI_Object_DefensePoint * CurrentDefensePointTest = Cast<AAI_Object_DefensePoint>(*ActorItr);

                    This generated the current error and thanks Pierdek that solution worked after the update.

                    2>F:\Users\dark5\Documents\Unreal Projects\darkstorm\Source\darkstorm\AIController_Base.cpp(718): warning C4458: declaration of 'CurrentDefensePointTest' hides class member
                    2> f:\users\dark5\documents\unreal projects\darkstorm\source\darkstorm\AIController_Base.h(209): note: see declaration of 'AAIController_Base::CurrentDefensePointTest'
                    Cepheus Protocol
                    recruitment@halcyonwinds.com

                    Comment


                      #11
                      Originally posted by Jackblue View Post
                      Hi,
                      "UPROPERTY inside this preprocessor block will be skipped"
                      Same here with USTRUCT, this must be a bug.
                      Get your GAME done - Productivity Plugins for Unreal Engine.

                      My articles in Game Programming Gems:
                      Real Time Modular Audio Processing For Games
                      A Lightweight Generator for Real-Time Sound Effects
                      Controlling Real-Time Sound Synthesis from Game Physics

                      Comment


                        #12
                        New: SceneComponent AttachChildren, AttachParent, AttachSocketName are now private. Use GetAttachChildren/Parent/SocketName, AttachTo, or SetupAttachment as appropriate.
                        I was going through the c++ fps tutorial and this tripped me up since AttachParent is used to attach Components. I added notes to the wiki for the tutorial. I used the AttachTo() function instead like this...

                        Code:
                        FirstPersonCameraComponent->AttachTo(this->GetCapsuleComponent());
                        FirstPersonMesh->AttachTo(FirstPersonCameraComponent);
                        Also the api reference for AttachTo() has a code example that doesn't include the AttachTo() function! :P

                        Comment


                          #13
                          Taking a look at the 4.13 code, AttachTo() looks similar to 4.11.2 (version I currently work with the most):
                          Code:
                          bool USceneComponent::AttachTo(class USceneComponent* Parent, FName InSocketName, EAttachLocation::Type AttachType /*= EAttachLocation::KeepRelativeOffset */, bool bWeldSimulatedBodies /*= false*/)
                          The following should work fine for you basic attachment:
                          Code:
                          FirstPersonCameraComponent->AttachTo(this->GetCapsuleComponent(), NAME_None);
                          FirstPersonMesh->AttachTo(FirstPersonCameraComponent, NAME_None);
                          Unless you need to offset it etc.
                          Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

                          Comment


                            #14
                            FConstraintInstance has had a major overhaul, most members are deprecated and have been moved into the new ProfileInstance member.
                            There are getters and setters for some, but unfortunately not all, though they can be accessed directly via the above member.

                            From what I can see, joint drives are now bugged to the point that I've reverted to 4.12 - see AH post here.

                            Comment


                              #15
                              Originally posted by kamrann View Post
                              FConstraintInstance has had a major overhaul, most members are deprecated and have been moved into the new ProfileInstance member.
                              There are getters and setters for some, but unfortunately not all, though they can be accessed directly via the above member.

                              From what I can see, joint drives are now bugged to the point that I've reverted to 4.12 - see AH post here.
                              Yup, that change kept me on 4.12 as well.

                              Does anyone know what happened to FCoreUObjectDelegates::PreLoadMap ?

                              FCoreUObjectDelegates::PreLoadMap.AddUObject(this, &UMyGameInstance::BeginLoadingScreen);

                              no longer works.

                              Comment

                              Working...
                              X