Project Origin #01

Many years ago, I had an idea. Not many people have heard about it, but I now feel ready to let the world know. As you’ve probably guessed, it’s a game. A huge, epic game. A game that lets you control your own human population from the very beginning of human history, to the end of our current era and beyond.

Being a massive fan of management and city-builder games, one thing has always bothered me. You’re never given the opportunity to create your own personal, intimate settlement. One where you decide architecture style, what laws to follow, religious believes and culture. All the factors that differentiate populations around the world are usually already defined. You’re left with a plot of land where it’s up to you to build skyscrapers as fast as possible.

Well, what about the small, but strong communities? The ones where you have a personal relationship to the mayor and the guy running the local grocery store? You’d think there was one game that let you build a massive empire, or just a farm in the outskirts of that empire if that was your thing. A game giving you a whole world as a sandbox. There’s no shortage of that last one, but those usually only let you build block by block. I’m dreaming of a game whereas I’m able to rule a whole kingdom one moment and taking a break from everything because I just felt like making something small and personal. Where nothing’s off limits. I can create anything regardless of how large, or small it may be.

Introducing Project Origin. A game where you start of by managing a small population in the stone age and help their development throughout time. Any management aspect is available for you to take fully control of. My admittedly highly ambitious project which I’ve been developing for the last 3 to 4 years, and I’m finally going to tell the world about it! This idea came to me a few years back while at work. I was employed at the home care services, driving from home to home, usually taking care of elderly people too healthy to stay at a care facility, but still in need of help. I often worked 7 days a week and spent what little time I had left hiking or playing games with my friends. At work however, I spent much time in the car alone with my thoughts. I’d often ask myself what was next. What am I to do with my life? I had two passions: Software development and gaming. This naturally eventually led me on the path to game-development.

On a sunny, but cold Friday while on my morning round, it suddenly hit me. This game which would combine all the best parts of my favorite games: Exploring the human history like in Empire Earth and Civilization. Having a simple, but beautiful art-style like in Legend of Zelda (2D games), Stardew Valley and Kingdoms and Castles. Being able to customize buildings like in Sim City (2013) and Stonehearth. Advanced governing like in Urban Empire. A simple, but tactical combat system like in Advanced Wars. Smart and creative game-mechanics like in Factorio and Don’t Starve. All while maintaining a limitless sandbox, like in Minecraft and Terraria. Is such a big game even possible?

I’ve been wondering about that for many years, designing one game-mechanic after another, getting closer and closer to a solution. Then it finally hit me. What if the game wasn’t made using 3D models and realistic graphics? Like most indie developers I eventually realized that I must shrink the project down to a realistic goal. Being unwilling to get rid of game-features, the only choice left was to decide upon another art-style. Pixel-art. The go-to choice for indie-games. Reusable, modular tile-sets. This is genius, I thought to myself. This will allow me to start developing the game immediately, and so that’s what I did. But before we get to the fun part, we must first prepare.

Welcome to the development blog-updates of Project Origin. Stay tuned to learn more.

How to install Oh My Zsh

Good, you’ve decided to start using Oh My Zsh. You’ll quickly find yourself navigating the command-line with breeze, but enough chit chat. Let’s get to work.

If you’re using Windows, make sure to install the bash shell first. See our guide to installing UNIX Shell on Windows before continuing.

First you want to make sure zsh is installed on your computer. In your command-line, run

zsh --version

This should display something like

zsh 5.1.1

If not, you need to install zsh by running

sudo apt install zsh

Now it’s just a simple matter of installing Oh My Zsh. This can be done in two ways, either with Wget or Curl. Use the method above to check if you have a version of either one installed. Now you’re ready for installation.

Install via Curl:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

or install via Wget:

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Great! Now it’s as simple as typing zsh in the command-line to run the shell. Before we let you go wild, it might be a good idea to look at some of the cool features that comes with Oh My Zsh. Please visit their Github page for more information.

