Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Advanced Sprites and memory

Author
Message
Arcaos
15
Years of Service
User Offline
Joined: 9th Dec 2010
Location: Russia... Is so Russia!
Posted: 15th Dec 2010 10:07
Hello!

For a couple of days i've been tryin to get working 2d game. The problem is when i use db pro standard sprites commands the fps is about 14-15. Not playable. But when i use Advanced Sprites, i've get an 59-60 fps. BUT! Simple, small program eats 362 mb of memory! (thats all because every image loaded as new sprite). After i've tried to set sprites as tiles. This gets me 20-23 mb of memory and 14-15 fps. Just like an a standard db pro commands. The question is: Is there some balance between memory/fps? How to do that?

P.S. The goal is to make tiled terrain (21x402 tiles (8442 at all)). Image size is 40 kb.

Sorry for my english!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Dec 2010 14:05
Quote: "The problem is when i use db pro standard sprites commands the fps is about 14-15"

Use SET SPRITE to disable anything to do with the backdrop:


Disabling the backdrop stuff for one sprite disables it for all.

Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 15th Dec 2010 17:00 Edited at: 15th Dec 2010 17:00
Also, double check to make sure you are reusing all your sprites and not loading the same sprite over and over (take any loading routines OUT of your main loop if they are in there as well)

Arcaos
15
Years of Service
User Offline
Joined: 9th Dec 2010
Location: Russia... Is so Russia!
Posted: 16th Dec 2010 15:03
Thanks for help! Actually, i've saved image (40 kb) to DXT1. Now it's 6 kb at all. (now program eats 30 mb with 8000+ sprites)

Sorry for my english!

Login to post a reply

Server time is: 2026-07-21 13:38:23
Your offset time is: 2026-07-21 13:38:23