This post houses a small collection of links and FAQs on the subject.Continue reading
This post is about a slightly fancier version of draw_sprite_ext - maybe you want to apply skewing/shearing to the sprite, or scale it after rotating it, or use a 2d matrix transformation.
The built-in function isn't made for that, but, with a little bit of math and draw_sprite_pos, you can have a script for this.Continue reading
(click to interact)
This is a small post about a replica of the strftime function seen in PHP, C standard library, and a handful of other APIs. Such a function takes a date-time and prints it according to the given format string.
The script supports the common formats and those that mapped reasonably to GML functions.Continue reading
And other reasons to avoid overusing reflection
On this fine day I have published the project that I use to compare relative performance of different approaches to algorithms. It aims to get a few things right with this:
- Tested scripts are re-shuffled between runs to lower execution order/CPU cache bias.
- Script call time can be excluded if you are comparing approaches rather than actual scripts.
- Easy to use - you add scripts that you want tested to the project, specify how you want them to be called, and that's it.
The project can be found on GitHub.
After seeing series of increasingly strange uses of "user events" in GameMaker games for object-bound actions, it came to my attention that most people are only vaguely aware of other ways of doing things, so I decided to write a small blog post on the matter.
There are many uses for these - for example, you might want to have a "take X damage" method on your enemy objects so that it can be varied depending on requirements - some enemies might just take damage, some should retaliate on being hit, some might have a fancy damage reduction formula. Being able to comfortably define/redefine methods on per-object-type basis can help a lot.Continue reading
Sometimes you might want to pass an instance variable by reference rather than by value - to have a script modify instance variable(s) passed to it without having to return them, or have an instance save a reference to variable(s) that it should change on other instance, or doing anything else that would usually imply using pointers.
But it might seem like GameMaker does not support such things... or does it? Well, we'll make it.Continue reading
Partially related to an earlier blog post about minifying JSON (which I had just updated), but adressing a different problem - sometimes, rather than trying to make your JSON more compact (and, consequently, less readable), you may want to make it more readable - be that for your own debugging purposes, or not to scare players away from files that they are allowed to edit.
Take Nuclear Throne, for example. The save file is a big nested JSON structure, and, needless to say, you aren't getting around passing it through an external JSON beautifier if you want to be able to make sense of it:
With a bit of string processing, however, you can have it printed out nicely readable:
So this post is about that.Continue reading
This is a small post about how to convert key codes to key names and/or convert key names to key codes. Comes with sample code for GameMaker and a generic version.
Mostly published because it covers majority of common and semi-common buttons.Continue reading
This is an average-length (~10 pages) blog post about how to write a parser, AST builder, bytecode compiler, and a bytecode interpreter - in general, and in GameMaker specifically.Continue reading