Posted: Wed Mar 18, 2009 11:18 am Post subject:
Some questions about the RA2 technology.
Hi there,
this semester I have only a few modules (read: quite some free time) and since I am a fan of the old C&C series, and especially the charme of the Tiberium Sun / Red Alert 2 games, I'm thinking about writing a similar engine/renderer. First of all just to learn from it, but if there is some useable output,... who knows, maybe it can be used for some kind of OSS game
I already did some research on the internet and this forum, about `how the red alert 2 renderer works´ but it is hard to find the needle in the haystack.
Here some open questions I have, maybe someone can help me
* The Renderer
From what I know, RA2 is fully software rendered, right? (I think the terrain is the only thing which can be `hardware accelerated´ by OpenGL or DirectX)
* Buildings / SHP
I found no documents yet about the SHP format. From what I understand, SHP is basically some kind of GIF format, which paletted textures and frames? I did also read, that shadows are seperated from the buildings, does someone know the reason?
* The Terrain
Well, seems to be a basic isometric terrain. But Cliffs and Bridges (for example) bug me quite a bit. Is there a little bit more information about them?
I found quite a bit about the Voxel format, but this seems to be a huge topic which seem to need quite a lot of time, but I put that back for later.
SHPs are proprietary format from Westwood, like other sprite making image formats (gif, tga, etc.). They are made in fanciful ways.
Other modders around here can tell you more.
Bridges are a special case scenario. That's mostly all I know about them.
Hardware acceleration wise, I do believe the entire thing is run on DirectX/OpenGL, not just the 2D elements. Especially true since everything is counted by frames rather than synced to the system clock. QUICK_EDIT
Hardware acceleration wise, I do believe the entire thing is run on DirectX/OpenGL, not just the 2D elements. Especially true since everything is counted by frames rather than synced to the system clock.
Hmmm, maybe they used a DirectX framebuffer and wrote there stuff over the CPU there? Regarding to the system requirements: "2 MB video card" it would fit.
(800x600 Pixel * 16 BPP) / 8 [to get bytes] = 960 KByte for one buffer. As you normally draw to a backbuffer, you need it twice, so 2 * 960 Kbyte = a little bit less than 2 MB.
Also, besides the terrain, there seems to be nothing, which could be represented as mesh/polygon data. And I can't remember that we ever had some hardware voxel support.
That are my thoughts about the renderer, so far. QUICK_EDIT
Well, you could try downloading several modding tools. Use them to pick through the files, it's how I learned to mod the original Command and Conquer games. It may not help you enough to find what you need, but you could use it for future reference. _________________ Okay, my signature was starting to annoy even me. QUICK_EDIT
You know about voxels/volume pixels right? Any vehicle in RA2/YR and any vehicle that tilts in TS (and some that don't) are voxels. These are 3d models made up of little cubes, each one has a colour and a "normal" (way light reflects off it) assigned to make up the tank/plane/sentry gun turret etc _________________ Yes, work on MV continues. It is not forgotten. QUICK_EDIT
Yes, I know what Voxels are. But I'm interested in how they are rendered. I don't know about any voxel support on the video cards back than and today (besides some voxel-renderer written with CUDA), so thats why I think, that the whole game was software rendered.
Same for the SHP's, from my current knowledge about rendering/OpenGL, I don't think that there is a acceptable way to store them on the VideoCards back then. (Without eating dozents of MiB VRAM)
Example: You have a 128x128 building sprite, with 16 bit color-data, and a total of 60 frames animation (Idle, build, destroy...)
(128x128x16x60) / 8 = 1,8 MiB
And this quite often, for all fraction buildings and map-entities (buildings etc...). Feels too big for the rather small cards But videocards can swap/use the normal system Ram too, but not as fast as the VRAM.
If the SHP algorithm is simple, it might be fast enough to blit the building on the fly without creating and caching full (WIDTH)x(HEIGHT)x(BPP) RGB frames. All you need to store in RAM, would be the small SHPs itself, theoretically.
The whole thing is somewhat weired Today it might be possible to render the terrain and buildings using the GPU, if there is enough VRAM available, and render the Voxels over the prerendered frame. With an actual GPU probably the voxels too, using some shader twirks or such. We'll see.
However, if I should start programming, I'll try to define a good API for the renderer to keep easy replaceable for other approaches. QUICK_EDIT
Joined: 14 Feb 2006 Location: Flying into hostile territory
Posted: Sat Mar 21, 2009 8:51 pm Post subject:
only place in ra2 where you will find 16 bit artwork are the pcx files and anything that may be an icon. voxels and shp's both use a 255 color pallete.
Also I agree in that it was almost a complete software rendering only acceleration I think that was supported was mmx and 3dnow! _________________
I need to correct myself, the tiberiumsun / red alert 2 renderer depends on direct draw and _is_ hardware accelerated. (or at least some (many?) parts of it)
After some playing/benchmarks with the SDL software-surface it prove itself as _very_ slow. (I know that it would, but I didn't think that it would be that dramatic)
For example: I get around 75 FPS on a 1024x768 Window on a AMD X2 6000+ (one core used, with 3 GHz) while displaying a very simple color fade, way too poor. So, after some research I found a Mail on the Wine MailingList which confirmed it: http://www.winehq.org/pipermail/wine-devel/2007-September/059231.html
I'll play around with PBOs as next, hopefully with better results, sadly PBOs are not supported by Intels GMA 945GM (some notebooks and nearly all netbooks... ) So, i have to say good bye to the intention of a game which runs nearly everywhere :-/ QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum