• Omega_Haxors
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    8 个月前

    Multiple operations per tick is a trick I learned early in my days of modding. What you do is use the modulo of an operation (for example a 132% completion is equal to 1.32 and its modulo is .32 or 32%) and run normal math on that, while outputting the factor of the whole number. So if you have 30% operations per tick it’s just a simple “add 30% to your progress” but if I have something crazy like 810% than I will add 10% to the operation and then add an output equal to the normal output multiplied by 8 and output it that tick.

    Put more simply, add the % of progress to your bar, if it’s above 100% than divide your progress value by 100 and round down. The result will be amount of times to output the item while the reminder will become your new progress % value. If the process is something that can’t be resolved to a simple number (such as pulling from a randomized loot table) than use a loop to run the operation x amounts of time.

    The best part about this system is that it also fixes the bug where you have like 99% progress, add 13% and end up at 0% progress.