

Uuh. That is exactly how games work.
And that’s completely normal. Every modern game has multiple versions of the same asset at various detail levels, all of which are used. And when you choose between “low, medium, high” that doesn’t mean there’s a giant pile of assets that go un-used. The game will use them all, rendering a different version of an asset depending on how close to something you are. The settings often just change how far away the game will render at the highest quality, before it starts to drop down to the lower LODs (level of detail).
That’s why the games aren’t much smaller on console, for exanple. They’re not including all the unnecessary assets for different graphics settings from PC. They are all part of how modern game work.
“Handling that in the code” would still involve storing it all somewhere after “generation”, same way shaders are better generated in advance, lest you get a stuttery mess.
And it isn’t how most game do things even today. Such code does not exist. Not yet at least. Human artists produce better results, and hence games ship with every version of every asset.
Finally automating this is what Unreals nanite system has only recently promised to do, but it has run into snags.
Still have it on android 15, Sony Xperia 1 V.