Skip to content
Ricimon edited this page Nov 15, 2026 · 1 revision

Much of the implementation around arbitrarily spawning VFX was taken from VFXEditor.

FFXIV stores VFX objects such as explosions, fireballs, AOE indicators (a.k.a. omens), tethers, etc. under .avfx file paths. If you have one of these paths, you can enter it into VFXEditor to spawn it or edit it.

A VFX is classified as either a static VFX or an actor VFX. A static VFX can be placed in arbitrary positions and rotations around the game space as well as having additional controls for its transparency and scale. An actor VFX must be attached to a GameObject actor, and may or may not inherit the transform of its attached actor.

Spawning these VFXs involve using FFXIV hooks. FFXIVClientStructs contains the known signatures and function input structures for creating and removing VFX objects, and this is bundled into the Dalamud library. At a low level, the game calls the function located at the known signature location when it spawns real VFX, and a plugin can call the same function at that memory signature to replicate that behavior but with custom arguments.

Static VFX

The signature of the StaticVfxCreate function looks something like E8 ?? ?? ?? ?? F3 0F 10 35 ?? ?? ?? ?? 48 89 43 08, but FFXIVClientStructs also exposes it as FFXIVClientStructs.FFXIV.Client.Graphics.Scene.VfxObject.Addresses.Create. The function input structure is declared in the Delegates class, under VfxObject.Delegates.Create. By writing the following C# code:

var staticVfxCreateAddress = sigScanner.ScanText(VfxObject.Addresses.Create.String);
StaticVfxCreate = Marshal.GetDelegateForFunctionPointer<VfxObject.Delegates.Create>(staticVfxCreateAddress);

where sigScanner is Dalamud's ISigScanner plugin service, we can create an arbitrarily callable function to create a static VFX.

There is also another native function to call to run the static VFX once created, but all put together, arbitrarily spawning a static VFX is called like so:

public void CreateStaticVfx(string path, Vector3 position, float rotation)
{
    Vfx = resourceLoader.StaticVfxCreate(
        (new Utf8String(path)).StringPtr,
        (new Utf8String("Client.System.Scheduler.Instance.VfxObject")).StringPtr
    );

    resourceLoader.StaticVfxRun(Vfx, 0.0f, 0xFFFFFFFF);

    UpdatePosition(position);
    UpdateRotation(rotation);
    Update();
}

Calling the StaticVfxCreate function returns a pointer to a native object that holds the data of the VFX object. FFXIVClientStructs already contains the layout of this data under the VfxObject struct, so plugin code can easily modify the known parameters of this VFX object. One of these known parameters is the object's position, which can be modified at any time by calling the following function:

public void UpdatePosition(Vector3 position)
{
    if (Vfx == null) { return; }
    Vfx->Position = new Vector3
    {
        X = position.X,
        Y = position.Y,
        Z = position.Z
    };
}

Same thing goes with rotation, transparency, and other properties.

The result is a static VFX object placed anywhere and anyhow the plugin wants. The most apparent case of static VFX usage in RaidsRewritten is for AOE indicators, or omens. This is for example an orange circle on the ground before an attack snapshots. Through a lot of normal gameplay, most of us have internalized that real attacks snapshot when the omen disappears and not necessarily when the attack VFX is visible. To recreate this, omen VFX objects are set to fade their transparency value moments before "snapshot". The system in charge of this is

world.System<FadeOmen>()
    .Each((Iter it, int i, ref FadeOmen fade) =>
    {
        var entity = it.Entity(i);
        fade.ElapsedTime += it.DeltaTime();

        var alpha = Math.Clamp(1.0f - (fade.ElapsedTime / fade.Duration), 0, 1);
        entity.Set(new Alpha(alpha));
    });

This particular function goes more into the overall architecture that RaidsRewritten was made under, which is using the flecs ECS architecture. Another system then applies the new alpha value set to the native VfxObject struct.

To make things look nice, destroying static VFX objects also applies a fade-away transparency just like with omens fading. Omens are coded to fade much faster though, to appear consistent with how the game normally fades out omens. The actual native VFX object isn't destroyed until the fade away is done.

Actor VFX

under construction

Clone this wiki locally