Help me find the right search term, looking for general programming organizational overview

Hi, I am a blueprint programmer with little traditional programming experience.

I am rebuilding the “game manager” scripts for my game. Previously I have made a working system and it is fine, but it is a little harder to maintain than I think it could be because I have not used a consistent discipline. I made things up as I went along since this is my learning project.

I am having trouble finding the sort of high level information I seek though. I thought design-patterns might be the correct terminology but that seems more game design focused or returns stuff that is so jargon heavy it’s like different language to me.

What I would like to accomplish is to use a consistent discipline for blueprint communications - i.e. if looking at my code six months from now, even if I dont remember how everything works, I’ll understand that, for instance, X class actors would always send interface messages and Y class actors would always receive messages and run their own logic, etc.

I am familiar with all of the blueprint communication tools which exist, but since i have been learning as I go with this project, it is currently a hodepodge where sometimes I communicate using casting, other times an event dispatcher, and some times the game manager runs events and other times actors in the level run events.

It is small enough I can live this way but I know that things can be done in a more consistent manner. I would like to find some examples of that if possible, especially some high level, plain language overviews if possible.

Performance and hyper - modularity isn’t a real concern here. This is a soloist project and pretty small in scope. I just want to take another step closer to easier to maintain, clean code is all.

Can anybody recommend some article or video wihich might lay out some best practices? Or let me know a good search term?

Thanks

update:
I’ve got some more links down below, but this one is the best:

1 Like

I don’t think there IS anything out there that summarizes all this, not that I’ve seen anyway.

I think the main thing to know, is WHY we use this different methods of communication. Here’s the helicopter view:

  1. Casting. There is a lot of misinformation on youtube about casting. First and probably the main thing about it, it is NOT a method of communication. Casting is a method of checking that the thing you’re about to talk to, is of a certain class. Once that’s done, direct blueprint communication is used to actually make the transition. Direct communication is fine, but has the downside that BP A knows what kind of thing BP B is, which is called ‘tight coupling’.

  2. Interfaces. There’s not enough time here to go into what tightly coupled code is, and it’s not evil, but interfaces are a step up. The whole point of an interface, is it can be called on an ACTOR. That means, BP A doesn’t knows what kind of thing BP B is. That’s loose coupling. You can use an interface call on the sky sphere. It won’t care, but you can do it.

  3. Dispatchers and used when you want one object to simultaneously talk to many others. It avoids using ‘get all actors of class’. But BP B still knows what kind of object BP A is, so that it can make the bind.

  4. Game manager blueprints. It’s great having the modularity of blueprints, but when you drop a bunch of them in the level, they don’t have an overview of themselves. That’s when you can make a separate actor which knows about them and can form a consistent picture of how they’re behaving. There’s nothing wrong with this kind of thing, you need it sometimes. People get a bit snotty about them and think you should use the controller ( I never understand ), or game instance or game mode. But why bother, when it’s only for one level?

So that’s my tuppenny’s worth. It’s horses for courses.

3 Likes

Ask uncle google about “Refactoring”

2 Likes

I thought it was Auntie Google?..

2 Likes

haha - woman are much better at communicating than google :smiley:

2 Likes

Thanks so much for that. I am familiar with the term but didnt’ think to search that.

It led me directly to this useful article, so I’ll link it here just for future searchers:
Refactoring complex Blueprint Code into separate functions in Unreal Engine – JAY VERSLUIS

@ClockworkOcean , thanks so much for that overview. I know its hard to answer very broad questions like this so I appreciate the help. It helps me understand these different tools more fully.

2 Likes

The SOLID Principles of Object-Oriented Programming Explained in Plain English (freecodecamp.org)

Adding this here. This is related to what i was seeking. I guess it’s really “prgorammer 101” stuff, just to help me work with a more consistent design principle.

edit: and this too Community Led Training - Exploring Code Principles in Blueprint - July 18 - Peter L Newton - General / Announcements - Unreal Engine Forums

edit 2: THIS is what i’ve been seeking - Game Programming Patterns

and great examples of design patterns in unreal: Paul Gestwicki - YouTube

heres another goodie:

3 Likes