refactor: rename template classes to APogo*, move gameplay BPs to /Game/Pogo

This commit is contained in:
Christophe Del Vecchio committed 2026-09-29 03:04:27 +02:00
1 parent 438b0f2154
commit 26a204b49c
83 files changed
+245 -179

No files matched your search

+8 -1
View File
@@ -3,7 +3,7 @@
[/Script/EngineSettings.GameMapsSettings] [/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/ThirdPerson/Lvl_ThirdPerson.Lvl_ThirdPerson GameDefaultMap=/Game/ThirdPerson/Lvl_ThirdPerson.Lvl_ThirdPerson
EditorStartupMap=/Game/ThirdPerson/Lvl_ThirdPerson.Lvl_ThirdPerson EditorStartupMap=/Game/ThirdPerson/Lvl_ThirdPerson.Lvl_ThirdPerson
GlobalDefaultGameMode=/Game/ThirdPerson/Blueprints/BP_ThirdPersonGameMode.BP_ThirdPersonGameMode_C GlobalDefaultGameMode=/Game/Pogo/Blueprints/BP_PogoGameMode.BP_PogoGameMode_C
[/Script/Engine.RendererSettings] [/Script/Engine.RendererSettings]
r.Mobile.ShadingPath=1 r.Mobile.ShadingPath=1
@@ -268,3 +268,10 @@ ConnectionType=USBOnly
bUseManualIPAddress=False bUseManualIPAddress=False
ManualIPAddress= ManualIPAddress=
[CoreRedirects]
+ClassRedirects=(OldName="/Script/TP_ThirdPerson.TP_ThirdPersonCharacter",NewName="/Script/pogo.PogoCharacter")
+ClassRedirects=(OldName="/Script/pogo.TP_ThirdPersonCharacter",NewName="/Script/pogo.PogoCharacter")
+ClassRedirects=(OldName="/Script/TP_ThirdPerson.TP_ThirdPersonGameMode",NewName="/Script/pogo.PogoGameMode")
+ClassRedirects=(OldName="/Script/pogo.TP_ThirdPersonGameMode",NewName="/Script/pogo.PogoGameMode")
+ClassRedirects=(OldName="/Script/TP_ThirdPerson.TP_ThirdPersonPlayerController",NewName="/Script/pogo.PogoPlayerController")
+ClassRedirects=(OldName="/Script/pogo.TP_ThirdPersonPlayerController",NewName="/Script/pogo.PogoPlayerController")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+59
View File
@@ -0,0 +1,59 @@
"""Move the Third Person gameplay Blueprints into /Game/Pogo and clean up redirectors.
Idempotent. Run headless (editor closed):
UnrealEditor pogo.uproject -run=pythonscript -script=Scripts/setup_pogo_content.py -nullrhi -unattended -FullStdOutLogOutput
"""
import unreal
MOVES = {
"/Game/ThirdPerson/Blueprints/BP_ThirdPersonCharacter": "/Game/Pogo/Blueprints/BP_PogoCharacter",
"/Game/ThirdPerson/Blueprints/BP_ThirdPersonGameMode": "/Game/Pogo/Blueprints/BP_PogoGameMode",
"/Game/ThirdPerson/Blueprints/BP_ThirdPersonPlayerController": "/Game/Pogo/Blueprints/BP_PogoPlayerController",
}
FOLDERS = ["/Game/Pogo/Blueprints", "/Game/Pogo/Maps", "/Game/Pogo/Characters",
"/Game/Pogo/Input", "/Game/Pogo/UI", "/Game/Pogo/Materials", "/Game/Pogo/Audio"]
eal = unreal.EditorAssetLibrary
tools = unreal.AssetToolsHelpers.get_asset_tools()
registry = unreal.AssetRegistryHelpers.get_asset_registry()
# Commandlets start with a partial registry: rename needs every referencer discovered.
registry.search_all_assets(True)
registry.wait_for_completion()
def log(msg):
unreal.log(f"POGO_SETUP {msg}")
for folder in FOLDERS:
if not eal.does_directory_exist(folder):
eal.make_directory(folder)
log(f"mkdir {folder}")
for src, dst in MOVES.items():
if eal.does_asset_exist(dst):
log(f"already {dst}")
continue
if not eal.does_asset_exist(src):
log(f"MISSING {src}")
continue
ok = eal.rename_asset(src, dst)
log(f"rename {src} -> {dst} ok={ok}")
# Maps that reference the moved Blueprints (World Settings GameMode override, placed actors).
# Resaving them writes the new paths so the redirectors left behind can be deleted.
MAPS_TO_RESAVE = ["/Game/ThirdPerson/Lvl_ThirdPerson"]
for m in MAPS_TO_RESAVE:
if eal.load_asset(m):
log(f"resave {m} ok={eal.save_asset(m, only_if_is_dirty=False)}")
EXPECTED_PARENT = {
"BP_PogoCharacter": unreal.PogoCharacter,
"BP_PogoGameMode": unreal.PogoGameMode,
"BP_PogoPlayerController": unreal.PogoPlayerController,
}
for dst in MOVES.values():
bp = eal.load_asset(dst)
name = dst.rsplit("/", 1)[1]
cdo = unreal.get_default_object(bp.generated_class()) if bp else None
log(f"CHECK {name} loaded={bp is not None} child_of_{EXPECTED_PARENT[name].__name__}={isinstance(cdo, EXPECTED_PARENT[name])}")
@@ -1,6 +1,6 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Copyright Epic Games, Inc. All Rights Reserved.
#include "TP_ThirdPersonCharacter.h" #include "PogoCharacter.h"
#include "Engine/LocalPlayer.h" #include "Engine/LocalPlayer.h"
#include "Camera/CameraComponent.h" #include "Camera/CameraComponent.h"
#include "Components/CapsuleComponent.h" #include "Components/CapsuleComponent.h"
@@ -12,7 +12,7 @@
#include "InputActionValue.h" #include "InputActionValue.h"
#include "pogo.h" #include "pogo.h"
ATP_ThirdPersonCharacter::ATP_ThirdPersonCharacter() APogoCharacter::APogoCharacter()
{ {
// Set size for collision capsule // Set size for collision capsule
GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f); GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);
@@ -50,7 +50,7 @@ ATP_ThirdPersonCharacter::ATP_ThirdPersonCharacter()
// are set in the derived blueprint asset named ThirdPersonCharacter (to avoid direct content references in C++) // are set in the derived blueprint asset named ThirdPersonCharacter (to avoid direct content references in C++)
} }
void ATP_ThirdPersonCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) void APogoCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{ {
// Set up action bindings // Set up action bindings
if (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent)) { if (UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent)) {
@@ -60,11 +60,11 @@ void ATP_ThirdPersonCharacter::SetupPlayerInputComponent(UInputComponent* Player
EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping); EnhancedInputComponent->BindAction(JumpAction, ETriggerEvent::Completed, this, &ACharacter::StopJumping);
// Moving // Moving
EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &ATP_ThirdPersonCharacter::Move); EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &APogoCharacter::Move);
EnhancedInputComponent->BindAction(MouseLookAction, ETriggerEvent::Triggered, this, &ATP_ThirdPersonCharacter::Look); EnhancedInputComponent->BindAction(MouseLookAction, ETriggerEvent::Triggered, this, &APogoCharacter::Look);
// Looking // Looking
EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &ATP_ThirdPersonCharacter::Look); EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &APogoCharacter::Look);
} }
else else
{ {
@@ -72,7 +72,7 @@ void ATP_ThirdPersonCharacter::SetupPlayerInputComponent(UInputComponent* Player
} }
} }
void ATP_ThirdPersonCharacter::Move(const FInputActionValue& Value) void APogoCharacter::Move(const FInputActionValue& Value)
{ {
// input is a Vector2D // input is a Vector2D
FVector2D MovementVector = Value.Get<FVector2D>(); FVector2D MovementVector = Value.Get<FVector2D>();
@@ -81,7 +81,7 @@ void ATP_ThirdPersonCharacter::Move(const FInputActionValue& Value)
DoMove(MovementVector.X, MovementVector.Y); DoMove(MovementVector.X, MovementVector.Y);
} }
void ATP_ThirdPersonCharacter::Look(const FInputActionValue& Value) void APogoCharacter::Look(const FInputActionValue& Value)
{ {
// input is a Vector2D // input is a Vector2D
FVector2D LookAxisVector = Value.Get<FVector2D>(); FVector2D LookAxisVector = Value.Get<FVector2D>();
@@ -90,7 +90,7 @@ void ATP_ThirdPersonCharacter::Look(const FInputActionValue& Value)
DoLook(LookAxisVector.X, LookAxisVector.Y); DoLook(LookAxisVector.X, LookAxisVector.Y);
} }
void ATP_ThirdPersonCharacter::DoMove(float Right, float Forward) void APogoCharacter::DoMove(float Right, float Forward)
{ {
if (GetController() != nullptr) if (GetController() != nullptr)
{ {
@@ -110,7 +110,7 @@ void ATP_ThirdPersonCharacter::DoMove(float Right, float Forward)
} }
} }
void ATP_ThirdPersonCharacter::DoLook(float Yaw, float Pitch) void APogoCharacter::DoLook(float Yaw, float Pitch)
{ {
if (GetController() != nullptr) if (GetController() != nullptr)
{ {
@@ -120,13 +120,13 @@ void ATP_ThirdPersonCharacter::DoLook(float Yaw, float Pitch)
} }
} }
void ATP_ThirdPersonCharacter::DoJumpStart() void APogoCharacter::DoJumpStart()
{ {
// signal the character to jump // signal the character to jump
Jump(); Jump();
} }
void ATP_ThirdPersonCharacter::DoJumpEnd() void APogoCharacter::DoJumpEnd()
{ {
// signal the character to stop jumping // signal the character to stop jumping
StopJumping(); StopJumping();
@@ -5,21 +5,21 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "Logging/LogMacros.h" #include "Logging/LogMacros.h"
#include "TP_ThirdPersonCharacter.generated.h" #include "PogoCharacter.generated.h"
class USpringArmComponent; class USpringArmComponent;
class UCameraComponent; class UCameraComponent;
class UInputAction; class UInputAction;
struct FInputActionValue; struct FInputActionValue;
DECLARE_LOG_CATEGORY_EXTERN(LogTemplateCharacter, Log, All); DECLARE_LOG_CATEGORY_EXTERN(LogPogoCharacter, Log, All);
/** /**
* A simple player-controllable third person character * A simple player-controllable third person character
* Implements a controllable orbiting camera * Implements a controllable orbiting camera
*/ */
UCLASS(abstract) UCLASS(abstract)
class ATP_ThirdPersonCharacter : public ACharacter class APogoCharacter : public ACharacter
{ {
GENERATED_BODY() GENERATED_BODY()
@@ -52,7 +52,7 @@ protected:
public: public:
/** Constructor */ /** Constructor */
ATP_ThirdPersonCharacter(); APogoCharacter();
protected: protected:
+8
View File
@@ -0,0 +1,8 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "PogoGameMode.h"
APogoGameMode::APogoGameMode()
{
// stub
}
@@ -4,20 +4,20 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h" #include "GameFramework/GameModeBase.h"
#include "TP_ThirdPersonGameMode.generated.h" #include "PogoGameMode.generated.h"
/** /**
* Simple GameMode for a third person game * Simple GameMode for a third person game
*/ */
UCLASS(abstract) UCLASS(abstract)
class ATP_ThirdPersonGameMode : public AGameModeBase class APogoGameMode : public AGameModeBase
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
/** Constructor */ /** Constructor */
ATP_ThirdPersonGameMode(); APogoGameMode();
}; };
@@ -1,7 +1,7 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Copyright Epic Games, Inc. All Rights Reserved.
#include "TP_ThirdPersonPlayerController.h" #include "PogoPlayerController.h"
#include "EnhancedInputSubsystems.h" #include "EnhancedInputSubsystems.h"
#include "Engine/LocalPlayer.h" #include "Engine/LocalPlayer.h"
#include "InputMappingContext.h" #include "InputMappingContext.h"
@@ -9,7 +9,7 @@
#include "pogo.h" #include "pogo.h"
#include "Widgets/Input/SVirtualJoystick.h" #include "Widgets/Input/SVirtualJoystick.h"
void ATP_ThirdPersonPlayerController::BeginPlay() void APogoPlayerController::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
@@ -33,7 +33,7 @@ void ATP_ThirdPersonPlayerController::BeginPlay()
} }
} }
void ATP_ThirdPersonPlayerController::SetupInputComponent() void APogoPlayerController::SetupInputComponent()
{ {
Super::SetupInputComponent(); Super::SetupInputComponent();
@@ -60,7 +60,7 @@ void ATP_ThirdPersonPlayerController::SetupInputComponent()
} }
} }
bool ATP_ThirdPersonPlayerController::ShouldUseTouchControls() const bool APogoPlayerController::ShouldUseTouchControls() const
{ {
// are we on a mobile platform? Should we force touch? // are we on a mobile platform? Should we force touch?
return SVirtualJoystick::ShouldDisplayTouchInterface() || bForceTouchControls; return SVirtualJoystick::ShouldDisplayTouchInterface() || bForceTouchControls;
@@ -4,7 +4,7 @@
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "GameFramework/PlayerController.h" #include "GameFramework/PlayerController.h"
#include "TP_ThirdPersonPlayerController.generated.h" #include "PogoPlayerController.generated.h"
class UInputMappingContext; class UInputMappingContext;
class UUserWidget; class UUserWidget;
@@ -14,7 +14,7 @@ class UUserWidget;
* Manages input mappings * Manages input mappings
*/ */
UCLASS(abstract) UCLASS(abstract)
class ATP_ThirdPersonPlayerController : public APlayerController class APogoPlayerController : public APlayerController
{ {
GENERATED_BODY() GENERATED_BODY()
-8
View File
@@ -1,8 +0,0 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "TP_ThirdPersonGameMode.h"
ATP_ThirdPersonGameMode::ATP_ThirdPersonGameMode()
{
// stub
}