Unreal Engine 4.27 (UE4.27) has a similar modular structure to UE5, but there are key differences, such as the use of PhysX for physics instead of Chaos, different rendering systems, and a slightly different folder structure. Below is the UE4.27 Layer-Module-Source Code Mapping Table to help you navigate and modify the source code efficiently.
π UE4.27 Layers, Modules, and Source Code Folder Mapping
Layer | Module | UE4.27 Source Code Location | Key Files to Look At |
---|---|---|---|
Game Layer | Game Code (C++, Blueprints) |
π YourGame/Source/YourGame/ |
YourGameGameMode.cpp , YourGameCharacter.cpp |
Β | Asset Management (Pak, Virtual Texturing) |
π Engine/Source/Runtime/Engine/ |
TextureStreamingManager.cpp , AssetManager.cpp |
Framework Layer | Gameplay Framework (Actors, GameMode, Pawns) |
π Engine/Source/Runtime/Engine/ |
GameModeBase.cpp , AActor.cpp , UWorld.cpp |
Β | AI System (NavMesh, Behavior Trees) |
π Engine/Source/Runtime/AIModule/ |
NavigationSystem.cpp , BehaviorTreeComponent.cpp |
Β | Input System (Legacy Input, Touch Input) |
π Engine/Source/Runtime/InputCore/ |
InputComponent.cpp , TouchInterface.cpp |
Β | UI System (Slate, UMG) |
π Engine/Source/Runtime/Slate/ π Engine/Source/Runtime/UMG/ |
SlateApplication.cpp , UserWidget.cpp |
Engine Layer | Engine (World, Actors, Input, Events) |
π Engine/Source/Runtime/Engine/ |
GameInstance.cpp , LevelStreaming.cpp |
Β | RenderCore (Rendering Pipeline) |
π Engine/Source/Runtime/RenderCore/ |
Renderer.cpp , RenderGraph.cpp |
Β | RHI (Render Hardware Interface) |
π Engine/Source/Runtime/RHI/ |
RHI.cpp , DynamicRHI.cpp |
Β | PhysicsCore (PhysX Physics Engine) |
π Engine/Source/Runtime/PhysicsCore/ |
PhysicsEngine.cpp , PhysXSupport.cpp |
Β | Audio (SoundCore, AudioMixer) |
π Engine/Source/Runtime/AudioMixer/ |
AudioMixer.cpp , DSP.cpp |
Β | Networking (NetDriver, Replication) |
π Engine/Source/Runtime/Online/ |
NetDriver.cpp , ReplicationGraph.cpp |
Core Layer | Core (Memory, Logging, Math, Threading) |
π Engine/Source/Runtime/Core/ |
Core.cpp , ThreadManager.cpp |
Β | CoreUObject (Serialization, GC) |
π Engine/Source/Runtime/CoreUObject/ |
UObjectBase.cpp , GarbageCollection.cpp |
π Key Differences Between UE4.27 and UE5
| Feature | UE4.27 | UE5 | |ββββββ-|βββββββββββ|βββββββββββ| | Physics Engine | PhysX (Nvidia) for rigid body physics | Chaos Physics Engine (default) | | Rendering | Uses Deferred & Forward Renderers | Introduces Nanite & Lumen | | UI System | Slate & UMG | Same (but improved in performance) | | AI System | NavMesh, Behavior Trees | Same (but with minor optimizations) | | Networking | NetDriver, OnlineSubsystem | Same (but better replication performance) |
π How to Find & Modify Modules in UE4.27 Source Code
- Locate the Module Folder
- Go to
Engine/Source/Runtime/
for engine modules. - Go to
YourGame/Source/
for game-specific modules. - Use Visual Studioβs Solution Explorer to browse files.
- Go to
- Find the Build Script (
.Build.cs
)- Every module has a
ModuleName.Build.cs
file. - This file defines dependencies and compilation settings.
- Every module has a
- Modify the Relevant
.cpp
and.h
Files- Gameplay: Modify
AActor.cpp
,GameModeBase.cpp
, orAIController.cpp
. - Rendering: Edit
RenderCore.cpp
orRHI.cpp
. - Physics: Adjust
PhysXSupport.cpp
instead ofChaosSolver.cpp
. - Networking: Optimize replication settings in
NetDriver.cpp
.
- Gameplay: Modify
- Recompile & Test
- Run
GenerateProjectFiles.bat
(Windows) orGenerateProjectFiles.sh
(Mac/Linux). - Open Visual Studio and build the engine/game.
- Use Unreal Insights to measure performance after changes.
- Run
π Best Practices for Mobile Porting in UE4.27
β Disable Unused Modules
- Modify
YourGame.Target.cs
to remove unnecessary desktop features.
β Optimize Rendering (RenderCore
,RHI
) - Switch to Forward Rendering for mobile.
- Use low-overhead shaders and reduce dynamic lighting.
β Reduce Physics Overhead (PhysicsCore
) - Use simple collision meshes and disable complex physics calculations.
β Improve AI Efficiency (AIModule
) - Lower AI tick rate and simplify pathfinding logic.
π Final Takeaway
- UE4.27 uses PhysX instead of Chaos, meaning different physics-related files.
- UE5βs rendering is more advanced, but UE4.27 still supports Mobile Forward Rendering.
- Networking, UI, and AI systems are similar, so porting strategies remain largely the same.
This should help you navigate UE4.27βs source code efficiently and make the right porting optimizations. Need help with a specific module? Let me know! π