This is an aspect of the Unreal Engine architecture and how it deals with Actors.
[General Explanation]
All game engines have some list of (possibly transient) objects that represent non-static information in the world. In general, this is everything except the terrain, in non-voxel games. In World of Warcraft, they refer to it as the "Object Manager" and the "Linked List". In UE, it is the Unreal Channels. Unreal Channels must be opened before they can be used, populated with specific data, and then closed in order to be freed up.
[Vanguard - Part of this is our implementation, but most is straight from the Unreal Source, which we don't believe Sigil modified much]
VGO Client expects a channel to be "Opened" with a very specific packet before it can be used to receive information, and in fact, the client will CTD if it receives a non-Opening packet on a Closed channel. This Open packet is generated by the VGO Server in the SendSpawn chain of functions. These functions collect information about the spawn, going through each base Class to obtain this, and the information is compressed using the BitStream* line of Classes. Likewise, there is a RemoveSpawn function which sends the, much simpler, Close Channel packet.
The function SendAndRemoveSpawns() (something like that) loops through each Client object and compares distances to all the other ACTOR objects in the chunk Actor encompasses all spawn objects). If the distance meets the criteria AND the Actor hasn't already been opened for that Client, the Client is sent the Open Channel packet for that Actor. Once this packet is sent, the Client being looped has it's list of Actors Sent updated (so it does not get sent another Open Channel Packet for that particular Actor). This packet includes all the information that the client should know about the spawn, including Attachments. When the client chunks or moves out of range of the Actor, the Close Channel packet is sent to the Client, removing all information stored in the Client about that Actor, and the Actor is removed from the "List of Actors Sent to this Client" on the Server.
Having said all this, I haven't researched in Live how equipment was done. I do know that equipment is included in the Open Channel Packet (01 Packet or Unreal Bitstream or Unreal Packet are other ways we refer to these packets). It seems like at all other times, the equipment information is sent in a regular 03/09 packet, but I'm not sure if this was verified against live. Did live ever send any other 01/Unreal Packets containing Attachment information besides during the Open Channel packet?
[quote="zippyzee"]If so, when a character comes into your range, I would then have to find that character's object (relative to you) and attach all the visual items to it.[/quote]
Yes, and this is already done by the Unreal Channel / SendSpawn system. Whether it's actually including valid Attachment information is another question (it probably isn't, as this system sounds new to you). You will need to look at the (I think) SGOUnrealPawn Class and see how attachments are being formed in the NPC and PC Constructors.
[quote="zippyzee"]If that were the case, then why does it update when the other character re-equips an item? I've only updated that particular player's unreal pawn, and done nothing relative to the other player.[/quote]
I'm having trouble interpreting this question: I'm assuming you mean, "Why, when Player 2 re-equips an item does Player 2's pawn update on Player 1's client? I've only sent the Equipment Changed packet to Player 2".
This very well could be because of the Unreal System, but this is just a guess, as I'm going off memory. The Unreal Actor system is set up with "Has Changed" flags for all of the attributes in the various Classes, sometimes referred to as a "Dirty" Flag. When an attribute changes, it sets bit in a bitmask to 1 to indicate it's changed, and when it comes time to flush out another Unreal Packet to the client, these flags are checked and any "Dirty" attributes are pushed into the packet. It
may be that after an item is re-equipped, it flags the whole attachments section as "Dirty" and this is updated via an Unreal Packet.
[quote="zippyzee"]This goes into the lingering problem that when you hover over an item in your inventory, you lose the visual attachment to your character.[/quote]
When you stop hovering over the item, does the appearance come back? Or remain gone?
Whatever your answer, this makes sense to me that the Unreal Channel is never being populated with the appropriate Attachment information. It could be that the information populating the Unreal Channel is the "Base" information for that Actor, and information sent with the 03/09 Packets (which are what you are creating/sending with the OpCodes) is used as temporary information or state information. When mousing over the equipment, the client may be looking at the UnrealChannel information and discovering nothing there.
Is this the same behaviours after you re-equip something? After doing this, can you hover over the item and it remains displayed?
This doesn't explain why Weapon and Shield remain displayed. Perhaps they are being sent as attachments and nothing else is. I don't know without seeing the spawn packets.
You could capture this by Breakpoint, by loading 1 client in, breakpointing the SendSpawn type function in the SGOPCPawn Class, logging in with a second character, and stepping through the creation of the Attachments array. You could create a temporary pointer to the WorldCharacter object within the SGOPCPawn Class by doing something like
Code: Select all
WorldCharacter *character = dynamic_cast<WorldCharacter*>(this->GetActorPointer())
and this way, while stepping through, you could make sure that this SendSpawn line of functions is pulling the information from where it's actually stored (I have a feeling it's not). Note: This pointer is only temporary, so you can mouse over in Visual Studio to see the information fields contained therein.