Just testing some flash embedding. Ignore the generic platformer. Or.. don't.
Platformer
Alternative content
Just testing some flash embedding. Ignore the generic platformer. Or.. don't.
Alternative content

I just jumped years into the future with both my cell phone and my computer. The future is a mixed bag.
The Cell Phone
For quite a few years now, I’ve had a flip-phone and was paying for service out of contract. When people started getting smartphones, I kind of wanted one, but never enough to justify the cost of a phone or tying myself to a new 2-year contract to get a free one.
I did the math recently. I found out that for what I pay just for voice, data, and texting would be equivalent to getting a new smartphone with a contract. I’d even be able to take advantage of the data plan since the one with my flip-phone which became nearly unusable when they stopped supporting some of the already-poorly supported video options. I went with my fiancee’s Sprint-based provider instead of AT&T, and that referral netted me a discount that made it even cheaper.
So now I have an Android, the HTC EVO Shift, and I’m fairly happy with it. It’s way more useful than my old phone.
Plus, now I can play the games everyone has been talking about.
Plus plus, I have a device to test my own projects when I start mobile development.
However, I’m still getting used to figuring out how to hold it since I seem to keep accidentally hitting the search button or some part of the screen. I still hit the volume control on the side too often, and I press the power button as I slide the device into my pocket if I’m not careful. And as great as having a keyboard is, the phone automatically unlocks when I slide it out, which has accidentally happened in my coat pocket more than once already. While my old phone let me easily look up a name in my phone book since I could type a letter and it would jump to that section of my phone book, this new device seems to think I want to include everyone I’ve ever emailed, Tweeted, circled on G+, or friended on Facebook when I want to search for someone to call.
But this is the future, and the benefits are outweighing the negatives. Being able to fit a computer more powerful and integrated than my first desktop into my pocket has so far been pretty amazing.
The Computer
And speaking of computers, I’ve mentioned my dying laptop a few weeks ago. My Dell Precision M90 was a fine machine until the video card started failing. I’ve purchased a replacement: the Precision M6600.
I’m going from:
That last item unfortunately feels like a downgrade to me. I really liked having a 1920×1200 display. The extra lines of resolution were great for coding work. Unfortunately, it seems that 1920×1200 will no longer be available for most laptops. There’s no real explanation, either. There’s merely speculation that the hardware manufacturers will save money, especially since most people probably just want to watch movies on their laptops anyway.
Still, this new laptop came with Windows 7, and while I’ve used Windows Vista by being the default tech support guy for my family, I hadn’t really become familiar with anything since Windows XP, which is what my old laptop came with. The new interface is somewhat jarring. When I was running Firefox and had the download window open as well as the main browser, I wanted to minimize it, and so I clicked on the button in the taskbar, like I normally would. Instead of minimizing Firefox, it popped up a the windows as buttons so I could choose which one I wanted. Darn new-fangled tech doing things differently than I expected…
But no matter! I repartitioned the drive so that Windows gets about 100GB, and I installed Ubuntu 11.10 on the remaining space. And it turns out that Ubuntu is all new and shiny, too.
See, I used Ubuntu 10.04 Long-Term Support (LTS), and I didn’t want to upgrade to newer versions because I wanted a stable development system to do my work on.
So here I am, jumping two years’ worth of Ubuntu development, and this new Unity interface threw me for a bit until I realized they were trying to make it seem more Mac-like. There’s a launcher, and the buttons are all big and shiny, and there’s a Software Center where I can easily click and download apps and even purchase them. There’s quite a few indie games there, and it seems like it could be a decent marketplace.
But after looking at the entire games collection, I took the time to find the Terminal (more on that later) and typed: “apt-get install nethack-console” as fast as I could.
And then I added the Terminal to the launcher.
Seriously, it’s nice that the UI is 3D-powered and all, but sometimes I don’t want to mess around with a frickin’ mouse. I LIKED being able to open the system menu at a keypress and see ALL of my installed applications. Now I have to explicitly type to search or click on Dash, then click on “More Apps”, and then click some more? On the old system, I could hit Alt+F1 to open the “Applications” menu, then use the arrow keys to move to “Accessories” > Terminal. Now, I press the Windows key to bring up Dash, and if I know the name of the application, I can type it out right there, but if I don’t, it’s faster to click on “More Apps”, then go to “Installed” and click on “see all”, then scroll down until I find it.
I also liked being able to figure out how to open a file within an application by just looking at the screen. Unity has Mac-like context menus that applications share at the top of the screen, which…ok, whatever. Maybe it’s great, and I’ll try it, but why Unity hides the menu until you mouse over it, I don’t know, but I’m not the only one who is unhappy with it. Maybe I just need to get used to it, but there were a couple of times when I opened an application and wondered why the heck I had no way to open a file since the window I was using (seriously, why would I want to shift my eyes all the way to the top of the screen when the application I’m using is over here?) didn’t have a File option.
Unity also seems to hate the idea of customization. At least Windows let me move the taskbar around the screen. Why does the launcher have to stay stuck to the left side? Why do my windows have to have the close and minimize buttons to the left like on a Mac when I prefer them on the right? I’ve yet to find a way to change anything to work the way I want it to work.
I’m aware that it is possible to replace Unity with Ubuntu Classic UI or KDE, but I’m going to try to stick things out just to see how most users are expected to run their new Ubuntu-based systems. I actually do like being able to see all running application instances in an Exposé-like way, and there are parts of the UI that feel more intuitive. And Ubuntu 11.10 does seamlessly run 32-bit and 64-bit applications. I ran Stop That Hero! just to see if I had all of my development libraries installed, and I didn’t even realize that it shouldn’t have worked on this new 64-bit machine. So that was a pleasant surprise.
But if this is the future of computers, where laptop screens get smaller resolutions instead of larger ones, where the UI is made out of candy and shiny at the expense of being useful for people who know what they are doing, I’m not sure I’m happy about it.
I feel like the future is pushing me out of the way to make room for people who just want to watch widescreen movies or use a “workstation” as nothing more than a consumer electronics device.
Am I being unreasonable? Am I just disoriented because everything is different in the future? Is it better and I just need to get used to it?
The Future Is Disorienting is a post from: GBGames - Thoughts on Indie Game Development

If you’re not familiar with AltDevBlogADay, you should be. Each day, a game developer posts on a variety of game development topics. There’s a huge backlog of content there now, and while the recent redesign has made it difficult to find the category you want (you have to click on a post to see only some of the tags available as of this writing), it’s great getting regular, up-to-date, state-of-the-art tips and tricks from the people in the trenches. Authors can be mainstream game programmers, indie developers, academics, or anyone who has something valuable to share.
It seems to be such a successful site that they’ve decided to host an online conference. AltDevConf will be held on February 11th and 12th (that’s this coming weekend), featuring three tracks: education, programming, and design & production.
Our goal is twofold: To provide free access to a comprehensive selection of game development topics taught by leading industry experts, and to create a space where bright and innovative voices can also be heard. We are able to do this, because as an online conference we are not subject to the same logistic and economic constrains imposed by the traditional conference model.
As it doesn’t look like I’ll be attending GDC this year (I’m still hoping to win an All Access Pass with my GDC magnets), AltDevConf seems like a high-quality substitute. While it won’t be the same as rubbing elbows with other indies or meeting cool celebrities in the gaming world, I’m excited about it.
Do you plan to attend? Will you be speaking?
An Online Conference You Can Attend #AltDevConf is a post from: GBGames - Thoughts on Indie Game Development
Woah, woah, hold everything.
The team behind Valve’s online shooter Team Fortress 2 has posted a most interesting update on the TF2 blog, including some fascinating details about their plans for 2012. This includes a secret TF2 project, the new Steam Workshop Blog, and the Second Annual Saxxy Awards. Those are all well and good, but I think we’re most interested in the final “Meet the Team” short, the ever-forthcoming video documenting the Pyro’s (maybe?) dark and (probably) storied past. All the speculating fans will finally find answers to some of the questions surrounding the flame-throwing maniac. Is it a woman in the suit? Is she secretly the announcer? Was his or her flamethrower handed down by his or her ancestor GLaDOS from another universe through a inter-dimensional portal opened by none other than Gordon Freeman’s great uncle? But then, will Valve even reveal any of these details? We’ll have to wait for the video to find out.
On second thought, with Valve time in the mix, who knows when we’ll see any of this stuff. Oh, well. If you’ve got predictions about the Pyro or the secret project, or anything else about this post, leave a comment.
Disclaimer: this tutorial covers how to render IVF / VP8 / libvpx video in an OpenGL libSDL / SDL window. IVF video only includes video, not audio. For game developers, it’s trivial to play audio via their own audio system. So you’ll have two files per movie “movie.ivf” and “movie.ogg” or whatever. As an exercise to the reader, you could easily jam both into a single file if you really wanted to.
The Problem We’re Trying To Solve
So you’re an indie game developer and you want to show a clip of video in your commercial cross-platform (PC/Mac/Linux/other?) game! Obviously you want a patent-free open source unrestricted license to do it.
Wait, can’t I go commercial?
Better than that, you could just use the built-in codecs on a platform! I’d suggest this if you are targeting a single platform, iPhone / iOS for example.
Otherwise, you’ll be using Bink, a commercial solution at $8500 / platform. I emailed about their “indie licenses” and never heard back.
The Open Source Options I didn’t like much
Here’s what we have for patent free open source codecs .. and their various problems.
Xiph Theora – Probably the best known codec. To get it working you have to have libogg, libvorbis, and libtheora all built for your target platforms. To me, that seemed like a lot to ask. Also, the libtheora API is a MONSTER. playtheora is a SDL example (similar to this one) that covers some of that ugliness, so I’d recommend checking that out if you want to use theora.
Dirac / Schroedinger – the BBC funded codec. I couldn’t get this one to build. It doesn’t seem to be all that popular.
Motion Jpeg – This isn’t so much of a codec as an idea. Make your own movie file with a ton of .jpg’s in it. I tried this. The files get really huge really fast. I wouldn’t recommend this.
Motion JPEG 2000 – This implementation was also pretty confusing. I couldn’t find where to start. And, yeah, this isn’t all that popular either.
libvpx .. why I chose it
WebM / libvpx – Backed by google this is a new contendor on the block. The thing that sold me was the sample encoder which was pretty simple. It also depends on nothing. Also, building it on OS X and Linux was trivial. Also they offer a pre-built Windows binary. Also, they just had their 1.0.0 release a few days ago.
So, yeah, having a supported, up and coming, easy to build codec was key to me.
How to encode for IVF / libvpx
Since it’s a new codec, not much supports it right now. I used a fresh build of ffmpeg under linux that I built with this configure command:
./configure --enable-encoders --enable-libvpx
Then I was able to use ffmpeg to encode ivf files pretty easily:
ffmpeg -i Untitled.mov -vcodec libvpx -b 1000k -s 1024x512 movie.ivf
Note: we’re not dealing with WebM files. WebM files are container files that also contain audio. Again, you’ll have to store your audio separately, or create your own container file, or figure out what WebM is on your own time.
So .. what’s the bottom line? Do we get any code?
Yes! I created a libSDL player that plays back the video at max speed possible and it converts the YUV data to RGB data and loads it as a texture. Here are the functions I provide:
void playvpx_init(Vpxdata *data, const char *_fname) ;
Just init your Vpxdata with a filename “movie.ivf” .. It’ll try and get libvpx up and running for you.
bool playvpx_loop(Vpxdata *data) ;
Call this once per frame to have it decode a frame of video. It will return false once it has run out of frames. If you want to mess with the libvpx YUV data yourself, it’s data->img. See the playvpx.cpp source or the libvpx example above to see what that structure provides. It’s pretty simple.
int playvpx_get_texture(Vpxdata *data) ;
Call this once per frame to have it convert the YUV data to RGB and upload the texture to OpenGL. It will return 0 on failure or a OpenGL texture ID on success. I convert on your CPU, so it’s not super fast, but it should work fine on modern computers. If anyone cares to provide a Shader version of this function, or provide a SIMD / MMX / SSE version .. well, that would be faster!
void playvpx_deinit(Vpxdata *data) ;
Call this function when you’re done to cleanup.
Conclusion and Source Code
Okay, here’s playvpx for you to check out. It’s a C-style API, but I’m sure I use some minor C++ in there. Probably wouldn’t be hard to make it C-only if you require C for your project.
Oh, and I include the libvpx binary for Windows, OS X, and Linux. So you may not have to build it for any platforms!
The code is licensed under the libvpx BSD-style license. My code here is a gutted version of their sample_decoder.c, so .. that seems to make most sense to me.

