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.

2D All the way! / Extreme 2D Slowdown

Author
Message
Avien Langley
21
Years of Service
User Offline
Joined: 29th Jan 2004
Location: State of Denial
Posted: 5th Nov 2004 11:52
OK, I've got a major slowdown problem with a Darkbasic Professional project of mine.

Part of the problem may be that I loop through a 128x128 array with every cycle, and I have the sync rate set to 30 frames per second. That's a lot of calculations going on (around 491,520 per second) and that probably puts a bit of a strain on the CPU. But when I run the program with this loop intact it still runs fairly smoothly.

However...

When I add code that displays approximately 600 sprites on the screen at once, it drags almost to a halt. It barely manages a couple of frames per second. From my understanding, DarkBasicPro is supposed to have lightning fast 2D rendering capabilities, even with hundreds of sprites onscreen at once, so I can only conclude that I'm doing something terribly wrong.

I've already tried disabling transparency for all the sprites, as I thought that might cause the problem. Also, I was initially using .bmps, but I converted them to .pngs since those are smaller. Still no luck with either of those attempted fixes.

Does anyone know of any common sprite problems that could cause extreme slowdown like this and how it could be fixed? Thanks in advance for any advice.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 6th Nov 2004 05:41
Don't use the backsave option in sprite command as it knackers your frame rate. You may have to compensate by redrawing background every frame though if no 3d is being used.

Boo!
Avien Langley
21
Years of Service
User Offline
Joined: 29th Jan 2004
Location: State of Denial
Posted: 7th Nov 2004 03:29
Thanks, I'll give that a shot.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 7th Nov 2004 04:18
I think this is a problem with DirectX not DBPro.

Why on earth would you want that many sprites?
the_winch
22
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 7th Nov 2004 05:00
It might just be the massive number of sprites. What are you system specs?

I get ~160fps running this



For comparison with just one sprite it runs at ~850fps

Quote: "this is not a quote"
fog
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Newcastle, England
Posted: 7th Nov 2004 05:33
In my experience you should be able to use several hundred sprites but you must disable the backsave mode as Spooky says.

ie. SET SPRITE spr,0,1

It's difficult to put an exact figure on just how many you should be able to use as there are so many factors to take into account (resolution, sprite size etc) and you really want whatever you write to run on as low a spec PC as possible.

That's why my lowly 1.6Ghz GF2 PC came in handy when testing DUO.

Login to post a reply

Server time is: 2025-05-15 19:32:49
Your offset time is: 2025-05-15 19:32:49