BugIt
BugIt
#Overview
name: BugIt
This variable is created as a Console Variable (cvar).
- type:
Exec
- help:
Sorry: Exec commands have no help
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of BugIt is to provide a debugging and bug reporting tool within Unreal Engine 5. It allows developers to quickly capture and report issues they encounter during game development or testing.
BugIt is primarily used in the UnrealEd and Engine modules of Unreal Engine. It’s referenced in the editor’s command handling system and the game’s cheat manager, indicating its utility in both development and gameplay contexts.
The value of this variable is not directly set in the provided code snippets. Instead, BugIt appears to be a command or function that can be invoked in various ways:
- As a console command in the editor (EditorServer.cpp)
- As a cheat command in-game (CheatManager.h and CheatManager.cpp)
- As a Blueprint function (BlueprintPathsLibrary.h)
BugIt interacts with several other functions and variables:
- BugItGo and BugItGoString for setting player location and rotation
- BugItStringCreator for generating BugIt strings programmatically
- FPaths::BugItDir() for determining the directory where BugIt files are saved
Developers should be aware of the following when using BugIt:
- It can capture screenshots and save them to a specific directory
- It can log player location and rotation information
- It’s accessible through various interfaces (console, cheat commands, and Blueprints)
Best practices for using BugIt include:
- Use descriptive names for screenshots to easily identify issues later
- Combine BugIt with other debugging tools for comprehensive issue reporting
- Ensure BugIt is disabled or removed in release builds to prevent cheating or exploitation
- Use BugItStringCreator when you need to generate BugIt strings programmatically without taking screenshots
- Familiarize yourself with the different BugIt functions (BugIt, BugItGo, BugItGoString) to use the most appropriate one for your debugging needs
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorServer.cpp:5834
Scope: file
Source code excerpt:
return HandleJumpToCommand( Str, Ar );
}
else if (FParse::Command(&Str, TEXT("BugIt")))
{
return HandleBugItCommand(Str, Ar);
}
else if( FParse::Command(&Str,TEXT("BugItGo")) )
{
return HandleBugItGoCommand( Str, Ar );
#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/Misc/Paths.h:336
Scope: file
Source code excerpt:
/**
* Returns the directory the engine uses to output BugIt files.
*
* @return screenshot directory
*/
static CORE_API FString BugItDir();
/**
* Returns the directory the engine uses to output user requested video capture files.
*
* @return Video capture directory
*/
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/GameFramework/CheatManager.h:306
Scope (from outer to inner):
file
class class UCheatManager : public UObject
Source code excerpt:
/**
* This will move the player and set their rotation to the passed in values.
* We have this version of the BugIt family as it is easier to type in just raw numbers in the console.
*/
UFUNCTION(exec)
ENGINE_API virtual void BugItGo(float X, float Y, float Z, float Pitch, float Yaw, float Roll);
/**
* This will move the player and set their rotation to the passed in values.
* We have this version of the BugIt family strings can be passed in from the game ?options easily
*/
ENGINE_API virtual void BugItGoString(const FString& TheLocation, const FString& TheRotation);
/**
* This function is used to print out the BugIt location. It prints out copy and paste versions for both IMing someone to type in
* and also a gameinfo ?options version so that you can append it to your launching url and be taken to the correct place.
* Additionally, it will take a screen shot so reporting bugs is a one command action!
*
**/
UFUNCTION(exec)
ENGINE_API virtual void BugIt(const FString& ScreenShotDescription = TEXT(""));
/** This will create a BugItGo string for us. Nice for calling form c++ where you just want the string and no Screenshots **/
UFUNCTION(exec)
ENGINE_API virtual void BugItStringCreator(FVector ViewLocation, FRotator ViewRotation, FString& GoString, FString& LocString);
/** This will force a flush of the output log to file*/
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Kismet/BlueprintPathsLibrary.h:258
Scope (from outer to inner):
file
class class UBlueprintPathsLibrary : public UBlueprintFunctionLibrary
Source code excerpt:
/**
* Returns the directory the engine uses to output BugIt files.
*
* @return screenshot directory
*/
UFUNCTION(BlueprintPure, Category = "Utilities|Paths")
static ENGINE_API FString BugItDir();
/**
* Returns the directory the engine uses to output user requested video capture files.
*
* @return Video capture directory
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/CheatManager.cpp:1110
Scope (from outer to inner):
file
function void UCheatManager::BugIt
Source code excerpt:
void UCheatManager::BugIt( const FString& ScreenShotDescription )
{
APlayerController* const MyPlayerController = GetOuterAPlayerController();
// Path will be <gamename>/bugit/<platform>/desc/desc_ (BugItDir() includes a platform and trailing slash)
const FString BaseFile = FString::Printf(TEXT("%s%s/%s_"), *FPaths::BugItDir(), *ScreenShotDescription, *ScreenShotDescription);
FString ScreenShotFile;