Ok, need some questions about HWA answered
Well it seems I've find a lot of conflicting and/or ambiguous answers concerning certain things about MMF2's HWA, so I'd like to try and get a definitive answer to these.
First, what exactly am I going to gain by making sure my graphics are all in powers of 2? Is that going to significantly affect game speed? For a lot of things, it's really hard to make it a power of 2 without adding negative space to the sprite, which seems kind of pointless. For some graphics, you might even have to split it in half without making it too large. So I just want to know if it really makes that big of a difference making sprites powers of 2, and what exactly performance gains would I see.
Second question is about layers. HWA is supposed to render layers without lagging. I've heard a couple of things regarding layers. I've heard that MMF2 automatically calculates a collision mask for the objects on layer 1 at the start of the frame. And then anything on other layers the collisions are done a per instance. I've heard that being the reason why layers lag without HWA. Then I've heard that it's just the fact that MMF2's engine is just rendering a lot more graphically with having parallax layers, so HWA just speeds that up. What is the real deal with layers and how HWA speeds that up?
Re: Ok, need some questions about HWA answered
Power of 2 : the main problem is the quantity of memory on the video card. For example if the video card only supports powers-of-2-sized images, a 750x500 image will use the same quantity of memory as a 1024x512 image. As video cards have a limited amount of memory, you should try to reduce the lost space. This can result in huge speed gain if the video card hasn't lot of memory, because if the memory is full on the video card, DirectX will use system memory.
Layers : the collision mask is not the problem. The problem is that backdrop objects that are not in the first layers are drawn like active objects, i.e. they are redrawn much more often than backdrop objects in layer 1 and the background behind them is saved. This takes lot of time in the non-HWA version. In the HWA version it's much faster as the backdrops are drawn by Direct3D and the background is not saved.
Re: Ok, need some questions about HWA answered
Thanks Yves! Appreciate the response.
In regards to the Power of 2 answer, does that mean it's more of an issue for the larger sized graphics, say like backgrounds, etc.? Does that mean for smaller things such as the player, enemies, etc, it's not as big of a deal?
Re: Ok, need some questions about HWA answered
Yes you'll lose less space with smal graphics. However you shouldn't use too small graphics because in this case the speed gain you get will be reduced. I.e. if the graphics are small (smaller than 32 or 64 pixels), then you'll have more objects on screen and mmf will spend more time to tell DirectX what to display. You have to find a compromise.
Re: Ok, need some questions about HWA answered
Ok great. Thanks Yves! Very informative and helpful :)
Re: Ok, need some questions about HWA answered
One more question. In regards to this:
Quote:
Originally Posted by Yves
if the video card only supports powers-of-2-sized images, a 750x500 image will use the same quantity of memory as a 1024x512 image
So if I had a sprite that was say, 42 pixels wide, 64 high, as I understand it, that would take the same memory as if it were 64x64. Is that the only issue (memory)? Or would there be any real reason to say increase the transparency around the sprite to actually make it 64x64 or is that a waste? I didn't know if that had something to do with rendering speed or what.
I'd prefer to not have to artificially pad a sprite with negative space if there's no reason to.
Re: Ok, need some questions about HWA answered
There is no reason to pad the sprites with transparent space.
Re: Ok, need some questions about HWA answered
Quote:
Originally Posted by Yves
There is no reason to pad the sprites with transparent space.
Ok great. I didn't think there would be but just wanted to be sure. Didn't know if for some reason it would run faster if the sprite was actually in powers of 2 for dimensions or not.
Thanks again for the answers. Appreciate it.
Re: Ok, need some questions about HWA answered
I remember Yves saying the MMF2 runtime does pack the objects into power of 2 squares, so it really shouldn't matter if you leave transparent space. It would matter if *you* could choose which sprites would be packed in a specific space.
Re: Ok, need some questions about HWA answered
No, MMF2 does NOT pack the objects into power of 2 squares. Maybe for MMF3, but not in MMF2.