The engine powering InterAction studios games is called UVE (short for āUltra VGA Engineā). There are 4 main generations of this engine (well, there are more, but 4 are relevant to the remastering):
-
UveDX (1997-2002): Used by the original CI1 and the original CI2. Uses DirectX 7, purely 2D blitting. No scaling, no rotation, no translucency. This is why youāll see certain graphical assets (e.g., your bullets) have pre-rendered frames for 360o of rotations. Supports Windows 95/98/Me/2000/XP/Vista/7. Technically it can also work on more recent versions of Windows, however starting with Windows 8, DirectDraw is software-emulated, which means itās very slow.
-
UveDX8 (2006-2014): Used by original CI3, CI4, and by the CI2 remaster. Uses DirectX 9, ālooks like 2D but is in fact 3Dā. Supports Windows XP/Vista/7/8/8.1/10/11.
-
UveUDX9 (2014-2018): āUltraā UVE (on-demand loading, multi-touch support, better widescreen support, unicode). Used by CI5 and the āremasteredā (double-resolution) CI3, CI4.
-
Uve++11 (2018+): Used by CIU. Uses DirectX 11 and C++ 11 features. Supports Windows 7/8/8.1/10/11.
Which generation should we use for the remaster? I briefly considered using UveUDX9 (due to its XP support), but I quickly dropped it in favour of Uve++11. Windows XP support is not that important because the original game still runs fine under it. Besides, I think itās only a matter of time until the rest of the games transition to Uve++11, so might as well jump on that bandwagon now.
Question: So how do we transition from a 26-year-old engine to a contemporary one? Answer: Not all in one step. There are too many incompatibilities (technical and otherwise), and itās all bound to end up in tears. So we try to break it down in smaller progressive steps.
Towards this end, we in fact have something going for us, and that is CI2 (which luckily uses a very similar engine to CI1) which was already remastered in late 2011(*).
(*) I donāt actually remember these dates by heart, you understand. Iām searching through file dates and news posts, or trying to cross-correlate them with other milestones. So there might be slight inconsistencies.
This is a big win. I canāt understate how important this is. If I didnāt already have the CI2 remaster, I would most likely not consider remastering CI1 at all. Itās otherwise a lot of work, and itās a deal-breaker for a small project such as CI1.
The reason why the CI2 master is important is because it includes technology to emulate the āoldā 2D UVE using the ānewā 3D UVE. There are two main parts to this emulation layer:
-
2D bitmaps now become 3D textured polygons. Coordinates are re-mapped and some shims are applied to make sure things are placed at exact pixel boundaries.
-
More importantly, UveDXās single-pass āprocessā model is mapped to UveDX8ās two-pass ātick-renderā model.
In the āprocessā model, game logic and rendering are inextricably linked because they occur in the same function. This function is called once per frame at a steady rate. It is not possible to have variable frame rates using this approach, because speeding up the frame rate would also speed up the game logic(*).
(*) Strictly speaking, the problem is that all game logic assumes time passes by counting frames rather than measuring physical time. This is a very fundamental design decision upon everything is built, and itās not something that can be changed after the fact. This is similar to how you should decide in advance whether your game is going to support multiplayer, because youāll be in a world of pain if you try to retrofit it later.
In the ātick-renderā model, processing is split into the ātickā phase (which handles all the game logic) and the ārenderā phase (which handles the visual presentation). They are independent and it is quite possible to only tick (the game servers use this, because they donāt need to show anything on the screen), only render (useful when game is paused), or both. Also, time is decoupled from frames and measured properly.
Anyway, so we can use CI2 remaster as a stepping stone. But thereās a problem: CI2 remaster runs on
UveUDX9, not Uve++11. Oops.
This is (relatively) easily solved by doing a bare-bones port of CI2 to Uve++11. The entire game doesnāt need to fully work (because it will be replaced by CI1 code anyway). We only need the emulation layer to work barely enough so CI1 can run on it.
Turns out this only took a couple of hours. There was a lot of heavy commenting-out involved of anything that I couldnāt get working trivially. Itās now time to rip the CI2 code out and replace it with CI1. Iāve saved a copy of the code at this stage in case itās useful in the future, but in all likelihood the actual CI2 port to Uve++11 is too far into the future for this to result in any significant time savings.