Download

GameInstance/Architecture Question

Hi all, this is my first question on the forums and I’m a bit new to the engine so bear with me if it’s a dumb question. I’m trying to design a RPG and right now I have two menus: a main menu, and a character creation menu. I quickly found out that having member variables store the information from the character creation wasn’t going to work because Character’s are destroyed between levels. My idea is to store the character information in GameInstance since it lives throughout the game session. Is this the best approach? It seems weird to only have Character info (besides movement, stats mainly) in a separate class, but maybe I’m just being weird about it?

Thoughts/Advice?

GameInstance is a good place to store any data that should persist between levels, like your character info.

You can also use level streaming: basically you have one mostly empty map, the “persistent map” as its called, while levels with actual content are loaded and unloaded on the fly and you teleport your character between them. Your character is part of the persistent map, so it won’t get destroyed when you switch between sub levels. Look into level streaming for more information.

Any of these approaches should work fine, however.

Thanks Zhi, right now I’m going with the game instance approach as that seems simple. I might have to look into level streaming though because I want some bigger areas and it seems to be pretty necessary to keep quality and speed reasonable as the maps scale.