Provoking Mersenne Twisters

I've lost hours and days to various kinds of games, but one genre that appears quite often is the one where you're supposed to do the most proverbially insane activity: doing the same thing over and over while expecting different results. I kind of think I should have a problem with that, but I don't really feel guilty. Somehow this gets recorded for me as "valid entertainment".

Before we analyse this further, let me open with a question: What does Mahjong have in common with Diablo?

Read more…

Games are generators of stories

So I was reading "A Theory of Fun for Game Designers" and one idea particularly resonated with me. Idea is: "Games are like story generators".

The book elaborated on the distinction between "stories" and "games". If you take, say, a book, the story is there on purpose and you consume it by reading. Most computer games (the non-abstract ones) have their storylines, and - in similar manner - you learn the story by playing. That's not what I mean. This is not "story generation" because the story is sort of already there. Non-abstract games tend to be like movies and books in this regard, even if the story branches off into different variants in predefined monents. The best stuff happens when it's not the game designer, but the game and the player who create the story together.

Read more…

On gamepads in PC gaming, XInput and compatibility

"Which gamepad should I buy for PC?"

A reasonable question, but with no single good answer, other than "er, it depends, what game would you play on it?". Gamepad support on PC is decent nowadays, much better than it used to be before the advent of Xbox360, but there's a mess here. Let's try to untangle things a bit.

Gamepads used to be available in tremendous variety and have now pretty much converged to a standard layout: 2 analog sticks, a D-pad, 4 face buttons, 2 shoulder buttons, 2 analog triggers, select, start and 2 secret buttons that you mostly press by accident. There's some variety on top of that, like vibration, left analog positioning, touchpads, motion sensors, but the general idea stays the same between PC, PlayStation 2-4, Xbox 1-360 and even Android (kind of, if you count the NVidia Shield). Would you believe that?

Read more…

Risk of Rain: A Story of a Bug

So the funniest thing happened recently: Risk of Rain, a well-acclaimed video game, has received an update 1.2.1 that introduced a silent bug that has significantly affected the gameplay. The circumstances are more than entertaining.

Read more…

Bug vs feature

We've had a lot of discussions about what should go as a "bug" and what should be a "feature" in our tracker. Turns out there's quite a big gray zone here.

Read more…

Commentary on Javascript: The Good Parts

"The Good Parts" has been a good read. The language has been described briefly and consistently from ground up, including a thorough explanation of objects, functions, closures and arrays. A great addition to the mix is a description of the numerous pitfalls and design problems. It seems opinionated at some points (more on this later), but very valuable as a whole. (That's correct - "The Good Parts" actually has two appendices dedicated to the not-really-good ones.)

My commentary for selected parts of the book follows.

Read more…

Interfaces dissected

Recall methods. A method is some piece of code that can be "called on objects". There are two things to methods: They're meaningful with an object to call on, and their interface looks like "they can be called with some arguments to return a value".

Properties are similar to methods, in that a property is meaningful when paired with an object. They have a different interface than methods, though: you don't "call" them; instead you "get" and "set" their "current value".

We normally consider properties and methods to be some abstract "traits" of objects. But why not treat them as first-class objects too? Imagine properties and methods as building blocks for object interfaces. A method would be an object that describes callable parts of other objects, while a property describes readable and assignable parts.

Read more…

Introducing Glory

Glory is the code name of my prototype IDE for developing OpenGL-powered graphical effects. After half a year of work, it has entered a functional alpha stage (and awarded me the MSc.)


Read more…

Say hello to Unicode

Basic explanations

Unicode is a standard that defines several things. Here is a handful of some most important facts about it:

  • There are thousands of "code points" that represent characters in various alphabets, numbers, punctuation, various symbols, etc. Each of these has a name and a number. Here are some examples:
  • Different code points may share their appearance, or "glyph" (like OHM SIGN and GREEK CAPITAL LETTER OMEGA).
  • Code points are grouped into blocks like "Basic Latin" or "Mathematial Operators". They also are divided into categories like "Letter, Uppercase".
  • There are some "encodings" that provide a mapping between code points and their bitwise representation. The encodings have names like UTF-8, UTF-7 or UTF-32. Each of these has some interesting properties.

    Read more…

Git adventures: Loose object is corrupted

I couldn't read my Git history today because I ran into this problem:

$ git log --oneline
f1330fd Basic automation
7234c6e Textures work
3b18493 Fix combo defaults
error: inflate: data stream error (incorrect data check)
fatal: loose object 65d626bb82c8996f8fc5f659f7c207fee1d74948 (stored in .git/objects/65/d626bb82c8996f8fc5f659f7c207fee1d74948) is corrupted

The same message appeared when checking the repository with git fsck.

My working copy and dozens of last commits were intact; this error showed up when trying to view more history or when trying to clone a repo. Some googling revealed that I should get the original (non-corrupted) object from somewhere and replace it.

Read more…