Tiles versus canvas: a lil test

New releases and general discussions.

Post » Tue Nov 17, 2009 8:16 pm

Just dropping some observations here...

Display size: 1024x768, unlimited FPS mode

a) Tiles
32x32 sprites in 32 columns and 24 rows, total of 768 instances.
VRAM usage: 0.00 MB (minimal)
FPS (after a few seconds): 720-750

Observation 1: Painful to work with (try moving 768 objects around in layout). PROBLEM: Prone to crashing with this amount of objects on the layout. May consider creating these at runtime instead (might increase loading time a bit, but hey.)
Observation 2: FPS takes a slight dip the more different frames are shown by tile sprites. Faster to render same textures than different ones, anyway.
Observation 3: This method may work better for dynamic tile replacements.

b) Canvas
1024x768 internal Canvas resolution (fills the whole display)
VRAM usage: 7 MB (for the canvas object alone)
FPS (after a few seconds): 800-810

Observation 1: After pasting the sprite in tile manner and thus populating the canvas with varying textures, the frame rate took quite a dive (down below 400 FPS) and the VRAM usage is at 14 MB.
Observation 2: Perhaps the best choice for static tiled terrain.

Will post more as I test some more. I will be experimenting with various tile engine options.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Nov 17, 2009 10:56 pm

Why not both?
I know people probably get tired of me touting the benefits of distort maps, but the thing is its just so versatile.
I recently realized that its possible to take an image like this:


And make an entire map out of just the one image using a distort map.
Then for collision detection, you could just paste the sprite into the canvas and update its collision mask.

Of course you would only want to make a simple background out of it, and creating an editor would be quite an undertaking, but the benefits would be very nice. The map could be just about any size, and your ram would be that of the the one sprite, and canvas. Once the map is generated, you could destroy the sprite.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Nov 18, 2009 6:57 am

The downside of tileset within one image is that it doesn't really leave you with much freedom of adding new tiles or altering existing ones.

Anyway, it certainly is interesting, as you can use an existing tileset and replace it later. I was just exploring performance limits. Big canvas certainly is slow, especially on resolutions of 800x600 and larger (>512). Big advantage, it cuts the number of on-screen objects down dramatically.

Yeah, seems using both is the way to do; canvas for background and sprites for, uh, sprites.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sat Nov 21, 2009 4:55 am

I'd like to see an example of this.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue Nov 24, 2009 10:16 pm

I almost never use canvax Oo should I?
B
11
S
3
G
4
Posts: 622
Reputation: 3,186


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests