Agent.GetFortCharacter[] can fail with PlayerAddedEvent

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

Verse

Summary

Agent.GetFortCharacter can fail with PlayerAddedEvent

Steps to Reproduce

  • Subscribe to PlayerAddedEvent
  • In Event Handler: if(FortChar := Agent.GetFortCharacter) {
    } else { Print(“No Fort Char”) }

Expected Result

FortChar should always be set for a Player Agent

Observed Result

It fails seemingly random. It might only occur with very big projects, that take a long time to load (over 600 MB).

Platform(s)

UEFN

IMO, A player being added to the Playspace doesn’t mean he’s controlling a character.
I agree that this being random is weird, but I don’t think you should rely on this function to retrieve the fort_character. We all have to make the difference between the fort_character and the player. What if your player spawns in spectator ? He shouldn’t have a fort_character.
Also whenever your player disconnect you’ll notice that the fort_character.IsActive[] won’t work anymore.

Not saying this is not a bug, but I’d understand if they told you so.

PlayerAddedEvent means a player has connected to the map but it does not mean they have fully loaded in. It is possible they have not spawned in and/or not been assigned a fort_character yet. You can tell this by the black screen and the loading at the bottom right.

You should always use the spawned event to grab newly added players instead of player added due to this “bug”

Well, that’s more a wish for how the API should work alternatively. While I understand your point, I would not suggest to not rely on that method.

If this behavior is somehow intended, it should be clearly documented, which it is not.

Especially as the documented PlayerAddedEvent explicitly mentions that the payload is a fort_character.

In other words, this is a critical bug.

Is it definitely a bug? It says “Fails if InAgent is not a fort_character”, which is possibly the case before the character has been spawned in

PlayerAddedEvent says “Returns a subscribable with a payload of thefort_character that entered the fort_playspace.” which to me is a guarantee that during that callback calling into GetFortCharacter should not fail.

Either way, something has to happen. A bug fix or decimation update and clarification.

1 Like

cc @Conan_Reis, we need some clarification on this, as I think it’s a pretty critical issue if it turns out to be a real bug.

If the fort_character is created lazily, but not during GetFortCharacter call, it might need to do so now.

1 Like

No the function returns a player, it should not return a fort_character, I want this function to be called even when I send my players to spectator on start you know, I think the doc is just not up to date. :man_shrugging:

Well I know that the payload returns and that the documentation is somewhat off there as well. The point is that per that documentation we should expect fort_character to be accessible during the callback. Something is clearly off and the verse team has to provide some update to something.

1 Like

The status of UCB-1059 incident has been moved from ‘Needs Triage’ to ‘Awaiting Validation’.