Skip to main content

Posts

Showing posts from September, 2015

Unreal Engine Diaries #5: GPU Profiling & Rendering Optimizations

The 'profilegpu' console command can be used to profile the GPU for a single frame.The 'r.xxxxx ?' command can be used to get the tool tip for the particular rendering command that is being passed on as parameter.Shaders can get really expensive when using World Position Offset and Tessellation. And speaking of World Position Offset, it can be used to manipulate the vertices of a mesh from it's material.If there are lots of skeletal meshes in a game, the 'SkinnedMeshComp Tick' can get expensive. Reducing the number of bones of the skeletons or the complexity of the anim blueprints can help improve the performance in these scenarios. Also if you do not need the animation to update when you can't see the skeletal mesh consider setting the 'Mesh Component Update Flag' in the details panel of skeletal mesh component to 'Only Tick Pose when Rendered'.The 'Smoothed Frame Rate' option in the Project Settings [under General Settings cate…

Unreal Engine Diaries #4

MaterialEditor: In the material editor, we can add the 'Noise' node to display noisy patterns on the surface of a mesh. However it's very expensive and hence best used for prototyping or in rare scenarios where using an actual texture isn't justified.

Material Editor: The 'Particle Position' node can be used to get the location of a particle in space.

AI: The 'Bind Event to ReceiveMoveCompleted' in the AI controller can be used to automatically receive the status of a bot once it has completed it's movement order. It's got different states like success, aborted, blocked, invalid, etc and these can be used to have the AI respond to different situations with different behaviors. But if we have multiple events waiting for it's reply from different places, like say from different tasks in a Behavior Tree, all these bound events will start executing. And that might not be a desirable outcome. So in order to work around such a scenario, it would be …

Unreal Engine Diaries #3

If we're displaying the game over screen as a widget that's added on to the viewport while the game is running, make sure that the game is paused using the 'Set Game Paused' command. Not doing this would mean that the actors in the level are continuously being updated in the background. Now sometimes it's fine to have the enemy actors move around the screen in the background, but even in those scenarios, it'd be a good practice to make sure that any constantly updating game element that's part of the player character/controller are turned off. An easy example to think of would be an actor in the level that is responding to the mouse cursor. So it might move around the screen, even while we're trying to click that restart button.When creating a widget from within a task in a Behavior Tree, it's a good idea to make sure that it's not being called continuously. It's generally better to create widgets outside the task flow, within normal bluepri…

Unreal Engine Diaries #2

Useful Material Editor Hotkeys [Press these keys & click anywhere on the mat editor]: B = Bump Offset; E = Power; I = If condition; O = OneMinus; P = Panner; S = Scalar Parameter; U = Texture Coordinates; V = Vector ParameterIf you change any of the member names of a Struct in the Content Browser, the connections from the aforementioned members in all blueprints will get cut. As a result, you'll have to go around each of these blueprints and manually connect them again. So it helps to actually note down where you need to reconnect before making changes to a Struct.

Also note that in v4.8 of Unreal Engine, these renamed members will have their input pins invisible the next time you check out those structs in your blueprints. In order to make make them visible again, click on the struct >> go to the details panel >> tick the checkbox next to the changed element to see it again. You'll however have to do this for every instance of the said struct.An Unlit material …

Unreal Engine Diaries #1

When you're calling the function 'Get Random Point in Navigable Radius' [see link below], make sure that you store the vector return value inside a variable if you intend to use it in multiple scenarios later down the line. Otherwise, it ends up creating different randomized vectors each time it's used even though you're taking the same return value. It's kind of obvious as those are different function calls, but sometimes in the heat of the battle, it's easy to overlook small things like these.Blackboards can be cleared from within blueprints using the 'Clear Value' function [see link below]. This is especially useful in scenarios where you're dealing with vector blackboards. Setting it to zero in this case is not ideal as it actually represents a location in the game space.  Basic workflow for creating splines: Create a spline component in your blueprint >> Set it's world points by passing in the vector data [see link below] >> …