Until next time, keep coding.

Oh My Zsh!

So you’ve gotten to know the command-line. You’ve felt like a true hacker and thrown away the mouse long ago. Or maybe not. One thing that always bothered me while using the command-line on my MacBook, was the lack of information given on datatypes. It was just plain text regardless of whether it displayed a directory, an executable or just a simple file. You might be sitting there in front of your Linux computer smirking right now, but most of you are probably thinking “I never knew there was a way to make the command-line better”. Well, there is and thy name is ZSH.

Like bash, zsh is a UNIX shell. Zsh however adds many great features for making your time with the command-line easier. It gets even better. There is an open source framework for zsh named Oh My Zsh which lets you customize your command-line with themes and shortcuts. Say you’re in your Home directory and want to cd to Downloads. It used to be that you had to write three letters before you could tab, because Desktop and Documents share their first letters. Not anymore. Now all you need to do is type cd d and tab your way through. You can even use your directional keys.

As you can see, the directories have now been colored to differentiate them from files. The long address and name has simply been replaced with an arrow, followed by a tilde to let you know you’re in the Home directory. You might also have noticed that I only had to enter ll to get a long list. This is because Oh My Zsh comes with many shortcuts pre-defined. These are only a handful of features that’ll make you even more proficient at using the command-line. Please see our guide on how to install Oh My Zsh to start using it now.

Until next time, keep coding.

Install UNIX Shell on Windows 10

So you want the benefits of running the command-line interface on a UNIX based system, but won’t switch to Linux or macOS? Luckily there’s a solution. It used to be that you had to install a UNIX-like environment like Cygwin. UNIX-like meaning it simulated a UNIX CLI (Command-Line Interface), but was restrained to only work within Cygwins’ own sub-directories. This not only meant that all your code had to be inside a Cygwin directory, but more importantly, no zsh shell.

Fret not, those days are over. Now you can choose to get a Windows subsystem for Linux. As of February 2018, this is a completely new feature so be sure to tell your friends, family and colleagues. They might not have heard of it. Now, lets get to work.

  • Open PowerShell as administrator:

  • Run the following line:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  • Restart the computer when prompted.

For this next part, you need to make sure you’re running Windows build 16215 on newer.

  • Go to Settings > System > About and look for OS Build:

For earlier versions follow these instructions using lxrun.

  • Open the Microsoft Store and choose your favorite Linux distribution. We went for Ubuntu.

  • Once the download has completed, select “Launch”.

This will open a console window. Wait for installation to complete then you will be prompted to create your LINUX user account.

Congratulations, you’re good to go! You can even run bash and zsh shells in your Windows Command Prompt, but don’t expect it to look as nice as on Linux and macOS. Remember to install Oh My Zsh, it looks way better. Installation guide can be found here.

If you at any point had trouble during this guide, visit the Microsoft guide.

Until next time, keep coding.

What is a Terminal/Shell?

If you’ve already had a go at programming, there’s a good chance you’ve familiarized yourself with the command-line interface (CLI or Shell).

This is an example of the macOS CLI, Terminal.

Command-lines are the most powerful tool you have on your computer. It allows you to go places and do stuff otherwise not allowed. The reason why programmers are introduced to command-lines in the first place is usually because they have compilers built into them. A compiler is what translates your code into instructions your computer can understand and run. We won’t go into detail on compilers right now because Python, our current language of choice, doesn’t need to be compiled. You only need to create a python file like so:

test.py

Then, using the bash (the most commonly used shell), you navigate to the files’ location and type

python3 test.py

The shell will now run your program like a charm (that is, provided you’ve written flawless code). Visit codecademy to take their course on using the command-line for free.

