Hi Folks and welcome to my blog! As a long-time game developer, I’d like to share some of my projects and some helpful tips with others. While professionally, I work mainly in C++, I’ve taken a liking to many other languages / platforms… currently favoring GameMakerStudio 2, but I’ve got a soft spot for some Lua and Node.js. This blog is currently very GML centric, and most of my projects are written in GMS2! Hopefully, you’ll find something of use here, and welcome!
Here’s a quick short-cut to wrap up some boiler plate code you may write when trying to access elements of arrays. While we can’t chain accessors syntactically, we still can work around the issue in a fairly readable way still. A method I use is adding a function arr(_array, _index) that simply returns the value in _array at _index:
While I didn’t start these patterns with the core library, it is actually a foundation to all of the rousr projects, though it’s more of a jack-of-all-trades than anything with a big heavy hitter. As a result, this entry is more of a “grab bag” of helpful scripts I’ve added to our core library to give you some concepts you may not have considered.
I wanted to make sure I gathered everything I’d need for any project and had a very easy way to access it, so while they don’t follow much of a common theme in total - their common theme is “necessity.” You’ll notice a bit of it is heavy on the idea of “caching” and “re-using data” which are really the main tenets of what the sr_core library is attempting to abstract. In addition, it aims to eliminate as much project “boiler plate” code as it can.
(Boiler plate code is a term used for tidbits of code you have to add to each and every one of your projects, so why not make it small and as painless as possible?)
Some of you may be familiar with RousrSuite - the ill documented extension that is included with the other Rousr extensions. RousrSuite is a collection of small GML Extensions, generally each with a singular purpose, that are used by Rousr projects.
The current make-up of RousrSuite is:
RousrCore - a grab-bag set of functions used at the core of most Rousr code. This includes much of the basic functionality we’ve wrapped up… such as ensure_color and ensure_font which store a global for the current draw_set_* variable and when passed a color or font, they’ll do a draw_set call if its not already that. Of course, there’s things like math and debugging functions in here as well!
RousrDs - a set of new data structures that are based on arrays, as well as some helper functions when working with the native ds types.
RousrInput - an (unfinished) set of functions to wrap up the paradigm of named actions being mapped to controller inputs in an attempt to add a layer of abstraction to input.
RousrUI - an (unfinished) set of UI widgets and basic GUI functionality you’d expect. This is intended for in-game use, which differs from the ImGuiGML debug-use case.
It’s available to be downloaded on the YYMP, but mainly is intended to be used internally by our extensions. I do hope one day it’s an extensively usable library of functions for anyone!