/* Logo Pending */

Plaintext level data

December 23rd, 2011

A few days back, I got involved in some of the most asinine drama I could ever had imagined. Considering most internet drama is asinine, that’s saying something, but ofcourse that’s just my opinion. Basically, two of my friends on IRC are writing games, in two completely different styles. One, by NovaYoshi, is a graphically simple single-screen puzzle game. The other, by GreyMario, is somewhat more complex in the graphical sense. One has less than ten different tiles, the other potentially hundreds.

Now, GreyMario may make some mistakes in life, but he knows very well that when you have so many different tiles to store in a level map, you’d be better off with a byte stream of some sort. That is, you store the level data in some binary format that you’d need specialized tools (a level editor) for. And there’s nothing wrong with that approach. In contrast, Nova’s game uses plaintext data files.

The funny thing about plaintext level maps is that the most basic of basics as far as obviousness goes looks a little like this:

#             E#
# * * *   ##H###
########    H  #
#           H  #
#  * *      H  #
# * * *  P  H  #
################

It’s quite clear what’s what and where it’d go, making the editing of the level map in any text editor very straightforward. The hashes are solid walls (as they more often than not are), the asterisks are pickups of some kind, possibly coins or gems or something like that, the ‘P’ is the player, the ‘E’ is, considering the rest, an exit, and the stack of ‘H’ is a ladder. It even looks kinda like a ladder. It’s pretty difficult to make grievous mistakes with this format, and it’s easy enough for the game to parse. In contrast, it’s pretty much impossible to display this format’s binary counterpart in the same way. If you displayed each byte value as a block of a unique color, you could maybe recognize the same basic level structure, but it’s no longer clear what the counterparts to ‘P’, ‘E’, and ‘H’ are.

However, this is not exactly what Nova’s game uses. Aside from some descriptive commands to name levels, describe them, and specify what enemies should appear, the map data itself uses two characters per tile:

# # # # # # # e e # # # # # # # `1
# # # # # # # . . # # # # # # # `2
# . . . . . . . . # # # # # # # `3
# . . . . . . . . # # # # # # # `4
# . . . . . . . . # # # # # # # `5
# . . . . . . . . # # # # # # # `6
# . . . . . . . . # # # # # # # `7
# . . . . . . . . # # # # # # # `8
# . . . . . . . . # # # # # # # `9
# . . . . . . . . # # # # # # # `A
# . . . . . . . . # # # # # # # `B
# . . . . . . . . # # # # # # # `C
# . . . . . . . # # # # # # # # `D
. . . . p . . . # # # # # # # # `E
# # # # # # # # # # # # # # # # `F

According to Nova, there are two reasons for this. One, it fixes the aspect ratio, or so he claims. I personally couldn’t care less but it’s his design so I’ll just deal with it. Two, the space characters function as tile type commands of some sort. In the metadata that precedes the map, the designer can specify custom tiles and use them in the map data as ‘!’ tiles, as opposed to space. Note that the backtics at the end of each line mark the end, and the numbers are ignored. Also, the ‘e’ tiles are enemy entry points – they sort of “flow” into the screen from those spots, and are defined in the metadata.

GreyMario has friends of his own. People I don’t know, and don’t talk to because they aren’t just on another IRC channel, but on a completely different server. One of those friends, and I use the term loosely, caused the drama I mentioned at the beginning of this article.

Basically, LordTrevor considered plaintext the be-all-end-all of level data formats, even for complex, hundreds-of-tiles data, and would not listen to reason. That by itself isn’t that bad, but the amusing bit is how he claimed plaintext was user-friendly, easy to edit, and all that jazz. His first argument was already good – textual information was supposedly easier and faster for the game to read than a byte stream. And then GreyMario pasted a sample of what Trevor used in his game:

[o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]
[o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]
[o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]
[o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]
[o][o][o][P][o][o][o][o][o][o][o][G][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]
[o][o][o][_][_][_][_][_][_][_][_][_][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]
[o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]
[o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]
[o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o][o]

Let me count the ways this is a bad format. One, the endless parade of brackets causes massive noise. They serve no obvious purpose whatsoever. Also, they make an already somewhat brittle format even more easy to break just by misplacing a pair. And when that happens, you can’t find the error because everything looks the same! Two, using ‘o’ for what I assume means “open air” causes contrast problems – it’s very difficult to find certain other tiles. In fact, when this first appeared in my IRC client, I couldn’t find the ‘P’ (probably for “player”) for almost a minute, and didn’t even notice there was a ‘G’ (goal?) until I pasted it into this article just now! Third, using ‘_’ for platforms. I’m guessing even Trevor noticed some contrast problems because that platform is the only thing that really stands out in this sample, and the all-but-industry-standard ‘#’ wouldn’t do. So because his empty air looks solid, the platforms have to look empty. How high do you have to be to come up with that?

Then there’s the problem of character range. On the average keyboard, you can type 26 letters, both upper and lowercase, ten digits and their shift-key symbols, and then another 22 symbols. That’s about ninety characters as a technical limit. For a game with more than a hundred tiles – like GM’s – that’s not enough. But if you go above that amount and get things like accented letters involved, you get encoding issues. Nothing at all would stop a user from saving his level map in Windows-1252 instead of the Unicode your game expects (hypothetically speaking), or things like accented characters not being stored in their precomposed form. The map’s readability is severely lowered too – even with only ~90 characters, you lose the obvious meanings – ‘/’ and ‘\’ might be grassy slopes, but you can’t use them for sloped ceilings, and there are no other characters like those. This makes plaintext intrinsically best suited to low-tilecount games like Nova’s Forehead Block Guy, and it logically follows that you get the most user-friendliness from a custom level editor. That, at least, gives the option of WYSIWYG, rendering the exact values moot.

