Making a Game with Multiple Rooms, Checkpoints, and Save Slots

Making another Dev Log for something I’ve been trying to program for awhile.

Here’s what I have:

I have a 2D Puzzle-platformer. It’s a linear side-scrolling game with several levels/chapters. It’s in a mansion and the levels are split up between the different parts of the mansion.

Here’s what I want:

I want to make my game have three game slots that the player can choose from. the player should be able to save to the file while they play. I’ve already made my game have multiple rooms, now I want to try and make a checkpoint system.

Here’s what I made:



The first image is the scene where players can select the Load Game option. The black square are going to be the Delete File buttons. They’re going to be clickable.

The second image is the code I have so far. I followed this tutorial to set up what I have so far. I disabled some of the programming because I’m going to try and see if I can use that for the checkpoint system as I continue programming this feature for my game.

The third image is the Global Variables I currently have for the files. It’ll likely grow as I work along this.

I’ll make updates here on my progress because I haven’t found many guides for this.

4 Likes

I just made some cosmetic changes. Things like making the image grow and shrink a little when the mouse hovers over the file buttons.

Next step: Tomorrow, I’m going to try and make a single checkpoint system for the player to respawn after dying. This will be a challenge because I’ll need to make sure the player will return to the starting room, but I’ll see to it. I think I got an idea of what I can do.

1 Like


I was successful in making a single checkpoint system!

What I already had:

  • A health system (heart containers)
  • A Dead State global variable
  • At least three rooms
  • A hazard/enemy
  • A transition animation

What I made:

When I pick one of the loading buttons, there’s a transition animation and the player spawns in the starting room.

When the player is dead, there’s a transition animation and then they respawn at a room I chose. I programmed the Dead State in an External Event and linked it to the chosen rooms.

Furthermore, the smaller enemies will reset after the player dies, which is what I want. That will need to change for the Boss enemies, but that will come later.

If I wanted to keep this as a Rogue-like, I’d probably stop here, but I want to make a checkpoint system, so on we go!

Next step: I’ll need to play with the global variables and change the programming in the saving/checkpoint external event. I want to create multiple checkpoint/saving points.

Sadly, I hit a wall tonight.

When the player dies and hasn’t touched a checkpoint, they restart in the first room. This is correct.

When the player dies after touching a checkpoint, nothing happens. They should respawn near the checkpoint, but that isn’t happening.

The image shows what I was able to do so far. Today was busy, so I didn’t have a lot of time to program today. I’ll try to figure it out tomorrow. If I can’t figure this out, then I’ll keep what I had in the previous post or I can make a Game Over pop-up.

EDIT: I just remembered that I had the Checkpoint extension, so I’ll try that out tomorrow.

1 Like

Well, didn’t get much further tonight.

I tried to use the Platformer tutorials here to help me use the checkpoint extension, but it’s still not working.
How To Make A Game Without Coding - Platformer - Part 1 - YouTube

What I want:

When the player dies without touching the checkpoint, they respawn in the first room.

When the player dies after touching the checkpoint, they respawn at the checkpoint’s position.

What’s happening:

When the player dies after touching the checkpoint, nothing happens. No respawn, no scene change, nothing. I also noticed that after touching the checkpoint, the hurt animation doesn’t play when the player gets hit.

I wonder if maybe it has something to do with the health extension, because most tutorials I’ve found so far either have a health bar or make the player die after just one hit.

I’m realizing what’s wrong.
Every tutorial for storage that I’ve looked up ONLY programs on the assumption that it works on ONE scene/room. I’m trying to make a game with multiple rooms/scenes and saving the data from that. That’s probably a big reason why nothing I’ve tried so far working. If I want to program storage from multiple rooms, there’s extra steps that these tutorials aren’t covering.

I thought that if I just made an External Event for the checkpoints and saving code along with some global variables, it wouldn’t be a problem, but it looks like it is.

The player doesn’t even restart at the checkpoint as intended and I don’t know if that’s a saving issue, a health issue, or something else entirely.

What I want:

  • Make three storage files for the game
  • Working checkpoints scattered throughout the multiple scenes/rooms in the game
  • Let the player save their progress, exit out of the game, reopen the game, and reload their progress from the chosen game file. That would involve storing the data, rewriting it with every checkpoint, and then giving the player the ability to access and open that data.

I’ve played gdevelop games that have done this, so I know it’s possible. I think I just need a break or something to rethink my approach.

EDIT:

What I need:

  • Create storage for the game (should be done in Load Game Scene?)
  • program the checkpoints to save/rewrite the specific storage file.
  • when character dies or player exits game, reload the storage so the player returns from checkpoint area.
1 Like

I give up. I give up.
No matter what tutorials I look up or try, I can’t even create one stupid slot of storage for my game. I’ve tried about 5 in the last three days and my game only got more screwed up.

Hey mate! Don’t give up :slightly_smiling_face:
It’s not that hard, just try to keep it as simple as possible. I would suggest you to try to make one save slot and one check point in game. Then try to save one variable for the test and then try to load that checkpoint. You can use Text object at screen to detect does your variable save/load properly :blush:

3 Likes

Thanks, NT. That means a lot. I’ve been using gdevelop for almost 2 years, so I guess I’m expecting more from myself.

I just found a tutorial about saving the game between multiple rooms, so I’ll try to follow that after some more rest.

1 Like

