Skip to content

Instantly share code, notes, and snippets.

@bluebright
Last active July 29, 2025 06:18
Show Gist options
  • Select an option

  • Save bluebright/bba0a79656909b971709ad6c703c920c to your computer and use it in GitHub Desktop.

Select an option

Save bluebright/bba0a79656909b971709ad6c703c920c to your computer and use it in GitHub Desktop.
Unreal에서 제공하는 Path 관련 함수의 반환 값을 실행모드 별 비교
// (C++, 시작프로젝트를 포함하여) 새로 생성한 프로젝트에 있는 AGameModeBase 클래스 코드에서 진행
FString FixPathSeparatorsToWinStyle(const FString& InPath)
{
return InPath.Replace(TEXT("/"), TEXT("\\"));
}
void AReleaseTest53GameMode::BeginPlay()
{
Super::BeginPlay();
TArray<FString> PathInfo;
// 수집할 경로 정보들 (모두 경로 구분자 교정)
PathInfo.Add(FString::Printf(TEXT("EngineDir:\t\t\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::EngineDir())));
PathInfo.Add(FString::Printf(TEXT("EngineContentDir:\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::EngineContentDir())));
PathInfo.Add(FString::Printf(TEXT("EngineUserDir:\t\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::EngineUserDir())));
PathInfo.Add(FString::Printf(TEXT("RootDir:\t\t\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::RootDir())));
PathInfo.Add(FString::Printf(TEXT("LaunchDir:\t\t\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::LaunchDir())));
PathInfo.Add(FString::Printf(TEXT("ProjectDir:\t\t\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::ProjectDir())));
PathInfo.Add(FString::Printf(TEXT("ProjectContentDir:\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::ProjectContentDir())));
PathInfo.Add(FString::Printf(TEXT("ProjectConfigDir:\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::ProjectConfigDir())));
PathInfo.Add(FString::Printf(TEXT("ProjectIntermediateDir:\t%s"), *FixPathSeparatorsToWinStyle(FPaths::ProjectIntermediateDir())));
PathInfo.Add(FString::Printf(TEXT("ProjectSavedDir:\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::ProjectSavedDir())));
PathInfo.Add(FString::Printf(TEXT("GeneratedConfigDir:\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::GeneratedConfigDir())));
PathInfo.Add(FString::Printf(TEXT("ProfilingDir:\t\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::ProfilingDir())));
PathInfo.Add(FString::Printf(TEXT("ScreenShotDir:\t\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::ScreenShotDir())));
PathInfo.Add(FString::Printf(TEXT("VideoCaptureDir:\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::VideoCaptureDir())));
PathInfo.Add(FString::Printf(TEXT("AutomationDir:\t\t\t%s"), *FixPathSeparatorsToWinStyle(FPaths::AutomationDir())));
// 타임스탬프 추가된 파일명
const FDateTime Now = FDateTime::Now();
const FString Timestamp = Now.ToString(TEXT("%Y%m%d_%H%M%S"));
const FString FileName = FString::Printf(TEXT("%s_PathInfoOutput.txt"), *Timestamp);
const FString OutputFilePath = FPaths::Combine(FPaths::LaunchDir(), FileName);
// 저장
if (FFileHelper::SaveStringArrayToFile(PathInfo, *OutputFilePath))
{
UE_LOG(LogTemp, Log, TEXT("경로 정보 저장 완료: %s"), *OutputFilePath);
}
else
{
UE_LOG(LogTemp, Error, TEXT("경로 정보 저장 실패: %s"), *OutputFilePath);
}
}
테스트 환경
Win64 기준, 프로젝트 이름 : ReleaseTest53
프로그램 (1) : 에디터에서 바로 실행 (현재 나의 엔진설치 경로 => D:\Program Files\Epic Games\UE_5.3)
프로그램 (2) : Shipping 후 "D:\ShippingOut\Windows\ReleaseTest53.exe" 실행
프로그램 (3) : Shipping 후 "D:\ShippingOut\Windows\ReleaseTest53\Binaries\Win64\ReleaseTest53-Win64-Shipping.exe" 실행
==================================================================
//[Engine 관련 경로 1] : 3경우 출력값 모두 동일
EngineDir: ..\..\..\Engine\
EngineContentDir: ..\..\..\Engine\Content\
EngineUserDir: C:\Users\Admin\AppData\Local\UnrealEngine\5.3\
===================================================================
//[Engine 관련 경로 2]
Editor : 엔진 (에디터) 경로
Shipping : 실행 프로그램과 연관
RootDir
(1) D:\Program Files\Epic Games\UE_5.3\
(2) D:\ShippingOut\Windows\
(3) D:\ShippingOut\Windows\
LaunchDir
(1) D:\Program Files\Epic Games\UE_5.3\Engine\Binaries\Win64\
(2) D:\ShippingOut\Windows\
(3) D:\ShippingOut\Windows\ReleaseTest53\Binaries\Win64\
==================================================================
//[[Project 관련 경로]]
Editor : 프로젝트와 연관
Shipping : 실행 프로그램과 연관
[ProjectDir]
(1) E:\Development_NotSync\Unreal\ReleaseTest53\
(2),(3) ..\..\..\ReleaseTest53\
[ProjectContentDir]
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Content\
(2),(3) ..\..\..\ReleaseTest53\Content\
[ProjectConfigDir]
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Config\
(2),(3) ..\..\..\ReleaseTest53\Config\
==================================================================
[ProjectIntermediateDir]
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Intermediate\
(2),(3) C:\Users\Admin\AppData\Local\ReleaseTest53\Intermediate\
==================================================================
[[Saved 관련 경로]] Editor 모드와 Shipping 모드 다름
Editor 모드 : Project 경로와 연관
Shipping 모드 : 공용 경로와 연관
[ProjectSavedDir]
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Saved\
(2),(3) C:\Users\Admin\AppData\Local\ReleaseTest53\Saved\
[GeneratedConfigDir] : ProjectSavedDir + "Config\"
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Saved\Config\
(2),(3) C:\Users\Admin\AppData\Local\ReleaseTest53\Saved\Config\
[ProfilingDir] : ProjectSavedDir + "Profiling\"
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Saved\Profiling\
(2),(3) C:\Users\Admin\AppData\Local\ReleaseTest53\Saved\Profiling\
[ScreenShotDir]
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Saved\Screenshots\WindowsEditor\
(2),(3) C:\Users\Admin\AppData\Local\ReleaseTest53\Saved\Screenshots\Windows\
[VideoCaptureDir] : ProjectSavedDir + "VideoCaptures\"
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Saved\VideoCaptures\
(2),(3) C:\Users\Admin\AppData\Local\ReleaseTest53\Saved\VideoCaptures\
[AutomationDir] : ProjectSavedDir + "Automation\"
(1) E:\Development_NotSync\Unreal\ReleaseTest53\Saved\Automation\
(2),(3) C:\Users\Admin\AppData\Local\ReleaseTest53\Saved\Automation\
==================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment