Saturday, April 29, 2017

Unreal Engine Diaries #12

1. Blueprint function libraries cannot be accessed from an Object class.

2. If you spawn a base 'Actor' using Spawn Actor from Class function, it's transform (or the individual sub components like location, rotation, & scale) cannot be modified.

3. The 'Get Game User Settings' node can be used to get the local machine settings like screen resolution, texture quality, etc, but this function returns the settings data from the memory & not from a permanent storage location like the hard disk. This means that if the player had used 'Save Settings' prior to this function call during the same instance of the game, it would not return the saved information.

4. The 'Load Settings' & 'Save Settings' function [accessed through the Get Game User Settings node] loads/saves settings data from/to the disk. While saving new data, it does not apply these settings parameters to the game. So it's generally used in scenarios where the player has to restart the game to see the desired effect.

5. The 'Apply Settings' function [again accessed through the Get Game User Settings node] on the other hand, takes the active game user settings from the memory, applies these to the game, & saves the information in a permanent storage location.

Tuesday, April 25, 2017

Top Down Stealth Toolkit Tutorial: How to modify the size of noise pulse emitters

The Top Down Stealth Toolkit uses pulse emitters to display various types of noises. More than just being visual effects, these emitters also provide the added benefit of displaying the audible range of noise stimuli.

The noise pulse emitter's radius is indirectly dependent on two user-defined factors: one being the AI bot's hearing sense radius, & the other factoring in the loudness of the noise itself. By default, the patrol bots have a hearing sense radius 'r' of 500 units. This basically means that a noise event with a loudness value of 'l' (default = 1.0) can be heard by the AI bot up to a maximum distance of 'r*l' units. For example, the footstep noise with a loudness value of 1.0 can be heard up to 500 units, while a different custom noise event with a loudness of 2.0 could be heard from a distance of 1000 units. This maximum distance corresponds to the maximum size of the pulse particle effect.

In order to demonstrate how to edit this value, I'm going to increase the AI hearing sense radius to 800 units & have the same loudness of 1.0 units for the noise event. So first we have to edit the hearing sense radius from the AI Perception component of the Patrol Bot parent class as shown below:

Since the footstep noise loudness is 1.0, I'm not going to edit it. So now we open up the 'P_FootStepPulse' particle system asset & make the following changes:

1. Within the 'Initial Size' module, set the Start Size value to be (1.0, 1.0, 1.0) [the already existing value works as well, but this is easier to understand]

2. Now within the 'Size by Life' module, set the Life Multiplier out value for point 1 to (1600.0, 1600.0, 1.0). This value is basically a multiplier for the initial size value. Point 0 corresponds to the starting value & hence we multiply it's size with the default (1.0, 1.0, 1.0) & while point 1 (which corresponds to final moment of the particle lifespan) multiplies the x & y values by 1600 units thus forming a circular ring of radius 800 units.

With that, you should be able to control the radius of the noise pulse. You can check more learning content at:

Friday, April 21, 2017

FPS Tower Defense Toolkit Basics: Holographic Tower Constructor

[The following information is based on the v2.1 edition of FPS Tower Defense Toolkit & hence may not remain entirely relevant in later versions. For more information about the toolkit, check out the official support thread in the Unreal Engine forums:]

The Holographic Tower Constructor represents the part of the Holographic Tower Display system that displays Holographic models of the tower designated by the player for construction. The Holograms are created & updated at run time through the 'BPC_HolographicTowerDisplay' component (attached to the player character) using information specified in the 'Holo Constructor Data' array, located within the Tower Manager. Listed below is a brief explanation of the different parameters that drive the Tower Constructor:

- The 'TowerType' enum identifies the data associated with the tower model selected by the player for construction.

- The 'Tower' parameter determines the base mesh (same as the mesh model for the actual tower) used to create the tower hologram.

- The 'LocationOffset_GridCellToTower' controls the translational offset of the tower hologram relative to the location of the focused grid cell.

- The 'UsesGridCellOrientation?' flag decides if the hologram will be partially or fully aligned with the grid generator. For example, the Trap holograms have this value set to true, since their spatial orientation completely match that of the underlying grid generators. The remaining towers (including the Tower Base) on the other hand, have this value set to false, since they only partially align (along the XY plane) with the grid generator.

- The 'HasTurretAttachment?' flag determines if the tower has a turret attached to it.

- The 'TurretAttachment' determines the mesh (same as the turret mesh model for the actual tower) for holographic display of the Turret (if any).

- The 'LocationOffset_TowerToTurretAttachment' controls the translational offset of the turret mesh hologram relative to the tower mesh hologram.

- The 'RotationOffset_TowerToTurretAttachment' controls the rotational offset of the turret mesh hologram relative to the tower mesh hologram.

- The 'DisplayTowerRange?' flag determines if the constructor needs to display the effective range of the tower.

- The 'LocationOffset_TowerToTowerCenter' stores the offset between the tower location & the central point of the tower mesh (specified based on the said offset in the actual tower class).

- The 'AffectsNavMesh?' determines if the placement of the tower affects the navigation mesh. This flag is set to true for the Tower Bases since the AI bots will have to path around them. As a result, the holograms for Tower Bases keep updating their color to convey the availability of valid navigational paths based on the tower placement location.

The Hologram itself will be displayed as long as the selected tower model can be created at the focused location. However, based on the construction pre-requisites like availability of tower resources & valid navigational paths, the hologram may change it's color to reflect the feasibility of constructing a tower of the selected variety under the given conditions.