Friday, September 25, 2015

Unreal Engine Diaries #4

Material Editor: 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 a good idea to have a check on the current state of the bot in all these events and proceed based on that result. This could help ensure that even thought multiple events maybe fired, only the one that is suitable for the current state of the AI will see through to it's completion.

AI Perception: When using the 'OnPerceptionUpdated' event to detect potential targets, you may have noticed it does not give any details regarding the location of the source of the stimuli. But there is actually a method to retrieve this data. Just loop through this array of actors and for each actor, get it's actors perception ['Get Actors Perception' node], then break down it's output 'info' struct and loop through the 'Info Last Sensed Stimuli' to get all the necessary details like stimulus location, age, tag, etc.

Editor: Press 'Alt+C' in the map editor to see the collision data for all the meshes.

General: In Unreal Engine, most of the physics calculations are done by the CPU.