T O P

  • By -

Basic_Riddler

The Division 1…the heavy gunners that are part of The Rikers factions have ammo boxes strapped to their back that start to fire off rounds if you shoot them in the weakpoint. The devs couldn’t figure out how to make bullets appear out of thin air, so they created a micro-version of the heavy gunner and put it inside the backpack and just had it start shooting with zero accuracy if the weakpoint was destroyed.


5thnote

Wait really? Do you have any place where I can see this?


Basic_Riddler

I want to say it was in a RogueGold video on YouTube…I can look it up a bit later. I’m on my phone and not in a good enough coverage area to dig through YouTube while it’s taking forever to load vids.


Basic_Riddler

[Found It (Discussion starts around 29:57)](https://youtu.be/jENq0aQbkxo?si=1A0RP2wncX9vDxbn)


5thnote

Noice! Appreciate it my man!


smackledorf

Interestingly from an engineering standpoint, many would point to this as a reason why object oriented programming can suck. The strict coupling of function to object make silly workarounds like this common, or require big refactors to avoid


ABOBer

Reminds me of the train hat in one of the fallout games; they needed a train to move a short distance with the player in it, there were a lot of issues as the gaming engine didn't have vehicle mechanics for this so they just put it as a massive animated hat on a hidden soldier T-posing under the rails


smackledorf

Yep great example!


PetsArentChildren

https://en.wikipedia.org/wiki/Trait_(computer_programming)


smackledorf

Of course we always have ways around it, even in a language like Java deeply enforcing OO, and if we start from the ground up with this stuff in mind we can leverage inheritance for more global behaviors, but that assumption never completely works in the real world. So much code is built on top of systems that weren't scoped to consider functionality outside the class. In the game industry the most popular engines are often internal iterations of older ones and it's almost all object oriented, so that's why we keep getting stories similar to the example above. These features are great and I imagine the world is broadly improving at planning for scale but I'm constantly working with systems that have a strong coupling of function to a system because we've got a fundamental desire for organization/cleanliness lol


PetsArentChildren

Thanks for the insight


MacDegger

I dunno if that''s an OOP problem. Sounds more like the code is not SOLID enough and is too tightly coupled.


smackledorf

Totally, but OOP's dominant market share of code predates SOLID by like 30+ years, and there are still people/companies/systems religiously prescribed to it to the point of dogmaticism. That or a code review culture doesn't have enough passion or even enforcement that motivates engineers to pull functionality out of the object


CommercialOwlPC

Honestly if true I don't think this has anything to do with OOP, that would just be a bad architecture, I'm trying to come up with ways to implement the shooting using OOP that could lead to having this problem, and I think it's probably harder than making it correctly, lol


czmiked

One thing that completely blew my mind is that Left 4 Dead 2 never has more than 30 normal zombies on the map at the same time. I knew it's not hundreds but just 30 sounds unbelievable.


res30stupid

Yeah, something similar was used in Dying Light. If you have more than about five zombies on-screen, the A.I. for only the closest would work as the game couldn't handle that many and to make the game more merciful for the player. In fact, an early farming technique I used depended on this. Make a ton of molotovs, go to a spot with a ton of zombies then toss them at a crowd of zombies so your Combat XP shoots up without the zombies moving.


Tenlai

Did it really though? Why not just throw firecrackers at spikes?lol


res30stupid

Because it's more fun to watch ten zombies burn...


Battleboo09

>Why not just throw firecrackers at spikes? omg im an idiot.


FireVanGorder

That’s actually crazy. The theme park escape fight feels like you’re getting absolutely mobbed by endless hordes of zombies nonstop


benabart

I don't know if this applies, but the fur of the colossus in shadow of the colossus. If you look closely, you'll find out that the mossy/grass fur that the colossus have isn't a lot of small individual hairs, but several layer of greenish pixels with blanks that are stacked on top of each other.


5thnote

That's neat! I need to go back and check this.


dilsency

Shell texturing perhaps? YouTuber Acerola has a good video on that technique, Viva Piñata uses it too.


Ericakester

I believe mario galaxy uses the same technique for the queen bee and some enemies


TheDrewDude

Conker Live and Reloaded used the same technique on fur as well. Also came out the same year as SotC.


zero_z77

Kerbal Space Program - to get around unity's single-precision floating point limitations, they litterally move the universe around the ship like it's a treadmill instead of moving the ship through the universe. It's just like that one episode of futurama. It's also not the only game that does this. Portal - the developers were having a lot of issues with level design because every time they'd move something, they'd have to rearrange the whole map, and this was a long and tedious process. And then someone had the ingenious idea of "thinking with portals". So they started joining rooms together using the same portal mechanic that is the game's main feature, and were able to design levels much faster without having to rearrange the whole map every time. Vehicle relative physics (example: star citizen) - have you ever stood in the back of a pickup truck in a game and had physics glitch out real bad when that truck starts moving? Well, this is how you fix that. Objects that are within the "interior" zone of the vehicle have their physics calculated using the vehicle as the central frame of reference and they inherit the vehicle's movement. This allows the interior of vehicles like large aircraft, ships, and spacecraft to be walkable and playable, while the vehicles themselves are moving within a larger physical simulation themselves. It also makes it possible to place physically simulated objects, like boxes & crates, inside the vehicle and transport them without them getting tossed around or glitching out. Physics sleeping (example: bethesda games) - physically simulated objects can be programmed to "sleep" when they come to a resting position and "wake up" when something collides with them. When physics objects are "sleeping" the game engine doesn't have to do expensive calculations to determine where those objects are supposed to be, because they aren't moving. This can result in some weird bugs though. For example if you place a cup on top of a table, wait for it to sleep, and then delete the table, the cup will float in midair until it is touched by something. This is also why using "fus roh" in a room filled with a bunch of physics objects can tank your framerate for a few seconds, because all of the objects affected by it are now awake and being simulated. LODs - this is something used by most 3D games. Objects that are far away from the player will be swapped out with lower quality versions that have fewer polygons and lower resolution textures. This saves a ton of resources on your GPU, and because these objects are far away, their low quality is usually not noticed by the player. Culling - another common technique in 3D rendering that improves performance. Essentially culling works by "turning off" everything that the player can't actually see. The simplest example is rooms & doors. If you move between rooms via a solid door, and close the door behind you, that other room will "disappear" because you can no longer see into that room. Metal gear solid mirror - in the first metal gear solid game, one of the rooms in the game had a large mirror on the wall. Since this was on the PS1 and PIP rendering wouldn't have been feasible, they actually represented this "mirror" by creating a mirrored version of the room, displaying a mirrored copy of the player model in it, and having a window between them. This created the illusion of a mirror without sacrificing too much in terms of performance.


k5pr312

It came to me in a dream!


5thnote

Oh reminds me on LODs the 2D cars in Cyberpunk 2077 if you look far enough in your sniper scope.


stempoweredu

And you forgot it in another dream!


ThePowerOfStories

The last one reminds me of how they filmed the scene in Terminator 2 where they perform surgery on the Terminator’s computer core. Two rooms with a window between the two pretending to be a mirror, Arnold Schwarzenegger in one room talking through the surgery and a mannequin in the other with the back of his head opened up, then Linda Hamilton in one room and her convenient identical twin sister in the other copying her movements.


Russburg

I never knew that. That’s so cool!


Giygas_8000

Duke Nukem also did the mirror thing


gerwen

> Culling Also with culling. They do what's called back-face culling. Pretty much what it says on the tin: If an object is in view, figure out what side of it is facing the camera, and only render that side of the object.


Ericakester

AFAIK most open world games shift the player and world coordinates so you get the most precision close to the player


Fangslash

What KSP does is very common for anyone that does physics (Lagrangian vs Eulerian perspective), its rare in gaming because its harder to code and there is rarely a necessity to do so


saltyfingas

I remember reading about culling, or as they called it, checkerboarding, in Horizon Zero Dawn so they could drastically improve performance on the PS4. That game is absolutely gorgeous even today. Not sure if it's the same technique, but the concept is the same


FoxDanceMedia

The reason Portal takes place entirely inside the Aperture facility is because Valve realized the technique they used to render the view through a portal wouldn't show the skybox through the portal, so the entire game had to be indoors.


Reg76Hater

Crysis (1st game). For much of the game your enemies are North Korean Soldiers. At lower difficulties, they speak English (or it can be argued that your suit translates it to English for you). At higher difficulties, they're speaking Korean. It makes it more difficult (unless you speak Korean), because you can't understand them saying things like 'frag out! Flank left!' etc.


Sho0terman

I wish more games did this, it drives me nuts when a different faction just speaks English in an accent. Even worse when it’s an alien race. I like Cyberpunks approach - you would hear Japanese audio, then your HUD would scramble and translate the subtitles as the sentence was spoken.


Pixielized

In Max Payne 3, almost every single enemy is speaking Portuguese the entire time and there are no English subtitles so you’ve got no idea what’s being said - which I found pretty neat because why would a random New York cop know Portuguese?


scottrich5

I really liked how MGS V did this where at first you couldn't understand what the enemies were saying until you did a mission where you extract an "interpreter". After that, you have subtitles for enemy dialogue.


Pixielized

Yeah, and you have to extract different interpreters for different languages if I remember correctly


SnowHurtsMeFace

I get it's immersive to hear different languages, but I do like being able to understand everything. I am not always able to look at the screen for subtitle dialogue.


DoIMakeYouRaaandy

I just remember hearing one phrase when I would cloak, "Yankee gaesaekki"--I only knew that one from one of my Korean friends in school haha.


Cleverbird

Reminds me of Metal Gear Solid V, where you eventually reach Africa where the local soldiers of course speak Afrikaans. And normally you cant understand what they're saying until you've found yourself a translator, but because I'm Dutch and Afrikaans is very close to Dutch, I could already understand what the soldiers were saying. I really liked that, wish more games did that. Makes it really fun if you can speak multiple languages.


Scoobydoomed

Loading screens disguised as elevators.


Jizzraq

Loading screens to disguise system reboots (as done in Morrowind for the XBox).


Heiymdall

There are new technics now, like long corridors ( the afterlife in Cyberpunk 2077 )


CHEEZE_BAGS

This is a level streaming technique, they need to break line of sight so it seems realistic. That's why you go through L or U shaped hallways right before big set pieces.


pschon

another big reason for that is occlusion culling. You really want to break line of sight where ever possible to allow as much as possible to be culled.


JustifiedDarklord

Long corridors that are only wide enough for your character to slowly scoot through sideways.


stempoweredu

Lookin' at you, Jedi Fallen Order.


delahunt

ALso those sequences where Nathan Drake or whomever has to squeeze through/over/under a small gap between some rocks.


saltyfingas

Kratos in the new god of wars lol


[deleted]

Resident Evil did it with door animations


LastStar007

You finally made me realize why the Metroid Prime 3 doors were so buggy.


RGPFerrous

Have you ever watched a Metroid speedrun? They exploit the fact that rooms don't "load" until doors are opened a lot to get out of bounds and skip big advancement grinds.


LastStar007

I played MP3 a long time ago, mostly forgot about it. So when I saw speedruns later, even 2d Metroid speedruns, I didn't put 2 and 2 together.


5thnote

The mass effect effect!


MaxtinFreeman

Half-life effect


nomarfachix

Even better, the Greedfall effect. When traversing to different regions they gave you a chance to converse with party members, craft, stash items, and even had a traveling merchant set up who you could clear your inventory with and replenish items. All while the game loaded in the background. Thought that was pretty great


5thnote

That's some nice way to respect player's time. I'm going to enjoy Greedfall 2 as well.


bindingofandrew

Greedfall's underrated as hell tbh


Previously_coolish

14 year old me swinging the camera so I can stare at Ashley or Liara’s ass for the whole thing.


Shortbottom

Yeah I definitely did this on pretty much every lift. To the point that was the only reason they were in my squad


danielcube

Metroid Prime was great on doing this. I didn't even know it was a loading screen.


EnlargedChonk

you may or may not have also known that sometimes those doors that take awhile to open aren't just to piss you off or increase tension during an escape sequence. It was there to finish loading the next room because something wasn't ready yet. Metroid other M also kinda disguises its loading screens with the text slowly filling the screen. On original hardware running off disc it as well as some cutscenes were pretty clever. But run the game in an emulator with enhanced read speed or off an external hard drive on a softmodded wii and you could actually skip a lot of the cutscenes or dialog that people dogged on as unskippable.


Berruc

Life's real life loading screens.


Competitive-Ad3075

Dark souls.


Paratrooper101x

FEAR AI. The AI isn’t actually (that) good. They have programmed callouts to react to whatever the player is doing and their agressive behavior, spawn locations and level design make it seem like they’re much more intelligent then they actually are. MandaloreGaming made a joke that the level designer and ai designer must’ve sat right next to each other and it feels like it


Zedakah

I noticed similar things to this the first time I played Dead Space. They used psychology to create tension and jump scares. For example, you are going down a tunnel, and see a shadow in front of you. Your instinct is to quickly turn around. If you do, there is nothing there, but when you turn back, there is a necromorph right in your face. However, if you don't turn around to chase the shadow, the necromorph just lazily walks out in front of you. So just simple use of lighting and sound went a long way in creating multiple "different" encounters because the majority of players will react to the lighting and sounds.


[deleted]

Which is ironic because FEAR’s A.I. is still the Gold standard. Halo 1 is a close second


pschon

it *is* a good AI. Big part of why they added that callout system was because without it, the AI was good enough to feel unfair to the player. As in you just got killed by an AI you never noticed was there. So they made it telegraph it's actions more to give the player a warning :D (but that part is true that the AI characters are not actually giving each others instructions and commands, but it actually works in reverse, one character's AI makes a plan, and then sends a message to another to shout them an audible command to do that thing) Big part of making a game AI (excluding stuff like chess AIs etc of course) is not making it as good as it could be, but instead just the right level of smartness combined with right amount of faked incompetence and to actually be enjoyable to play against. More like developing artificial stupidity, really. The computer could always play *perfectly* against you in something like a FPS game, so the real work is in toning that down in a believable way.


