The "fourth wall" is a fiction term referring to the idea that the fiction - be it play, song, book, film, game, or any other form of media - exists without acknowledging the viewer. But the fourth wall in video games is a bit different, because the player is always a participant - we just have to play along and pretend that teaching a protagonist how to walk (in, say, a tutorial sequence) can really fit into the fiction. The line between player and character is so slim that video games that break the fourth wall really stick out, especially when they remind you that it's all a game in clever, subversive ways.
Video game perspectives are unusual because there's a degree of participation that isn't present in other media. You embody a character, but usually, that character doesn't represent you. You may also exist as a sort of godlike being with power over multiple in-game characters, but there's always a degree of separation. When games ignore that separation and address the player, whether outright or through more clandestine means, we get narratives that really muse on the nature of agency, challenge us to think differently, or, in some cases, just plain make us laugh.
Hideo Kojima's games are rife with fourth wall-breaking moments, but some of the best come from the first Metal Gear Solid. The fight with Psycho Mantis is a particular favorite, as his mind-reading powers don't just affect Snake within the game, but also appear to affect the player, as well.
By reading the players' inputs, it appears as though Psycho Mantis is reading their thoughts. If the player has other Konami games on their memory card, he'll mention them during the fight. He's only defeated when the controller is unplugged from the first-player port and plugged into the second-player port, preventing him, according to the game's fiction, from reading Snake's mind. The scene is all about breaking the fourth wall as Psycho Mantis toys not just with the character, but the player, as well.
The Arkham series attracted a lot of attention for finally making a Batman game that really feels like Batman, complete with his detective skills as well as his combat. But that's not all - Scarecrow deploys fear gas against the eponymous hero, plunging him into a nightmare world. Only it's not just Batman who's affected by the gas - it actually appears to turn the game off after a series of graphical glitches reminiscent of the Xbox 360's infamous "Red Ring of Death."
The fear gas isn't just for the hero, but for the player, as well, and it's not until the game reloads itself with a tweaked opening cutscene in which the Joker takes Batman's place that it's revealed to all be part of the joke.
Horror games playing with sanity mechanics is as old as horror games themselves, but Eternal Darkness: Sanity's Requiem took that trope to a whole new level. Inspired by the works of H.P. Lovecraft, in which the protagonists often go mad as they learn more details about the world, Eternal Darkness likewise makes the game more difficult as your sanity meter decreases.
But that difficulty isn't from more enemies or more powerful attacks - along with a tilted camera and strange noises, the game also weaves in graphical errors and fake crashes that affect the player, not the protagonist. Because these glitches are easily mistaken for the real thing, players might mistakenly restart their consoles to get rid of them - possibly decreasing their real-life sanity meters after discovering they've been tricked.
Max Payne isn't a particularly humorous game, but that doesn't mean it can't break the fourth wall. The game uses graphic novel-inspired cutscenes to tell the story, which has a film noir grittiness that the illustrated sections emphasize.
But in one scene, when Max is injected with controlled substances, he hallucinates a note that tells him he's inside of a graphic novel. Upon returning to that room, he encounters another note that tells him he's inside of a game. His altered state is the perfect time to play a bit with reality, something Max Payne often leans into as a series.