Where do you usually blueprint-script your game progress?

Hi!
I’ve been working on a game with my team for some time on already. I’ve been setting all the things around the characters, some AI stuff, materials and rendering-related blueprints, art, animation blueprints, abilities, UIs, and most of that stuff. I’m no expert with programming languages, and all i’m currently working with are BLUEPRINTS. Now we’re starting to set some advanced game logic to implement what i define in my head as the game progress itself.

What i mean by game progress is basically how/when/in which ways will the events that make part of the game be scripted so that they mark an advance. Making the player gain some new attack or power, giving them out a new mission, letting them upgrade things or unlock them… all of this without going back to the previous way it was (you had 100HP, gain +50 HP → you won’t ever be in 100 again but in 150 and so on…) in essence **where do you people usually write all this ‘progressing’ stuff (in blueprints)?? Game Mode? Game State? Player State? ** How do you usually, for example, tell a certain thing to happen (like a cinematic) when crossing a door, but just the very first time a character crosses it, not every time it happens (in this sense the ‘On Begin Play’ node crumbles me… is that on the beginning of the game and never again or every time the player reopens it?). I know the question is wide, but what i really aim at is the place to store all of that advance and make it effectively set.

What’s the most common thing you people use? I’d like to know if the way i’m proceeding with this is appropriate or i’m just going insanely complex without need of doing so. Do you know of good examples too take a look at for this? Thank you very much in advance!
Greetings.

For level specific events etc. extend from a GameInstance class. It’s available most places, then just cast to your type to access it.

For events and progress etc. that need to go beyond just one level extend from a GameState Class, it’s also available most places, then just cast to your type.

You’ll need to set the GameState in the project settings. I forgot where to set the GameInstance, it’s either in the project settings also, or on the map.

Edit: I got GameInstance and GameState backwards when I first wrote this, so flipped them.

Hi mikepurvis! First of all thank you for your answer!
So, for the game-constant things i use the Game State, i guess for example in an event driven way? Like i use a Event inside the player that i’m casting to, to make sure they level up or get a new feature and then call that event inside the GameState whenever the condition needed is filled?
And for the level-specific stuff i can use Game Instances, but how do they work? Do i access them from the levels themselves or i have to create many of them or one and use it multiple times? What do you recommend for a proficient methodology?
Thank you for your help!

I have only used one GameInstance Class. It comes into memory when the level loads, goes out when it closes or another opens and then you have a new instance of it. But I’m using them in games that only have one type. If you need to have many variations, using GameModes may be something for you to look into.

There are some Blueprint Nodes, GetGameState and GetGameInstance which I believe are available everywhere. Just cast them to your classes to access the functions or variables.

It really depends on your game design where you store player level, whether on the actual player or somewhere else.

Okay, i’m going to follow this line of work. Thank you! I’ll come back around if anything urges me. Just to know, how have you been using your GameInstances? If it creates a new one when a new level opens how do i script them (what kind of order)? I know it sounds confusing but what i’m really thinking about is being able to go back and forth to same levels but having things happening in some of them just at a certain point and never again.

For any state that is persistent past a particular level, I put that in GameState.

Things that are level only, such as having picked up the key to exit it, or a count of how many coins have been picked up in the level, I put that in GameInstance. At level end I save things over to the GameState that I want to keep. That works for the game design. Say, with picking up coins. I don’t want the player to get credit for them unless they complete the level, so I save them in the GameInstance during the level play, then on successfully completing it I save them over to the GameState.

Note: By saving, I’m not talking about to disk, just what’s in memory during play.

I see. I understand what you mean. I find it an interesting way of working. Thank you!

Don’t forget the GameMode, which is sometimes a good place to put certain kinds of state / progression!

Hi jwatte!
Please i’d like to know what kind of stuff you use to store in the GameMode. So as far as know we’ve talked about GameMode, GameState, PlayerState, and Game Instance. What are your recommendations for them? I’m very interested.
Thank you in advance!

GameMode is great for anything multi-player, such as who plays what role (for role-based games) and such. Anything that requires server authority can live in GameMode.
The fact that it runs on the server and has to serialize/message/RPC to other objects to actually have effect makes is less convenient for “visual” or “decoration” things, though.

I understand. I guess in the GameMode i will set some of the conditions for things to happen, like if we decided what kind of match to play or so.
What about GameState and GameInstance jwatte? what do you usually put in them? Same as mikepurvis?