Page 2 of 2

Re: So... back of the envelope RPG damage calculations?

Posted: Wed Feb 14, 2024 5:23 am
by OpenXTalkPaul
Also in your event checking 'run loops' if timing is very important to your project (let's say it's you're making a Drum Machine), and you absolutely have to do a bunch of calculations in real-time (do calculation intensive stuff ahead of time if you can), then you may want to figure out how long your script took to do those calulations and subtract it from the next 'send' interval. So say you want to fire your checkKeys message every 600 milliseconds, but checkKeys takes 47 milliseconds to check the keysDown keys and then do whatever, you would send the next checkKeys message in 600 - 47 = 553 milliseconds instead of 600 in order to try to maintain that constant rate. I've used this method to make fairly accurate timed musical notes playback using the engine as the sequence player (a Drum Machine).