Posted May 31, 2024 by KAPGamingStudio
#CodeReview #DidIDoItRight?
I have reviewed my code and execution and have concluded the following:
Pitfall: The code may have unnecessary complexity in the initial stages of prototyping.
Resolution: Simplify the prototype by focusing on core functionalities first. Ensure that each feature is implemented in a modular and testable manner before adding complexity.
Pitfall: Over-reliance on Blueprints for performance-critical systems.
Resolution: Implement core gameplay mechanics and performance-critical systems in C++. Use Blueprints for rapid prototyping and non-critical systems. This hybrid approach leverages the strengths of both C++ and Blueprints.
Pitfall: Lack of profiling and optimization.
Resolution: Regularly profile your game using Unreal's built-in tools to identify performance bottlenecks. Optimize critical areas using techniques like LOD generation, occlusion culling, and dynamic instance batching
Pitfall: Hard-coding asset references and inefficient asset management.
Resolution: Use soft references and asynchronous asset loading to manage assets efficiently. Implement level streaming and world composition to break up the world into manageable chunks
Pitfall: Tightly coupled systems and lack of separation of concerns.
Resolution: Follow established architectural patterns like MVC or ECS. Separate concerns by creating dedicated classes/systems for specific functionalities (e.g., AI, physics, UI). Use interfaces and abstract base classes to decouple systems and promote code reuse
Issue: The AI system for following and staying might be too tightly coupled with other game logic.
Refactoring:
AIController class to manage AI behavior separately from the player and other game logic.
Issue: The interaction system for picking up and placing body parts may not be modular or scalable.
Refactoring:
InteractionComponent that can be attached to any interactable object.
Issue: Hard-coded asset references for body parts and coffins.
Refactoring:
Issue: Potential performance bottlenecks due to inefficient asset management and lack of optimization.
Refactoring:
Issue: Redundant or unused code that adds unnecessary complexity.
Resolution: Regularly review and clean up the codebase to remove any redundant or unused code. This helps maintain a clean and efficient codebase.