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.

Author
Message
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 15th Nov 2014 06:10
I am using some text to show on screen stats of my character (strenght, stamina, gold, etc) but seems like the fps drops drastically.
Why some simple text commands (set text size, ink, text, center text) lags so much the game? Seems like adding 10 text commands on the screen makes the framerate to drop from 80 to 30.
My pc is not bad, i can run Battlefield 4 with no problems
Jachan19
15
Years of Service
User Offline
Joined: 1st May 2011
Location:
Posted: 15th Nov 2014 06:38 Edited at: 15th Nov 2014 06:39
Probably used too many loops or something... (which it happened to me before)

Did you used "Type" command and "Dim" command both? That I used and it didn't even slow my running game down since I mostly programmed RPG games.
If you didn't use any of those, I would be happy to tell you how to write them down if needed.
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 15th Nov 2014 07:00 Edited at: 15th Nov 2014 07:06
the text commands in DBpro are long known to be horribly slow.

A simple optimization is to check against previous settings and only call these commands when text styling actually needs to change rather than just setting them every loop regardless. Group your output by style so that you draw for example all red text, then all white text instead of red here, then white here, then some more red over there. The more you can limit the use of a bunch of different sizes, colors, styles all at once the better.

Aside from that, you can get better text performance using a plugin

Cloggy's D3D for standard text and various 3d goodness.

Sven B's Bitmap Font Kit use images for font's for full flexibility and customization.

=PRoF='s Bitmap Font Creator a handy tool for creating said images.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Nov 2014 16:11
Advanced2D is another good plugin.

I like offending people. People who get offended should be offended. -- Linus Torvalds
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 22nd Nov 2014 18:35
Even if this is already a week old - definitely use a plugin for text. Looks better visually and is way faster.
Changing the color of DBP text is not a problem, it's fast, just the ink command after all. Changing text size, style or font however slows DBP down significantly. With the plugins you can simply set up several fonts in the beginning and use all of them afterwards.

Login to post a reply

Server time is: 2026-07-17 12:28:13
Your offset time is: 2026-07-17 12:28:13