Strange "Leaking Logic" in BluePrints

I have a very strange thing happening in a series of BP’s that I can only describe as “leaking logic”.

I’m working on a 2 player turn-based game and I’m working in the basic start game and turn loop.

I start with

  • Event OnPostLogin
  • Get Num Players
  • If the Player Count == 2
    – Get All Player Controllers
    – Cache All Player Controllers
    – Assign an Index to each Player Controller
  • Start the Game

After Start Game, I call “Start Player Phase on CLIENT”

Here’s where things go wonky.

(Exec pins leaving the screenshot go to Print String nodes)

The Start Player Phase on Client seems to fire BEFORE the Start of the Game has been called on one of the Player Controllers:

The floats are “Get Game Time In Seconds” in the Print String.
The first OnTPC (OnTurnPhaseChanged) fires at 0.020533 Game Seconds.
Player Index of 999 is a debug default value which means the Player Controller is being accessed BEFORE it’s been indexed in OnPostLogin.

This code should be inaccessible until Start Game, and all controllers should be indexed before Start Game happens.

(The only notable point, which adds to the confusion, is that the print screens which are time stamped at 0.020… print to screen AFTER all the content at 0.978… yet the 999 index corraborates the early time stamp…)

But wait, it get’s weirder.

If I Disable “Start Game” this issue doesn’t happen.

This means that the “Start Game” is somehow responsible for calling StartGame and still involved in leaking the logic or executiong early… but the node itself doesn’t fire!?

I can’t figure out why, when Start Game is active, but not being called, logic AFTER that node fires, but when I disable the node, it doesn’t.

One thought about the Time Stamps that occures to me NOW (rubber duck programming FTW) is that the TIME STAMP at the top with the player index of 999 is the game time of the second client, which would be different from the host as this is running as a listen server in editor…

If this is true, then it reframes the question…

Why is the player controller that is being called not indexed? and it’s index value still at default even though both player controllers have been indexed OnPostLogin?

Yeah - this is a different issue.

It’s all about when and how the second player controller is added.

The time stamps must be from two different game lifetimes.

It’s still not working but this problem is now framed differently.