Blabberbox » 42 » Unreal Engine 4 NotesShare on Twitter

Unreal Engine 4 Notes

May 16th, 2020 | Posted by pftq in 42 | #
General notes and things I wish I knew as I delved deeper into #UE4:
- Package build by default includes unused assets, which can bloat the size of your game.  Go to Project Settings -> Packaging -> List of Maps to package only assets referenced by that map.  To be more aggressive and reduce unused assets in general (or to keep smaller backups), right-click your map and Migrate to a new project to create a new folder with only the assets used in your game.  More tips on this here.  But don't mark your game as shipping or distribution until you want to disable loading of listening servers by command line / shortcut.
- Never use AND boolean functions.  They will calculate every condition even if the first one is already false.  Use multiple branch nodes instead.  See Blueprint Scripting Has No Short-Circuit Evaluation.
- Disable motion-blur under post-processing in both the FirstPersonCamera and the post-processing volume object in the level.
- isHMDenabled requires a delay of 1 frame from BeginPlay event (node with delay of 0 sec works).
- Removed splitscreen players will still play audio.  Workaround is to teleport them to one of the remaining players before removing and add a delay of a split second before calling Remove Player.
- In Particle Systems, In value means time and out value means the value at that time.
- Use LODMethod ActivateAutomatic for particle systems to not jump in size as you get closer or farther.  Useful for things like bullet trails that don't last long enough for you to notice if it's a bit bigger or smaller than it should be (vs jumping in size if LOD changes).
- Cable component tick group must be post-physics (set with Blueprints). Otherwise at high velocities, the attachments are visually jittery and jump around a lot.  Similar with many other particles-based things like ribbon trails.
- Ribbon trails are still unstable no matter what tick group at high velocities.  Try checking Tangent Recalculation under Ribbon data, which sometimes helps snap it into the right place.
- Ribbon emitters don't work in higher LOD levels.  Don't bother.  Create multiple particle systems with draw distance ranges instead.
- Ribbon particles cost a lot of CPU.  Use sparingly.
- Projectiles can inherit velocity by adding the velocity of the parent, but particle systems at high speeds for some reason over-apply this. If possible, set the particle system to Use Local Space and apply fake initial velocity instead, as that works much more smoothly but you risk the particle system looking off if your initial velocity is too high or low vs what the emitter is actually moving at world space.
- Use Branch + isServer to run things only on the server (like impulse and collisions), not SwitchIfAuthority.
- Keep global variables in GameMode or GameInstance.  Players can then use GetGameMode or GetGameInstance to fetch these variables.  If multiplayer, do all this through the server.
- CustomEvents are asynchronous and avoid holding up the CPU.  Functions and macros are not the same way.
- Replicated actors only update when moved.  If a player joins late, the location will be wrong until something moves it.  So when a new player joins, you want to give every object a nudge to push updates out.
- Replicated variables are necessary for new players joining to know the status of everything else.
lower velocities and use Timelines in blueprints to gradually increase velocity over a split second.
- Create a replicated variable at BeginPlay and a branch with IsLocallyControlled to force server and other players to wait until the owning player has submitted/loaded all information.
- Disable gravity and set gravity scale to zero on non-server players to reduce replication bounciness/jittering.
- Kitbash3D for building collections way higher quality than what you find in the asset store.
- Vector operations in materials are called "components." If you want to break a vector into xyz, use the Split Components for RGB (R=X, G=Y, B=Z).
- Do not use max draw distance on particle systems details tab.  Particles still incur performance hit even if not visible.  Use LODs in the particle emitters editor instead.
- Camera controls and fades are under GetCameraManager.
Last Updated Jun 2nd, 2020 | 42 unique view(s)

Leave a Comment

Name: (Have an account? Login or Register)
Email: (Won't be published)
Website: (Optional)
Comment:
Enter the code from image: