协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
unreal【开发与工程】Expert game development with Unreal Engine - architecture, C++/Blueprint, rendering (RenderGraph/Nanite/Lumen), physics (Chaos), animation, AI, multiplayer, and performance.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Unreal Engine is a C++ game engine with a powerful actor-component framework (UObject/AActor), Blueprint visual scripting, the Chaos physics system, and the modern rendering stack built on RenderGraph, Nanite virtualized geometry, and Lumen GI.
Unreal Engine 5
Modules (UObject-based reflection)
Core, Engine, Renderer, RHI (D3D12/Vulkan/Metal), Niagara, Chaos
Engine loop -> UEngine::Tick -> UWorld::Tick -> Actor::Tick
GWorld: The current UWorld (loaded levels)
UObject base: GC (garbage collector), reflection (UFUNCTION/UPROPERTY), serialization.AActor: spawnable entity; placement via UWorld::SpawnActor<T>().UActorComponent: reusable behavior attached to actors.| Class | Role |
|---|---|
UGameInstance | Per-process, survives level loads, global save data |
UWorld | The active level + subsystems (GameMode, GameState) |
AGameModeBase | Rules: spawn points, teams, win condition (server-only) |
AGameStateBase | Replicated match state |
APlayerController | Input + view; replicated to owner |
APawn/ACharacter | The controllable entity |
Rule: GameMode is server-only; never game logic from clients. Use GameState for replicated data.
UCLASS()
class MYGAME_API APlayerCharacter : public ACharacter {
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Stats")
int32 MaxHealth = 100;
UFUNCTION(BlueprintCallable, Category="Stats")
void Heal(int32 Amount);
};
U prefix for UObject, A for Actor, F for structs, T for templates.| Concern | Choose |
|---|---|
| Data, core logic, perf-critical hot loops | C++ |
| Designer-facing flow, tuning, event wiring | Blueprint |
| Heavy algorithms (async, math-costly) | C++ + Async tasks |
| Prototypes and small features early | Blueprint then port to C++ |
Rule: Blueprint is for content, C++ is for code. Keep hot paths in native.
Build.cs/Target.cs (UBT). Module dependencies declared there.PCHUsage, CppWarnings, UnityBuild.UE5 renderer records a DAG of passes; the RenderGraph merges/splits passes, computes transient resources, and drives barriers automatically:
SceneColorInit -> BasePass (GBuffer) -> LightCulling -> DeferredShading
-> Reflection capture -> Sky -> Translucency -> PostProcess -> Present
Resources auto-lifecycled (scopes), driver-managed. You can author custom passes via FRenderingCompositePass or FSceneRenderer.
Lumen. console vars.NiagaraDataInterfaceArrays for bulk data.FPhysicsSolver fixed substep at PhysicsSubstep (default 0.0083s).USceneComponent::SetSimulatePhysics(true) to enable RigidBody.OnComponentHit / OnComponentBeginOverlap delegates.AChaosDestructible with geometry collections.Fast small projectiles: enable bCCDEnablePhysics on the body; or use sweep UKismetSystemLibrary::LineTraceSingle per tick.
UWorld::StreamLevel async; RegisterActor/UnregisterActor for hot unload.
UAnimationBlueprintLibrary.FAnimNode_* graph cost.bUseControllerRotationYaw=false for root-motion characters.UAIController + UBehaviorTree + Blackboard.UNavigationSystemV1 for path finding; NavMesh/NavLinkProxy.UAIPerceptionComponent for senses.UFUNCTION(Server) / Multicast / Client.UPROPERTY(Replicated) + GetLifetimeReplicatedProps.ReplicatedUsing for on-rep callbacks.NetServerMaxTickRate (default 30) for server simulation.ServerMove RPC + ClientAckGoodMove.UCharacterMovementComponent handles built-in prediction/reconciliation.Dormancy: actors freeze replication when unchanged (DORM_DormantAll).NetUpdateFrequency: throttle per-actor replication (default 100Hz, reduce for background actors).COND_OwnerOnly, COND_InitialOnly.MARK_PROPERTY_DIRTY + NET_SERIALIZATION.UUserWidget::NativeConstruct for init; NativeTick for per-frame logic.BlueprintNativeEvent; avoid Blueprint Tick.Invalidation Box to reduce widget re-rendering.Cook.bat + Stage.bat per platform.TSoftObjectPtr, TSoftClassPtr).AsyncLoadAsset / StreamableManager.stat unit, stat gpu, ProfileGPU, stat game, Unreal Insights.GetAllActorsOfClass in tick; maintain manager lists.| System | Budget (ms) @ 60fps |
|---|---|
| Gameplay (Tick) | 2.0 |
| Physics (Chaos) | 2.0 |
| Animation | 2.0 |
| AI / NavMesh | 1.5 |
| Rendering (CPU) | 3.0 |
| Rendering (GPU) | 8.3-14.0 |
| UI | 1.0 |
| Netcode | 1.0 |
| Misc / Driver | 2.0 |
| Anti-pattern | Consequence | Fix |
|---|---|---|
| Blueprint Tick heavy logic | Slow, GC | Move to C++ |
| Actor with no tick disabled | CPU wasted | Set bCanEverTick=false |
| Massive Blueprint inheritance chains | Hard to maintain, slow | Composition over deep inheritance |
| Not setting NetUpdateFrequency | Bandwidth | Lower on background actors |
| Full scene replication every frame | Network spike | Dormancy + conditions |
| Nanite on skinned meshes | Error | Fallback LODs |
| Lumen on low-end GPU | Frame drops | Disable or use baked GI |
skills/game/game-engine/ecs-pattern/SKILL.md — ECS patterns, useful alongside Chaos/UObjectskills/game/game-engine/patterns/SKILL.md — engine design pattern catalogskills/game/multiplayer-netcode/SKILL.md — netcode prediction and reconciliationskills/game/game-development/vulkan/SKILL.md — low-level GPU rendering under the RHIskills/game/game-development/physics-engine/SKILL.md — physics solver internals (Chaos)