tilled background glitch when scrolling

New releases and general discussions.

Post » Mon Feb 02, 2009 5:32 pm

I guess it's because the tiled background object changes renderstates for a tiling render process. Otherwise I don't know why. Optimisation is a very tricky area - you can never know for sure something is faster until you measure it. I've had cases where removing code made it go slower. You can't know till you measure.

It's worth also looking at non-power-of-two tiled background sizes, because they draw completely differently.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Mon Feb 02, 2009 8:57 pm

[quote="Ashley":3cwbtp4x]It's worth also looking at non-power-of-two tiled background sizes, because they draw completely differently.[/quote:3cwbtp4x]

Do they have to be square to get that bonus? Or would a 256x128 tile render the same way as a 128x128?
B
3
S
2
G
4
Posts: 271
Reputation: 2,017

Post » Mon Feb 02, 2009 9:35 pm

They have to be square.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Tue Feb 03, 2009 9:06 pm

Okay, get this...

450 of 32x32 box objects... ~180 FPS
450 of 32x32 sprite objects (just a box drawn)... ~450 FPS
450 of 32x32 tiled background objects (same box drawn inside)... ~220 FPS

ONE 32x32 tiled background stretched over 800x600 layout... ~ 420 FPS

Well... what can I say? Goodbye, Box.

P.S.: My machine is Intel Celeron 2.4 GHz, 1.5GB ram, ATI Radeon 9550 256 MB. The mother board is insanely crappy, though, they've subbed the suckiest one in for the one I fried. :(

Edit: I went ahead and gave each of tiles five different animations - just a different color - and randomized each tile.

450 of sprites, each has five different one-frame animations... ~260 FPS

Why was I worrying about tiled maps again? :roll:

Edit2: Tried creating 10000 sprites... Doesn't show the window at all, though debugger shows 10003 instances and 0 (1.#Jms) as FPS. Yikes.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Feb 03, 2009 9:46 pm

Well, since most people generally have most sprites, I've put most effort in to optimising the Sprite object. Which explains why it's fastest. As I said before, optimisation can be tricky business.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Tue Feb 03, 2009 11:18 pm

[quote="Ashley":3i9zez43]Well, since most people generally have most sprites, I've put most effort in to optimising the Sprite object. Which explains why it's fastest. As I said before, optimisation can be tricky business.[/quote:3i9zez43]

Must be in did. And it must be hard as well. I used to do do php and xhtml stuff, and optimising thise was pain in the ass.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests