What code philosophy/structure of abstraction/program design would allow a game to be used with both 2D and 3D graphics (seperately) WITHOUT having to re-code the Game logic?
We're talking taking the same code, changing a minimum of things (for example, exchange filenames for 2D assets with filenames for 3D assets), and maybe pluggind in a few specialisations of a base class per generics/templates.
To put it in a real context where it makes sense: imagine a LAN-multiplayer game where there is one top-notch, performance-hungry 3D client for the players with some really good Gamer Rigs, and a more humble 2D client for the old dusty boxes that someone found in their attic. But it's still the same game - the same events are registered (someone picked up a coin), the same Network protocol is used, the worlds are proportional, etc.
To put it in an MVC context: The Controllers are the exact same (pressing the "Up" Key will set the players accelleration at 3.5 units/second), the Views are totally different (2D versus 3D), and the Model is the same except for anything directly related to graphics. (a collision check for the environment is performed every 5 seconds, and it uses the same algorithm. Note that this would mean there IS a Z-coordinate for all the Game Objects in the 2D version, but it's just ignored or displayed to the user in another way, for example by a shadow that is displayed further left when the player is in the air)
What makes this such a fascinating topic is that it would FORCE the developer to have a very clear idea of how his data is structured and how control flows. Note that this does not imply using anything other than a graphics library like SDL, D3DX or OpenGL. No Game Engines!
Since this is a mostly theoretical question, I'll leave programming languages out of it, but if you want to give an example you can use any language you like, C++ if you want to go the whole hog, or even brainfuck if you feel up to the challenge. (Any concrete answers will be appreciated, as well as any abstract ones!)