12 months
12 games
12 songs
12 chapters
12 blog posts
1200 pushups
12 steps
12 words
The year is twenty twelve, and I’m setting forth a personal challenge for myself. A way to break beyond my comfort level and strive for ultimate productivity. Success is not guaranteed, and I acknowledge that I’m reaching for the stars, but these are my new year’s resolutions:
1. To finish twelve (small) games. A few will likely be on mobile platforms, others in html5 and Flash. Pen and paper RPGs or boardgames count too.
2. To compose an entire album worth of new music (12 songs). I’ve written many songs in the past but it has been a while since I let the musical inspiration drive my daydreams. These songs will be released as (CC) freeware mp3s that will be available for download from my blog as well as several music social networks like soundcloud.
3. To publish at least two books, (twelve or more chapters worth) as ebooks (pdf, mobi, epub) or traditional paper books. The ancient wisdom, “write about what you know” will be my mantra, so the books will be about game development. These books will be available on stores like Amazon, Barnes and Noble, the Kindle and iBooks store and others.
4. To actively maintain my blog (www.mcfunkypants.com) even in light of the fact that I get much more response when I post the same content on social networks like Google+. The cloud cannot be relied upon for longevity so my website will be the permanent record. I hope to produce a few game development tutorials, game jam recaps, and other content that fits my areas of expertise.
5. To continue my quest to get into amazing shape. I hope to do at least 1200 pushups this year, though the number is derived from the other twelve-based choices and I hope to in fact do many more than that. I wonder if I can log 4800?
Last year at my yearly checkup my doctor told me that for the first time in my life I was overweight! I was shocked but my beer belly was a testament to the truth I’d been in denial of.
I’ve joined the fitness gamification social network www.fitocracy.com and have been using their operant conditioning tools on myself (you earn XP for exercising and slowly “levelup” yourself by completing challenges and quests in your workouts).
Great news: though it is only February, I’ve already gone back to NOT being overweight (I’ve recently lost 15 pounds by going for daily 3-6km hikes), which in itself was a great motivator to continue being active and eating well. I hope to never again be anything other than my ideal weight. Even more imporantly, getting into the habit of hiking has become psychologically beneficial as well: these moments of fresh air help me clear my head and I often come up with solutions to things I’d been having trouble coding earlier.
6. To teach my son to walk and talk. My most important quest for this year is to help my little boy learn to take 12 steps without any help (or furniture to hold on to) and to be able to say 12 different words (and understand their meaning).
That’s it! My quest has been set in stone.
I hope to use the public declaration of all these personal quests to hold myself accountable so that I do not give up on them. This is precisely why I waited until February to make New Year’s resolutions: those made on January 1st rarely persist.
The goals above are ones I’m dead serious about achieving: 12 months, 12 games, 12 songs, 12 chapters, 1200 pushups, 12 steps and 12 words.
Wish me luck!
In my small review of Rust, I noticed one useful thing, that was the fact that the branches of if-else constructs could “return” a final value, which made the whole construct an expression, that could be assigned to a variable:
let var = if a == b {
5
} else {
6
};
I wrote it was particularly convenient associated with the fact that variables in Rust cannot be declared without initialization, which made the following Lua idiom impossible:
local var
if a == b then
var = 5
else
var = 6
end
And obviously, it makes for less typing, since there is no need to repeat the var = part.
However, I completely overlooked the fact that it was possible to do exactly the same in Lua, thanks to the lazy boolean operators:
var = a == b and 5 or 6
And see, it’s even far more concise. Even if there are many else if branches, it stays fairly short:
var = cond1 and val1 or
cond2 and val2 or
cond3 and val3 or
defaultval
Note however that you can have only one expression in the branch, while using Rust’s proper if thing gives you an actual block of statements, that can be ended in a single return value if you want. But well.
Reminder: in Lua, the or operator evaluates its first argument. If it is non-nil or true, it returns it. If it is false or nil, it evaluates the second argument and returns it. Of course, when using booleans, it’s exactly equivalent to the logical “or”. When using other stuff, it keeps the same logic but allows you to keep the values (not simply their boolean truth).
The and operator evaluates its first argument. It it’s nil or false, it returns this nil or false value. If it’s non-nil or true, it evaluates the second argument and returns it. Again, that’s exactly a logical “and” with booleans.
Let’s review the truth tables:
true or true = true
true or false = true
false or true = true
false or false = false
Therefore:
true or X = true
false or X = X
Hence the possibility of lazy evaluation. We need to evaluate the right hand side only when the left hand side is false.
true and true = true
true and false = false
false and true = false
false and false = false
Therfore:
true and X = X
false and X = false
Can you see the pretty symmetry? The “and” and “or” are perfect negatives of each other. These fundamental relations hold:
not(A and B) = not(A) or not(B)
not(A or B) = not(A) and not(B)
And these:
not(true and X) = not(X)
==> not(true) or not(X) = not(X)
==> false or Y = Y
not(false and X) = not(false)
==> not(false) or not(X) = true
==> true or Y = true
Logic is pretty. Math is pretty.
Anyway, some Lua users despise the overuse of and and or for other stuff than booleans, calling them unclear and difficult to read. I happen to like them very much.
The first classic use is the “default value”:
give_me(tea or coffee)
If there’s tea, I’d like some. Otherwise, coffee is just fine. When you say “I’ll have tea, or coffee”, you mean that both are OK, but you usually put your first choice first. That’s what happens in Lua too.
The second classic use is an equivalent of C’s ternary operator a ? b : c:
foo = cond and yes or no
If condition cond holds, give me the yes. Else, the no. It’s more difficult to find real language equivalents using “and” and “or”, but it quickly becomes a natural idiom in Lua.
take(raining and umbrella or sunhat)
“It’s raining and I take my umbrella, or then just my sun-hat.” I admit it’s less clear than the previous example, but once you’re used to it, it’s as readable as:
take(if raining then umbrella else sunhat end)
Or course if you don’t need a default value (and can deal with nil), you can leave it out, as a third (maybe less common) idiom:
take(raining and umbrella)
Finally, combine several of these and you get a multiple branch construct:
var = cond1 and val1 or
cond2 and val2 or
defaultval
I had never done that in Lua, but it’s completely correct, and I like it. What about in sool? The boolean operators are going to work exactly the same, so it should be OK. The only missing thing is the operator precedence. In Lua, the and is applied before the or, and we have:
( (cond1 and val1) or (cond2 and val2) ) or defaultval
I recently re-established operator precedence to sool, and for the sake of this beautiful construct, and must have higher precedence. And or must be left-associative, which is what I decided for all operators.
Done.
Of course, all this supposes the existence of nil. And that makes a pretty sentence:
We suppose the existence of the nothing.
Riddle me that one! It’s easy to name things, but it takes one more neuron to name the absence of things. But even then, if you’re able to name it, talk about it, manipulate it in thought, isn’t it already something?
That’s one possible way to construct mathematics (or, well, at least the natural numbers). The only thing you know how to do it make sets of things. Start with an empty universe. There is nothing in it. Give a name to the set of all things that exist (which is none): the empty set.
∅ = {}
Then there’s one thing in your universe: the empty set. You can also call it 0. Consider the set that contains only it. And for fun, call it “1″.
1 = {∅}
And then
2 = 1 ∪ {1} = {0,1} = {∅,{∅}}
3 = 2 ∪ {2} = {0,1,2} = {∅,{∅},{∅,{∅}}}
The way to go from one set to the next one is called a successor function:
For any set n, S(n) = n ∪ {n}
And then you conclude, the set N of natural numbers is the smallest set containing 0 and closed by application of S.
And from this, define operations and whatnot, and build yourself a mathematical system. Fun hey? For more info, there’s always Wikipedia.
I love cosmogony, the study of the creation of the universe. Can really anything start existing if there was nothing before? And can you define “nothing” if there is indeed nothing to compare it too?
In a more fantasy-like setting, I love the power attributed to language and speech as a creation, or “actuation” tool, whether it’s from the Finnish Kalevala, where bards are wise men who engage in duels of words that slash like weapons, or the biblical creation myth that says
In the beginning was the Word, and the Word was with God, and the Word was God.
The French versions usually say “verb” instead of “word”, which implies action and gives it a certain twist. There’s also the Myst series of games in which writing books with the proper words creates actual worlds that can be visited, or Tolkien’s universe in which some ancient beings sang the world into existence (if I remember correctly).
In math terms, when there is a one to one bijection between one space and another one which has a similar structure, you can use one as if it actually was the other. If we simplify a bit, that would hold for the space of names and the space of objects or concepts they refer too.
Considering the name equal to the named: that’s what we often do in programming.
int i = 5;
Object *obj = new Object;
What’s i? It’s an int. No, it’s a variable that contains an int. One step further (notice the quotes): what’s “i“? It’s an int. No, it’s a variable that contains an int. Well, no, it’s really the name of a variable that contains an int.
And as I wrote before, it’s even worse with references. When I say obj is an object, I bypass several levels of existence: obj is a variable that contains the address of an object. And with quotes, it would be the name of that.
But mind you, there is exactly the same confusion happening in real languages, the confusion of the name and the named:
Now replace “this man” by another way to name him, his actual name:
And in that last sentence, “John” is both the person and the name. Confused yet?
In a way, we could try to solve the problem by writing it as such:
The need to put quotes is equivalent to using the address operator in C. Think about this:
What’s the name of the name of John? John’s name probably doesn’t have a name, because John is a random guy. But if you take God instead, his name actually has a name: “tetragrammaton”.
Indeed, in Hebrew, Yahveh is written in four letters (semitic languages normally omit the vowels): YHWH. Hence, the name of god is “YHWH”, and since the name of god has four letters, it is itself called the “tetragrammaton” (“having four letters”, in Greek).
The quoting mechanism becomes a serious one in a language like LISP, where code and data are written the same. There is a quote operator that prevents the enclosed expression to be evaluated. Now try writing a LISP interpretor in LISP, using quotes and exec calls. Guarantied headache.
One last related issue in programming is naming strings. When I talk about the string “Hello”, does it include its double quotes? When I write about the string, should I say Hello or "Hello"? Or did I really mean ""Hello""? Is is clearer if I write <"Hello">? A programming language normally defines clearly how to write literal
strings and how to escape characters in them. But that is also a source of tremendous headaches, bugs, and security holes (PHP, JavaScript, anyone?)
Anyway, back to the creationist power of words. Complex architectures and silent beings live in the virtual world that is the computer’s memory, follow inflexible laws at the very base of their every behavior, evolve and reshape themselves as the processor ticks and does the bidding of a mighty being that conveyed it through language from outside the universe. I think the analogy is pretty clear.
I suppose all programmers have a little bit of a god complex.
Yesterday, I woke up to an email saying that Michael Simms is stepping down after 10 years of running Linux Game Publishing and Tux Games.
Wow, 10 years! That’s a lot of enthusiasm and work, and unfortunately it takes its toll:
It took me some months to notice what was going on, and even longer to accept that my burnout was going to kill LGP unless I did something about it. The lack of drive slowed down production of new titles, shipping, customer service, everything that I either handled or had a big part in helping with, was all being compromised.
…
But I didn’t want to let the company die. Of course not, I have invested too much time, money, blood sweat and tears into LGP to just say ‘That is it, bye’. And so I sat down and had a long think about how to save it.
Clive Crous will take the reins at LGP and Tux Games. Good luck, Clive, and good luck with your future endeavors, Michael!
Linux Game Publishing CEO Steps Down is a post from: GBGames - Thoughts on Indie Game Development
import sys, randomYou will get some lovely random failures injected into your code. A great way to find bugs, and make sure your reasoning is sound in the face of CHAOS!
def chaos_trace(frame, event, arg):
if event == 'line' and random.random() < 0.000001:
raise MemoryError()
return chaos_trace
sys.settrace(chaos_trace)
Here are a couple of crowd shots I took which show just how many people were there.
I think it was fairly obvious that we weren’t going to win the children’s choice award.
Finally here is some footage of people playing our game.
A month ago, there was a post on Reddit asking what people thought about indie developers asking for money up front.
Some people are fine if they get a good quality playable build for pre-ordering, but no one seemed to be happy with the idea of funding basic engine development. It seems the general consensus is that people are getting tired of the so-called “fad” of funding a game before it is finished with no guarantee that they will see a payoff.
Minecraft‘s wild success through pre-orders aside, it’s not really a new funding tactic at all. Lots of indie developers have tried to ask for money before their games are finished, and some have seen more success than others.
The Indie Game Development Survival Guide by David Michael mentions how Samu Games started selling Artifact when it was in the beta testing stage, complete with perks for early customers. And this was in 1999.
Today, sites such as KickStarter and 8-bit Funding have enabled a number of high-profile projects to get funding from fans. Of course, a lot of projects don’t get funded and therefore don’t become high-profile.
So if you don’t have a big name to leverage like Notch or Andy Schatz or Derek Yu, are you doomed to obscurity?
No, but obviously an existing name brand helps. Otherwise, success at crowdfunding requires hard work to get your name out there. In other words, marketing. And you have to be able to demonstrate you can deliver the goods.
I started taking pre-orders for Stop That Hero! late last year, and I’ll admit feeling a bit anxious about it at the time. I didn’t have the game in a playable state yet, and here I was asking people for money in anticipation of the initial release.
While I didn’t get many pre-orders, it was definitely a nice feeling to see people actually spending some money on my game. It showed some interest, and it gave me a productivity boost to know I had existing customers to satisfy.
Now, when it comes to how I marketed the Stop That Hero! pre-order, I’m sure I did a lot of things wrong. Perhaps I should have had more videos of game play as I continued work. Maybe I should have been posting more screenshots. I could have chosen to prioritize work on certain features in the hopes that they would excite players more than the features I did work on. And maybe I wasn’t very assertive with asking for pre-orders in the first place.
At the time, I was struggling to get the alpha build across the finish line, but I kept getting good feedback from playtesters. Since the game was good enough to provide some enjoyment to players, it meant it was good enough to ask for players to pay for that enjoyment.
Now, of course some people weren’t happy with the idea of paying up front for a game they couldn’t see. And it’s hard to blame them. Since many game projects don’t get finished, it’s asking a lot to essentially gamble the cost of a pre-order on an unknown. Especially when indie developers don’t necessarily have the offsite backup solutions of larger studios when disaster strikes. See the Project Zomboid burglary for an example. All of their code was gone when someone stole two laptops, so it was a huge setback for the developers who had to rely on outdated backups to continue.
And it didn’t sit well with some of their customers, judging by the Reddit thread. It seems this experience turned some people off of pre-orders and paying for early builds in general.
All that said, it seems that making pre-orders work requires regular, quality content. Basically, if you stop talking to your customers and prospects, they’ll stop caring.
But if all you do is talk and never produce anything, no one is going to stick around. Whether you’re taking pre-orders or pledges, you have to be able to show that you can deliver results.
If you can do both, then pre-orders are worthwhile. Otherwise, you’re wasting your customers’ time as well as your own.
Is Asking Customers to Pre-order a Bad Thing? is a post from: GBGames - Thoughts on Indie Game Development
… and Linux and Mac and Windows.
Once again, the Humble Indie Bundle guys are back with The Humble Bundle for Android. While the title clues us in on the availability of the games, through the bundle, for Android, the bundle also includes versions of the game for Linux, Mac and Windows. The games in the bundle this time around are EDGE, Osmos, Anomaly: Warzone Earth, and if you pay more than the running average, the excellent World of Goo. As always, the bundle costs whatever you care to pay for it, is DRM-free, and supports charities (Child’s Play and Electronic Frontier Foundation).
Let us know what you think of the games and the bundle in the comments!
Just throwing up some video I took of the 2012 Global Game Jam at NYU. I caught about 20-30 seconds of most of the games. Sorry if I missed anyone’s.
On Friday I travelled to Vienna to attend my sister’s “Sponsionsfeier” (ceremony where she was awarded her Master’s degree in biomedicine). I had heard of the GGJ earlier from Oncer in #Moosader so looked up the address and went there. And decided to register and take part.
I teamed up with someone who wanted to make a 3D snake clone. The result turned out quite interesting I think:

