How to structure the architecture of my game?

Hello everyone,

After completing a couple of tutorials, I am making my first game in UE5.

Now I want to create “something” that manages the objectives in the level. This entity should read from a Data Table the information regarding the goals and activate/deactivate them.

I am struggling a lot with the architecture of this. At first I was creating the goals logic inside of my Level Blueprint, but of course: different levels have different blueprints, so that it is not scalable

  • should I create an actor component and assign it to the Player BP?
  • should I use the GameMode somehow?
  • should I create an actor blueprint to drag and drop inside of any scene?

This is just one challenge, I would like to know more about how to structure an Unreal project.

1 Like

Everybody you ask this question to, will give you a different answer. There is no standard way to do things.

There are things to avoid, for sure, like using the level BP. You can use it for a quick fix, but it’s not the place the put functionality.

I tried very hard in my first 18 months with the engine, and had some very passable results, but threw all of it in the trash. Because you learn things as you go along, and you realize the way you did things previously, just aren’t as good as the way you can do things now.

So, I’d recommend taking an incremental approach to this. Don’t worry about getting it perfect, because you WILL be changing things. Just get it working in what seems to be a sensible way, and be prepared to strip out and re-do large chunks. Possibly several times.

Don’t use things just because you heard of them. There is a lot of misinformation on youtube. Best to find people who have a well used channel and take it with a pinch of salt.

PS: Data tables are a great place information, but they are totally static, you can’t update them.

2 Likes

Ryan Laley has a great series on quests/objectives on youtube. Implimenting a system that spans across any level. Using a struct/data table, a quest actor, quest log component and save game system all tied together with a few widgets. Highly recommend it, helped me build the framework for my system.

1 Like

Thank you very much! When do you put the UI widget creation if not in the level manager?

1 Like

For UI, you do need to decide on how to manage the situation, because it can get quite complicated.

Level BP is so totally not the place, simple because you’ll just have to copy it all for the next level you do.

Pretty logical places to start the UI from, would be the player or the player controller.

Once it’s started, it can manage itself.

1 Like

So what is the level blueprint for?

We could say, it’s for some simple code that only belongs to that level. But it’s a bit like saying ‘how long is a piece of string’? Just because something is there, doesn’t mean you have to use it. All of these things are options.

It is possible to write a totally great game, only using the level blueprint, and nothing else.

It’s also possible to write a game, without putting any code in the level blueprint, player controller, or game mode.

Don’t fall for the youtube ‘this is where this kind of code goes’ thing. It’s very often up to you to figure out a good system for how you want your game to work.

1 Like