Behind the Scenes: Flamethrower | jMonkeyEngine VFX

@kevinba99

Great glance! I hadn’t noticed it. Maybe it could be solved in 3 ways:

  • reduce the maximum collision distance of the flamethrower (5 wu instead of 10).
  • increase the initial speed of the flamethrower particles.
  • progressively increase the maximum collision distance of the flamethrower from a minimum starting value to the maximum final value (for example from 1 to 5).

I had in mind to add transient animation while the enemy is engulfed in flames, instead of a calm, unperturbed pose like in the video. :smile:

This is an interesting aspect, but it can be a problem. In fact, the flames would go beyond the walls in case of obstacles. How can I reduce the distance of the particle effect when I hit an obstacle? Do you have any ideas in mind?

This is my setup.

public static ParticleEmitter createFlamethrower(AssetManager assetManager, boolean pointSprite) {
    Type type = pointSprite ? Type.Point : Type.Triangle;
    ParticleEmitter flame = new ParticleEmitter("Flamethrower.Emitter", type, 900);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
    mat.setBoolean("PointSprite", pointSprite);
    flame.setMaterial(mat);
    flame.setLowLife(0.2f);
    flame.setHighLife(1f);
    flame.setImagesX(15);
    flame.setStartSize(0.5f);
    flame.setEndSize(10f);
    flame.setStartColor(ColorRGBA.Orange);
    flame.setEndColor(ColorRGBA.Red);
    flame.setGravity(0, 0, 0);
    flame.setFaceNormal(Vector3f.ZERO);
    flame.getParticleInfluencer().setVelocityVariation(0.1f);
    flame.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 0, 5));
    flame.setParticlesPerSec(0); //Particle Effect Disable
    return flame;
}
1 Like