donderdag 1 augustus 2013

An Open Letter to Microsoft

Dear Microsoft,

First of all, let me make clear that I do not hate Microsoft, I have used, and still use, as a matter of fact, a lot of Microsoft products in the past, and am in fact writing this post on my brand new laptop which shipped with Windows 8. However, as a user of the new Windows 8 operating system, I would like to provide some constructive criticism, as I, like many other users and especially independent application developers, do not agree and cannot agree with the direction Microsoft is going with its newest operating system.

I do not have anything against the Metro interface in and of itself, although I do think it's not the right user interface style to use in a desktop environment, but that's besides the point. The point is, that the desktop is an open platform by design. You can - in principle - choose the hardware you're running on, install the operating system you prefer (or even multiple operating systems). In principle it would then be logical to be able to install any application the user would like to on that operating system. Although Windows has been criticized in the past, I do not think the freedom to install programs as you wish is among the most frequent of these critiques. Windows has always granted the user the right to install whichever programs he/she likes.

It looks, however, like this is changing with the most recent version of Windows, Windows 8, and especially with the Metro interface. Any developer who would like to publish a "Metro-style app", has to do this via the Windows Store platform. Even though the idea of having a centralized store for everything is not a bad idea necessarily, and might even work out to be a great idea, what a lot of independent developers like myself have a problem with, is the fact that developers are now forced to publish Metro-style apps through the Windows Store.

Although the users have still been given a compatibility layer called "The Desktop", this is obviously not the way you want developers to go. If you want developers, especially independent developers, who usually have very strong opinions regarding freedom and restrictions on digital platforms, to utilize the Metro platform, please do not force us to use the Windows Store as our publishing platform. 

We want to be able to choose our own means of distributing our applications, without the need for Microsoft having to review and certify them first, because that takes away the fundamental openness and freedom that comes, or used to come, with the desktop platform.


Yours sincerely,

Antonie Blom

zondag 10 maart 2013

Surprisingly Flawless

I think Pencil.Gaming deserves an update, because it's been going very well. The library works on Linux (both x86-64 and x84), Windows (x86-64 and x86) and Mac OS X, without any problems. The only thing I can do now really, is just adding some utilities (I've currently got utilities for audio loading, image loading and swapping the full-screen-y-ness of the window). I really want a model-loading utility (just .obj is fine), to make your life just that little bit less frustrating.

I've also added a post-build event which decompiles the project into CIL, replaces "callvirt (delegate function)" with "call (delegate function)" and compiles it again, resulting in a performance gain of up to 10%.

I think the project is already stable enough for a first beta version, if that was the way I wanted to go. I think I'll go for a rolling-release model, so I won't have to worry about versioning. And if that's the way I decide to go, then it's pretty much ready for use in pretty big projects! It's definitely stable enough to use in my next ludum dare project...

I will start working on a GLFW3 version as soon as I figure out how CMake works, since currently I've only managed to build a static library for it, which is quite obviously not what I want.

If do find any issues in the project, be it a mistake in the API, or an unstability on a particular platform, please tell me in the github repository (under the "Issues" section).

Stay tuned if you're interested!

donderdag 28 februari 2013

Pencil.Gaming - Because everything else is shit

That is a horrible title for a first blog post, so let me introduce myself properly first.

My name's Antonie (internet name: antonijn or antonijnb), and I'm a dutch programmer/game developer. I started my programming life with a language you might have heard of; it's called HTML. I stayed in the world of web-development for a couple of years, but decided I wanted to switch to application development, so I learned a language, you might have heard of it, it's called C++. After that I thought it might be cool to learn another language, so I learned C#, because that was also provided by MSVS. After that I learned Java, C, Assembly and Lua, but currently I do most of my programming in C# and C++ (mostly C#).

I wanted (and still want) to make games, just for the sake of making 'em, but I soon ran into a problem. Every gaming library for C# is shit. Let's examine the options:
  • Microsoft XNA
  • OpenTK
  • SharpDX
There might be some others, but these are the largest ones that I'm aware of.

Microsoft XNA is the framework I learned first, and I've used it quite a bit. At first glance it's a great framework; it provides solid support for graphics (both for easy 2D applications and the more advanced 3D stuff), audio and input, and is very extensive.

So why is it shit? First of all it requires the user to install a very large redistributable package, which is something I want to avoid (this was the main reason I switched to OpenTK). Secondly, it's designed as a framework relying on DirectX, and is therefore not designed to be cross-platform. Of course you have MonoGame, but that just doesn't "feel" as solid as the Microsoft implementation, and using "Microsoft.Xna.Framwork" classes for Linux and Mac, seems cheat-y to me.

Then there's the second library I tried (you can't really call it a framework): OpenTK. OpenTK is great in many different aspects, but is, just like XNA, flawed in two vital places. OpenTK fixes the cross-platform problem with XNA, meaning it allows you to write applications for Linux (my current OS, so this is a must) and Mac OS. It does require you to install the OpenAL redistributable package, but you can work around this fairly easily, although you do have to give up 64-bit support for it.

However, it doesn't feel as solid a library as XNA, mainly because it isn't. Some of the implementations just don't work for Linux and OS X. I had an issue with my ludum dare entry, where someone on OS X couldn't play the game because OpenTK didn't register keyboard input properly.

A more recent downside of OpenTK, is it's update frequency. OpenTK used to be very frequently updated, but the main developer (the_fiddler) mysteriously vanished somewhere last year, and as a result, OpenTK hasn't been updated in almost a year.

Then there's SharpDX. This one's easy. Not cross platform; bye bye SharpDX. I've worked with Direct3D in C++ a little, but never really looked into it seriously. OpenGL is the future.


So everything is shit at the moment. There are two possible solutions:
  • Choose a different programming language (Java, wink, wink)
  • Write something yourself (what Linus would do)
Well, I didn't choose the first one, since I just love C# too much, I don't care whether free-software fundamentalists will shout at me for it. I chose to write something myself, and I finally started it last weekend.

I have the ideas of what I want it to be. I want it to be:
  • Rock solid
  • Cross-platform
  • Small
  • Familiar to C++/C developers
So I just want to wrap a couple of C libraries, maximizing cross-platform capabilities.

This is also an aspect of OpenTK that makes it so shit: it tries to implement it's own windowing system. It's shit. It works great for windows, but if you try to do anything with your window other than opening it, you're guaranteed to blow your program up, or blow yourself up out of frustration.

The library will be called Pencil.Gaming (long story, I'll explain later), and will wrap the following libraries:
  • OpenGL
  • OpenAL
  • Glfw
And it will have some utilities that I'll implement myself. Not a lot of them, but enough to make your life bearable.

It will work, and in fact already works, for x86 and x86-64 versions of both Windows and Linux (I don't think it will work flawlessly on Max OS X, I haven't had the opportunity to test it yet), and will feature strongly types enums, like OpenTK does.

I've simply copy-pasted the GL class from OpenTK, and changed it around a bit to match my way of OpenGL function loading (I'm using glfwGetProcAddress instead of OS-specific functions), but have implemented GLFW and OpenAL support myself.

There's no need to install any redistributable packages as far as I'm aware, and you should currently be able to create some pretty advanced games with it, although sound will only work on Linux as far as I know.


So if you're interested, here is the source. The binaries can be found there too. It's way too early for testing yet, and you can't even call it alpha at this stage in development, but it's there, and it kind of works.

The github repo also has a wiki page, where you can find some more info about GLFW. The standard README.md also provides some sample applications.

Expect more updates on it soon!