When you get really familiar with the command-line, you’ll find yourself writing scripts to automate tasks on your computer. Let me give you a real world example: A few weeks ago I decided to move all my personal pictures onto one computer. So I’m sitting there looking through my MacBook Pro, discovering that the iPhoto app has stored all the pictures of my old iPhone. Problem was that iPhoto had a really bad way of storing these. Inside a directory named “Master” there was three directories: “2013”, “2014” and “2015”. All seems fine, right? Well, I went on and to my horror, discovered that there were about ten sub-directories inside each of these three directories. You’re probably thinking “thirty folders containing pictures? It could’ve been way worse.” and you’re right. What if I told you that each single one of these directories contained about a hundred more? Well yes. It turned out that iPhoto had made a directory for each day a picture was taken. Lets say I’d taken a random picture on an uneventful day. iPhoto had now made an entire directory only for storing this one picture. As you can imagine, this would’ve taken well over a day to go through. I however wasn’t about to waste a single hour doing this.

“What makes the greatest programmers is laziness”

Entering the bash-scripts. Remember when I told you how powerful the command-line can be? Being a programming wizard lets you make sets of commands for the shell that can do anything you want! You can probably see where this is going, but before I reveal my magic trick, let me drop a little knowledge on you. What makes the greatest programmers is laziness. What would make me say that you ask? A lazy programmer never repeats his code. He instead writes code that can be used over and over again. Code designed with reusability in mind. Code like that usually takes more time to construct, but ends up leading to less work further down the line. In my case this meant writing a script that could go through every sub-directory of Master regardless of name and size. So after sketching a quick flowchart, I got to work.

My script would look inside the Master directory to see if there was any directories within it. It would then look inside the first one, in this case the 2013 directory, to see if there was any directories inside. It would keep on doing so until it was at the end of the line. Now it looked for any picture or video file. Prior to running this script I had made a directory in my Home directory and designated it as the target destination, meaning that any time my script discovered any media files, it would move them to this folder. When the directory was empty, it jumped out and deleted it. Now having a new “first” directory it would just repeat these steps until it had gone through every single directory inside Master, deleting the sub-directories in the process.

This probably took some time considering there was well over a thousand directories to go through, right? Well. Do you still remember the “powerful part I mentioned? I’ll proudly have you know it only took about two seconds for the script to complete its task. Admittedly the files were only moved to a new location on the same storage device, but I think we can agree that two seconds’ still amazingly fast for this amount of media files. So that’s my tale of how I turned a day’s work into thirty minutes using the command-line.

So, in conclusion, learn how to use the command-line as soon as possible. It’s a must for every programmer. Knowing it, and how to write shell scripts gives you limitless control. This is my awesome, but potentially highly dangerous bash-script

#!/bin/bash

startDIR=$(pwd)
DIR=$(ls -d */|head -n 1)

while true; do
    if [ "$(ls -A */)" ]; then
        cd $DIR
    else
        if [ "$(ls)" ]; then
            if [ "$(pwd)" == "$startDIR" ]; then
                break
            else
                mv * ~/Pictures/
            fi
        else
            cd ../
            rm -r $(ls -d */|head -n 1)
        fi
    fi
    DIR=$(ls -d */|head -n 1)
done

Until next time, keep coding.

Learn how to use the command-line at codecademy.com

Hello World

This is Casper at Community Games coming to you with a brand new blog. Isn’t that great? Some of you might already have seen the wiki page on Github that was posted yesterday, but it became apparent that it was going to be troublesome to document the progress and tutorials on Github. Don’t worry, you’ll always be able to track the code progress of every project there. The reason we decided to establish a blog was to communicate and teach in a sensible way. This blog is going to look a little ruff around the edges while we get things set up, so don’t worry if the theme has been changed since the last time you visited. As you can see, we decided to go with a dark theme to better resemble our preferred way of working when programming. If you find yourself full of ideas to improve this, or other aspects of Community Games please feel free to leave a comment. The email system is being worked at and won’t be up and running for a little while. Therefore we ask that you leave a comment right here or on our Facebook page. Until next time, keep coding.