[Poll] Time unit preference

In RPG Maker, the time units we usually work with is frames, as in the "Wait" event command or the "Show / Move Picture" duration, and 60 frames ~= 1 second.

I am working on a plugin where you can set the interval between automatic script update of switches and variables. The details of that aren't important, but the question is: Do you prefer RM's frames as time units, or would you prefer seconds or even milliseconds instead?

Let me specify that I mean this in the context of what you prefer to type, not how the engine internally deals with it.
MV is not asynchronous. Meaning it's absolutely pointless to work in other units than frames.
I should've specified that I mean this in the context of what you type and think of time units as a developer, rather than how the engine internally solves it.

As a developer, you still think of a Move Picture duration of 60 frames as "roughly 1 second of real time". Due to the internals of the update logic (see below), this is ~= 1 second even should the actual rendering framerate double.

In my specific plugin, I'm still basing all time calculations around game ticks which are expected to be 60 ticks / second. If you look at the function SceneManager.updateMain (which I originally wrote a plugin to do before it became a core part of the engine), calculations of ticks is based on the execution of requestAnimationFrame (which attempts to fire off a new frame the next available frame update on the host system) and calculations of the last update time in MS and the current time in MS. If a user has a 120hz monitor, these calculations will still render every frame at 120 fps, but they delay the logic updates to every second frame, so that 60 frames in a Move Picture duration still ~= 1 real second.

Given that, working in seconds or milliseconds does make sense, as it's relative to how much time has passed, not how many frames have passed. In this sense, I'd argue that MV's use of frames is misleading, since 1 second can be anything in frames depending on the host's hardware. However since everything involving time in the engine's events is handled in frames, that's my current time unit as well for consistency's sake.
requestAnimationFrame shoots every frame:
1. no sooner than your monitor's refresh rate tick, which results in an infamous bug in refresh rates greater than 60Hz - the game goes too fast. Yanfly's FPS synch plugin rectifies this issue by forcing the graphics to run at max at 60 fps, but the game time still runs at monitor refresh rate.
2. no sooner than the previous one finishes. Which results in an infamous problem where if the game cannot process the instructions in the update loop in time, the game actually slows down, because Javascript is waiting for the previous loop to finish. Yanfly's fps synch plugin rectifies this issue - if I remember correctly, it forces the update function to not always update graphics if there's no time left, resulting in a 60 fps game, but lag.

So in case number 1 it makes sense to deal with ms. In case number 2 I wouldn't see the point. Because when the game slows down, the frame count drops below 60 fps and as such you'd have the updater function shoot pointlessly.

Either way, it's up to you. If you intend to use ms, I'd think of an asynchronous function. If you want to use frames, I'd implement it to the game's update loop. For me frames are the prefered choice though, since mv works in frames.
1. In RPG Maker MV, this was fixed in the core engine scripts way back in March of 2016. See this thread with my FluidTimestep plugin that solved this issue up until then.

2. Again, this is rectified by the functionality now as a core part of the engine's update loop. You can check the code of the above plugin to see how it's done.
Frames is the most accurate, so that one. Seconds work for things that have large time intervals, like they are used for music fade duration.
Frames for me too! 😂

A nice compromise between milliseconds and seconds in terms of interval; personally I tend to use wait times of 1~200 frames. Also, as mentioned, other than audio everything in the base engine is measured in frames, so it feels more natural in that sense. 🙏

Also, better consistency: framerate may differ in various circumstances, intentionally or not. No need to unnecessarily strain low-end systems, ignore framerate-altering scripts/plugins, or wonder whether the variable is going to update mid-event (?)...measuring in frames means the plugin user doesn't have to waste time thinking about that stuff and can get on with making their game. 😴
you could potentially just stick to counting everything in frames, and just present the converted units to the user, if it actually matters to *time* things on... well, time.

if the user wants to choreograph something by seconds, allow it, but keep the actual math in frames.

as Poryg says, you can't escape the main loop that takes care of the core processing, and that (the bottom-most unit of processing) processes in frames.
Development / As a developer: Frames
As a player: Second(s)
Continuous stuff not bound in frames/second like audio: Millisecond / Sample
@Galenmereth I don't think that this fulfills the requirements of this section which is meant to be about broad themes as they affect the making of games - this seems a technical question to do with writing plugins, which is quite different, and is, by definition, not engine neutral.

Do you have enough information now?
@Kes Yep, I think I have the info I need. I wasn't sure where to put this to be honest; it didn't seem to fit any of the more specific forums. Where would you advise future similar threads be posted? 😅
@Galenmereth Without discussing it with other Mods, I wasn't sure myself, which is why it was not moved.
However, as you have the info you want, I am now closing this.

Original thread: https://forums.rpgmakerweb.com/threads/poll-time-unit-preference.108633/