Glad to help!
Oh keep it up :fist: Yeah, that’s common thing :sweat_smile:

2 Likes

I tried This Tutorial and made some progress.


I have:

  • the starting scene (Office)
  • Checkpoint 1 in the Kitchen scene
  • Checkpoint 2 in the Dining room scene

Here’s what happens:

When the player touches a checkpoint in a room, I can exit out of the game, turn it back on, and the player will spawn in that room. They won’t spawn at the specific position I told them to go to, but this shows that my game officially has working storage, which is a huge step in the right direction!

Next step: I’ll try and see if I can organize this in an external event. That should also make it so that I can open up the menu and selection scenes.

2 Likes

Thanks to some of the previous tutorials, I was able to make it so that I can start the game from the main menu, pick the file from the load scene, and get back into the game to the room that’s on the save file. That was actually the easy part.

The hard part was figuring out how to make the 3 separate save files.


I made three Global Booleans, one for each slot. I didn’t put them as childs in any groups. When the player presses on one of the three save files, one Boolean will set to True and the other two will set to False. If you press the button for Save03, then the Boolean Slot03 will set to True and the Booleans for Slot01 and Slot02 will set to False.

Then in the first game scene, the Office, I wrote is sub-event under Beginning of the Game to check which Boolean is set to True and then load the storage from that game file. If Boolean Slot02 is set to True, then the game will load the stuff saved in GameSlot02. This works with the other save slots.

I noticed one problem and that’s that the rooms will change checkpoint when I try to save on different files. This is likely because the two Globals for the rooms aren’t childs in any of the Global groups. I’ll have to do a lotta copy and pasting tomorrow.

Now all that should be left for this is programing and sorting the room coding for each file, integrating the Dead State, and finalizing the savepoint/Checkpoint extension so the player will respawn at the actual co-ordinates.

2 Likes

I took a break form this for a few days to focus on other things. I didn’t get much further today.

I tried to integrate the dead state, but it didn’t work. The non-disabled programming is the new stuff. The player doesn’t respawn anywhere.

I’m sure I’m just tired from the week, but this is all I got the energy for right now

EDIT: hey, future me. Try an action to change the LastRoom Global Variable when the player is supposed to die.

1 Like

Finally Solved

Me and Lucky-J teamed up to create a game template to make this possible!
Multi-Scene, Multi-Save by The Shade System - Play Online - Game Jolt
You can play it on the browser and download it.

(Oops! I wrote this awhile ago, saved it as a draft because the internet was awful that night, and forgot! Sorry about that.)

I’ve noticed that lots of people are using this as a way to help them with saving. For those who don’t want to or can’t download the game, I’ve taken some screen shots of Multi-Scene, Multi-Save:

I can’t guarantee that this is the best way of creating storage, especially as GDevelop updates, but it could give an idea of what it can look like. If I find better ways to create storage for a game, I’ll make sure to make a thread for that.

Global Variables
The variables CurrentRoom and LastRoom help us program the player changing rooms
SaveSlot, SaveSlotName, and DeleteSlot are for the storage, saving, and loading data
Health is health
CheckpointX, CheckpointY, and StartAtCheckpoint are for programming the checkpoint stuff. The last one tells the game if we need to spawn at the checkpoint’s position when we enter a room or not.
Save1 is the Parent that needs to contain all the things we’ll need to save when we hit a checkpoint in-game.

Menu Screenshot
The menu’s script. Press the button and it takes you to the next scene, Load.

Load Scene
This is where you can start a new game, access a saved game, or clear a game file. I included a screenshot of the scene itself.
At the top, you’ll notice a Sub-Condition at the beginning of the scene to convert a JSON string and store it into a global variable. You’re essentially loading a JSON file to a variable. When we access this variable, we access the contents of the JSON file, which is the game.

Going into the programming of File1: When you press one of the file buttons, you’re

  • changing the name of the global variable to indicate which button opens which storage (there’s 2 for this game)
  • we’re taking the data from the variables in Save1 from the chosen storage and putting it in a Scene Variable called Savespot. You need to have this variable for every scene that has a checkpoint.
  • Setting the variable StartAtCheckpoint to True.

Finally, there’s the Clear data option. When you press the ClearButton (the X button on the screenshot), it will store the data into another global variable DeleteSlot and then delete that. This way, you can save, clear, then resave the data on that file.


Room1
Make sure the Player Extension is linked to every room, regardless of whether it’s a scene with a checkpoint or not.
This is a game that starts with the player not touching a checkpoint yet. The object Marker is to mark where the player starts when they’re starting a new game. We also set the StartAtCheckpoint Boolean to False because when we start a new game or change scenes, we don’t want the player sprite to change position to wherever the checkpoints are.

Room2
Similar to Room1, but since the player doesn’t spawn here at the beginning of the game, there’s no need for a special Marker.

Player Extension
Saving the Game at Checkpoints: This is the part where I tell the game what Global Variables I need to change and update. You’ll also notice that I have a sub-condition that deletes the storage in that save slot and then another sub-condition right after that resaves the data. This means that every time the player activates a checkpoint, the global variables will update, the old data is deleted, and the new data with the updated global variables replaces it.

Player dies, Reset to Checkpoint: When the Health reaches 0, one of two things happen. Either you’ll change scenes to the data you have on the file, or you’ll go back to the checkpoint position if you’re in the room where you saved.

1 Like