How would I make a 'time loop' game?

The beginning is a cutscene of you waking up at your desk, and your goal is to get home, but you'll die a lot of times on the way, but instead of a game over, i want you to wake up back at your desk, and make a comment about what just happened

I was thinking of increasing a variable every time you die, but how would i replay the opening cutscene every time? And how would i revert everything back to default, so if you had completed a task for an npc you have to do it again, and they return back to where they were.

There's gonna be no saving or loading feature so I don't need to worry about all that stuff
I would make everything that is undo-able have a switch condition that unswitches to its original state when you repeat an area
I would make everything that is undo-able have a switch condition that unswitches to its original state when you repeat an area
Thank you so much! I will do this 🙂
I would make everything that is undo-able have a switch condition that unswitches to its original state when you repeat an area
Expanding on this more, what I've done in the past is have a Common Event that houses everything that I want reset that is run when I want things reset. That way I can keep track of which things should reset and which should not reset.
It also applies to any map that can be revisited, if you want some events to reflect changes since your last visit.
Sometimes the changes are so dramatic you need to create a different map, so you don't have to add too many branches.
Expanding on this more, what I've done in the past is have a Common Event that houses everything that I want reset that is run when I want things reset. That way I can keep track of which things should reset and which should not reset.
I do this too. I also try to keep them in a block for easier resetting. So for instance switches 100 - 400 could be things that are reset every loop, so I can then mass reset them. Similar with variables.

Also don't ever call Game Over in the engine. Fake it by going to a blank map, show a Game Over picture or something with Show Picture play the music then erase that picture, call your event to reset all switches/variables that you must reset, and go back to the first map.
Hey there. There's an RPGMAKER game made in MV called Mars Underground. It's a time loop game.The credits include several of the plugins used by the author. They recently made a web version on Newgrounds and made the game free. May be worth checking out to give you ideas.

Also don't know what you think of paid plugins but this one may be worth checking out. Could be relevant to you.
The beginning is a cutscene of you waking up at your desk, and your goal is to get home, but you'll die a lot of times on the way, but instead of a game over, i want you to wake up back at your desk, and make a comment about what just happened
so, Stanley Parable but RPG?
I would definitely go with the experts advice above. I am wondering, however, if one could use the same type of mechanic as Newgame+ to implement this. If you actually restarted the game when time travelling back to the start, you might be able to add the new switch variables to the front end.

Original thread: https://forums.rpgmakerweb.com/threads/how-would-i-make-a-time-loop-game.171547/