šŸ” Chicken Invaders 1 Remastered #04

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.

image

image

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.


Next part in the series

Start at the beginning

30 Likes

unity engine

Uve++11, perhaps? I mean, itā€™s the most modern version out of the others

1 Like

Uve++23 when? The best one is the one used by CIU right now though

1 Like

Canā€™t wait for #05.

1 Like

Yes, thatā€™s what the text says.

6 Likes

you mean with orthographic projection? like what i did for a fangame i made in Unreal Engine 4 in last November?

why are you trying to be toxic for nothing, all i did is i asked IA about using orthographic projection in the CI games, cuz i did happen to make a fangame in UE4 and i did just that so i was interested in hearing if IA did the same thing or did something else, why are you here trying to be like ā€œWhO aSkEdā€ and you just trying to mock me with an overused roast and you cut the question i asked before just to make me look bad, like seriously get the hell out of here

1 Like

Yikes man i dont know who this person above me is, but i dont reply with ā€œwho askedā€ thinking it do any good

If you just mentioned orthographic then Iā€™d be fine, no need to brag about your project you ā€œmade in Unreal Engine 4 last Novemberā€, orthographic is not too impressive and is used a lot in video games, and that will not make your ā€œfangameā€ special

They werenā€™t bragging, they were just normally and politely asking iA about that specific thing, and itā€™s rude to bump to the question after 4 days and be toxic against them.

3 Likes

well of course his unreal 4 chicken invaders fangame must be really well known and got a rating of 9.4/10 from ign right

They were just mentioning that they did something similar, and it doesnā€™t have to be popular in order to be mentioned. Either way, donā€™t be toxic on members, and treat them nicely.

1 Like

Sorry, maybe I was too harsh. I apologize again and will improve as a forum member.

6 Likes