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

All sorts of amusements and nonsense unrelated to xTalk
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

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

Post 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).
Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests