Best practices to build upon Lyra

In general I’m trying to modify as little as possible. My strategy so far has been as I build out my game, I’m trying to use unmodified Lyra assets as much as possible. However when I see that I’ll need to change something, I copy that asset (sometimes necessarily including one or more of its dependencies) to my project, and change the ones on my end.

In this way I don’t have an ENTIRE copy of EVERY Lyra asset in my code, only the ones that I actually needed to modify.

Unfortunately a lot of what seems to be to be core Lyra code is done in blueprints, which while accessible and easy for scripters to see what’s happening, are otherwise TERRIBLE and ANNOYING AF for knowing who changed what and when, and whether I want that change or not, which to me is far more important than accessibility.

The thought of trying to merge in future Epic BP updates is mind numbing so I’m trying to avoid ever having to do that.

The more I dig into Lyra the more I’ve come to the conclusion that you should NOT try to extend ANYTHING that is implemented as a BP or a DA. Only use the C++ base, and even that (as of 5.0.1) requires you to make minor changes to it to be usable.

Treat the BPs and DAs purely as examples. Make your own BPs and DAs.

If the LyraGame or dependent modules C++ changes, you’ll be able to see exactly what is different from their version to yours, and merging their changes will be as painless as possible.

If their BP/DA examples change, and you’ve derived from them, the amount of work necessary to visually inspect every single aspect of every single BP/DA to try to find meaningful changes is likely going to dwarf the up front cost of spending a few minutes duplicating their example stuff to your project and just building out your own stuff from there.

In your example you change the elimination mode in an Epic-owned BP. If you import their future upgrades, you’ve effectively removed that change you made to their BP, you’ve replaced it with you-have-no-idea-what change they’ve made and there is no real evidence that your expected change no longer exists. :nauseated_face:

BPs and DAs are great for artists and scripters and end users. They’re garbage for building extensible systems that other developers might consider building upon.

So, “is it worth it?” The answer IMO is if you are just messing around with Lyra and you’re going to throw your work away anyway, then no it’s not worth it. Do what the majority of developers are currently doing and modify Lyra in place and know that you’ll never be able to get updates with a reasonable amount of effort in the future.

However if you’re building an actual game that you intend to maintain for a while, and you know you want Epic’s C++ upgrades along the way, then treat the BPs and DAs as reference material, and try to NOT modify them AT ALL. If you need to change a BP/DA then you need to duplicate it to your project and change the one in your project only.

(I have lots of history maintaining C++ for long periods of time, I just started UE5 though so I’m new to BPs/DAs. If someone shows me how I can get reasonable version diffs on BPs/DAs this opinion is subject to change).

4 Likes