Skip to content

Untangle visibility, targetable, and other fields in spawn packets#1881

Merged
Haselnussbomber merged 1 commit into
aers:mainfrom
redstrate:work/redstrate/spawn-packets-galore
Jul 15, 2026
Merged

Untangle visibility, targetable, and other fields in spawn packets#1881
Haselnussbomber merged 1 commit into
aers:mainfrom
redstrate:work/redstrate/spawn-packets-galore

Conversation

@redstrate

@redstrate redstrate commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

These various fields are really strangely defined and were bothering me for a while. So I took the time to finally untangle them and hopefully they make more sense now.

The first one is targetable status, this plugs into the GameObject field of the same name but is not the flag itself. The disassembly (from Ghidra) looks daunting but what it's actually doing is checking if the field is 0 - or false - and if so, setting two flags: Unk0 | IsTargetable. Higher values don't do anything, I confirmed by recreating the code in Godbolt.

The next field is Visibility, it also plugs into the GameObject field of the same name but the name is somewhat confusing. On first glance, you would think every object spawned would have a Visibility of 1 - or true - but the field means the opposite! If you spawn an object with Visibility set to 0, its shown and vice versa. I renamed this field to something more suitable. I didn't bother changing the GameObject field for now.

There's a couple of fields that were included in the struct but not read by the client, so I marked those to be removed at a later date.

The final two fields are in SpawnObjectPacket, and are meant for general purpose across all types of objects. For example, the initial SharedGroupTimeline state is passed in Arg1 for EventObj. I renamed those fields as their actual purpose is already known in a way.

The remaining changes is just helpers to make the functions these fields plug into more readable. A lot of the GameObject methods I stumbled upon use this strange update flag system, so I started detailing that but didn't put too much effort into that yet.

Comment thread FFXIVClientStructs/FFXIV/Client/Game/Network/SpawnPackets.cs Outdated
Comment thread FFXIVClientStructs/FFXIV/Client/Game/Network/SpawnPackets.cs Outdated
Comment thread FFXIVClientStructs/FFXIV/Client/Game/Object/GameObject.cs
These various fields are really strangely defined and were bothering me
for a while. So I took the time to finally untangle them and hopefully
they make more sense now.

The first one is targetable status, this plugs into the GameObject field
of the same name but is *not* the flag itself. The disassembly (from
Ghidra) looks daunting but what it's actually doing is checking if the
field is 0 - or false - and if so, setting two flags: Unk0 |
IsTargetable. Higher values don't do anything, I confirmed by recreating
the code in Godbolt.

The next field is Visibility, it also plugs into the GameObject field of
the same name but the name is somewhat confusing. On first glance, you
would think every object spawned would have a Visibility of 1 - or true
- but the field means the opposite! If you spawn an object with
Visibility set to 0, its shown and vice versa. I renamed this field to
something more suitable. I didn't bother changing the GameObject field
for now.

There's a couple of fields that were included in the struct but not read
by the client, so I marked those to be removed at a later date.

The final two fields are in SpawnObjectPacket, and are meant for general
purpose across all types of objects. For example, the initial
SharedGroupTimeline state is passed in Arg1 for EventObj. I renamed
those fields as their actual purpose is already known in a way.

The remaining changes is just helpers to make the functions these fields
plug into more readable. A lot of the GameObject methods I stumbled upon
use this strange update flag system, so I started detailing that but
didn't put too much effort into that yet.
@redstrate
redstrate force-pushed the work/redstrate/spawn-packets-galore branch from 2d74c40 to 73b1217 Compare July 15, 2026 00:23
@Haselnussbomber
Haselnussbomber merged commit fcbf37c into aers:main Jul 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants