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 / Changing INK kills performance...

Author
Message
BoB Vila
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United States
Posted: 1st Apr 2003 05:07
In my main loop I was changing the ink Color twice every sync. On one computer, I first implemented the code in, it didn't seem to be a problem. When I tried it on another machine, it dropped the FPS from 91 to 16..

This might be a known issue, but if not.. just a lil FYI..
Bobvila.com made me take off my avatar! (dunno how they found out)
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Apr 2003 08:01
if the inks are the same colour it seems to be ok but as soon as you use it in this fashion it loses 20 fps.


sync on
sync rate 60


FRAMERATE=50
TDUR=(1000/FRAMERATE)-1

make object cube 1,1


disable escapekey
while escapekey()=0

Repeat
T1=Timer()
Until T1>T0+TDUR
T0=T1
text 10,10,STR$(Screen Fps())
Sync


ink rgb(255,255,255),1
text 10,30,"text 1"

ink rgb(255,25,255),1
text 10,50,"text 2"

ink rgb(25,255,255),1
text 10,70,"text 3"

ink rgb(25,25,255),1
text 10,90,"text 4"

ink rgb(255,25,25),1
text 10,110,"text 5"

endwhile
delete object 1
end


Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 1st Apr 2003 10:11
I am changing the ink colour several times in my Battle for Hoth game and getting 200-300 fps on my test systems here. Although change text size does cause a fairly major system hit.

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
BoB Vila
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United States
Posted: 1st Apr 2003 16:17
It seems as if it really depends on the video card. I have a GF4 440mx and it runs like crap. But it seems to handle fine on some other cards.. I'll have to try Battle for Hoth on my home PC and see what happens...

Bobvila.com made me take off my avatar! (dunno how they found out)
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 1st Apr 2003 17:56
I BELIEVE that all 2D is done in 3D in DarkBASIC Pro. I think that text is basically a texture on top of a z-depth disabled ghosted plain (just an idea, not concrete) Ie. when you change text size in presumably has to regenerate the whole thing. This would explain the speed hit with INK and CHANGE TEXT SIZE, which, I'll admit, is really crippling. The only alternative would be to rewrite the text and ink functions, with ink that would mean new text and drawing commands. The bitmaps are system bitmaps so presumably a TPC DLL could write to them.

Current Project: Retro Compo. Entry.
Rob K
Retired Moderator
23
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 1st Apr 2003 17:59
Ah yes, on the issue of SLOW 2D commands, Lee is apparently extending the GET IMAGE command with an extra flag which when used, should increase its speed.

An issue on the Blitz forums did give me an idea though. Apparently there are two types of images which a program such as DBP can make, "managed" and "unmanaged" ones. "managed" ones are slower but "survive" even if screen settings, depth etc. are changed, whereas "unmanaged" ones are faster, but have to be regenerated if the screen depth or resolution is changed. Any ideas folks?

Current Project: Retro Compo. Entry.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Apr 2003 18:58
I presume you mean when task switching to another program (DirectX loses all its graphics and surfaces, making you have to re-load everything again) - DBPro should be able to do that already - ALT+TAB seems to work.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 2nd Apr 2003 01:27
I reported the whole color and shape changing text thing ages ago, via email and on this forum, but it hasn't been fixed yet - I basically gave up using text and use sprites now.

Coming Soon! Kangaroo2 Studio... wait and quiver with anticipation! lol
[email protected] - http://www.kangaroo2.com - If the apocalypse comes, email me
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Apr 2003 15:31
Sprites are quicker anyway...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2026-07-21 20:34:13
Your offset time is: 2026-07-21 20:34:13