Then we have your "Groundhog Day" Loop Scenario in which a character is stuck in a repeating time loop, forced to re-live the same moments over and over again until a certain condition is met. This is typically a type of Mental Time Travel.
When you combine these two you get the Groundhog Peggy Sue, in which a character is forced to re-live a significant portion of their life over and over again, always looping back to a certain point in their childhood if he dies or reaches a predetermined point in time. The protagonist tends to be a Failure Knight if the loop depends on them saving someone or killing the Big Bad. Sometimes the person looping is trying to avoid some kind of disaster; however, no matter what they do, the future never changes unless of course it goes From Bad to Worse.
In some versions of this trope the characters live through each repeat of the loop fully, while in others they make a change in the past and are instantly transported to the "present" to see what their actions had changed. With so much life experience, they quickly become the most capable of the cast.
A popular subtype of this trope enables the Peggy Sue to interact with their world in a way more typical of video games than reality through the import of an original or published system, such as the the S.P.E.C.I.A.L. stat system and perk system from Fallout. Common internet terms for this type of fanfic include Life Is a Game, The Video Game Plot, [Fandom]: Game of the Year and [Character] The Gamer.
This subtype generally begins with the main character waking to their first New Game+ after a first playthrough (i.e. canon) characterized by a mandatory Harder Than Hard Mode with a disabled interface. Having lost their first game due to their death or the failure of a key plot goal such as preventing True Companions from dying, they're motivated to set right what once went wrong in classic Fix Fic style. Often the only character able to manipulate the loops via a save feature, among other game abilities, the Peggy Sue may reap big rewards. A typical reward is a gallery of unlockable avatars from which the player chooses one to start a new game as a different character within the setting. The biggest possible reward, usually achieved by grinding like mad, is to become a God-Mode Sue. The save feature and encouragement to restart as a different character both contribute to the time loopy essence of the story by rewarding the main character for repeatedly starting over or bailing out the main character from failed experiments and problem-solving attempts by allowing the main character to revert to a previous save.
As "Life Is A Game" type stories are heavily influenced by the survival, RPG, and dating sim game genres they may share key tropes such as levels, stat systems ripe for grinding, some type of physics-independent inventory, Sidequests and interfaces for viewing relationships with NPCs. Achievements may also unlock new avatars, perks, and other options for future playthroughs.
- Causing this is basically the result of Homura's wish in Puella Magi Madoka Magica. Homura turns back time to the point where she and Madoka first met every time she fails to save Madoka (through Madoka either dying or turning into a witch). Unfortunately, while she retains the skills and experience, she also retains her traumas of the loops, and the sad fact is she can never get strong enough to protect Madoka. Just to twist the knife further, it gets worse every time Homura goes back, because every alternate universe is focused on Madoka, and this makes Madoka's potential witch form, Kriemhild Gretchen, even more powerful than the last — but it also has the effect of making Madoka's wish in the final episode turn her into a goddess.
- This occurs in the manga Shin Mazinger Zero, with Minerva X the only one aware of it. She in fact causes the resets in order to find a timeline where Mazinger does not become a devil and destroys the world. It's shown she's gone through many of these resets since she began as the Minerva X in the original anime.
- This is what has happened to Rika Furude in Higurashi: When They Cry. Each time she dies in one of the loops she is sent back to the beginning of the loop. This has been going on for possibly over a thousand years.
- Poor, poor Hibiya from Kagerou Project. He's been stuck in a Psychological Torment Zone for decades trying to save his unrequited crush, Hiyori. Naturally, Failure Is the Only Option. Examples include Hiyori being hit by a truck, Hiyori being stabbed clean through the stomach by an iron pole, the list goes on. He gets out of the loop in the end...somehow.
- And it's not like Hiyori has it better either. "I failed this time, too..."
- At the end of Whatever Happened to the Caped Crusader?, Batman is reincarnated as an alternate universe version of himself; it's stated that, in lieu of a traditional afterlife, Batman is destined to spend eternity being Batman, living out different versions of his life over and over again.
- Happens to Fixer in Thunderbolts. The eponymous villains turned heroes end up in the past through some Time Travel shenanigans. One of the villains' earlier selves took affront to what a nuisance his future self had become and struggles with him. past!Norbert promptly gets shot through the head, and in order to make sure he reaches this point of time to prevent a Temporal Paradox, future!Norbert gets genetically de-aged, mindwiped and inserted in place of his old self. Doomed to forever live through this course of the events until the end of time.
- Some time later, however, he appears in the present, initially with no explanation as to what happened to the time loop. It turned out to be the work of childlike Reality Warper Kobik, who heard that some of his villainous friends missed him and decided to bring him out of the loop. He had no recollection of the loop before she told him.
- Infinite Corridor looks like it's going to be this for Orihime of BLEACH.
- Right Moments: Due to meddling by Happosai, Ranma is stuck repeating the day after the failed wedding from the end of the manga, a repetition which won't end until Ranma himself is satisfied that the day he lived was absolutely perfect. Hilarity Ensues.
- There's a growing sub-genre of this kind of fic called The Infinite Loops, the format of which was first codified by Innortal on fanfiction.net. The basic idea is, one character (the Anchor, usually the main character of a fictional setting) is looping back to the very first moments of their parent series every time either they die or some kind of time limit expires. They of course end up monumentally stir crazy given enough time. Eventually others start to loop as well. The reset is not always perfect. Sometimes a loop's history will be different to the "prime" loop, or canonical plot. "Crossover" or "Fusion" loops also occur, randomly. These can involve the home loopers having a guest, or the anchor for one universe spending time in another, or replacements of one character by another. Vacation Loops are where the Anchor (or others) decide/s "screw it" and lets off steam by doing whatever comes to mind. There's little or no attempt to maintain the original timeline in such loops.
- If this sounds like a generic description for the majority of all timeloops, with the addition of crossovers for no reason, bear in mind the Framing Device for these stories is that the loops were started as a safemode/debugging tool for the multiverse by the gods after a Time Crash. All of these stories are happening all at once within the same shared setting, which serves as a Genre Deconstruction for this trope by virtue of scale alone.
- The Piper at the Gates of Dawn: a ASOIAF/Game of Thrones fic in which Rhaegar is given a second chance at life after dying on the Trident. He then decides to change history and stop the impending attack of theOthers, but, being an ASOIAF fic, things are... bittersweet, to say the least. Rhaegar ends up in a time loop, stuck with his crazy father, his perfect wife he doesn't love, and the knowledge that the world is ending and he's the only one who can save it. Then he finds a way...
- Fixing The Factors, a humorous Buffy the Vampire Slayer fanfic in which Buffy and Spike are forced to live the same day over and over (the season 4 episode "The Yoko Factor") until they get things right and change the future for the better.
- Toil Until The Old Colors Fade: a Les Misérables story in which Javert keeps waking up on the day he first met the mayor of Montreuil-sur-Mer. Notable for how long the loops can run before snapping back. Also notable for handling that very, very well.
- And The Next: Jyn Erso keeps waking up in her Wobani prison cell. Sadly a dormant fic, but well worth the read.
- Has a FanficRecs page.
- Harry Potter and the Wastelands of Time: Harry is stuck looping to the same summer before his sixth year whenever he dies. Having lived over a thousand lives this way, he still can't seem to outpace Voldemort.
- Harry Potter and the Temporal Beacon: Harry and Hermione build a time machine which acts as a checkpoint of sorts and gets activated at June 30th, 1994 (end of their 3rd year). Afterwards, each time they die their minds get returned to that point in time.
- Sisyphus involves Harry stuck looping to the moment where he learned he was a wizard whenever he dies. He eventually after a hundred deaths, defeats Voldemort, dies of old age... and is still stuck.
- Again and Again: Harry has already repeated his life many, many times, often changing specific things with the intention to get it right, and thus be able to die for good. Having defeated Voldemort in every life in which he didn't kill himself early, he decides to try something entirely different this time around: siding with him.
- Harry Potter: Game of the Year Edition: Harry Potter jumps from his accidental death at the graveyard to a New Game+ of avatar statues. It takes him two tries to get all the way from his parents' death to his eleventh birthday, but he does unlock a secret 'wand select' menu and a pleasant print manual for the beta-test of his system.
- Has a FanficRecs page.
- Chunin Exam Day, which is quite possibly the Ur-Example for Naruto
- All is Relative Except the Stubbornness of a Demon: Because the Kyuubi refuses to die, Naruto is always sent back in time to the day before the Genin exam whenever he dies, whether it is in battle or of old age.
- In Myriad Ways: Naruto dies at the Valley of the End and strikes a deal with Death to save Sasuke and starts looping back to before the Chuunin exam.
- Time Braid has Sakura going back to the beginning of the Chunnin Exam over and over again, with the timeline usually resetting with her death, failing the test, or not preventing the later attack from Orochimaru. Eventually, she finds out that Naruto, Sasuke and Hinata are also going through their own personal groundhog loops, each with various states of sanity.
- Naruto: Game of the Year Edition: Naruto jumps from his death at the Valley of the End to an arena of unlockable avatar statues. Each statue is a timeline in need of repair and the dedicated sysadmin staff may actually be Shinto gods. Too bad he's a target for assassins from soon after his birth... Each death before he receives his headband means he has to start over from the beginning and it takes him a long time to make it to that first checkpoint.
- Naruto the Videogame: Thanks to free saving and, eventually, loading, the assassins targeting Naruto's baby self are defeated by trial and error.
- Naruto: Ramen Days: Naruto jumps from his death at the Sand-Sound Invasion to just before the Wave Arc. Thanks to interference from the Kyuubi, not only does it take him five lives to make it past the tutorial and reach the first checkpoint after the Chunin Exams, it becomes impossible for him to reload and save the life of the Hokage before he knew he was in danger. His unlocked teammates retain memories through reloads as well.
- Fuzzy Logic starts with the Kyuubi breaking out of this sort of loop.
- Has a FanficRecs page... This is generally very common in Evangelion fics, as a variation upon or deconstruction of the even more common Fandom-Specific Plot of Shinji going back after third impact.
- The Eighteenth
- Children of the Prophecy
- Samsara: Shinji finds himself in a "Groundhog Day" Loop in which he keeps on living the same day over and over again, with nobody else aware of it. Though he fools around with it, he ends up upsetting Asuka when he becomes too reckless, prompting him to try to make her happy. He finally exits the loop when he succeeds.
- and many, many more....
- And Again sees Naegi relieving the Deadly Game of Danganronpa: Trigger Happy Havoc, trying to ensure that more of his classmates survive.
- Death's Favorite Game: After Master Chief completes Halo 3 on Legendary mode, unlocking avatars and a ton of perk-granting achievements, he jumps to before the Fall of Reach on Easy mode and dies almost immediately...
- Variations on a Theme, with Tank and Gunfire: Shepard finds herself reliving the last few years, from finding the beacon on Eden Prime to the battle for Earth. Again, and again, and again. How much can she change? How much should she change?
- Hard Reset is a My Little Pony: Friendship Is Magic example where Twilight relives the three hours that culminate in a changeling attack and the destruction of Canterlot trying to stop it. Unusual in that story continues after the loop ends and spends the last third of its run examining what the psychological ramifications of this might be.
- The Best Night Ever does this with Prince Blueblood, who is forced to relive the Grand Galloping Gala over and over until he not only sets things right for all of the guests, but he learns his lesson about how to not be such a Prince Charmless.
- Deconstructed in Pony POV Series. It's eventually revealed that Dark World is stuck in a "Groundhog Day" Loop with both the Big Bad Nightmare Eclipse and Discord as the Groundhog Peggy Sue. In the case of Discord, it's an Ironic Hell inflicted on him by Eclipse, and while he can use his experience from the previous loops to do better, Eclipse will never allow him to actually win, and he's long since had a Heel Realization she'll never permit him to act on. In the case of Eclipse, she's the Big Bad of the Arc, and fighting her is every bit as horrifying as one would imagine.
- Rewind: Charmcaster uses Time Travel magic to trick the Tennysons, rewinding whenever she gets caught. It does not end well.
- The one-shot The Chosen from the Avatar: The Last Airbender collection The Ember Island Lighthouse. Ozai goes through his life with different allies each time.
- Not this time, Fate by Coeur Al'Aran (of Professor Arc fame) A RWBY fanfic in which Jaune Arc has been in a loop for a century at least, and nothing he's done has been able to save his friends.
- Replay, by Ken Grimwood, revolves around the protagonist and a few others going through the eponymous Replays which take the replayer back to an earlier point in his/her life, to relive the time period until his/her death (the same date and time in every loop, although the exact date and time differ from person to person). Problem is that each replayer finds that his/her replays are beginning later and later...
- The short story Spring Fever implies this. Having married a conservative businessman, the protagonist is bored with her comfortable-but-bland lifestyle, and daydreams about her first love, Ray. Her daydreaming seamlessly melts into the past, where she chooses to "go all the way" with him... Back in the present, she is now unhappily married to Ray, and the ending heavily hints she's about to repeat the loop again.
- Played with in The Time Traveler's Wife. Henry's physical body constantly returns in time to his mother's death, but he cannot change anything.
- It's revealed at the end of The Dark Tower series that the whole series was just one iteration of a loop that is implied to have been looping for countless iterations. However, the final passage is one of hope, and implies that finally, this next time around, things will be different.
- The kalachakras in The First Fifteen Lives Of Harry August are an entire society who meet this trope, complete with a system for sending messages arbitrarily far back in time by having people near the beginning of a loop find people near the end of a loop to give the message to.
- Mother of Learning: Zorian, a mage in training, finds himself stuck in a month-long time loop after some changes are made to his person in his zeroeth life. Has some similarities with Edge of Tomorrow.
- That Was Then: A short-lived 2002 series in which the protagonist repeatedly goes back to his High School years in an attempt to make things better. Similar to The Butterfly Effect.
- Happened to the SG1 in The Gamekeeper when they were trapped in a Lotus-Eater Machine that forced O'Neill to relive a failed Special Ops action, and Daniel to relive the death of his parents.
- Misfits has Curtis, who has Mental Time Travel as his power. He ends up making several loops back in time so that he and his girlfriend Sam don't get caught with drugs. He succeeds, but because he wasn't sentenced to do community service, the other main characters died (except Nathan) because he wasn't there to save them. He loops back once more to make sure he gets caught, but not Sam. The next episode has a comedic variant, where he tries several times to break up with Sam, but he feels so guilty about making her cry that his powers activate on their own, sending him back to thirty seconds before he breaks up with her.
- In the pilot episode of Star Trek: Deep Space Nine the wormhole aliens in contact with Sisko at first seem to be having trouble understanding humans' concept of linear time. But as they keep returning Sisko to the moment of his wife's death, he realizes they're trying to say humans don't exactly live linearly after all: the way we dwell on our memories means we all create this trope for ourselves all the time, especially if we've experienced trauma.
- Russian Doll: After Alan and Nadia die at the same time, they are forced to relive the same day over and over again. The only way for them to escape the loop is to help each other avoid their original deaths: Alan has to stop Nadia from getting hit by a car, while Nadia has to stop Alan from committing suicide.
- The plotline of BlazBlue: Calamity Trigger, from the perspective of Rachel Alucard. There's an interesting twist on this trope with her, however. On the one hand it is thanks to her being an Observer that she is a Groundhog Peggy Sue; on the other hand, as an Observer she is not allowed to actively Set Right What Once Went Wrong, but can only nudge the other characters in the right direction.
- The Reveal at the end of Calamity Trigger reveals there is a second one at work. Unlike Rachel, Terumi has been trying all along to make things even worse.
- The When They Cry franchise—both Higurashi: When They Cry (though we're not told who the Peggy Sue is until the end of the first season) and Umineko: When They Cry (in an odd meta way).
- You can turn your companions into this in Ephemeral Fantasia; until you bring them out of their "Groundhog Day" Loop, they're unaware of the repeating five-day cycle.
- The plot of Shira Oka: Second Chances is that the protagonist must repeat high school over and over again until he can snap out of it. He may be forced to restart again if he dies or makes the wrong decision that ends up in an unhappy ending.
- Majora's Mask features Link in a three day time loop trying to stop Skull Kid from dropping the Moon on Clock Town.
- A particularly horrifying and tear jerking one is the fate of Jyoji Hijiri in Shin Megami Tensei III: Nocturne. He is essentially trapped within the endless cycle of death and rebirth that Kagutsuchi has imposed upon the worlds. He witnesses the end of one world, suffers within the Vortex World and dies, and then is reborn in the new world just in time to watch the end once more. Furthermore, he is cursed so that he can never influence these events, essentially making him a spectator for all eternity. And to cap it off, it's heavily implied Hijiri is a reincarnation of Aleph from Shin Megami Tensei II, whose sin (killing God) was committed solely in an effort to save the world.
- Embric of Wulfhammer's Castle revolves around this trope... Or Does It? Duchess' strange ability to go back and continue her life from just before an ending so as to allow the player to experience other endings is All Just a Dream, but a prophetic one; Duchess is using a precognitive vision to explore possible futures.
- In Alan Wake's American Nightmare, Alan's Evil Counterpart, Mr. Scratch, attempts to create a no-win situation for Alan by capturing him in a time-loop; even if he survives the deathly trials of the loop, he will still have to go through them again. However, as Alan and the three women stuck with him in the loop retains memories of the previous cycles, they eventually begin to coordinate their efforts to drive the loop Off the Rails.
- A good part of Steins;Gate revolves around this. Okabe's messing around with D-Mail leads to SERN mooks come crashing through his door, lead by Moeka, and ultimely killing Mayuri. So he sets up the recently assembled Time Leap machine to leap to the point in the past before that happened, in order to avoid it. Unfortunately, every time he goes back in time, no matter what different idea he tried to save her, her death was always the result.
- no-one has to die. has this as one of the central plot points. Each time you finish one of the timelines, the last remaining non-player character enters a mysterious machine, which unbinds their consciousness from their body and pushes it back to a compatible body. One of the characters has gone through this five times. Did I mention there's a fire?
- John Buchanan's indie Flash game duo The Freewill Cycle involves a person who, after injecting himself with a special compound that keeps him from being 'uncreated' when stepping into a wormhole left open by a time machine experiment gone horribly wrong. He jumps back in time, in the second game, to find out that he's a mercenary for hire, and there's a mission accepted by his past self to complete. Once that's done, another one comes up that asks him to do everything the first game entailed, which he failed to complete before entering the wormhole. The player can either accept the mission, start what the first game entailed all over again, and jump back in time again, causing an infinite loop that will eventually cause the space time continuum to implode, destroying the entire universe; or he can reject the mission, watch his future self get zapped out of existence, and allow himself to move onward, ending the cycle.
- The Elder Scrolls series has the concept of "CHIM", where one becomes aware of the nature of Anu's Dream but exists as one with it and maintains a sense of individuality. Vivec, the Dunmeri Tribunal deity, claims to have achieved this and (very cryptically and steeped in heavy metaphor) explains what this means in his 36 Lessons of Vivec book series. Essentially, achieving CHIM is the realization that you are a character in a video game. This comes with it a number of powers which would seem god-like in-universe, including the ability to Save Scum, use the Master Console, and use the "Construction Set" Level Editor. Talos, the Deity of Human Origin ascended god-form of Tiber Septim (and possibly others, is another theorized to have achieved CHIM. Further, the series has the in-universe, metaphysical concept of "heroes". These are rare individuals not bound in any way by fate and who have the ability to rule their own destiny. Heroes are closely related to the prophecies revealed in the Elder Scrolls, but are not bound by them, and they often grow to become far more powerful than most other mortals. Each Player Character in the series to date has been such a hero, and many others are mentioned in the series' lore (often as Long Dead Badasses and Founders Of Their Kingdoms). Where this trope in particular applies is the "Save Scumming" aspect of CHIM. As Vivec explains in his Morrowind dialogue:
Vivec: "When I die in the world of time, then I'm completely asleep. I'm very much aware that all I have to do is choose to wake. And I'm alive again. Many times I have very deliberately tried to wait patiently, a very long, long time before choosing to wake up. And no matter how long it feels like I wait, it always appears, when I wake up, that no time has passed at all."
- Undertale has three characters constantly looping through the same couple of days. Flowey, and then you, get to do it every time you load up the game, retaining their memories and thus their knowledge of various timelines and events the more they reset. There's also Sans the skeleton, but only to a point: it's unclear how much that character remembers of each preceding timeline after a reset, though they know the resets exist, keep mementoes of previous timelines, and can deduce the events of previous loops very accurately. Furthermore, they don't even have a say in when the resets kick in, much less an ability to end it by fulfilling some condition.
- In Amnesia: Memories, it is a unintended consequence of Ukyo's wish to save the Heroine from death and for him to be able to be with her again at the cost of her not remembering him. As long as the two conditions are not fulfilled, the wish cannot be granted and Ukyo is forced to remember every parallel world the Heroine dies by his hand, dies in an accident, or fell in love with another man. He dies in her place because their existence in the same timeline is an anomaly the world is trying to eliminate.
- In the Skin Horse chapter 'Choose', Jonah Yu finds himself in one of these, with the loop reset whenever he dies. It also happens to be in the middle of a place where death is common and frequently very silly. What makes this a Peggy Sue? The ending makes it rather unclear whether this will happen again after he's lived a long, full life.