This article is obsolete as Fire Entities are deprecated as of CRYENGINE 3.5
The fire entities are very specialist entities that can be used to great effect to stimulate the effects of fire propagation and extinguishing fires in such a system.
There are two main entities involved; the propagator entity and the fire particle entity:
We'll look at a simple example to better understand the relationship between the entities.
So let's say in the scene we have here, when the fuel pump is destroyed we want a fire to spread around the building starting out from the fuel pump, but we also want the player to be able to put out this fire.
So the first thing we need is to find a suitable fire particle effect. Open the database view and navigation to the particles tab, open the Smoke_and_Fire PFX library.
In there is the small_flame_wall PFX under the VS2_Fire group. That's the PFX we will be using. It's a good idea to drag the PFX into the world so we can see it in full detail.
Now place a fire particle entity into the level.
Now you can type in the name of the PFX we want to assign to the entity, but for speed and accuracy we'll just copy the Particle Effect field, from our Particle Effect entity into the Particle Effect field on our Fire Particle Entity.
We can now delete our particle effect entity. Looking at our Fire Particle entity we can see that the rotation of the PFX is wrong but before we change this we'll quickly make a solid object around our PFX.
The solid we make is going to determine the bounding box of our Fire entity, which will be used for hit detection. Note: The snap to grid tool is a great aid when creating solids.
Once the solid has been modeled we can use the Save to CGF button to quickly save out our solid as a CGF file.
Place it in an appropriate folder and give it a suitable name, for this tutorial I'm simply going to place it in the level folder and call it Fire_collision.
Now we can assign our newly created CGF to the Fire Particle Entity. This will then be used for collision detection.
Once the model is assigned we can set the DrawDebug variable to true and we should see our model rendered as part of our Fire Particle entity.
For optimisation reasons lets also set our physics properties on our fire Particle entity to false.
Now let's rotate and place our Fire Particle entity next to the building and clone the entity so that we have a few instances surrounding half the building like so.
Now let's just deactivate all the Fire Particle entities, because we don't want them to be active at the start of the level.
We'll also set the Prime property to false, this will cause the PFX to start from nothing and rise up, instead of starting with the flames already burning.
Now let's add our propagator entities, we'll use one propagator for each fire particle and it's a good idea to place them near each other for visual representation.
We can leave the properties on our propagator entities alone, but we will deactivate them, as will only want the propagators to start once the fuel pump is destroyed.
So now to link our propagators together; this is done by using the entity link feature on the propagator. So starting from the propagators closest to the fuel pump on either side, I'm going to link them to the following propagator and so on.
The links now need to be renamed to PropagatorLink, if the links do not have this name the links will not work.
So now we've got our propagator network linked together. It's possible to have two way links creating a more complex system but we'll just stick to a simple one way propagation system for this example.
You'll notice that the fuel pump object currently in the level is a simple brush and so to have it explode we'll need to replace it with a suitable entity.
For the purpose of this example we'll just throw in a Destroyable Object Entity and tweak some of the values to make it work with our model file. The Destroyable Object Entity can be found under Entity -> Physics -> Destroyable Object.
To get our fuel pump model into the destroyable object entity we can simple copy the model name from the brush and paste it into the model field of our destroyable object entity.
You should notice that the model is not yet rendered that's fine; we're going to cheat a little here. In the ModelSubObject field where it says "main", we're simply doing to delete that piece of data and leave the field empty.
The model should now appear on the entity, lets scale it down to match our brush (scale: 0.8).
Now we just need to set a couple of extra parameters for additional effect:
The final thing we need for our Destroyable Object is to change the particle effect. So in the Explosion Effect field enter the string "explosions.barrel.explode".
Now we can just place our Destroyable Object entity over our brush and delete the brush. The Align Selection tool is a useful tool for aligning objects together. Select the Destroyable Object, press the Align Selection icon and then select the brush object.
Now back to our propagators. So now we need to create a flowgraph that will control the propagation and link the propagators to the Fire Particle entity.
So let's create our flowgraph off our new Destroyable object since the fire will be triggered when it's destroyed. When prompted for a Group to place our new flowgraph in, we can create a new Events group.
Now we need to add all our key entities to the flowgraph as shown below.
So simply select our destroyable object, propagators and fire particle entities and in the flowgraph, right click to bring up the right click menu and then select the Add Selected Entity option.
This will add our entities to the flowgraph.
Now we will link our entities together like so, for each Propagator and Fire Particle pair:
Now to trigger the whole system off, we need to connect the Explode output on the Destroyable Object to the Enable input on our two starting propagators.
So to recap, once we've destroyed our fuel pump, we enable our starting propagators and their associated fire particles. Once the pulse time has been reach, our propagators send out a propagate message to linked propagators, this will also enable the propagator and thus their fire particle and so on.
Now if we try and extinguish the fires at the end of our chain we would see that they would be continuously re-spawned. In order to put out the fires completely we could have to extinguish our starting fires first, taking out the head of the chain first, moving iteratively along the chain. We can now quit to game and play around with our system.
Property | Description |
---|---|
Active | Activate the Fire Particle Entity, when set the Particle effect will also start activated |
AttachForm | Used in combination with AttachType variable. Specifies the elements of the Linked Entity that particles will emit from. The PFX must be linked to an entity for these variables to take effect. Note: Does not work with brushes.
|
AttachType | Used in combination with AttachForm variable. Specifies the type of geometry particles emit from. The PFX must be linked to an entity for these variables to take effect. Note: Does not work with brushes.
|
CountPerUnit | Used in combination with AttachForm and Attach Type variable. If set to true the particle effect will be spawned from all available locations on the attached entity e.g. all vertices. |
CountScale | Can be used to increase the PFX count. Should be used with care as can easily ruin the look of PFXs or create overly expensive PFXs. |
DrawDebug | This will render the assigned model object in the world. |
IncreaseRate | No current Function |
MaxIntensity | Set the health of the Fire Particle Entity |
Model | Assign the model to be used for hit detection. |
ParticleEffect | Assign the Particle Effect for the entity. |
Prime | Set whether the particle effect should start from nothing or whether it should start pre-simulated. |
PulsePeriod | Set a pulse period on the particle effect to allow the particle effect to loop. This should be used with care as it can ruin the look of a PFX. It is not a substitute for the continuous setting. If used, the pulse period should always be longer than the lifetime of the particle effect. |
Scale | Scales the particle effect |
SmartObjectClass | Assign a smart object class to the entity. |
SpeedScale | Scales the speed of the particle effect |
Strength | No current Function |
HitReaction | |
BulletType | Bullet type that the fire particle entity will take damage from |
ProjectileName | Projectile Name that the fire particle entity will take damage from |
ProjectileType | Projectile type that the fire particle entity will take damage from |
VerboseHit | Turns On or Off console log output of hit information |
Physics | |
Density | Density of object |
Mass | Mass of object |
Resting | Set to true to start the Entity in the resting state |
RigidBody | Enable Rigid body physics on entity |
RigidBodyActive | Turn on Rigid body physics on the entity as soon as the entity is activated |
RigidBodyAfterDeath | Enable Rigid body physics on entity once the entity is dead |
Property | Description |
---|---|
Active | Start the propagator activated or not |
PulseRandom | Random percentage of the pulse timeout that can be added or subtracted to produce a final pulse period. |
PulseTimeout | Based value for pulse period, this is combined with the pulse random variable to produce varying pulse periods. At the end of each pulse period a propagate message it sent. |
StartDelayRandom | Random percentage of the start delay timeout that can be added or subtracted to produce a final start delay time. |
StartDelayTimeout | Base value for the starting delay of the propagator. So when the propagator is activated this sets a delay time before the pulse period will start counting. So from being activated the first propagate message will be sent after both the Start Delay and the Pulse period has timed out, after that a propagate message will be sent with every pulse period. |
This entity works much the same as a normal propagator but allows random selection of which linked propagators to send the propagate message to. The entity requires at least two linked propagators in order to work.
Property | Description |
---|---|
Active | Start the propagator activated or not |
MaxSynchronPropagation | This is the maximum number of propagate message it will send out at the end of each pulse period. Note: Currently these are not unique messages. For example if this variable is set to 2 and the propagator as 3 links, a single linked propagator could get both propagate messages. |
PulseRandom | Random percentage of the pulse timeout that can be added or subtracted to produce a final pulse period. |
PulseTimeout | Based value for pulse period, this is combined with the pulse random variable to produce varying pulse periods. At the end of each pulse period a propagate message it sent. |
StartDelayRandom | Random percentage of the start delay timeout that can be added or subtracted to produce a final start delay time. |
StartDelayTimeout | Base value for the starting delay of the propagator. So when the propagator is activated this sets a delay time before the pulse period will start counting. So from being activated the first propagate message will be sent after both the Start Delay and the Pulse period has timed out, after that a propagate message will be sent with every pulse period. |