Hello everyone, this is my first ever board post on TGC forums. Let me give you guys a little of my background before I get into the meat of my problem. First of all, I first started working with DBPro about 8 to 9 years ago. I was a teenager then, and I quickly lost interest after a few months of studying out of the "DarkBasic Pro Game Programming 2nd Ed." book. I had dabbled in it since, and never really got into it again, until about 10 months ago. Since then, I've almost gotten through part 2 in the book, with just the 3D portion in part 3 left to read.
And so that brings me to where I am now. For almost an entire year, I've been working on my game, Marooned. For those of you who know what Terraria and StarBound are, it's pretty much that kind of game; A 2D sort of Minecraft type of game. The character explores a 2D world of blocks, breaking them, placing them, digging tunnels, finding treasure, building structures of out blocks, etc.
The problem I am having is a classic one, something that many of you have seen all over the forums: SYNC RATE IS INCONSISTENT AND UNRELIABLE. Let me elaborate a bit. My game runs in a screen that is a resolution of 640 x 480. It used to be 1280 x 720, but I realized that DBPro was just handling too many sprites concurrently. I tried incorporate an efficient masking system, separating untouched groups of blocks into chunks, mathematically calculating which blocks are in which chunks, playing with the sync rate, and adding a timer feature to the main game loop and setting the sync rate super high (say 200 FPS) in effort to coax at least 60 FPS out of my game.
Here's the thing. I have an Intel Core 2 Quad machine, with 4 GB of RAM. I've noticed that DBPro does not support thread management, i.e. you can't specify which parts of your program you want to split up on different cores of your CPU to make your program more efficient. So it basically pegs one core of my CPU to the floor (supposedly) for as long as my game is running. HOWEVER, if my game is running by itself, it will seem to struggle. I can be running it in 30 FPS, 60 FPS, or even more, and it will somewhat achieve it, although teetering between 29 and 30 fps or 59 and 60 fps. Then when I open another program along side it, sometimes performance improves, sometimes it gets worse. Sometimes I boost the frame rate up to 70 FPS and it stays at 60, and once I get into the 80's then it starts to move up a little bit. But once I hit a sync rate of 90, then BOOM, all of a sudden the game reports it's running at 90 FPS. You see my struggle now hopefully.
As far as efficiency in my game goes, I have it running as efficiently as possible. I've been tinkering with it for months. It draws only the blocks in the world that are currently being displayed on-screen, and nothing else unless the character moves and the screen is shifted. More specifically, I do this by splitting up a 3000 x 3000 px world into a grid of (potentially) 200 x 200 blocks at 15 x 15 px each. These blocks are separated into 64 chunks of 25 x 25 blocks each. Each time through the loop, the game determines which chunks are within the screen boundaries and need to be displayed. Then after the chunks are passed a 1 or 0, the next part of the program checks which blocks need to be drawn within those chunks by checking if they are within screen boundaries. Bear with me guys, this is the very dumbed-down version of it, but this is essentially how the game works.
Now, I have seen people suggesting to install the hitimer() plug-in for a more accurate timer, to use timer-based movement, tinker with v-sync all of that. I've even seen someone separate the game into two parts, the game loop and the display loop, and then running each loop one after the other inside the main loop, only updating the screen via the display loop when it's possible/feasible by the computer (which I have not been able to get working at all).
I am here today to ask if there is a better way. Am I doing this right??? I hit this brick wall about 3 months ago in my game, and have struggled to overcome it since. I've studied this forum religiously for months and still haven't found a reliable/plain-english answer. I KNOW that DBPro can DO what I want it to do! Can't I just somehow tell the CPU to run at max power while my game is running, allowing me to determine what sync rate I want the game to run at and just leave it at that? Whatever sync rate I put the game at, it can achieve it, but with varying results in varying situations. Sometimes it does it with flying Colors! And other times... not so much. Sometimes nothing will be running on my computer at all, and the game will do poorly, and other times it will run great!
My fellow programmers, I am desperate. Like I said, this is my very first post on here, and I am at my wits end with this problem. I am searching for answers and have been unable to find any. If any of you know some magic fix to this problem, I am all ears. Also, the reason this is my first post on here ever is because I don't want to feed the trolls. I've seen a lot of scenarios on other forums where people belittle each other for the sake of flexing their muscles. I have worked professionally in I.T. for 5 years now, and while I may not know as much about programming as the next guy, I am a confident technician and consider myself fairly knowledgable. But this is beyond my grasp. All I'm asking for is help with a problem I don't understand; So please don't yell at me, saying I should know better. Let's all be friends!

And thank you for your time spent reading all of this!