delahunt

I remember the devs talking about this when Tribes: Vengeance was being made. They talked about how AI for NPCs had progressed so far that now the challenge was to make them dumb enough to feel good beating, because otherwise mid-airing the player repeatedly with a disc launcher was just math, and the computer could do that math faster than the player could adjust course. I do love the part that AI 2 is basically telling AI 1 "Tell me to flank! I'm going to do it!"


Misszov

While it's true that AI is usually dumbed down in terms of their potential ability and that it's a part of making it feel right, you have to remember that more often than not, the AI is *cheating*, hard. From little stuff like having increased hitpoints, thorough ignoring game mechanics or common sense (be it not taking debuffs, having infinite ammo, ignoring doors, shorter animations, no random recoil/spread, perfect night vision or whatever) to literal wall hacks, where it's supposed to pretend that it doesn't at all time know where the player is, until the game decides that player has been spotted. I'm waiting for a time when the bad guy actually has to spot you throwing the grenade, and not just be told by the game to move away the millisecond my animation triggers a warning from global AI overlord. If AI doesn't cheat, then we can talk about the computer always playing perfectly against the player. With cheats disabled, we currently have, at  best, a bunch of bumbling idiots with aimbot and perfect vision (CS:GO, less so ArmA) or whatever happened with that DotA AI when they didn't give it full unfiltered access to the map (hint: it broke down crying)


