csanyk.com

video games, programming, the internet, and stuff

GameMaker Asset: Rolling Average

In creating my last tutorial and demo, I needed to calculate the rolling average for the fps so I could measure performance differences between Instance Pooling and Create-Destroy.

It turned out that the functions for setting up a rolling average were pretty simple, yet were a pain to do well. So once I got them working, I decided to make them into an asset for GameMaker: Marketplace, so they’ll be easy to re-use in any project, with any series of numeric values, and so I can share them with the community.

Calculating a rolling average over a series of streaming values is now simplified by these new functions:

rolling_mean_create()
rolling_mean_destroy()
rolling_mean_add()
rolling_mean_read()
rolling_mean_size()
rolling_mean_resize()

Rolling Average on GameMaker Marketplace (free download)

Rolling Average on itch.io (free download) (free download)

Full documentation

Updated: 2016-Dec-19 — 12:02 pm

Leave a Reply

csanyk.com © 2016
%d bloggers like this: