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 / fps collapse when paste a sprite panel

Author
Message
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 18th Dec 2013 10:50
Hi all guys.
I have a big problem!

I noticed my game slowing down when I open a sprite panel..
I got a decline of my game fps (so and so 10frames per second less).

Here my way to make my panel (outside my main loop):


Here how I make my panel appear (inside my main loop):


Pls take a look to the attached pic to see the size of my panel compared with the screen size.

I really disappointed about this performance collapse and I would to know if I can make a panel like the one you can see using another way.. a fast performance way!

Attachments

Login to view attachments
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 18th Dec 2013 12:08
Nothing to do with sprites, everything to do with Text!

All this text on the screen will give you a absolute massive performance hit but the worst performance hit you can get when using text is if you change font to bold and back during your loop, which I'm guessing is what your doing since you have normal text and bold texts only on your panel.

"Get in the Van!" - Van B
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 18th Dec 2013 12:43
Ok Sasuke so the problem is just the text.
Lucky I am not using "bold and back" text. Just normal text.

Then more text = more performance hit

Ah, my text changing his XY coordinates.. (is not static on the screen) ..is that a thing can make collapse fps too?

And, what is the best free plugin that can provide me a faster text?
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 18th Dec 2013 13:10 Edited at: 18th Dec 2013 13:13
Quote: "Ah, my text changing his XY coordinates.. (is not static on the screen) ..is that a thing can make collapse fps too?"

Don't think it would, just the text that does it.

Quote: "Lucky I am not using "bold and back" text. Just normal text"

I see it's just text in all caps looks bold. Good to know. Unfortunately DBP standard text verse plugin standard text is the fastest, though you don't have as much functionality as D3D. Instead you need to work on techniques that work whatever text your using because you'll still get a massive performance hit with any text your using.

Quote: "And, what is the best free plugin that can provide me a faster text?"

The best way to handle text and even sprite font is a render target. You draw all the text you need to on to it and only update the parts you need to when you need to. If anything needs constant update you just use a text command over it instead of on it.

Here's and example [Requires Ian M's matrix plugin]:


"Get in the Van!" - Van B
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 18th Dec 2013 13:58
Sasuke, again and again thank you!
Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 18th Dec 2013 14:47 Edited at: 18th Dec 2013 18:20
No problem. Just to add to this here's an example of how you would alter your render target if you needed to update something on it:


Something to take note of is you don't want to make loads of render targets. For all my text in my editor I only use 1 render target.

"Get in the Van!" - Van B
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 18th Dec 2013 18:17
very good! Now I need Ian M's matrix plugin and make some experiments!

Le Verdier
13
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 18th Dec 2013 19:15
There is also a text function in the advanced 2d plugin by Diggsey..
http://forum.thegamecreators.com/?m=forum_view&t=179096&b=5

It is incredibly faster than the native dbp 2d commands...

Sasuke
19
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 18th Dec 2013 19:31
Quote: "There is also a text function in the advanced 2d plugin by Diggsey..
http://forum.thegamecreators.com/?m=forum_view&t=179096&b=5

It is incredibly faster than the native dbp 2d commands..."


But the slowest text by a long shot! DBP seems to be the fastest:


"Get in the Van!" - Van B
Le Verdier
13
Years of Service
User Offline
Joined: 10th Jan 2012
Location: In the mosh-pit
Posted: 18th Dec 2013 19:52
I'll try this..

Login to post a reply

Server time is: 2025-05-15 17:17:39
Your offset time is: 2025-05-15 17:17:39