And the best part? Nova is writing a level editor for FHBG as I type. Because the game also runs on systems without keyboards. Now that is being user-friendly.

Why I am 0kay with the Signless Sufferer

November 28th, 2011

Facts on the table.

  1. I’m an atheist. As such, I believe the Bible (capitalized only to distinguish it from the generic term) to be a work of fiction, and the God described therein as much the same.
  2. In Andrew Hussie’s Homestuck, the Signless Sufferer is a pretty fucking blatant Jesus figure. He dies on a cross flogging jut, has a disciple and a virgin mother…

And I’m totally 0kay with all that, enjoyed the part where all that was revealed in the comic and shed manly tears at this fan recording of the Sufferer’s Final Sermon. Why’s that? Simple.

It’s because Hussie made no implication that Jesus was real. Only that the Sufferer was, in the context of the blatantly fictional Homestuck. Even so, the Sufferer didn’t do any miracles. There wasn’t even a proper Biblical resurrection as he didn’t just stand up after dying, but was reborn. Twice, if you consider Karkat very carefully. And even that has perfectly justified reasons behind it, given earlier in the story as things like ectobiology and the Scratch.

There are basically a couple different ways to involve Jesus, or really any other Biblical thing, in a story:

  1. Refer to the thing as fictional. This is fair game.
  2. Refer to the thing as truth. This can get messy and preachy, unless for example you use Historical Jesus instead of Biblical Son-of-God Jesus. You’d think “fictional story wherein the Bible is real” is okay, but that reeks of wish-fulfillment on the author’s part.
  3. Keep it ambiguous. Having a character ask “What would Jesus do?” says nothing about which one is being referred to, and that’s fine by me.

In Homestuck, references to the Bible are mostly of the ambiguous sort, and the story itself becomes downright blasphemous (not my opinion) when characters start reaching the God Tiers. And then there’s the trolls and their Sufferer, who, in the fictional framing story of Homestuck, is spoken of as a real person who existed… while being as fictional as the rest of ‘em! Even with all the perhaps heavy-handed Jesus parallels, the Sufferer is strictly fictional and the story his is based on is left ambiguous.

And it was good.

On RoxIRC, mIRC and scripting

October 22nd, 2011

So, recently I picked up on my RoxIRC project, a nice and shiny IRC client. Nice minimal UI (taking after common modern web browsers), Aero Glass effects… and a scripting language. You gotta have one of those. Used to be Lua, but something technical came up and forced me to switch to something else, and I ended up with CSScript, which basically means you can script RoxIRC in the same language it’s written in, and I still haven’t quite wrapped my mind around that one.

Problem is, isn’t C# a bit too much? I don’t think so, and here’s why.

Read the rest of this entry »

Dwight Spergle

August 20th, 2011

It is complete.

Poni collection progress: 120%
Poni acquired: Twilight Sparkle Rarity Fluttershy Pinkie Pie Applejack Cheerilee Rainbow Dash
Mother status: amused by Spike

20% Cooler

August 7th, 2011

When you see it, you’ll shit bricks. Rainbow-colored bricks.

Poni collection progress: 100%
Poni acquired: Rarity Fluttershy Pinkie Pie Applejack Cheerilee Rainbow Dash
Poni missing:  Twilight Sparkle
Packing newspapers: Very French

On Poni Two — Electric Boogaloo

August 3rd, 2011

Contender for the worst followup post title ever? Eeeeyup.

I’ll hopefully recieve a Rainbow Dash imported from France (of all places!) from my dad next Monday.

Poni collection progress: 80%
Poni acquired: Rarity Fluttershy Pinkie Pie Applejack Cheerilee
Poni missing:  Twilight Sparkle Rainbow Dash
Best pony: Eighties Cheerilee. Where’d I put my bowl of hot water?
Impression left on cashier: Pokerface

On poni

July 30th, 2011

Poni collection progress: 50%
Poni acquired: Rarity Fluttershy Pinkie Pie
Poni missing:  Applejack Twilight Sparkle Rainbow Dash
Unicorn status: Still awesome
Impression left on cashier: Ill defined

On Skittles

July 21st, 2011

<KP9000> I want you to blog about skittles
<Kawa> They're fruitier than Nick and Flan in a bunk bed together, and eating too much made me piss rainbows.

On indent styles

June 24th, 2011

There are several styles of indentation available to programmers, where C-like languages are concerned. That is, programming languages with braces. As the Jargon File explains:

K&R style
Named after the authors of The C Programming Language, Kernighan and Ritchie.

if (foo) {
    bar();
}
Allman style
Also known as BSD style.

if (foo)
{
    bar();
}
Whitesmiths style
An early C compiler, according to the File.

if (foo)
    {
    bar();
    }
GNU style
Used for GNU Emacs and FSF code, or so the File says.

if (foo)
  {
    bar();
  }

According to the File, K&R style used to be near universal, but the opening brace got lost against the right paren. Those who still use it would say that the gain in vertical screen space would weigh against the loss of readability. Of course, the File is rather old and screens are positively huge nowadays so that argument has become irrelevant if it weren’t for widescreen. Except for those with a Java background. Read the rest of this entry »

Inventory screen

April 12th, 2011

I think this looks much better. No?

A cookie to the first one who can tell where I got those icons.

/* Logo Pending */ is proudly powered by WordPress
Entries (RSS) and Comments (RSS).