Learning to Code

Executing Your First Code
Deciding which programming language to learn is often the most difficult decisions to make. C++? Java? Dogescript? Learning to program is 90% about the principles and 10% about the languages, so don’t stress about which one you choose.

Granted, there are languages that are more difficult to learn than others. While something like C++ is ultimately where your journey will take you, it’s also well known for its steep learning curve. Beginners often find that Python is more intuitive and paired with the great crash course over at Codecademy, you’ll be writing your first hello world program in minutes! The best part about Codecademy is that you can write code directly in your browser without having to install and setup any software. Once you’ve completed all the courses at Codecademy I recommend reading “Automate Boring Stuff With Python” which gives a more indepth look at programming in Python.

Adding Complexity
Now that you’ve taken these first steps, you’ve probably got a few projects under your belt – perhaps you’ve even programmed an automated light display for Christmas. While I’m sure your neighbors will be jealous when the holidays roll around, let’s apply your new skillset to something a little more substantial – making games. The most important concept that you need to understand is the game loop which is the beating heart of every game you’ll ever play.

So, you’ll want to grab Pygame which is a set of modules that will make writing games with Python easier. There’s a bunch of great tutorials on the website, but I recommend reading “Program Arcade Games” first. Once you start working on your first game, don’t make the common mistake of creating that complex role playing game you’ve been dreaming about for years; you won’t finish it. Instead begin with clones of classic games like Pong or Missile Command.


From there, just keep making games because as they say, practice makes perfect. You’ll start lots of projects that won’t even make it past a simple prototype. The important thing is that you’re gaining experience – one project may require path finding with A* and another may need an undo system. These little nuggets of information get added to your programmer’s tool belt and ultimately make you a better programmer.

It’s important to understand that as a programmer you aren’t just writing code – you’re solving problems. It’s also not about just solving the problem, but finding the best way to do it. One method may be quick and easy to write, but is it the most elegant solution? Code organization and structure is crucial to becoming a successful programmer. Poorly designed code will not only make your job more difficult, but also create serious problems for your co-workers.

Honing Your Skills
If you need some inspiration, game jams are one of the best ways to churn out projects. Usually you’re given a theme and a time limit (typically 48 hours) to make a game from scratch. The details often vary from jam to jam, but the purpose remains the same – to make games among others that share your passion. You can often find game jams near you by asking around, but here are a few that I recommend checking out:

  • Global Game Jam is the world’s largest game jam and happens once every year. Participants gather at various locations around the world to watch a keynote where a secret theme is announced. Once the clock starts ticking everyone pitches ideas to each other in order to form teams.
  • Ludum Dare runs every April, August, and December. There are two components to Ludum Dare – the Compo and Jam. The Compo is “classic” Ludum Dare, which is done solo and has a strict set of rules. The Jam rules are more flexible and allow you to work with others. Unlike the Global Game Jam, you don’t have to meet your teammates at a physical location. Instead you can work from the comfort of your own home!
  • One Game a Month is a monthly event that has no rules. If you want to make a game, then you’re ready to go. The main benefit here is that you will have a community to provide feedback on your games as well as emotional support.

The topics I’ve covered here are just the tip of the iceberg. If you’re still hungry for knowledge, there is a huge collection of free ebooks available on Github. Make sure to stay tuned for future posts!

This article was originally posted at www.filamentgames.com/blog

2014 Year In Review

Even after spending a few days attempting to transcribe my feelings and emotions, I still feel that this post doesn’t even come close to conveying how important this year has been to me. I traveled to two states, graduated from college, met a plethora of new people, hiked a 13-mile trail, visited the beautiful parks of Big Sur and Muir Woods, saw Linkin Park in concert, and finished two commercial games…just to name a few. It was an epic year of exploration, personal growth, and self discovery.

However, I think my decision to accept a job at Filament Games has been the most pivotal. While I’m quite excited to meet my new coworkers and create some awesome games, I’m also thrilled about moving to the mid-west and gaining the independence I’ve sought after for so long. It’s unfortunate that such a great opportunity also means that I have to leave behind my friends and family. No combination of words could describe how much I appreciate them. I am forever in debt for all of their love and support; I wouldn’t be who I am today without them.

