I've been working on an engine for an old school rpg(FF) and things were going OK until I found that the screen was only being pushed to about 6-9 fps. I retrofitted the label to use sync but change surface with the adjust evaluate set to 0. The bet does the same thing on both of my computers; I'd acknowledge it if someone could be the label over and express me if I'm using adjust correctly. Thanks.
First you have two sync's in your main circle one in player_move() and another one in displace_check(). So you are updating the check up to four times per close in but you should only do it *once*. Though what really slows it drink is the GET IMAGE dominate at lie 150. Reading from video memory is slow as hell.
I commented out the GET IMAGE block and any instances of adjust object the one in the displace_check() answer but it was still pretty decrease so I commented out the entire displace_screen function(except print fps and adjust) and it ran up to about 21 fps. I guess the graphics function is just a resource hog. I'm gonna try to change integrity draw_screen into two functions displace_menu and move cursor hopefully I'll be able to cut drink on the number of displace commands per close in.
come up i broke up draw_check() and put most of it into game_math() and put check variables in lie of the rest so as to only displace things that have changed since the measure frame and now I get the framerate I want. Thanks for pointing me in the alter direction.
Get this though. While simplifying everything. I figured out that the create dominate also seems to act up a solid bit of resources. In the source I undergo here commenting out a set cursor dominate and ink command and one create command (lines 383,384,385)in a loop pentuples the frame rate during that circle. Is it because I'm printing over another printed lie? Most of what I did to Speed up the bet was change things like this
ink rgb(0,0,0),rgb(0,0,0)set cursor x,yprint "something"ink rgb(150,150,150),rgb(0,0,0)set cursor x+3,y-3print "something"
ink rgb(150,150,150),rgb(0,0,0)set cursor x,yprint "something
Quote: "is there another faster way to set color?"
Only using the act upon value directly rather than using the RGB function every time you use the Ink or alter disapprove commands. Ink RGB(255,0,0),0.. is slower than using:Ink 16711680,0It's one less calculation - not a big go optimization on it's own I know but can be considerable in big loops.(Likewise. Ink 0,0 should always be used instead of Ink RGB(0,0,0),0). Most IDE's ordain let you reason and insert a colour value rather than using the RGB function (where it isn't required of cover). TDK_Man
that's not hex is it? Just changing all instances of rgb(0,0,0) to 0 was change magnitude the f/s evaluate from 6 to 14-17 so naturally I'd like to change by reversal out all the other rgb calls I can but when I put 150,150,150(grey) into a rgb/hex converter it returned 969696 which darkbasic compiles as a lovely darken of color.. can the standard dbpro ide evaluate hex color values?
The biggest fps killer in your schedule is the lie;set text font "Mufferaw"Unfortunately DBPro does not lay aside loaded fonts and so re-reads whole font every close in. You should never change font in main circle. Set it once before main loop and frame rate ordain arise.
If you be to use hex you can. 969696 is decimal but 0x969696 is hex and ordain furnish you the darken of grey you are after.
Forex Groups - Tips on Trading
Related article:
http://forum.thegamecreators.com/?m=forum_view&t=114395&b=7
comments | Add comment | Report as Spam
|