One thing has always bothered me while writing my compiler, it’s the
fact that the words “class” and “struct” have a very different status,
although they are used at the same level. Lemme clarify.
A class is a model of object. The model is the class, the particular
instance is an object.
A structure is both the model and the instance. I like this not. When I
do:
astruct = MyStruct
the model MyStruct is called a structure, and the content of that
particular variable astruct is also “a structure”. This is very
annoying, because when talking about the models, structures and classes
are very similar. In fact, they are even the same thing in my compiler,
except that one has a “structure” flag set. And I never know how to
refer to the set of both. “Class or structure”. “Composite” usually does
it. But everywhere in my code, I use “Class” for both.
Since structures are just “like classes, but value types”, saying
“class” for just the “by reference” classes seems like a bit of language
abuse.
When in the code we use “class” to introduce a class definition, and
“struct” to introduce a structure definition, we mix up the semantics a
little bit. Where “class” is quite clear (“what follows is a class, ie.
a model for an object”), “struct” is not (“what follows is a structure,
but not the one you mean, a model for it, but it still kind of is
called a structure anyway”).
Wiktionary defines class as:
A group, collection, category or set sharing characteristics or
attributes.
That applies to both: all structs of a same kind share attributes and
behavior, they form a class, just as much as objects that share
attributes and behaviors form a class.
In sool, an object lives on the heap: it has a unique identity (it’s
address), not only an internal state. It is an object as we mean it
in every day life (a mug, a phone, another phone). A structure on the
other hand has only its internal state, its value: where it is in
memory is irrelevant, and two separate structures with the same content
are indistinguishable.
So what about using the word “class” for what it means: model,
blueprint, and apply it to both kind of things we have: objects and
values.
Writing source code is writing object classes and value classes. And
since all we do is writing classes, we can omit the word, and put
directly the precision:
object Dog
text name
end
value Vector
num x
num y
end
The fact that it emphasizes the natural behaviors is really interesting.
Values have no identity, just content, or essence: they can only be
copied around. A Vector is a value just as a number is a value. An
object, on the other hand, is an independent separate entity. You create
it, fill it with data, and it can interact with other objects. The word
“class” is polyvalent.
v = Vector(1,2)
d = Dog("Barky")
v is a value of class Vector. It is the vector (1,2). If another
vector has the value (1,2), they will be the same vector, just as we
say that 10 and 10 are the same number, or blue and blue are the same
color. On the other hand, d is an object of class Dog. It is a
dog, which happens to be named Barky. If another dog was named Barky,
they would still be different dogs. Just like two cars from the same
model, despite being exactly the same when they come out of the factory,
are really two different cars that can evolve in their own ways.
I like this. Not only it makes things clearer, but it brings a
bit of originality. “struct” and “class” as keywords are so C++.
I was writing a draft of interface for the built-in types, and I noticed
I was already repeating myself a lot. Thanks to method overloading, we
can have different prototypes for the same method. A particular use of
this is when we want to omit some arguments:
method data copy() end
method data copy(blob newsize) end
method data copy(blob newsize, blob val) end
method text gsub(text pattern, text repl) end
method text gsub(text pattern, text repl, blob times) end
method text rep(blob times) end
method text rep(blob times, text sep) end
That already bothers me. In Lua, where everything is dynamic, you can
pass any number of arguments to any function, and if you don’t pass
enough, the rest is filled with nil. That way, you can have a sequence
of optional arguments at the end of the argument list, which makes very
nice shortcuts.
The current way to do that in sool is to manually define all prototypes
and do the calls with the default values inside. Thanks to inlining, the
final machine code will probably be the same, but the source code has a
lot more in it.
Lua allows this in a general manner, and uses the nil mechanism to
“catch” which arguments were not filled. C++ allows default values for
the arguments at the end of the list as well.
Since now we have a proper “optional type” equivalent for each normal
type, we could do something similar.
method data copy(blob? newsize, blob? val) end
method text rep(blob times, text? sep) end
Consecutive optional typed arguments at the end of the list can be
omitted when writing the call (and will get the nil value):
foo = somedata.copy -- same as .copy(nil,nil)
foo = somedata.copy(200) -- same as .copy(200,nil)
foo = somedata.copy(200,2)
megalol = "lol".rep(2) -- same as "lol".rep(2,nil): "lollol"
megalol = "lol".rep(2,",") -- "lol,lol"
Pretty sweet. But here comes the “however”.
However, that can result in an ambiguity:
-- method foo(num a)
-- method foo(num a, num? b)
obj.foo(10) -- is it really foo(10) or foo(10,nil)?
Are there really cases where you’d need to be able to define both? Are
there really cases in which an optional-typed argument is not an
optional argument?
Some ambiguities are trickier:
-- method foo(num? lol) end
-- method foo(blob? lol) end
obj.foo()
obj.foo(nil)
Yikes. What nil is that? A nil num or a nil blob? A poor
implementation would simply pick the first one in the list that matches
the call. That would be random, that would be bad. I mentioned already
that classes may have a built-in selfless nilval method that would be
used only to type an expression:
obj.foo(num:nilval) -- no more ambiguity
obj.foo(blob:nilval)
But the less stuff I build in, the happier I am. You can always do:
extend num
selfless num? nilval()
return nil
end
end
if you really need it.
In any case, trying to solve ambiguities at the call is not completely
awesome. Defining conflicting methods in the first place is a bad idea.
If it’s possible to pass either a number, or a blob, or nothing, the
safer thing to do is:
method foo() end
method foo(num a) end
method foo(blob a) end
and be done with it. I have difficulties imagining cases where you’d
need to make the difference between an absence of number and an absence
of blob. When in doubt, just write them all down.
Unfortunately, that means a bit more work for the analyzer, which will
have to internally generate all prototypes corresponding to missing
arguments:
method foo(num n, num? m, text? t, data? d) end
-- becomes:
foo:num,num?,text?,data?
foo:num,num?,text?
foo:num,num?
foo:num
And all conflicts can be caught. C++ allows ambiguous interfaces to be
defined, and catches the conflict only at the call. That seems odd,
given that an ambiguous interface will always result in a ambiguous
call, except if all arguments are provided, which would make the whole
default argument thing pretty useless.
If the conflicts are checked at the interface, then every call is non
ambiguous and can be resolved to a single method.
It’s true, defining optional-typed arguments at the end of the list does
slightly pollute the method namespace, and may unintentionally bring
trouble. But like I wrote earlier, if two methods have the same name,
they really should do the same thing. If this system gives birth to a
conflict, then probably one of the methods does something slightly
different, and needs to be named something else.
Optionals, in any case, should be used wisely. They require a certain
amount of care in handling them.
What I found most special about Rust is that every variable is always
initialized, and no pointer can ever be NULL.
In C++ or sool, you allocate an object of a given type, and then fill
its members. In Rust, the only thing you can do is build an object by
specifying its members, and this determines its type. Then, if you
happened to have named this type earlier and defined methods for it, it
becomes the equivalent of an instance of that class. If you omitted to
give a value to a certain field, the field doesn’t exist and the record
is of another type, in which you cannot access this particular field.
Of course, in practice, that doesn’t prevent you to have shortcut
functions that construct the objects by filling in default values, so
it’s not necessarily less convenient.
What fascinates me is that is suppresses the need for NULL pointer checks
entirely. Remember, when discussing nil, I said it was impossible to do
without because we use it for:
option<T>, andalt control statement that branches depending on which subtype isThis is beautiful. Very logical, very neat and theoretical like a
functional language. Type constructors and type pattern matching. Wow.
Does that mean I want the same in sool? Grumph. No nil-checks sound
really good, implementation-wise. So far in my head, the way to deal
with nil is inserting a test before each method call (and hope for
compiler optimization), or inserting a test on self at the beginning
of each method’s body. Doable, trivial, but not awesome.
What would the “all members always initialized” mean in sool? For
primitive types and struct members, no issue there, I planned on having
default values anyway. The big question is for objects on the heap.
Like I mentioned before (probably when discussing the “single
ownership” thing), it’s OK the pre-allocate sub-objects all the way
down, as long as the whole thing has a tree structure. Obviously, when
there are loops, we’d have an infinite recursion.
Many pointers are not meant for ownership, but for shortcut reference,
like pointing to parents in a tree, or a network manager that could be
accessed from all over the program. A big program can look like a cloud
of objects, all talking to each other.
Having an automatic allocation in sool would also mean that we force the
distinction between “owned objects”, that can be allocated
automatically, and “simple shortcuts” to must be pointed at something
existing, at initialization.
Instead of an initializer method in which you can set some fields, and
leave the others be, it would mean that every pointer-like variable
has to be set. Either to a new object, or an existing one. No exception.
What about recursively defined data structures like linked lists or
trees? If we don’t go all the way of Rust and have enumerated types, we
need new tricks: the last node of a list could point at itself to mean
“no next one”.
What about returning nil to mean “is not in this collection”? Or “this
pattern did not match”? What about object members for which we simply
do not have the info yet? Like in my sool compiler, lots of fields of
the AST nodes are filled in by the analyzer, a lot later than the
creation of the node. Should I, for instance, define a child class that
adds the new fields, and replace the old object by the new one instead
of having lots of members hanging uninitialized so long?
Can members be optional, or only arguments and return values?
Oh, Rust, why do you bring my old questions back? I was never satisfied
by the nil solution I had, but now I’m afraid to go back to the
“nullable vs. non-nullable” type quest.
Compare
str = "yepee"
if str:find("blah") as where then
-- use where
end
to:
std::string str("yepee")
size_t where = std.find("blah")
if(where != std::string::npos) {
// use where
}
The principle is exactly the same: if we have a valid result to return,
we return it. If not (and that might happen, we don’t know), return some
kind of invalid value. What invalid value? -1? std::string::find
returns a integer of type size_t, which is unsigned, so it can’t be
-1. Actually, it is -1 casted to an unsigned, so it becomes the
highest possible integer of the native integer size. So, in this case
the guys who made the STL decided arbitrarily what was the invalid
value. Not only that breaks if you have a veeeeery big string (albeit
unlikely), but also, it’s so arbitrary that nobody can ever remember,
and the best practice is to compare it to some class member where it is
stored.
Now if you use an std::map, the find method will return an iterator
that points to the result of map::end(). It could be anything else.
In Lua, there is one standard normal way to say “invalid”: nil. And nil
happens to evaluate to false in condition statements, which gives very
natural looking idioms. That’s one of my favorite things in Lua, and I’m
not ready to give it up.
It works in the other direction as well. In my compiler, when I generate
a diagnostic, I must first give the severity and the message, but then I
can also add a source position, so that the report contains a reminder
of the source code, with the exact position highlighted. “Would you like
to highlight some source?” “Yes” “Which one?” “Here, have this SourcePos
object”. Without optional arguments that gives: “Would you like to
highlight some source?” “No thanks” “Which one?” “Err wut?”.
Sure, I could have two versions of the method, one with the SourcePos
argument, one without. But then what if I have instead two arguments of
the same type that I would like to be optional? If I make a method with
one less, how do I know which one was omitted?
For sure we can do without optional arguments, but they can also make
life so much easier.
Lastly, I think about the members. Same example, instead of printing
directly a diagnostic, I want to store it in a Diagnostic object, which
will be probably used for statistics and printing later. If I don’t have
a SourcePos to give, what do I do? Invent an invalid SourcePos that will
not be printed later? That means inventing for each and every kind of
objects a way to mean “this one is invalid”. Or we could have a unified
proper mechanism: nil.
Sure, I can think of ways to do without: have the Diagnostic class
contain no SourcePos, and a child class DiagnosticWithSourcePos contain
one, and by magic of dispatching, one would print its source and not the
other. Now suppose I have 10 similar optional members. Should I really
derive 2^10 children classes? I think not.
In my previous example of the Class AST node, in which we add a bunch of
information later, it might be indeed a cleaner design to have a derived
class, because in that case they’re not really optional, they are just
“not there yet”. But once there, they will most likely be all there,
and we can do without nil-checks.
“Optional” should really mean optional. Since it does require special
handling, it should be used only when really necessary.
For all the rest (non optional references), we can force initialization.
Period. That’s a good practice anyway. It will mean that you will have
to gather all the elements before grouping them together in an object.
But once an object is made, it is guarantied to be full.
If you use a custom init, the compiler checks that all members are
initialized. If you use the default init and the with member = val construct, the same check goes there. No mercy.
end
As I recall, I longly pondered about how to check for presence or
absence of an optional object, and how to cast an optional to a
non-optional.
It’s not that hard. We can decide that the only way to de-optionalize an
optional is conditional statements:
as in if and while constructsorNo message can be sent to an optional, it has to be verified first, and
in case it does have a value, this value should be put in a new name.
-- opt is an optional Object
opt.dothing -- ERROR
if opt as value then -- value is of type Object
value.dothing
end
value = opt or Object() -- if opt is non-nil, value gets it,
-- otherwise the second branch
This means the conditional statements can take either:
Nothing else. In case of an optional, the variable in the “true” branch
will be casted to a non-optional. Sure, that requires using a new name,
but it makes sense. The fact that you can’t do anything with an optional
(except casting it into a non optional) mirrors the fact that it would
be unsafe to do so anyway!
nil, or optionals, are also a way to catch errors. And dealing with
errors is important enough that it may require additional typing. For
instance, typecasting may return nil, if the cast (which can serve as a
test as well) failed:
vehicule = Vehicule()
maybe_car = vehicule to Car -- this returns an optional
if maybe_car as car then
car.honk
end
Of course that can advantageously be combined into a single statement:
if vehicle to Car as car then
-- car is a real Car
else
-- well, vehicle is not a Car
end
Same for results that may be nil:
if mytext.match("pattern %w+") as thematch then
thematch.print
end
It seems like a lot to type, but in Lua you would have to deal with
nil too anyway, otherwise you risk a runtime error of sending message to
nil:
local thematch = mytext:match("pattern")
thematch:whatever() -- hey, forgot to deal with the nil case!
-- if it didn't match, runtime error!
The fact that sool forces to use optionals in the if construct and
name a new local for the result is just one step further than Lua where
you don’t have to, but any good code needs it anyway.
And, well, you don’t even have to use them right away, you can store
them in a temporary optional. But you will definitely need to rename
them once they’re casted into a non-optional:
opt1,opt2,opt3 = iReturnThreeOptionals()
if opt1 as a then
a.yay
end
Finally, you can use optionals in boolean expressions even if you don’t
gather their value:
if opt1 and opt2 then
"haha".print
-- still can't use the values of opt1 and opt2, even if
-- logically, we know they're both valid
end
So, yes, it might make some syntax a wee bit heavier, but in the grand
order of things, it’s for the greater good. Optionals and nil are
serious matters. In C/C++, dereferencing NULL makes the system shut you
down immediately and without mercy. In Lua, which runs on its own
virtual machine, it’s caught, but the sentence is the same: immediate
shutdown. And the fact is that since these errors happen at runtime, you
don’t see them happen until they do, which can depend on input data, and
is therefore more difficult to debug.
If we manage to design a system in which there is no such thing as NULL
pointers, or rather, where the validity is enforced at compile time by
the type system, well, maybe the programming work-flow will get improved.
Be forced to be tidy and organized from the start instead of just
throwing sloppy code and see if it works.
I don’t know, but it sounds like a good idea.
The C# syntax of using ? seems obvious. A question mark for something
unsure is definitely meaningful, and it’s one of the few tokens left.
Where to put it is another question:
class Meh
-- after the type
num? somenum
-- after the name
num somenum?
-- for return values it doesn't change much
method text?,blob,blob match(text pattern, blob? start) end
-- but for arguments it does
method text?,blob,blob match(text pattern, blob start?) end
end
One important thing to notice is that it qualifies the variables or the
expressions (which are equivalent internally to temporary variables),
not the values or objects. You can’t have an allocated object that
contains the information “I am actually nil”. The info is in the
variable.
Of course for value types, the distinction is less clear, since the
entire value is contained in the variable itself. But conceptually, the
optional status is part of the variable, not the value.
If also means that you can’t use optionals as template arguments. Can’t
have an “Array of optional numbers”. And that’s good, because having a
suffix ? in the type declaration would be syntactically annoying. If
you really need containers of optionals, you must box them into a struct
or object. Templates are instantiated using class names, not types.
Attaching the ? at the end of the type seems more logical. It mirrors
exactly the type signatures and method signatures (in which the argument
names disappear).
nil keywordFinally, we get back the generic and unique keyword nil that works
with every type (provided it’s optional):
method foo(Object a, Object? b)
a = nil -- ERROR, "a" is not optional!
b = nil -- fine
somebool = (b == nil) -- ERROR, optionals answer to no method!
somebool = (b is nil) -- that could be allowed
somebool = (b is a) -- that shouldn't hurt either
end
Since the is operator is meant for testing the references, there is no
dereferencing, only comparison. In theory, the optionals should be
casted back to non-optionals, and only in the success branches could
their value be accessed (and compared). But it still would be safe and
much nicer to replace
method foo(Object obj, Object? opt)
if opt as obj2 then
if obj is obj2 then
-- they are the same
end
end
end
by:
method foo(Object obj, Object? opt)
if obj is opt then
-- they are the same
-- technically, we still can't do anything with opt,
-- but we know obj is the same, so...
end
end
That only implies that the compiler does the glue between the
representation of an optional reference and a real reference. Which
brings us to:
Soooo, we’re back to adding a nil value to each variable type. A
consistent and simple way is to stick a boolean to each, and use it to
mark the variable as nil or not.
But of course, we know there are more efficient ways to deal with this.
As long as it’s hidden in implementation, anything goes. References can
obviously use the address 0 as a nil value. Double precision numbers
have a very big range of unused values (the NaNs), out of which we can
pick one to be nil (we just need to be sure that normal operations won’t
generate this particular NaN). Booleans are probably going to be bytes,
so plenty of room there. The only sensitive one is the blob (aka opaque,
aka unsigned int), in which every value is normally valid. For this one,
no choice, we have to either reduce its range by one bit (or one value),
or add a boolean to it.
This is mostly detail, except we’ll have to be careful with it when
writing the foreign function interface. The C API should define clear
functions or macros to produce or compare these values. And as always
with FFI, C functions should be kind enough to return the correct type,
even if there will be built-in dynamic type checking on the sool side:
basically every pointer that comes from C is assumed to be an opaque
blob, and it is dynamically type-casted back to the sool declared type.
You can always fool the system, but that should prevent accidental
mistakes at least.
init (eithernil. That way, we know that all pointers are alwaysnil to anas Nameor operator, and will be of theisnil literal.Well, I’m fairly happy with that new nil system. Hopefully it won’t
come back to haunt me later.