Hi Guys
Looking for info on the best method for scrolling a large playing area - smoothly and effectively...
Is iterating through 50 drawsprite calls better
or
Is drawing screen and saving screen as a 1 large sprite to draw better
My instinct told me the second method was best but on execution it looked slightly slowly and more blittery on the screen.
Any tips?!
I would suspect that drawing a bunch of smaller sprites would be faster.
Actually, I would use POLYVECTORs instead, reading from a texture map / tile sheet.
If the actual background has no pattern and is one large image, I would still break it down into smaller tiles.
One advantage would be you only have to draw the portion that is visible, and not off screen.
I had a POLYVECTOR tile map working years ago, when helping my nephew with a scrolling map, and it was smooth and fast.
Thanks Slydog.
I am looking at the drawing-only-what-u-see method and that should help
However, I noticed something that is prob not so much a performance issue as a limit of the screen drawing technique...
While scrolling the items in the lower part of the screen are a fraction of a second behind the items above making a tearing looking effect on the vertical lines...
e.g. (need imagination to visualise it - long rectangle scrolling from left to right)
D
D
D
D
D
D
If you are getting tearing effects, it could be a setting of your video card.
Look for video sync options and set it to "always on" if you have nvidea, on ati I think they use a similar name or vertical sync.
Last time I heard GLBasic follow your card settings for that and antialiase.
Also, I think I have heard this on a few threads that it is not currently working ok on MACs.
hmmm, couldnt find any setting like that on my laptop...
Its a kind of jitter and just on the horizontal scrolling
There is a LIMITFPS with second argument. It's for vsync. It's does only work on Windows, currently not on Mac.
in karma miwa, backgrounds, clouds and enemies using draw commands, while tiles is used with POLYVECTOR from a tilesheet. Font system also partly using POLYVECTOR but might uses more drawbacks. Similar in Greedy Mouse.
In CatchOut, I'm only used a 4096 color map image for and then one drawn call. It's was faster than normal draw commands it's seen. Even on ios.
spot race did mostly not used POLYVECTOR at all (only for font).
Cheers SF!
Slowly finding ways to optimise my screen drawing...cheers for the vsync tip!
If you can dropping virtual screen, then you will get about 50% faster. Im did quite very early in Greedy Mouse dev when im tested it on a Sony Xperia Play. im remeber im could not get it run a least 30fps, so im dropped it quite fast.
im wisely still use the PaintImage function im created back for Greedy Mouse:
http://www.glbasic.com/forum/index.php?topic=9848.0
You can take ideas from that.
Howover the biggest problem is not scaling as sake, but more various screen ratio and you want to utilty fully of all sizes and ratios.