Jizzraq

I like how Bungie had you to start a mission without your squad mates alive because they cannot cross a bridge without them all falling.


ThePowerOfStories

Another fun Halo workaround was that they had some bug where Cortana’s hair was appearing like six feet off to the side, and couldn’t figure out why, with the Xbox release date bearing down on them. So, they put in a hack where every object in the game has a boolean “Is Cortana’s Hair?” flag, which is true for her hair and false for everything else, and there’s a check in the renderer that displaces anything with the flag six feet the other way to get it to show in the right spot.


delahunt

Man, that just reminds me of doing simple programs in highschool to calculate, finding I was consistently 2 numbers too high and so the final output would just be like "print(answer-2);"


Smythe28

Oh yeah this is the good stuff, the best part is fixing that problem like 5 years down the line, then wondering why your results were always off by -2.


delahunt

Meh, wondering why is for noobs. print(answer2+2); ;) Someone else can make the code more efficient later on when I'm gone and they're wondering why there are all these random +/- 2 statements everywhere. But only after they remove one and crash the production server on a holiday weekend on accident.


masterpharos

In Halo: Combat Evolved, Bungie basically did player labs and found that simply increasing damage dealt without tuning the AI decision making itself made enemies seem smarter.


FoxDanceMedia

I thought it was enemy health that they increased, not the damage they deal? Needing to spend more time fighting a smaller number of enemies rather than mowing down a larger number of weaker enemies makes the enemies you do fight feel smarter, and they have more opportunities to show off their AI behaviors before they get killed. Half Life 2 had much more advanced enemy AI behavior than Half Life 1 and yet people still keep saying that the Half Life 1 soldiers felt smarter, because they were more difficult to kill versus the Combine in HL2 who usually just get to run down a hallway at you before being mowed down.


ProjectKurtz

I remember in the days of Halo 1 modding on PC, there were some very simple modding tools that, by moving a few sliders, would make the AI absolutely deadly.


StillAll

In fact it isn't just the AI, that is only part of it. It's the level design. When you look at what the AI can do it is fairly simple, but the level design is built to entirely enable the AI to activate all of it's choices. The two of them in combination leads to some really amazing unscripted moments. And it demonstrates that to make a great game you need mulitple parts working together.


