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 / Sprite movement problem (backsave?)

Author
Message
DWD
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 10th Apr 2003 22:27
G'Day,

I have assembled a small sprite movement example here (with latest patched DBP version) but I have some problems with it:



If you try this example, it runs very slowly giving a frame rate around 10 fps.

If I change the "backsave" feature to the following in these lines, the example runs very smoothly and fast on all our test computers:

set sprite 2, 0, 1
set sprite 3, 0, 1
set sprite 4, 0, 1
set sprite 5, 0, 1

But this leaves a trail from our sprite.

What can I do to avoid this since it seems that the "backsave" feature is bugged?

I am not interested in clearing the screen after each sync and repaste the background.

All our test computers live up to the minimum requirements to run DBP if not better.

Thank you in advance!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Apr 2003 22:49 Edited at: 10th Apr 2003 22:50
Yep, I see your problem. I've fixed it by switching off backsave (like you did) and redrawing the backdrop each frame - just like you didn't want to do

I got 5 fps with backsave on, 113 with backsave off but lost the background, and 95 fps with my changes.

The backsave feature is *not* bugged. It is slow simply because of the way graphics cards have evolved. They are designed to give you the fastest writing of data into graphics memory that they can, at the expense of reading speed. So blame the card designers, not DBPro

(Click the source button below - I didn't think it would work like that!)
DWD
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location:
Posted: 11th Apr 2003 00:44 Edited at: 11th Apr 2003 18:10
Thanks for your answer! You gave me an idea for a workaround. (I would like to point out that I do write my code with comments and better structure – I was just assembling a quick example to show the essence of my problem )

I have more things to repaste besides the background (obstacles, etc.) but this is the way I will do it. At least I do not have to clear the screen after each "sync".

With "bugged" I meant that if you set backsave to true for one of them sprites, it would be enabled for all of them.

Cheers

Login to post a reply

Server time is: 2026-07-10 18:01:40
Your offset time is: 2026-07-10 18:01:40