Friday, October 29, 2010

Flow Graph Mastery

Movement:RotateEntityTo


The RotateEntityTo node is simple, but incredibly useful. It can be used to establish complicated, infintely iterative movements, and is useful for aligning objects or dynamically animating an environment. The Flow Graph below demonstrates the looping rotation about 2 axes as shown in the second half of the clip.

The Logic:Any is used to loop the Flow Graph, and the Vec3:Add is used to adjust the objects rotation by 90 degrees every time the rotate nodes are called by referring to an Entity:GetPos node to calculate the vector to rotate to.


SWAT Analysis
Strength
The node creates simple movements and rotations, and can be looped to create sequences without the need for animation. The simplicity allows it to be integrated into existing flowgraphs with ease.

Weakness
The node performs its own calculations as to how to rotate to the required vector, making it unpredictable at times, and is incapable of performing full rotations without lopping increments.

Application (Opportunities)
This controls the artificial environment in which the porosity lens is recorded. It allows the fabrication of gravity shifts and creates a dynamic, moving entity to inhabit and explore with the porosity lens.

Threats
Collisions and Physics are not updated on the player while they are stationary, meaning the entity will move through the player if they are not moving. This was fixed by the final mastery, Physics:ActionImpulse, an excellent solution to collision problems. 


Entity:Spawn / Effects:SpawnParticleEffect
One of the keys to an additive porosity lens is the creation of markers at regular time intervals. This is best achieved by either the Spawn:Entity FlowGraph Plug In node, or the Effects:SpawnParticleEntity default node. The Timer triggers the spawning at the specific rate, and the players current position is returned and input into the location to spawn the particle or entity. 

SWAT Analysis
Strength
The Porosity Lens is created through the spawning of entities, whilst simple it is easy to implement and the results can be rewarding. 

Weakness
Controlling the particles after they are spawned is not possible. Controlling the entities after they have spawned is very difficult. Manipulating the orientation of spawned entities requires much calculation. 

Application (Opportunities)
To track where players move and graphically represent their location over time. This creates the data of the porosity lens, and displays it in real time.

Threats
Different particle effects have different properties, and it is difficult to control them. Creating lights can cause framerate loss and limitations of the rendering engine come into play. 


Physics:ActionImpulse
This is my solution for Collision problems inside a rotating Entity. As some problems exist with the other solutions available on the forums (the entity is a GeomEntity and collisions still fail), I implemented my own Flow Graph to counteract the problem. This manually updates the physics on the player by applying a force to the LocalPlayer Entity 50 times per second (roughly once per frame). It is possible to set the period of the time to increase the update speed, but this can drain performance. I found that 50 times per second is sufficient to smoothly navigate without causing issues.


SWAT Analysis


Strength
By updating the physics manually, the collisions have been tweaked to work within the artificial environment created by the rotating GeomEntity. Again, it is a simple solution that works extremely well. It can also be applied to AI, or the GeomEntity itself, however it is preferable to use the LocalPlayer.

Weakness
There is a slight drain on performance when many physics actions are occurring, as it requires recalculation of the players collision mesh every frame. 

Application (Opportunities)
To prevent the failure of collisions inside the GeomEntity. This is vital to the navigation of the environment. 

Threats
Slight decline in performance and frame rate due to increased physics calculation. This is necessary, but needs to be considered when composing the remainder of the environment. 


No comments:

Post a Comment