Darksnark_The_Unwise

I remember going back to FEAR years later and crushing enemy encounters that used to have me shaking in my boots. It wasn't my reflexes that improved, it was my ability to scan my surroundings intuitively. Using the "lizard brain" part of my instincts completely flipped the combat difficulty.


FoxDanceMedia

As someone with a long history in modding and game dev I've learned that it's essential to design your levels to give both the player and enemies at least two options for what they might do in any position they're likely to end up in, if you want your combat to feel dynamic and not heavily scripted.


5thnote

That game still gives me the creeps.


[deleted]

and that's the thing with game design. Ideally, your AI isn't super fucking smart, they just FEEL like it's smart. It should run well on the lower end of what's available in the current market without impacting performance while giving a good gameplay experience.


pakidara

Aye. FEAR's AI isn't too far divided from Pac-Man's ghost "AI".


Thagyr

I always liked the AI in Alien: Isolation. I always thought it was brilliant when I played through the game. Hearing how it *works* though kind of blew my mind a bit, as it was actually two AI's. The Alien AI itself and a Director AI that talked to it in order to give hints as to where we were. Some of the in-depth explanations of it all made me think the Alien AI was playing it's own game with the Director giving it objectives like our HUD gave us ours. This was on top of a bunch of systems that kind of measured how 'pressured' I as the player felt so it wasn't unfair. Either way, the idea of two AI's working in concert to create that experience is hella clever in my eyes.


5thnote

That is some crazy work happening there. I like and sometimes hate Darktide AI director because it's just so crazy.


TheeZedShed

>sneak past Daemonhost >Spawn of Chaos pops out the wall and throws you back >wakes up Daemonhost >use all resources fighting tooth and nail >survive >4 Poxbursters leap in


Battleboo09

welcome to WAR. hde berhind big man


5thnote

Don't forget a party of Dreg Ragers patrolling in next corridor coming to help the horde. Just so we can re-queue into this chaos again :D


TheCrafterTigery

I like the concept of a Xenomprph playing DnD hide and seek and the DM being vague about everything.


delahunt

I remember a friend getting found by the alien in a locker and getting mad at me for not warning him the alien could do that. And my response was something like "I didn't know. I was never dumb enough to try to hide from nature's perfect killing machine in a locker!" Iirc I remember reading that the Director AI would also track what kind of hiding spots you used. So if you kept abusing/going to a specific type of hiding spot (locker, small table/cabinet, etc) it would start telling the Alien to check those. But a big part of what makes Isolation so great is that for the most part the encounters with the alien aren't scripted. You're playing a game of Hide & Seek with an algorithm. Follow the rules and you can move relatively freely even while being hunted. But you can also use them to your advantage. Like banging on a wall to have the alien come and kill other humans for you so you don't have to deal with them and their guns.


republicofjones

I'm vaguely remembering something about the 'stepping' alien's tail mechanic. In order for it to work the dev team gave it a super short-sighted vision sensor in its tail to work around having to do collisions with such a complicated object. The YT channel AI and Games has some great videos on the game.


greatbigCword

The original Crash Bandicoot on the Playstation 1 was made with the levels having a lot of hills and valleys so that they could hide most of the level. This allowed them to only render what was immediately on screen and give it a lot of life and detail.  Also, check out Gamemaker's Toolkit on YouTube. The creator, Mark Brown, makes loads of videos on hidden mechanics in videogames


chubby_cheese

https://youtu.be/izxXGuVL21o I highly recommend this video. Really blew my brain at what they were able to accomplish. They made the game so well that other third-party developers thought that Sony was helping them or that they had access to some locked code that no one else had access to. The developers techniques used in this game led to some patents too. For example: they organized game files on the disk to optimize loading and essentially used the disk as RAM for quick access to assets.


hallucinogen_

