About Vadym

Thanks for reading!
[dinosaur peeking in from the right] Hey! I now have a newsletter! Come take a look.
You can also follow me on Twitter or Tumblr.

Adding thousand separators

string_thousands

Often, games and applications may display numbers. Sometimes, large numbers. In some cases, numbers with so many digits that you aren't even sure about most suitable notation.

And that's where use of thousand separators is handy. Since delimiter symbols (normally commas) appear in fewer quantity than digits, they are easier to count, and user can tell the order of magnitude easier.

This post covers detail of doing that, both in algorithm and code.

Continue reading

BitFive: Now with multitouch

This is only a small thing out of everything I need to make/finish/release in next months, but...
So there is now multi-touch support in openfl-bitfive, which is an alternative OpenFL HTML5 backend with focus on blitting and compatibility across platforms.
Usage is identical to Flash/AIR - you add an according event listener to your desired DisplayObject, and handle the TouchEvent objects it catches:

stage.addEventListener(TouchEvent.TOUCH_BEGIN, function(e) {
	trace("Touched at (" + e.stageX + ", " + e.stageY + ")");
});

And, same as it goes for mouse events, the rest is handled behind the scenes - events are routed automatically, and you don't need to worry about browsers and devices with partial or glitchy support.
You can even have your mouse events converted into touch events for ease of testing if you want (see bitfive_mouseTouches flag).

Addition is already live at both repository and haxelib, there's a demo available (probably want to view it from mobile device), and this post contains some extra details on what it took.
Also, if you needed this for some time, you can pretty much thank Ozdy (which is also the largest supporter of backend) for suggesting the feature.

Continue reading

Introducing: Spelunky SD!

If you've been following me on the social networks, you may already know, that for the past three months I was working on a Spelunky Classic modification called Spelunky SD. It is a pretty broad project, implementing a number of fixes and improvements to the original game, and, most importantly, adding a 2-player cooperative online game mode.
Today, I am proud to announce the first public release of this project.
And this is a blog post about my experiences.

Continue reading

GameMaker: trace/log function

A scribble reads "trace(x,y)"

Debugging games can be fun! Or not fun. Depends on what your definition of "fun" is.

Either way, starting with GameMaker: Studio, GameMaker has a proper debugger with breakpoints, step-by-step execution, watches, profiling, and other conveniences.

There is also an Output panel, to which you can write messages using show_debug_message. This can be preferable if you need to inspect order of execution or are in a hurry - after all, throwing a quick look on the panel is fast. You know what's not fast though? Using show_debug_message to do so.

Continue reading

Haxe: Simplistic .properties parser

If you have ever been using Java, you may already be familiar with .properties file format. This is a simplistic configuration file format, somewhat similar to INI:

# Comment
key = Value

For ones not liking that, there's also alternative syntax:

! Comment
key: Value

Where leading/trailing spaces are optional and are trimmed in parsing process.

Since I've seen people ask about this kind of thing, and also have seen people invent ridiculous (and non-functional) regular expressions to parse this file format, I thought that I may as well make an implementation that works "just right".

Continue reading

GameMaker: GM8 code editor color scheme for Studio

If you are using GameMaker: Studio and find default dark theme to be odd, you probably have already switched to lighter "GM8" theme via File - Preferences dialogue.

But, alas, switching to "GM8" theme does not change code editor color scheme, and you still get the default dark gray-orange theme in middle of your light-colored IDE.

So I thought that it would make sense to publish a GM8-esque color scheme that I've made and am using locally for a while now.

This color scheme follows GM8 style closely, with few exceptions like displaying resource names in teal instead of yellow (which grants higher contrast and generally looks better).

To import a color scheme, go to File - Preferences - Scripts and Code, click Import button, and pick the obtained file.

It is hard to make a large post about thing as small, so here's the file:

Download COL

Alternatively, file' contents (to be saved as gm8x.col and imported into GMS):

<Colours>
  <Color0>0</Color0>
  <Color1>8388608</Color1>
  <Color2>16711680</Color2>
  <Color3>32768</Color3>
  <Color4>128</Color4>
  <Color5>128</Color5>
  <Color6>128</Color6>
  <Color7>8388736</Color7>
  <Color8>11171870</Color8>
  <Color9>16777215</Color9>
  <Color10>14744314</Color10>
  <Color11>10512464</Color11>
  <Color12>5988454</Color12>
  <Color13>16120058</Color13>
  <Color14>255</Color14>
  <Color15>2633011</Color15>
  <Color16>11913437</Color16>
</Colours>

Have fun!

GameMaker: Testing two game instances at once

If you are using GameMaker: Studio to create multi-player games (via not-so-recently added network_ functions or by utilizing existing DLLs) without separate projects for server and client, you might have stumbled upon one annoying limitation - you can't run two instances of game from IDE.

From a glance, this looks like a small issue, but it gets tedious really fast - to run a second instance, you have to either compile the game (takes time and monotonous file dialog actions), or find a compiled .win file in depth of temporary directories (or otherwise retrieve it's location via means of WinAPI), and pass it to the runner via command-line, like

...\AppData\Roaming\GameMaker-Studio\Runner.exe -game (path to *.win file)

But that's no fun, right?
At least I've found so.
So I took a bit of time and made a small GML snippet to lift this unfortunate limitation.

Continue reading

GameMaker: Windows-specific functions for Studio

While working on one of recent projects, I've stumbled upon few common issues that many meet - even if you are only targeting Windows in GameMaker: Studio, you cannot access files outside the game's AppData directory (not even in program directory). Neither you can order system to open a file, meaning no external "readmes" to be easily hooked up with game, nor portable configuration files, and some other limitations.
So I took an evening and made a simplistic DLL library to bring equivalents to some functions (sleep, execute_shell, non-sandboxed I/O) back for Windows target. Function list is as following:

Continue reading

Simple GameJolt API plugin for Construct 2

GameJolt API plugin for Construct 2

As you may know, there's a program called Construct 2. You can make games with it. While I'm generally not a huge fan of built-in scripting system (scene editor and idea of behaviours are pretty great though), some people make nice games with that.

Also there's Game Jolt. Game Jolt is a site you can host your games, devlogs, and related media upon. It's great. I'm not sure which of Saturn's moons you are living on if you haven't heard of it by now.

Then when two come together... you can upload Construct 2 games to GameJolt, but you cannot use any of it's quite so nice Game APIs (such as high score tables, trophies, data stores...), since, well, noone made a plugin for that so far.

Seeing that, I thought that I may as well fix that part (a bit). So I have devoted a bit of time over few days and have made a plugin that provides basic functionality, such as sending scores and trophies. Everything is pretty straight-forward and easy to get hang of.

Installation is simple also - download ZIP file below, and unzip contents (a folder called "gamejolt") into HTML5 plugins directory (Construct 2\exporters\html5\plugins) in your Construct 2 installation. Upon next launch of program, GameJolt plugin will be available in "Platform specific" category alongside of Kongregate, Scirra arcade, and other items.

That's pretty much it, I guess. Download links are below. If there are any questions, feel free to ask.

GameJolt page (demo+downloads)

Update (August 2014)

Extension has been updated to include additional functions. So have been links in this post and files on GameJolt.