While I learned many things this year I think the most import thing was that every choice you make should take you a step closer to your dreams, not away from them.

In other words, follow your heart and fuck the rest. 

New Year’s Resolutions

Well, its that time of the year again where I make some resolutions and try to stick to them throughout the next year, but first, let’s look at last year’s list:

Get a job or internship in the industry. While I didn’t get a job at a studio around here, I did manage to score a job at a cell phone repair shop with a friend. I worked there for a few months before I quit (on good terms, of course!) so that I could focus on new contract work with Bullet Proof Arcade. I really enjoy working with them and the new contracts have been keeping me busy, so in essence, I sorta accomplished my goal.

Finish more games. On my own, I finished one game – Caved In 2. Which I actually find quite depressing since I finished four games in 2011. Granted, this has been a busy and chaotic year for me so I didn’t really have as much time as I did in the past. On the flip side, I finished Full Auto Mayhem with BPA (so really, I finished two…but saying that makes me feel like I’m cheating).

Go through with #OneGameAMonth. Yeah, totally didn’t happen. I could blame this on many things, but I’m just going to say I got lazy and didn’t partake in the event.

Meet some devs at GDC this year. I met a few developers, but nothing really stuck. I think the thing I held on to the most was that I didn’t really need to go to school to get into the industry but many of the AAA studios preferred that I had one.

Finish school. I’m due to graduate in Feburary, but quite frankly, it was a disappointing experience. My main issue is that 95% of my peers could careless about their education, so group projects were a total waste of time. Granted, I learned quite a few technical things in my programming classes that I probably wouldn’t have learned on my own, yet I still feel like my experiences outside of class provided me with a better education. Oh well, now I have a piece of paper that says I’m a professional game developer. Awesome.

Resolutions for 2014

I’ll be honest, 2013 sucked for many reasons. In order to make up for a crappy year, I’m going to make 2014 as best as I can possibly make it! Here ‘s my obligatory list of goals:

  • Make more games
  • Move out on my own
  • Travel somewhere
  • Write more interesting posts on this blog
  • Budget my finances better and start putting away money into a rainy day fund
  • Continue juggling
  • Eat healthier and get out more


Caved In 2 – Post Mortem

 What is Caved In 2?


Caved In 2 is the sequel to the original game that I created for Ludum Dare #21. Since the original was created in such a sort amount of time, I didn’t get to fully explore the ideas I had for the game. The sequel is meant to fill in the gaps that the original missed, such as, a overhauled lighting systems, monsters, and power ups.

What Went Right

Hook, line, and sinker. From the start, the core mechanic was fun and addicting – digging around looking for ores and exploring the randomly generated caves. The addition of monsters and an overhauled lighting system really helped with exploration.

The sky is falling! Early in development, I realized I had an issue with continually pushing the player forward. Sure its fun just digging around, but I really wanted them to keep moving forward. Eventually came up with the integrity system. If you haven’t played the game, the integrity (represented by the percentage in the HUD) decreases with every block removed. The lower the integrity, the higher the chance a cave in will occur. The strength of each level gets weaker as you descend, making later levels harder.


Let’s slap some lipstick on this pig. A friend of mine also made a suggestion of different themes the deeper you get. I ended up adding three additional themes, however, it seems the majority of players barely get to the moss theme before rage quitting. Oops. In the latest patch I actually shortened the number of levels you must descend before seeing another theme.


To infinity and beyond. The original caved in suffered from too much procedural generation – generated caves weren’t interesting and they would be sometimes really weird layouts. I still wanted to have the almost infinite levels, but I also wanted to make sure I had more control over them in the sequel. After many iterations, I eventually came up with a ‘room stitching’ method. What the heck is that you ask? Basically, I designed a pool of “rooms” in Ogmo which were basically just all dirt room with hand-carved caves and a few manually placed props. I also gave rooms tags to determine what sort of content they contained so the game could decide what rooms it wanted to use. Then I used a script I wrote with AutoHotKey to stitch all of the rooms together into a single XML file. When a level is generated, it chooses a room and then randomizes all the dirt tiles with ores and rock, then randomly places items and monsters on open tiles.