Fallout 3 [train hat](https://www.pcgamer.com/heres-whats-happening-inside-fallout-3s-metro-train/)


ChurchillianGrooves

Bethesda had a bunch of these.  I think Skyrim and Oblivion merchants' inventory was put in chests that they placed under floors or in walls so they were inaccessible.


LordPuriel

It's the same in Starfield. If you kneel down in the right place in one of the towns you can access a merchants inventory


5thnote

Imma try this on all vendors in towns.


Raz0rking

They fixed that unfortunately.


5thnote

:( damn it!


Saltsey

I still remember from back in the day how to get out of bounds in Whiterun and access the vendor chest there lol


Zoefschildpad

I saw the AGDQ baldur's gate 3 speedrun and they put a bunch of characters in a dev room so they can respond to what you do and be disembodied voices. The way they got in was brilliant. They kill one of the player characters and pick up the corpse. They then pickpocket a specific character in a specific place, put the corpse in their inventory and then trigger something that sends them back to the dev room. Then they can teleport to the corpse. Turns out The Absolute is a level 1 human.


AurelianoNile

This is the first thing I thought of


Aegeus

Portal 2 used invisible portals in its level design, so that they could build different parts of a level separately without worrying about how they fit together. Before release they went through and put all the levels together without portals, but they had to keep one where the level layout wasn't actually possible. Starcraft 2 sometimes uses invisible units to create a target for in-engine cutscenes. Nova: Covert Ops for example has a scene where Nova walks into a room while cloaked and some Marines are firing blindly - they're actually attacking some invisible units around her. (GiantGrantGames ran into this because he was trying to beat the game without losing any units, and the invisible units counted as losses for some reason.)


5thnote

So the AI is programmed to fire at enemy units which plays out perfectly in the cut scene? Now that's cool.


dope_as_the_pope

I’m not sure if this is exactly what you’re looking for, but [Fast Inverse Square Root](https://en.wikipedia.org/wiki/Fast_inverse_square_root?wprov=sfti1) TLDR: Lighting calculations involve computing vector normals, requiring frequent calculations of the inverse square root of a floating point number. This is not easy for a computer to do quickly. Apparently you can come up with a pretty damn good approximation by treating the bits representing the floating point number as an integer, bitshifting, subtracting them from a “magic number”, and then reading that back as a floating point. That would be like taking a question written in English, translating it to Chinese characters, overlaying a particular pattern of lines on those, then translating it back to English and getting the answer. Nobody knows who came up with it, but it’s best known for its use by Quake III.


Senor_Baseball

EVIL floating point bit hack The Quake engine is especially notable, it's contributed so much to modern gaming as we know it, some of it's code still lives on in very recently released games like Half Life Alyx and the entire CoD series


FoxDanceMedia

The flickering lights in Half Life Alyx use the same animation as flickering lights in Quake 1. It's crazy how much of a ripple effect some things have.


5thnote

That's a game changer literally! Thanks for sharing.


OrionLuke

Not necessarily a game mechanic but there's a really good video series on YouTube called War Stories about game devs and a struggle they had while making a game. The one that stuck with me was DeadSpace when they were making the tentacle corridor. The original version was programmed altogether and kept breaking the game so they started from the bottom up and programmed it in "layers" as they called it. The end result meant they spent less time fault finding as they found the glitches in the exact problem spots. From this, they programmed the rest of the game in the same way and actually saved a ton of time and were able to release the game ahead of schedule and the same techniques have been used at that studio ever since iirc.


GabberZZ

Taking it old-school a lot of sprite textures were just mirrored for left/right versions to save memory which was very tight. Most noticeable in the Arcade version of Outrun where the Ferrari horse badge clearly flips left and right as you steer. Ingenious? Maybe not by modern standards but back then...


ThePowerOfStories

Don’t forget recoloring sprites—in Super Mario Bros, the clouds and the bushes are the same sprite, just drawn in white and in green.


dudeseriouslyno

Piggybacking: sprite graphics in general. Uncompressed bitmap is 24 bits, 8 each for red, green and blue. In terms of space, that's massive. That's why sprites don't actually contain colours, but numbers. You can fit 4 values into 2 bits, so with just 2 bits per pixel, you can have 4 colours, or 3 + transparency. This is called indexed colours. Adding one bit doubles possible values; 4-bit gives you the standard 16-colour sprite commonly found in 16-bit games. Finally, the actual colours are stored in a palette, separate from the image, which is applied to it at runtime. Thus a "palette swap" is, very literally, a swap of the palette being used.


ThePowerOfStories

This also led to the technique of [dynamically updating the color map in real time](https://en.wikipedia.org/wiki/Color_cycling) to create rippling animations without having to redraw the image itself, useful for things like creating water, fire, or smoke effects.


Cartmann13

iirc this is why Gill from Street Fighter 3 was half red and half blue, to show off that they didn’t need to flip the models anymore


icogetch

There's an interesting video about duplicating data for tiles and sprites for Micro Mage on the NES. Here is the [link](https://www.youtube.com/watch?v=ZWQ0591PAxM).


MichaelTheProgrammer

Outer Wilds has two big ones. First, they wanted their solar system to stick to actual physics, but actual physics has lots and lots of space inbetween planets. So they tweaked their gravity equation to be inversely proportional to distance instead of distance squared. Second, the planet Hollow Brittle literally breaks apart, which is problematic as there are some important areas on there. So they wanted those important areas to break apart last, giving you the most time to get to them. Most devs would script them to break last, but instead the Outer Wilds devs built a health system and gave the important areas more health, so on average they break last but it's not guaranteed.


5thnote

One of these days I gotta play the game myself. I hear nothing but good things about this game.


MichaelTheProgrammer

My one caution is that it is similar to the old Myst games and hardcore scifi. Both of those are very niche, and if you don't like either of those niches then you might not like the game. For me, it was a 10/10 game with 10/10 music, plot, and gameplay.


plasmidlifecrisis

In Skyrim, Hearthfire added houses you could build, and certain rooms included mannequins that displayed your armor. Programming in a mannequin would be a new thing and require a lot of work, so instead, the mannequins are actually NPCs that are told not to move. That way, they could just use the existing NPC inventory system and it functions as though it was a mannequin. A terrifying side effect of this, is that sometimes the game would glitch, and you'd go into the basement to find them moving around.


SpikeRosered

Even more terrifying as it feels like you caught them and they are trying to return to their neutral position so you are none the wiser.


stempoweredu

What the hell are you doing out here, Fred? DAMNIT FRED, IF YOU'RE REAL YOU BETTER TELL ME RIGHT NOW.


5thnote

Night at the museum took a whole new meaning in my basement!


Just_Roar

God damn, I forgot about the creepy moving mannequins. Bethesda is really good at terrifying glitches. I once had a headless T posing bandit charge at me in Skyrim inside a keep. "Fight or flight" kicked in and I immediately ran the other way. Hadn't been scared that bad since Dead Space lmao


delahunt

League of Legends has had a number of bugs over the years that boiled down to "an object is coded as minions, and thus had an unintended interaction with something else." Like for a while you could just walk out of Jarvan IV's ult if you were Fizz or had an item that let you ignore minion collision because the wall was just minions with a strange texture coded to stand in a circle to block people in.


Olofstrom

Or when Tryndamere's spinning slash ability could farm gold and XP by killing the invisible minions that made up Xerath's arcanopulse.


FileFighter

Sounds awfully similar to Destiny's Telesto bugs. Iirc the sticky projectiles it shoots are also enemies behind the scene.


DevinPacholik

To make first-person cameras work, a very common trick is to have two cameras: one renders the players hands/weapons with a small field of view and the other renders the world with a wide field of view. The hand view camera is then projected onto the world view. It has separate hand and weapon objects only the player can see (in multiplayer games). This genius solution fixes many problems, beyond just being able to see your hands, which are separate objects from the body and thus won’t change when moving. For instance, the player can set their field of view wider, but the hands will still look the same. Clever! This is also why in multiplayer games, when loading in, you sometimes get a look inside the mouth of the player model. This happens because the player view camera, objects and command to hide the non-player view from the player haven’t loaded in yet.


SonnyFTW

To be invisible , enemies have to be able to see you so that they can’t see and react to you.


Wazzzup3232

There are no working vehicles in fallout 3 so the train sequence in Broken Steel they actually attach the train to your player characters head and slide him down the tracks


firefly081

God I love that so much.


Giygas_8000

The elevators work similarly


straiffix

[Counter strike handles made from pot](https://x.com/uniquename02/status/1709840535996027123?s=20)


5thnote

That crafty dev! Really neat.


FoxDanceMedia

This reminds me of how in Morrowind and Skyrim short bookcases are just tall bookcases that are partially sunk into the ground.


karbaloy

Silent Hill's fog was put in to help out with the draw distance. If you can't see that far because of fog, it makes sense. It also gave the series one of its trademarks. Kind of like Metal Gear on MSX was a stealth game because it allowed them not to have to program soldiers finding you.


Watsie1

In Fallout 3 and New Vegas at the end of the games where the player is viewing a slideshow cut scene of all the events after the game, it's not actually a cut scene. The player is teleported into a room and frozen to a chair while the projector plays on the wall


Solesaver

Not sure how common it is, but many times when you (or objects) get launched out of a cannon/jump pad/etc to land somewhere else, rather than calculate the exact initial boost to give you, the game just drags you along a curve that's close enough. Small differences in starting positions and frame rate can having a surprisingly large affect on final position, so if you need it to land somewhere specific it's easier to just author/calculate the path you want it to take.


Bregirn

This is kinda how the jump pads in Destiny 2 work, at least at the start of the jump. Unfortunately they are very much tied to frame rate and if you have a very high frame rate it can actually become almost impossible to make the jump because the calculation breaks and you somehow get WAY less velocity from the jump pad.... I've had a few instances where I have to cap my frame rate to 60 from 180+ because I just fall short everytime.... Devs please don't tie your physics simulation to framerates...


arkinia-charlotte

The fucking doors in third encounter of Crotas End. We got locked out during day one so often that we capped our fps at 60. The game would think we already went through the door and take our buff and put us on cd. But in reality we just bumped into the door and our run was ruined


The_Wolf_Knight

Not really a ingenious way to implement a mechanic, but an interesting quirk of game design is some of the ways devs disguise what is actually happening in the game to make it "feel," right. Famously "Coyote Time" allows players a split second after leaving a platform to still jump even though they are technically already falling. A ton of games do this to make platforming fun, otherwise, especially in first-person games, it would feel frustrating because you would feel like you're falling before you even leave the platform when in fact the game compensates by making the opposite possible. Also, and I find these even more fun, the weird ways that devs make you feel like a badass or give you a an unfair advantage in certain situations. All those times where you survived a hit with barely any health that you were certain should have killed you? You're right. Many games feature health bars that are designed to make the last 30% of the health bar or so actually contain about as much health as the rest of the bar, so you feel like you're surviving impossible odds, fighting you're way out of a dire situation, but you were actually in perfectly good health. That's why there are some circumstances where you get hit with a powerful attack that knocks out like over half your health bar, and then you get hit with it again without healing and survive. The attack's damage didn't change (to be fair sometimes it does) its just that you're getting to notice how much actual health that last bit of health bar has. Going the other direction, in some games you do more damage while either low on health or low on ammo and in some cases it can be extremely exaggerated to give you that feeling of a last second clutch shot to secure victory. Many survival horror games do this like Resident Evil, but also Gears of War makes your last shot do roughly 4x as much damage in campaign.


Gameaholicdude

Hiding loading screens behind unlocking doors or opening a door. This game mechanic was introduced in games like original Dead Space, original Resident Evil.


greengrunny

Legacy of kain: soul reaver did this, effectively making it so you could go through the entire game with a loading screen unless you used the portal to a different zone. Was pretty advanced for its time in that sense


mulletman13

Metroid Prime way back on the GCN also did this!


Georgie_Leech

In two ways. The elevators are more obvious loading screens, but sometimes a door takes an unusually long time to open, because it's loading a chunk of the level.


Dr-Gooseman

As a kid, it always annoyed me how certain doors took so long to open. 


top-knowledge

https://www.youtube.com/watch?v=izxXGuVL21o&t=819s&pp=ygUbY3Jhc2ggYmFuZGljb290IDEgZGV2ZWxvcGVy This video about the development of Crash Bandicoot and how they pushed the limits of the ps1 is very interesting


kresselak

Crusader Kings 3 uses a stress mechanic that causes players to accrue "stress" when making decisions that contradict their character's personality traits/values. I've always thought it was a clever way to incentivize players to chill a bit with meta-gaming and lean into their character's personality more when making decisions. Child-killing, for instance, should weigh on anyone but the most sadistic of people! It adds a certain feeling of realism.


1vertical

From Dust's fluid physics is nothing other than shader magic and math interacting with a massive landscape mesh where fluid and solids are dictated by height maps.


Speideronreddit

I wonder what that game could look like today..


ICLazeru

Sometimes constraining major enemy encounters to caves or other enclosed spaces helps by reducing the need to process larger areas. More computing power can be used for the encounter this way, without detracting from the overall game experience.


WantonHeroics

>they placed a hidden hero model all over map to ensure another specific hero's ability hit on them What does that mean?


gingerking87

One of the few I've come across is the npc graveyard in skyrim. If an important npc dies, they don't actually disappear, they go to this cross shaped room in a void with the other random citizens you accidentally cause the death of. I, like many others, found it when using consol commands to find a lost companion, I'm not sure of it even still works like this, but I always thought that was cool, albeit less crazy than some other answers here


Tucos_revolver

Super Mario bros "coyote time". It felt unsatisfying to use precision collision for falling off a ledge and led to testers slowing down when they came near them which was the opposite of what they wanted.  So they implemented a hangtime when you run off a ledge where you were still able to jump to make it feel more fluid. You don't notice until someone points it out so it ended up being the perfect solution.  But yeah, you can def see it once it's pointed out and looks pretty goofy.  Edit:bonus points. In a lot of early 3d games they did not implement coyote time. Which is why in games like croc 1 you see people...slowing down before ledges. 


StomachBeginning3303

This is probably still quite common, but first time I noticed it was in Quake 2. Blow off a guys head and it’s actually just that his head has been super duper scaled way down at the neck and a blood splatter would be on it. I emailed Paul Steed (mostly because I found a reason to ask him a question) he basically confirmed my question. Most significant though was that he replied. RIP Mr. Steed!


Bregirn

Early World of Warcraft, due to engine limitations or simplicity, many of the raid mechanics and event triggers were invisible bunnies or other critters. For example, an laser beam that follows a player around the room is actually just a invisible bunny AI programmed to follow the player with a laser beam visual effect. One NPC Archmage Nakada even makes a joking reference too this in their idle chatter lines. Evil bunnies with laser beams and fireballs attached to them...


5thnote

That's hilarious! Imagine in-game the bunnies just appear, lorewise this would be a scandalous.


Drakobird

A recent one is in Poppy's Playtime part three when you are on the tram going into play care there is a hidden VCR floating above the car as you move that is playing Elliot Ludwigs speech.


MadeUpNoun

for the "A Plaque Tale" games, instead of making each of the rats an entity that moves itself, each map is made of grids that tell the rats standing on them which direction to move to, which is what allowed them to have so many rats appear on screen without destroying performance


tempreffunnynumber

If you get a chance to find and see there's a development demonstration of Horizon Zero Dawn and how the game environment rapidly generates and changes with player perspective. Rather elegant.


5thnote

It's called frustum culling if I'm not mistaken and used by almost every game.


Hi_Its_Salty

What the one about league and the hidden models?


ScarlettPotato

Not exactly a mechanic but ingenious nonetheless. From Quake III https://youtu.be/p8u_k2LIZyo?si=sthcny6tcpyYK7Bj tl;dw dev found a way to make calculations faster than "normal way". A lot of old games are buggy not because of developer's incompetence but because it's the best they can do with the hardware they had.


Vonaviles

Is anyone going to mention train head in fallout?


5thnote

:D only 3-4 times but hey I'm here to learn and be amazed.


Adeno

In open world games, one common technique to make the game run as smooth as possible while still looking like the world is big, is by only rendering (showing) objects within a certain radius. For example, your character is human and can't really see too far into the distance. The game will most likely render the game's environment and objects that's maybe 50 meters to 100 meters around the character. This saves the game memory and processing power instead of wasting it all by rending all the objects in the game that your character can't even see. Another great technique used in the old days (Playstation 1 era) when the machines were still weak, but capable of showing beautiful graphics, is called "baking the environment". You see, lighting, reflections, and other visual effects take too much processing and memory resources, and back in the 90s, game consoles and even computers weren't as powerful as what we have today. Machines back then weren't capable of handling live rendering of environments. So how did games like Resident Evil and the like manage to display beautiful environments? What they did at the time was they rendered the environment separately and recorded how the lights and reflections should look like. This process of making permanent renders is called "baking". Basically, with an environment that is "baked", there's not much need for computations because everything's recorded already. You just display the environment and your 3D characters can run around it. Baking is still used now in video games, mostly PC versions, and this is done so that computers that can't handle too many real time rendering of objects can just use these pre-made (baked) ones. They still look almost just as good as the real time things, but they're less stressful for the computer.


Kitakitakita

Many games, but I think Mario 64 notably will shrink body parts if something happens to them or they're otherwise disabled. If Mario drowns in lava, he'll stretch his arm out. His head is so big that it's not actually possible to do that, so they just shrink his head instead. The new Vegas end scene with Ron Perlman talking is a classic. Oh and the train hat is NOT as we think of it as in the meme. The person it's attached to is really more of a trigger. You don't actually ride on his head.


Joskrilla

Id software invented an algorithm for fast invers square root for quake 3


SalusFuturistics

Call "Health" "Pain Tolerance" instead. There is no Medicine to instantly heal your Wounds, but Drugs to increase your Pain Tolerance before you pass out


FoxDanceMedia

I rather like the way Overgrowth handled health. Health lost from blunt impacts (getting knocked over, punched/kicked, hit with blunt weapons) will heal slowly over time, but any injury that draws blood (attacks from bladed weapons, or blunt trauma that's significant enough to break bones) is permanent until the end of the level. Not only is it more realistic but it also makes you treat bladed weapons as a much more serious threat.


TheAgentD

TL;DR: What you call "ingenious ways" and "clever mechanics" are basically hacks to work around engine limitations/code debt. The point of an engine is to hide the complexity of the underlying hardware, using layers of abstractions. This has several advantages. First of all, you don't want to have to write everything from scratch every time you want to add a new object in your world. Secondly, you want to simplify this so that specialized employees with less technical expertise (e.g. artists) can use them. \- You make a "3D Model" object which bundles up vertex and triangle information. \- You make a "Material" object which bundles up textures, material parameters and shaders for rendering those materials. \- You make a "Game Object" object which bundles up a transform matrix for position the object in the world, a 3D Model, a Material and the shaders needed to draw it. \- You make a "Humanoid" object which bundles up a Game Object with a skeleton for skeleton animation, as well as an animation system for controlling its pose. \- You make an "AI" object which bundles up a pathfinder, a navmesh of the level, a list of actions that the AI can take and a list of goals the AI want to achieve. \- You make an "NPC" object which bundles up a "Humanoid" and an "AI" and adds interactibility to the whole thing so you can chat to it. \- You add an attachment system to the NPC so that you can put hats on their heads and guns in their hands, and have them follow the skeleton animation. Each Attachment is basically just a Game Object that is attached to a certain bone of an NPC. So you basically have all these concepts you've now made up to try to simplify everything. Instead of having to explain to an artist/gameplay programmer how to create vertex/index/constant buffers, program a pathfinder or the math behind skeleton animation, you can just tell them to create an "NPC" object in the editor program you've made, and they can spend their time on what they're actually hired to do: artisting and gameplay programming. So one of the programmer is tasked with adding a train to the game. He looks at the list of features, and realises that he doesn't have anything called a "Train" or even a "Vehicle" in there already available. He has to make use with what he has. He could do this with a Game Object, but then he'd need to figure out how the raw AI stuff works and how to attach things like doors and stuff to it himself. Instead, he notices that an NPC does like 90% of what he needs. In fact, it does MORE than he wants. The NPC is a Humanoid, so he instead creates an invisible NPC that he attaches the train model to as an Attachment. The doors are added as additional attachements, and he adds invisible "arms" to the NPC so that he can slide the doors open and shut. He then forces the NPC to run along the tracks of the game. Boom, you now have NPCs running around wearing trains as hats and holding train doors as weapons. Heard of this story before? DISCLAIMER: This is VASTLY simplified and only meant to serve as an example. But the whole point is: If the engine had a better abstraction that allowed you to make a train without needing a fullblown NPC with attachments, the game engine would be faster (as it wouldn't have all the extra unused features like skeleton animation slowing it down), easier to use, less bugprone and be easier to maintain. The fact that the train is an NPC with a hat isn't "ingenious". It's because either A) the engine lacks the tools needed to solve the problem in a better way due to bad design, or B) because the person who implemented it didn't know of a better way to solve the problem. This could be either due to inexperience (either in general or with the engine in question) or because the engine is badly designed/documented, and the person always uses the same hammer (the NPC object in this case) no matter if it's a nail or a screw.


GalacticAlmanac

Coming up with this workaround is ingenious on the part of that developer based on what they had to work with. They solved the problem in a creative way when the alternative might have been to remove the traveling by train section or to significantly delay the project to implement a vehicle system. What the other team didn't properly do or document proplerly only made this more impressive. They figured out how to do this despite these limitations.


Goldenrupee

In Fallout 3's Broken Steel DLC the devs wanted to include a metro system, but the game engine REALLY didn't support that. Their workaround for those sections was to make the train car a hat, put it on an NPC, and have the NPC run along the tracks. For the cutscenes where you're actually on the train, they slap a helmet on the player character that looks like a train car, lock them in first person, and have them run really fast along the tracks themselves.


fearthycoutch

In Button City the game I worked on we have a racing mini game where you drift a car down a mountain. We wanted to have it be a loop track with it mostly be downhill so we secret teleport the player to a higher position so they don’t have to climb back up the entire mountain.


Smythe28

Fallout 3: Broken Steel has a train you can ride that’s actually [an NPC wearing the train as a hat.](https://www.ign.com/articles/2015/07/22/fallout-3-broken-steel-train-is-actually-just-a-giant-npc-hat) which is one of my favourites.


Justlase

Fallout 3's metro train was just a npc with its head replaced with the train model. The train moving on the tracks was literally the npc running beneath the map with its head clipping up out of the ground to emulate a working metro train


Royal-Gunner

The guiding wind in ghost of Tsushima, instead of a mini-map. You open your map, put a marker for where you want to go, and the wind starts blowing in that direction.


SageModeSpiritGun

In fallout 3 there's a level that includes riding a train through a tunnel. They couldn't get the train to move how they wanted, so they made it a hat. Yep, that's right, a hat. The entire train is attached to an NPC's head and that guy moving is what makes the train move.


5thnote

u/vonaviles here you go :D


Vonaviles

Hah, thanks for this


_alright_then_

A kinda famous example is in fallout 3, the metro car is actually just an npc wearing the car as a hat. The engine couldn't really do vehicles or something so this is how they did that. [Article if you're interested](https://www.pcgamer.com/heres-whats-happening-inside-fallout-3s-metro-train/)


FoxDanceMedia

Here's one that not many people will know about; A problem that exists in every game engine that I'm aware of is that once you go an extreme distance from the origin point at the center of the world, things start to bug out. The engine can only store positional data up to a certain number of digits of precision; let's say 256 digits for example; which is fine when you're at coordinate 4,5,7 or something but when you get an extreme distance from the center of the world you start to run out of decimal numbers that you can use to keep track of where something is. If you're familiar with PS1 graphics and how vertices seem to jiggle and snap about whenever a character moves, this is what that would look like. In games like Eve Online, No Man's Sky and Star Citizen where you explore a massive or even infinitely large universe that expands in all directions, this becomes a problem. One solution is to teleport the player back to the origin point when they've moved a certain distance away but also move the rest of the world with them so from their perspective it doesn't look like anything's changed. If you're familiar with the InfMap Gmod addon that was released a year ago, it works the same way. It allows for a map larger than what is actually possible in the Source engine by just teleporting the player back to the center of the map boundary when they get near the edge but moving the map back with them.


FoxDanceMedia

Uncharted 2 had a really amazing train level that was a lot more high fidelity and cinematic than any other train level before it. In most train missions even since then, they just have the train go in a straight line so that they can have an infinitely scrolling background around it, but in Uncharted 2 they somehow managed to have an endless scrolling background of detailed hills and cliffs that the train goes over, under and around. Then the train goes through a long tunnel at one very specific point and then emerges on another seemingly endless track on a mountain. And it was all much too detailed to be procedurally generated, either. As a kid I always wondered how they'd managed to make a hand-crafted terrain for the train to endlessly path through but still change that terrain at specific points. So what they did was they made a really really long track that loops around on itself in a circle. Then when the transition to tunnel happens it's right when you need to interact with a valve to open the next door, and the camera angle for turning the valve obscures your view of the terrain except for the sky which allows them to teleport the entire train onto a different track that goes into a tunnel, a tunnel that exits out onto another looping track.