ark0n Posted June 7, 2010 Author Share Posted June 7, 2010 Step 1Look for the current FPS Lock.Step 2Â Remove the whole FPS LockStep 3Add a timer to FrmMirage or FrmStable or whatever the place you have the PicScreen on.and set its tickrate to 33ms. This will give it a 30 FPS Lock.Step 4Add the boolean canDraw as a Global BooleanStep 5In the tick section for that timer, have the code "canDraw = true"Than after that, go to sub GameLoopStep 6As the first line add this code:```If Candraw = False ThenExit Sub elseCandraw = falseend if```That should be a much better FPS Lock :DCredits:Me: For making this tutorialHomicidal Monkey: For teaching me how to do this. Link to comment Share on other sites More sharing options...
ark0n Posted June 7, 2010 Author Share Posted June 7, 2010 UPDATE: Forgot to say where the Current FPS Lock is, it is in sub GameLoop Link to comment Share on other sites More sharing options...
Joyce Posted June 7, 2010 Share Posted June 7, 2010 And what's the purpose of replacing a cap with a different cap? It's still capped. :huh: Link to comment Share on other sites More sharing options...
Robin Posted June 7, 2010 Share Posted June 7, 2010 The point is so that you're not running through the entire loop only to start sleeping it to keep the FPS low.This tutorial is horrible though. It has absolutely no explanation and it's pretty much you just copying & pasting Fabio's code over. Link to comment Share on other sites More sharing options...
Joyce Posted June 7, 2010 Share Posted June 7, 2010 Are they still doing that in Mirage nowadays then? I thought they stopped using that horrid method ages ago. Link to comment Share on other sites More sharing options...
Robin Posted June 7, 2010 Share Posted June 7, 2010 @YamYam:> Are they still doing that in Mirage nowadays then? I thought they stopped using that horrid method ages ago.Mirage is dead. Active development and the community is, anyway.The main sources now are my old Mirage Realms game which was released as open-source and Eclipse Origins. Link to comment Share on other sites More sharing options...
Joyce Posted June 7, 2010 Share Posted June 7, 2010 Wow.. I guess having a life does makes you miss things. Link to comment Share on other sites More sharing options...
Kimimaru Posted June 9, 2010 Share Posted June 9, 2010 @Robin:> This tutorial is horrible though. It has absolutely no explanation and it's pretty much you just copying & pasting Fabio's code over.You claim that the tutorial is horrible, but is his edit horrible? Should I consider implementing this edit into my game? Link to comment Share on other sites More sharing options...
ark0n Posted June 9, 2010 Author Share Posted June 9, 2010 Well, actually it's really good, i just got it from HM. And i wanted to teach you guys how to do it. Link to comment Share on other sites More sharing options...
Homicidal Monkey Posted June 9, 2010 Share Posted June 9, 2010 fixed it a little, you forgot to re-engage the lock.Basically, it indirectly locks the fps by having a lock system based off of a timer, and pretty much guarantees that it will function at the desired framerate. You might want to set the timer to 33 instead of 66\. 1000ms (1 sec) / 30hz = 33ms. Link to comment Share on other sites More sharing options...
ark0n Posted June 9, 2010 Author Share Posted June 9, 2010 Thanks =D Link to comment Share on other sites More sharing options...
Homicidal Monkey Posted June 9, 2010 Share Posted June 9, 2010 yeah, i was trying to build a fps lock myself and after several tests, one similar to this design proved to be the most accurate. Link to comment Share on other sites More sharing options...
ark0n Posted June 9, 2010 Author Share Posted June 9, 2010 Cool, lol. This work for EO? Link to comment Share on other sites More sharing options...
Kimimaru Posted June 9, 2010 Share Posted June 9, 2010 I think I'll put this in my code, thanks! However, I'm still confused as to how it works. You said to make a timer and set its Interval to 66, meaning it will execute every 66 milliseconds. When it executes, according to your tutorial, it will set **CanDraw** to **True**. Then, in the main **GameLoop**, you have this code:```If CanDraw = False Then  Exit Sub Else  CanDraw = FalseEnd if```So basically, every 66 milliseconds, **Sub GameLoop** stops executing for another 66 milliseconds to stop processes from executing? Something similar to this is seen in the existing Eclipse Evolution system, where the program stops execution using the **Sleep** command for 1 millisecond. The loop continues until 31 milliseconds have passed by, effectively keeping the FPS down to about 31.With this system, as Robin pointed out, instead of going through the entire **GameLoop Sub** simply to lock the FPS, it does it at the beginning of the Sub so that it has to search through less code.Even with the inaccuracy of the Timer API Tool Function, this still works well? Anyway, please let me know if I'm correct on all of this. Thanks! Link to comment Share on other sites More sharing options...
Homicidal Monkey Posted June 9, 2010 Share Posted June 9, 2010 yeah, basically. Its also a more passive means of locking than the old fps lock. And you dont really need the timer to be accurate. If you get +- 5 ms accuracy, it really wont matter. Link to comment Share on other sites More sharing options...
Kimimaru Posted June 9, 2010 Share Posted June 9, 2010 @Zetta:> yeah, basically. Its also a more passive means of locking than the old fps lock. And you dont really need the timer to be accurate. If you get +- 5 ms accuracy, it really wont matter.Okay, I got it. Thanks a lot! Link to comment Share on other sites More sharing options...
damian666 Posted June 10, 2010 Share Posted June 10, 2010 when ya say pu it on first line, you mean the first line of the sub, or the loop?because that makes a difference ya know, a big difference actually xDDamian666 Link to comment Share on other sites More sharing options...
Joyce Posted June 10, 2010 Share Posted June 10, 2010 > Cool, lol. This work for EO?I tried it following your very vague directions(Had to guess what you meant at times?) And it just froze the entire screen rendering it only once. And yes the timer was there. So I removed it and went on with doing other stuff. ;D Link to comment Share on other sites More sharing options...
ark0n Posted June 10, 2010 Author Share Posted June 10, 2010 Oh, lol. Okay, So it works for all mirage -EO. Link to comment Share on other sites More sharing options...
Joyce Posted June 10, 2010 Share Posted June 10, 2010 It should work really, but your explanations are rather vague so I probably ducked it up somewhere along the line Link to comment Share on other sites More sharing options...
Robin Posted June 10, 2010 Share Posted June 10, 2010 He can't explain it because he doesn't understand it.It's not his code. Link to comment Share on other sites More sharing options...
DFA Posted June 10, 2010 Share Posted June 10, 2010 yes, lets re-invent the wheel, but this time, lets do it half-assed Link to comment Share on other sites More sharing options...
Kimimaru Posted June 10, 2010 Share Posted June 10, 2010 @Robin:> He can't explain it because he doesn't understand it.> > It's not his code.Maybe people looking at this topic can check out my explanation on my last post of the first page. Link to comment Share on other sites More sharing options...
Zytox Posted July 3, 2010 Share Posted July 3, 2010 Jusus crist! I mean, holy hell. I am currently in shock at how fluently my game is running by changing that fps lock. It's amazing, really. I'm using my own engine which is based of the early mirage stuff and in all this time of developing I've never noticed this small error, do I feel stupid xD Link to comment Share on other sites More sharing options...
Mikekan13 Posted August 22, 2010 Share Posted August 22, 2010 using Eo and tried to do this. The directions like everyone said really are vague. The game just doesn't initialize at all. just sits at a black screen. If someone understands how to make this work please help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now