Map/Level variables store location for starting resources Gamemode/Gamestate concepts

Hey Guys I’m struggling a little with the concept of variables used in level setup and where to store them.

For example, level 1 may give you 5 units of ammunition and 5 health packs where as level 5 may give you 0 ammo and 1 health pack. I would assume you would attach this somehow to the map or level blueprint but I can’t seem to find a good way to do this that feels intuitive.

From what I’ve googled some have suggested using gamemode or gamestate and reading into both seems to return conflicting results on what these two classes are for depending on where you read from.

The game I’m working on is single player only so I don’t have to worry about server/client sync and levels would be loaded at the completion of the previous. I’m using UE5.1 and world partition.

Is there a standard on where these variables reside?

Thanks

I’d consider storing stuff like that in a data asset. My preference would be a data table. But you could just have variables in the game instance as well. You could just put them in a category called “Level Config | MyLevelName” for example.

Then, using a blueprint function library to get your game instance, you can just search “Level Config” and easily find those variables.

Using C++ I believe that you can make a custom ini file as well.

I prefer to house static data all in a single place and then categorize it for easy search/filtering. Rather than having data stored all over in many different classes. Much time and energy can be drained trying to remember where things are and then hunting them down.

Okay thanks that tracks, gonna try the gameinstance route first and move it to a datatable if if gets too confusing. I could always make a folder that houses both the map and levelconfig data table together to keep everything organized.

Appreciate it.

i only use data table if i feel like i could benefit from doing data entry in excel. Otherwise I prefer fewer assets to wrangle and so would put it in the game instance.