What Went Wrong

Are we there yet? Looking back on when I first started Caved In 2, I realized I had started it almost a year ago! I had intended it to be a quick sequel, but I ended up getting stuck on making the game ‘flow’ right. I also had a lot going on this past year which got in the way and really slowed development. I basically spent the last 3 months working on the last 10%. But you know what they say, the last 10% is 90% of the project.

Getter done. I was a little to eager to finish the game and push it out the door, and as a result there were a few obvious things that I didn’t do. Most notably – alternative controls and a mute button (both of which I’ve added now). There were also some bugs that I should have tested for, such as the bonus points not being included with the score sent to the Mochi score board. Doh!

What a mess. I think this is something all programmers have a problem with for awhile – keeping the code base neat. Caved In 2 was started after my first game with Bullet Proof so I was in the process transitioning to a different way of organizing projects and how I structured my code. As a result, the source was had clashing naming convention and overall was just a mess. The last stretch I did before releasing the game was the worst as I had to got back to some very early code to make changes. Yuck.

Until the next game…

Caved In 2 Update

Today I pushed out an update for Caved In 2 (and also a hotfix) which adds and fixes a bunch of things! This will probably be the only major update – only planning on pushing out patches if something is broken.

– FIXED: mineral scanner not working occasionally
– FIXED: endless looping sounds
– FIXED: bricks affecting integrity
– FIXED: being able to place bricks on thermites
– FIXED: supports not working
– ADDED: mute option
– ADDED: effects toggle option
– ADDED: alternate controls
– TWEAKED: spider damage rate reduced
– TWEAKED: lower the required depth for level themes
– TWEAKED: increased spawn chance of spike traps
– TWEAKED: player is bumped out of caveins if only partially in the tile

Play Caved In 2

Level Generation

I love procedural content, especially when it comes to randomly generated levels. Not only are such systems fun to set up, but it provides almost endless experiences without having to tediously design a butt-load of levels (don’t get me wrong though, handcrafted levels made with love and care are also as fun to play). Of course there is a fine line between how much should be randomly generated and how much should be predefined. There’s a certain point where randomness becomes a little too random and detracts from the fun of the game. For example, in the first Caved In I took a rather easy route with level generation:

  • Fill the level with dirt.
  • Based on weights for each block type choose one. Then find a random square shaped-area in the level. This varies the tiles in the level creating deposits of coal, gold, water, and etc. Do this a few times.
    • For each tile in the square area, change the dirt tile to the chosen block based on a specified chance (if I remember correctly, blocks had a 30% chance to dirt). This ensures we don’t have square areas of tiles.
  • Find a random square-shaped area and change all the tiles to floor tiles, which creates (boring) caves. Do this a few times.

Resulting levels were “unique” each time but not very interesting because they lacked defining features or fun caves to explore. In Caved In 2 I’ve decided to take a different route. Instead of randomly generating the level, I broke it into four 12×12 tile “rooms”. The rooms are designed by hand in Ogmo by laying out dirt tiles to define caves and placing object spawns (such as loot, power ups, and etc).

A bare room designed in Ogmo.

The rooms are then compiled into a XML “room database” using a script I wrote in AutoHotKey. When the level is generated, it randomly chooses rooms and stitches them together to form the entire level. The dirt tiles in the rooms are then replaced with other tiles using a similar algorithm found in the original Caved In, although it’s been refined to provide a better spread of block types.

Same room from above in-game…although some gravel caved in above where I dug in.

In the end, levels are still randomly generated but provides me with a bit more control to help give the levels a more personal touch. In the coming weeks I’m going to be churning out loads of more rooms as I get closer to release along with more props and decorations. Stay tuned!