Hi all! I’m hoping to get some guidance on how to construct a game such that a player repeats the same exact level 100 times before the game quits. I’m trying to structure it such that each repeat makes the player feel like he or she is starting in the exact spot they started. I realize I could create 100 copies of the same level and just stream them all individually, but I’m wondering if there’s an easier way to accomplish this - maybe by creating a for loop or using the Do N function?
I’m now approaching this by creating a persistent level that loads a streaming level, but I’m not sure how to go about reloading the streaming level multiple times while retaining info and then terminating the game after 100 iterations. (Blueprint photos are below!) Thanks in advance for the help!!
I’m not sure if this is what you mean by concept-wise…
The game as it currently stands drops a first person character in a small enclosed field with two different rooms (with doors) in front of them. In one room, there is a 30% chance of a single coin spawning, and in the other room, there’s a 70% chance of three coins spawning. The player has 15 seconds to enter both rooms and collect whatever coins are available before the next trials begins.
I’m ideally just trying to get this situation to repeat over and over while still maintaining coins collected from previous trials.
There’s a number of ways of doing this, but you don’t have to use a persistent level.
You could actually restart the map using RestartGame as long as on BeginPlay ( in the level BP or somewhere else ) you adjust the level according to data you have previously saved in the gameinstance.
It really depends how much / what sort of changes occur during play.
If you want to make it look like you’ve restarted the level without actually doing so, then you just have to program enough changes in the level ( triggered by some event ) to convince the player of that. This way, you don’t have to use gameinstance.
You can keep restarting the same level. Game Instance is where you need to save your coins or anything else that you want to be persistant in the game. Game instance is always there from the begin of your game till you shut it down.
You can also keep a counter variable of type int to store how many times you have loaded the level or for how many times to load it etc.
Thank you! I think programming the changes in the level would work well for this game, but if I eventually wanted to add more complexity, it might be a hassle to program all the changes triggered by a specific event. I might try to implement it anyways, though!