Is circular reference/dependency still a problem in Blueprint?

So it’s 2023 and do we still have to clear every circular reference to avoid any potential crash/corruption when the project gets bigger? This is a key to my project architecture since most of my code will be done in BP and now I have been excessively using interface to avoid circular reference. I’ve heard the problem was mostly fixed since UE4.17

Would love to hear other people’s experience as well.

2 Likes

I had a problem a while ago with the circular reference from hell, in 4.27.

It’s still very much alive, I assume also in 5.

I think something is done to mitigate crashes and damage, but long chains of references are never a good thing. Using interfaces is a great way to break these chains at source, and is recommended.

But also becoming aware of how these chains build up, and avoiding them by just by habit.

There’s a util that will find the worst ones for you

1 Like

Wait, so longer chains of circular references is even worse? I thought it was the AB circular dependency that causes most problems…

The free plugin looks nice, will try it out.

Long chains are bad also, because it means that to load your little, apparently innocent, blueprint, the system has to load half the asset list :slight_smile:

There’s a good vid about it, will hunt it out

1 Like

Yeah already watched it before. Very informative video. Actually I was digging into that subject last month.

Here is my current approach to mitigate this so far:

  1. Create a parent class to handle all the logic but no art/audio asset reference(set it to none). Only cast to this logic-only parent class.
  2. Use DataAsset instead of DataTable or DataOnlyBP to assign the actual asset
  3. Use interface or event dispatcher instead of direct reference… mostly
  4. Persistent classes like Player or GameInstance never/seldom reference actor classes placed in the level(Pickups for instance). It’s usally the other way around.
  5. Use soft class/object reference… sparingly.
  6. Gameplay tags… sometimes.

The video did mention a bit of circular reference though. But I guess that’s another topic and I’ve never managed to find a video talk about it though.

1 Like

Well, sounds like you’ve got it pretty nailed.

Like I say, an obvious circular reference was handled previously. But a ‘distant’ one may not be, so well.

Dispatchers unfortunately use a typed reference… :-/

For me, interface is the holy grail. You can basically communicate between all BP types, just using interfaces. Including player controller and game instance etc.

Tight coupling with direct references is not a problem, of course, as long as it’s needed, and doesn’t lead into a long chain.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.