Skip to main content
gamedev.net
🔒 Locked

2D Software rendering for a RTS

Started by Daivuk Aug 30, 2006 at 3:50 PM 6 replies 1.3k views
Original Post
Daivuk
Daivuk
Hi there, this is not really a question, but just seeking for opinions about the subject. I'm about to start a big RTS project with a friend, in the style of Starcraft in term of gameplay. Our first idea was to build it in 3D. But we finally changed mind and decide to make it in 2D. This way we can put more details on the units and its pretty simple to handle with the mouse. And of course, its much more easier to create the game and the units (remember we are two on this project) Are first expection was to use OpenGL for the 3D. But now we are making it in 2D, we think of using DirectX. Because its more friendly for 8 bit indexed textures. Then (when playing starcraft) I remarked that cloacked unit actually deform the image. And also the EMP shockwave. We are not intending to remake Starcraft sorry for the comparaison. But in term of gameplay we want it the Starcraft way. (Its a free game ok, so dont tell Blizzard chuut :P). And of course we will have cloacked units. SOO. we finally come with an idea. Making it software (BitBlit power!). Only render the final buffer on a texture and give it to DX or Ogl. And I'm wondering if you think that starcraft do this. Because it was DirectDraw4 I think, and I'm not sure, that you can not achieve this kind of effect (deforming) with DirectDraw4. I think (here I need you opinions) that they do render it software, and use directDraw to render the final buffer. Also, we target Gforce2 and more. (Thats another reason why moving into 2D) So folks, what you think about all this? (Except those who will tell make it 3D full of shaders etc) Opinions, interrest, etc? Thanks, Dave
Ravuya
Ravuya
I don't see a reason why this couldn't be done in OpenGL or another 3D API -- while your graphics API may support 8-bit RGB images, in reality it's being converted to 32-bit RGBA inside the videocard driver anyway so you might as well use the improved image quality.

Most effects can be approximated using semi-translucent images and palette swaps on 32-bit images; you're not bound to a palette if you want to change the colour.

You would largely lose the many performance benefits of hardware acceleration when running on something like DDraw behind the scenes; most cards these days simply aren't built for accelerated 2D graphics.

Also, DDraw is ancient. It's no longer in DX9, and I have no idea what MSFT's future plans are.

For a more modern compromise, look towards SDL. It's still using DDraw internally on Windows (moving to hardware-accelerated OpenGL in the upcoming 2.0 release), but provides platform-independent palettes, input, timing and sound. It's being updated very frequently, and offers a wealth of options and a lively community. There are also some libraries built on top of it, such as Kyra.
Daivuk
Daivuk
Oups anonymous, previous was me
OrangyTang
OrangyTang
Quote:
Original post by Anonymous Poster
Now put this in numbers :
60 units * 16 anim * 9 direction * 4 (rgba) * 48 * 48 =
79 626 240 bytes
That makes : 75.9375 Mo !!!!!!!!!!!!!!
We want 32Mo video card to support the game.

A 32Mb video card would still be able to run it, you'd just need 76Mb of main RAM to hold the textures, and they'd be shifted in and out of video ram as needed (which is why you'd use texture atlases/sprite sheets and sort things by texture where possible).

Compressed texture formats such as DXT3 / DXT5 should also be able to save you a considerable amount of memory, with only minimal visual difference.
Daivuk
Daivuk
Ok.
But if we use hardware, we will probably make it in OpenGL.
For portability purpose.

The thing is, I can still render software on a buffer, and then give this buffer to openGL.

We want a resolution of 800x600 (640x480 if we see we dont really have choice (size of textures, software CPU time, etc)). Anyway low resolution for a 2D game is not an handicap.

So guys, how do YOU think blizzard made starcraft??
(That is DA question haha)
They have blending, screen deformation, etc.
My first bet would be software rendering. But I'm not sure you can achieve smooth things like Starcraft in software. (and it runs on old computers)

Thanks for opinions all :)
Daivuk
Daivuk
Ok guys, I just test it with a very fast algo.
I can draw 500 32x32 sprites and keep my 60 fps.
But if I put alpha on it or any other operation. ayayaye.. 20fps.

I will make it hardware. And since all images of a units is stored into ONE big image. It will take less place. The marine dont really take 32x32, but more like : 22x28.
And packing it into a texture will let it be smaller.

Ok guys, any more suggestion ?
pammatt
pammatt
I would definitely recommend going the 3D api, i.e. OpenGL route. It is quite easy to work in 2D using textured quads for sprites and you will gain mega huge amounts of performance by doing so. Not to mention any sort of blending effects are way more easier going the OpenGL route.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.