Starting an open source project

The free and open source software ecosystem is a rough, harsh place. Lots of initial work has to be put in to ensure your project is successful, the conditions need to be just right to get third-party contributions, and often you still need a thick skin to handle the conflicts that inevitably arise.

But as both those who contribute and those who maintain projects themselves know, it’s a labor of love. As a long-time supporter of many projects, I myself am willing to accept the risks and launch a new project of my own. I have been working on building a data-oriented game engine in C++11 for a few months now, and it has just recently seen a fully-fledged port to Rust. I thought I would share it with the world and have it be developed in the open.

Enter Amethyst. This is a work-in-progress game engine written in Rust that aims to be both data-oriented and data-driven, taking heavy inspiration from the industrial-strength Bitsquid engine (now called Autodesk Stingray). There are plans for an entity-component-system (ECS) architecture and a strong emphasis on modularity (e.g. multiple graphics API backends for the renderer, easy to bind to Lua/mruby/Python for scripting). Amethyst is in its early days yet, so don’t expect to be wowed. The most it can do now is transition between game states in a pushdown automaton design, and there is preliminary work being done on the renderer.

I have a few design documents up on the wiki, an unfinished online book, generated API documentation, a CONTRIBUTING file for people interested in helping out, and also a simple command-line client that can generate full-fledged game projects like this:

$ cargo install amethyst_tools
$ amethyst new mygame
$ cd mygame
$ amethyst run

I am also starting another blog called This Week in Amethyst on January 18th, 2016 that will detail the weekly changes and updates from the project as it evolves.

So what do you all think? Are you interested in helping out? Have you started an open source project and have some wisdom to share? Leave me a reply in the comments below.

Library Review: SFML

Visit SFML's project page

Hello everybody and welcome! I decided that I will review a very, very useful cross-platform library that I have been using often lately called SFML, which stands for “Simple and Fast Media Library”. For those who don’t know, SFML is a game library (at version 1.6 at this time of writing), which is a collection of C++ functions that can aid you in making games, and is similar in spirit to another more mature game library called SDL (“Simple DirectMedia Layer”).

Let’s say that you wish to create a sidescroller like Mario, for example. Instead of researching deeply through the net and going into the nitty-gritty of setting up the window and coding unimportant (but complex) components, you could simply bundle SFML together with your project’s code. SFML can take care of playing the sound effects or video cut-scenes, displaying textures and loading game maps, interacting with OpenGL for 3D graphics, etc. while you focus on actually writing the game logic itself.

❗ NOTE: SFML is not a game engine! It is a bit more low-level than that, and it does not include any drag-and-drop editors or media creation tools. It’s purely source code, and you are expected to already know how to program in order to use it. However, it  is powerful enough that it could actually help you create a game engine of your own.

In this review, I will go over the features of the library and explain what it can do. I will also supply an example C++ snippet that demonstrates how to initialize SFML, along with step-by-step explanations of what the program does and how it works. I will finish by outlining SFML’s pros and cons, summarizing my overall impressions, and telling you whether it is worth being in your toolbox as a programmer.

Read more

Game engines: What they are and how they work

Featured image: Crysis Expanded Mod

Most people are familiar with the following video game titles: Battlefield, Halo, Doom, Civilization, Call of Duty, Half-Life, the Sims, and Unreal Tournament. Chances are, you may have seen the term “game engine” associated with them, but don’t really know what the term means. Perhaps you know what game engines are and think you have what it takes to write your own? In either case, I will introduce you in this article to the wonders of game engines and attempt to explain their internals as simply as I can. I assume that you, the reader, is familiar with basic programming parlance. If not, you might not understand everything I’ve written here.

Basics

A game engine is essentially a software development kit (SDK) that contains the source code and tooling necessary to get a basic video game up and running fast, letting the developer script in the gameplay, levels, and characters, without needing to touch a single line (or at least, much fewer lines) of C/C++ code or know advanced programming.

This allows the game developer to focus more on the gameplay and the “fun factor”, spending less time on complex math and other mundane boilerplate trying to get everything set up. This is analogous to an automobile designer selecting a ready-made engine from a trusted third-party vendor, eliminating the need to build a custom engine from scratch and therefore saving time, money, and effort.

Read more

Want to write an operating system?

There are people who live to make things. Some make cars, some make weapons, some make awesome Tesla coils, but have you ever heard of people who make full-blown operating systems for fun? Chances are, you probably haven’t, but there are indeed many programmers who are itching to take on such an extreme hobby.

Introduction

Operating system placement.svg
An OS is a low-level interface between the hardware and you, making the computer simple to use and program for.

Firstly, what is an operating system in very simple English? An operating system is, in theory, a relatively simple concept to understand. Naturally, it all begins with the computer itself: monitor, tower, mouse, and keyboard in all their glory, which is the hardware. But akin to any human being, no physical body can function on its own; it requires a conscious mind to operate it. This is where the operating system comes in.

In the simplest of terms, the computer hardware is a digital device, meaning each transistor on the motherboard can only process two values: 1 and 0 (otherwise known as “true” and “false”). Programs at their lowest level are written in binary “machine code”, or strings of 1’s and 0’s. When you execute a program, a stream of machine instructions are sent to the CPU which then proceeds to read them and loads up the program into RAM.

[The operating system] acts as a layer between the hardware and you, translating clicks of the mouse and taps of the keyboard into binary so that the computer can understand, as well as making sure that all the programs running are coexisting peacefully and not stepping on each others’ toes all the time.

When system developers write components for the operating system, they make use of assembly language, a low-level CPU-specific language which uses short human-readable 3- or 4-letter commands that directly translate to specific bits of machine code. Naturally, it’s a lifesaver for the purposes of writing the OS, but it is not robust, portable, and intuitive enough to use as a generalized programming language.

In order to make life easier for both users and programmers who do not want to deal with machine code directly, there is usually an operating system installed on the computer (such as Windows, Mac OS X, Linux, BSD, etc) which acts as a layer between the hardware and you, translating clicks of the mouse and taps of the keyboard into binary so that the computer can understand, as well as making sure that all the programs running are coexisting peacefully and not stepping on each others’ toes all the time.

Read more

Better WPF tab controls, anyone?

As my first post (w00t!), I’d like to give a shout out (and hopefully direct some traffic) to a great project going on at CodePlex for some time now: FabTab. These guys have been developing a wonderful replacement for the stock WPF tab control for some time now, and since I like to use it, I thought this would be a nice first post to repay them. It’s got tons of improvements, including a built-in “Close tab” button, an Internet Explorer-esque “QuickTab” capability, a tab list, real-time pop-up thumbnails, badass animations when switching between tabs, drag-and-drop tab reordering, and lots more. I’ve been using it for a while and I love it!

If that sounds pretty good to you, and you’d like to learn more or download this library (as a *.dll to link with your application), you can get it at their project page at CodePlex. Below is a screenshot of the example program in action, and it’s pretty epic.

Anyway, I think that the FabTab library is great, and I give major props to the devs. 🙂