Finally some code

This post is part of a series where I’m documenting my experience building an ECS game engine from scratch. Check out the homepage for this project for more posts, information, and source code.

Image for post
Image for post
It really is that simple!

As promised, I’ve built a barebones version of the Nomad game engine to share as an example built upon the blog posts in the series. I’ve also put it up as a conan package, which should allow for easier prototyping using the entity component system engine.

I was a bit hesitant to release code in the first place — I’m worried that having code will lead to people skipping over the blog posts and just copying the code from the repo. At the end of the day people are likely doing this anyway, so for the many of you who emailed asking for snippets of source code, here it all is in full glory! …


Image for post
Image for post

If you were worried that I’d leave the topic here, fret not! I’ve still got a lot of goals with both my game engine and this series.

Fleshed-out examples

Image for post
Image for post
The first game I go over in the blog posts will likely be our space shooter

Many ECS explanations online (including mine!) tend to explain simplified concepts that make composition seem like the easiest and most logical design pattern ever. Unfortunately, when it comes to actually implementing even a simple game, the devil is often in the details and ECS design can quickly become difficult to reason about.

To try to combat this, I’m in the process of creating an open source and simplified version of Nomad to accompany this series. The goal here isn’t performance (although it might come up), but instead to conquer the more difficult conceptual challenges with game design using ECS. …


This post is part of a series where I’m documenting my experience building an ECS game engine from scratch. Check out the homepage for this project for more posts, information, and source code.

Image for post
Image for post
Current state of Nomad (debug mode)

If you’ve made it this far in the series, well done! At this point I’ve covered everything that I think is necessary to start playing around building an ECS for yourself.

As I’ve stated before, my goal with this series was to fill a perceived lack of intermediate-level explanations of how to build an ECS — while building my own. I’m sure a lot of it could be explained better, and if there’s any confusion anywhere don’t hesitate to either shoot me an email (niko@savas.ca) …


Inter-System communication

This post is part of a series where I’m documenting my experience building an ECS game engine from scratch. Check out the homepage for this project for more posts, information, and source code.

Up until this point, we’ve almost got a working game engine — we have entities with components and systems acting on those components. This blog post will outline one of the last significant parts of a functional ECS — the event system.

Image for post
Image for post
Our space invaders game (assets: Kenney)

To illustrate the need for an event system, we’re going to construct a super simple game based on space invaders. Here are some quick requirements:

  • Spaceship can move side to side using the arrow…

A look back at McMaster Software Engineering’s 2018 Kipling prank

Image for post
Image for post

The night before the Ritual of the Calling of the Engineer, each engineering faculty at McMaster University sets up a prank for the rest of the school to enjoy during our special day. Past pranks have included building a bridge on campus, a maze, and a water fountain. Each faculty creates a prank that fits in their field of study, generally making nerdy jokes and showing off some of their building skills.

The coolest pranks in past years have typically been civil engineering ones — they build things that everyone on campus can appreciate and are usually very visible. In my years at McMaster, software engineering’s Kipling pranks have been lackluster, primarily due to them being pretty niche and only understandable by other engineers. …


The engine’s glue

This post is part of a series where I’m documenting my experience building an ECS game engine from scratch. Check out the homepage for this project for more posts, information, and source code.

I’ve gotten a few messages from readers about how parts of the engine fit together. In a theoretical way, we’ve already covered this, but when it comes to the practical code, there is a missing piece — the world.

Image for post
Image for post

The world is (mostly) a nicety that we’re applying to ECS (similar to the handles that we added in a previous post). …


My last post was almost 3 months ago… Yikes.

This will be a quick post to update on some general life stuff. If you’re reading this to get info on the next ECS posts, rest assured that the next one is sitting about half finished, and will be my first priority.

The main reason I haven’t posted recently is because a lot has happened in the last few months and I needed to narrow down what I was spending time on, which unfortunately meant putting blog posts on the back burner.

So what has been up with me?

I finished school

Image for post
Image for post
PC: Jimmy Wang

I just finished my bachelors in Software Engineering at McMaster University. I may end up making a separate post about my experience in university — I’ve made some amazing friends, had an amazing experience and learned a lot. …


Finally some game functionality

This post is part of a series where I’m documenting my experience building an ECS game engine from scratch. Check out the homepage for this project for more posts, information, and source code.

After a bunch of posts on theory, we’re finally ready to touch upon the part of the engine where the actual gameplay code goes. If any of the terms in this post are confusing, check out these two posts for a good overall picture of the engine architecture:

Our goal this post will be to make a very simple system: the Movement System. …


Prepare to have your socks blown off

This post is part of a series where I’m documenting my experience building an ECS game engine from scratch. Check out the homepage for this project for more posts, information, and source code.

Almost all of the things I’m going to share with you were taught to me in this blog post. A lot of my post is really superfluous if you’ve already read the post. I’m making this post for the sake of continuity in my code, I don’t want to be missing a section of my tutorial series. …


Optimizing data storage

This post is part of a series where I’m documenting my experience building an ECS game engine from scratch. Check out the homepage for this project for more posts, information, and source code.

In the next couple blog posts, we’re going to take a dive off the deep end. I’ll leave this as a warning here: none of this is actually necessary for an ECS. The performance difference in the vast majority of games will be negligible and it ultimately adds a lot of complexity to the inner workings of the component manager. If your goal is simply to build an ECS and get it working, skip the rest of the 4.x …

About

Niko Savas

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store