Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Ken

This may sound like a stupid question but it's one that I have been trying to understand. Why should I scale the game instead of just setting Scale=1?

Say I have a game set at Scale=1 where the game size is 400x200 and each tile is 10px wide. Then if I create a second version set at Scale=2 and then set the game size to be 200x100 with a tile size of 5px, I would end up with the same sized game in the end with the same number of tiles. So how is that really saving anything or make it more efficient?

I am sure I am missing something totally simple, or maybe efficiency is not the goal of scaling. But for whatever reason it just wont click for me.

Thanks.

1 decade ago by stahlmanDesign

For one, you get the big pixel effect like the classic platform games.

Another reason might be that if you have a full-screen game at scale=1 that would be pretty processor intensive for a browser that doesn't have hardware acceleration.

In a native app for iPad or the Mac you almost certainly use OpenGL and profit from hardware acceleration. I made a game using Cocos2D for iPad, and it used tile maps and sprite sheets like Impact, but with hardware acceleration, and much optimization.

I may be wrong, but scaling up still looks OK and saves lots of memory and CPU.

1 decade ago by Ken

@stahlmanDesign - Thanks. So it is more efficient then. I will have to dig deeper into how. I'm just curious how in the end my 200x100 game with tiles of 5px, scaled by 2 is more efficient then my 400x200 game with tiles of 10px not scaled. When they have the same number of tiles and occupy the same screen size in the end. Maybe scaling hands off some of the processing for drawing. Interesting. Thanks.

1 decade ago by fugufish

true, scaling is a good way of creating an immersive experience without sacrificing performance.

i use the hqx algorithm to scale the pixels in my game.

1 decade ago by pm99

@Ken,
I was wondering the same thing, but I'll take a stab at it.

I think the answer is in your example. A tile that is 5px in size has obviously less memory requirements than a 10px tile. Hence, by simple 'scaling' the 5px x2 you bypass the rendering engine from having to 'draw' the extra 5px. Presumably 'scaling' is a trivial mathematical process which outweigths the additional memory overhead.

But then again, I could be entirely wrong. : )
Page 1 of 1
« first « previous next › last »