More about Gameview

basil99

Active Member
Licensed User
Yes, I know, i'm boring, nut need anothed tip.

Game "world" may consist of 100's and 1000's of "Entities", each one is a structure, that contain coordinates. speed, bitmap index etc of game objects, like tiles, enemies, player, items and so on.

Usually a number of "dynamic" entities ( can move, animated ) is significantly less then number of statics

The width and height of the "world" id definetly much more then device widht/height, so a clipping problem appears.


So, what is better from a perfomance point of view:

1) Clear Gameview each timer tick and draw only part of the "world" that is visible -e.g. doing clipping yourself

2) Add all stuff to the Gameview ( 100's of bitmaps ) and allow Gameview to do all clipping job

Thank you
 

sorex

Expert
Licensed User
It all depends on the game type and how you code it.

Even when using gameview you could still go the old fashioned tile way which mean that you don't have the entire level already inthere but just add whatever gets visible which probably means a lot less memory usage on the gpu side.

Erel's first gameview example is quite simple although it's not 100% smooth on my 1024x800 tablet. I wonder if plain imageview movement wouldn't be faster in that case.

Also notice that a lot of devices won't be able to run your project since gameview is only supported on 3.0+

Edit:

I also found this in the example... "Bitmaps larger than 2048x2048 (in any dimension) will not be drawn."
which mean having a full level inthere won't probably work.
 
Last edited:
Upvote 0

basil99

Active Member
Licensed User
It all depends on the game type and how you code it.

Correct

Even when using gameview you could still go the old fashioned tile way which mean that you don't have the entire level already inthere but just add whatever gets visible which probably means a lot less memory usage on the gpu side.

Sure. Static tiles must be drawn with clipping on my side. I'm talking about moving objects, like player, platforms, enemies etc. So, actually question is whats better. Lets say, i have 300 "active" objects, but only 1-10 may present on the screen at the same time. "Sort of pseudocode follows:

A) Let gameview clip all bitmaps:

Clear Gameview
for obj = 1 to ObjectsNumbers
AddToGameView( obj )
next obj


B)Or clipping on my side:

Clear Gameview
for obj = 1 to ObjectsNumbers
if obj.OnScreen = true

AddToGameView( obj )

endif

next obj


I suppose B) is slower, but need to be sure

Erel's first gameview example is quite simple although it's not 100% smooth on my 1024x800 tablet. I wonder if plain imageview movement wouldn't be faster in that case.

Also notice that a lot of devices won't be able to run your project since gameview is only supported on 3.0+

Edit:

I also found this in the example... "Bitmaps larger than 2048x2048 (in any dimension) will not be drawn."
which mean having a full level inthere won't probably work.

Yes, I read about Bitmap size restriction and making tests on 2.2 without hardware acceleration
 
Last edited:
Upvote 0
Top