Daniel J. Petersen’s Devblog

Documenting my struggle to make a videogame.

Projects

I suppose the projects are in order from the ones I like the most to the ones I like the least, which means that they’re mostly in order from newest to oldest. I’ve strived to finish every project, or at the very least leave it with a good and working prototype.

It Always Ends In Nuclear War

Website

This is a pet project of mine that I’m always working on by default. It’s a 4x civilization building strategy game. I’ve been maintaining a gallery of almost every screenshot I’ve taken during development which can be found . The screenshots are all in order from oldest to newest.

My programming skill has gone up exponentially since I started this project, and my plans for what I’m going to do with it have also changed dramatically. It originally started out as my take on the game Civilization II, and I think most of the screenshots reflect that.

It’s built with C++ and SFML.


American Gothic in the Palette of Mona Lisa…

I stumbled across this post the other day and thought the idea was cool enough for me to try my hand at it. The task is to create a program which takes two images and attempts to recreate the second image by rearranging the pixels of the first image. I had a result I was happy enough with after about 3 hours of work:


Tetris / Tetris AI

I actually made Tetris twice. The first time I was still pretty new to programming, and it took me about 3 weeks to make. The code was a hot mess, but hey, it worked.

A few months later I entered into a 48 hour game jam contest. I decided to try my hand at Tetris again, and managed to finish it in about 9 hours. The code was a lot cleaner, so overall it was a pretty good improvement over my first try.

After I finished the base game, I had an important question to ask myself… What do you do when you have a functional version of Tetris? I guess you make a Tetris AI, because hey, that sounds pretty fun. It took me about 2 days to create. For an explanation on how it works, see this post.

Built with C++ and SFML


Game Of Life

This was one of the first projects that I worked on, but it also might be my favorite. I remember my father got us a computer when I was very young, and one of the programs that came bundled on the machine was It had two colors you could spawn, I think green and red, and I really liked placing the colors down and speeding the program up to see which color “won” (really just which color outlasted the other).

I wanted to replicate that with the version I was making, and I did so by allowing you to place 8 or 9 cell colors on the board. To make things more interesting, I made it so the color of any new cell born was the average of its three parent colors. This creates something akin to natural selection, it’s pretty fun to watch.

I made my own rudimentary GUI system for the program. There’s an option to speed up/slow the game down. You can also choose to place predefined interesting patterns that people have found such as the Gosper Glider Gun . You can also invert all the colors on the board, toggle the grid on / off, modify the rules, and well yeah, there’s a lot of options.

I revisited the project some months after completing it in order to implement an infinite grid. It’s really just a series of connected 800×600 grids which appear dynamically depending on where they’re needed. So it starts off with one grid, and if you click in an area where no grid exists, a new one will pop into the appropriate position. Grids will also appear if you have an alive cell on the edge of one of your grids. The memory gets freed up when a grid is no longer needed.

Built with C++ and SDL


Sins of a Hex Empire

This was based in large part on the game Hex Empire . The game is set on a randomly generated hex map, and you’re given the goal of conquering the capitals of 3 enemy AI. Scattered across the map are cities, which serve as the source of your armies — any city that you capture will produce troops for you each turn.

The name is a play on the game Sins of a Solar Empire. In reality my game has almost nothing to do with Sins of a Solar Empire, but I just thought it was a funny name.

The game has a fully functional AI that has actually managed to beat me a few times.

Built with C++ and SFML


Risk

I made what is in my mind a pretty nice clone of the game Risk. The AI could use some work, and I know that I could get it into a better state, but I’m happy enough with where it’s at. I started the project because I love the game Risk, and I wasn’t quite sure how you’d go about building it. Specifically, I wasn’t sure how you’d handle map creation, and I wanted to figure it out.

I opted to make maps .png files with an associated .ini file. The only requirement for the map images is that each territory must have a unique rbg color value. In order to define territories, you just provide an xy pixel coordinate for that territory in the .ini file. In practice this means that the .ini file has one line per territory, which looks something like TerritoryName = 4, 5. The game collects the colors present at each of the coordinates you specified, and uses that information to scan the .png for territory colors to figure out what territory is where.

Built with C#


2D Jumper

I was fooling around with Box2D one day, and I came up with an interesting mechanic for flying. It reminded me of the show dragonball Z which I used to watch as a kid, and I thought I should give it a go with making it into a small game. I liked to think of it as a mashup of DBZ and Super Smash Brothers.

Your goal was to knock the other player off of the screen, and you could fire energy balls or melee them in order to do that. Energy attacks would damage them and knock them back a bit, and melee would knock the other guy back based on how damaged he was. In order to melee, you had to fly into the other player — If he flew into you, the player who was traveling faster was the player that won. Flying and charging an energy attack ate up your energy, and energy only started to regenerate after a few miliseconds of not using any energy.

I implemented a simple AI for this. It had a state machine that changed states depending upon the context of what was happening in the world. I was actually pleasantly surprised to see how good the AI was considering that I put relatively little effort put into it.

I should mention that I eventually ditched Box2D for this, because what I wanted to do wasn’t that complicated, and I wanted to see if I could program the physics myself. I also had a (terrible) map editor up and running, too. The videos up top are from an older version where the AI / collision detection on energy weapons weren’t working.

Built with C++ and SFML


Happening Now

This is a website that was built as my final project at Dev Bootcamp. The site allows a user to search Instagram and select pictures/videos to stitch together into a longer slideshow/movie. Given that Instagram videos are a maximum of 15 seconds long, it seemed natural to allow users to stitch together videos into a longer cohesive whole.

Our team was Jack Dubnicek, Chris Prater, Tom Willis, Joe Wilmoth, and me. We were given a week to complete the project, at which point we had to present it in front of the school / a group of employers. It was a lot of fun working on it, truth be told.

I wrote a little more about the project in this post . Check out the Github Page for a list of technologies used.


Sudoku Solver

This was another project that I worked on while at Dev Bootcamp. It was actually the first group project that they gave us, and I think it was also one of the coolest. It was a console program – You’d feed it a string which represented an unsolved Sudoku board, and it output a solved board.

Built with Ruby. The team was Neal Peters, Chris Prater, Tom Willis, and I.


Drug Wars

The first program that I ever made was a console clone of the game Drug Wars. I barely knew what a function was, but I managed to make a fully complete and fun game. When I got a bit more experience, I decided to revisit the game in order to do it better justice.

So yeah. I spent about a week making this (and learning some C# along the way). I’m pretty happy with how it turned out.

Built with C#


Lunar Lander Clone

This was a project that I worked on for only two days, but I thought it turned out pretty cool. I wanted to learn the library SFML , and I also wanted to learn the library Box2D . I remember liking the old Lunar Lander game, so I figured that’d be a nice little game to use in order to get the hang of both libraries.

I learned quite a lot making this project, such as the need for a constant time-step in games and how to implement one. The video I used to show this off is a slightly older version of the game that has the thrusters set slightly too strong — I was trying to land in the green zone. Also, yeah, my Lunar Lander was the Tardis from Doctor Who.

Built with C++, SFML, and Box2D


Basic 2D Water

This was just a quick little program that I made by following a tutorial which I no longer remember the address to.

Built wtih C++ and SDL.


Flappy Bird Clone

Another one from Dev Bootcamp. There was a hackathon that they were hosting one weekend, and I decided it would be fun to go in and participate. I ended up working with Chris Prater and Dustin Fox, and we were given 6 hours to make something. We opted to make a clone of the game Flappy Bird because why not.

I think it’s pretty cool, although I don’t think anyone else will appreciate its beauty. It’s fully functional, but if I’m going to be honest, it needs a complete rewrite in a framework that’s not terrible. None of us knew Javascript at the time, and we opted to go with a game engine called Wade which is, again, terrible.

All the artwork was done by me except for the bird, which was done by Chris Prater. Such a beautiful bird, too.


Typing Terminator

Typing Terminator

Listen, and understand. That terminator is out there. It can’t be bargained with. It can’t be reasoned with. It doesn’t feel pity, or remorse, or fear. And it absolutely will not stop, ever, until Neal is dead.

My friend from Dev Bootcamp, Ian Bates, has lovingly gained the nickname of terminator. Neal Peters and I made this in his honor, with the wonderful gif of Ian provided by Eric Stensland. Full disclosure, the code for the speed test is taken from a site we found online.


Fox Overflow (Stack Overflow Clone)

This was a project I worked on at Dev Bootcamp. We were given three days to create something, and my group chose to make a clone of Stack Overflow. It was fully functional and in a pretty good state, but it sadly is no longer up online.

Built with Ruby, Ruby on Rails, Bootstrap, and I’m sure some other good stuff that I can’t remember at the moment. The team was Matthew O’Connell, Andrew Wittrock, Amara Getzell, and me.


Reddit Clone

Another project I worked on at Dev Bootcamp. I worked with classmate Chris Prater on this. We were given most of the day to create a clone of Hacker News, and we opted to create a Reddit clone instead. Given our time constraint, I thought we did very well. All the functionality you’d expect from Reddit was present here.

Built with Ruby and Sinatra


URL Shortener

This was another one of the projects that I worked on at Dev Bootcamp. I think it took a couple of hours to do, but it worked perfectly. I think it’s a good example of something not needing to be overly complex/time consuming to create in order to be useful.

Built with Ruby and Sinatra


Solitaire

I made Solitaire! Specifically, 3 Card Klondike Solitaire. I think the hardest part about this project was realizing I didn’t actually know the rules of Solitaire about halfway through making it. Other than that, it was a bit of a challenge getting it into a bugless state.

Built with C++ and SDL


Breakout

My first non-console program! I had found a library called SDL and, along with it, a tutorial for SDL called Lazy Foo . I love whoever created that tutorial. He walks you through how to use SDL, but he does so in a way where he gives you the tools and knowledge to create something yourself without actually holding your hand and making it for you.

One of the tutorials on his website shows you how to display a dot image on the screen and move it around with the arrow keys. I took that code and transformed it into a very simple version of breakout. I remember being excited at the entire prospect of doing this, it was just very cool to finally start making something that resembled an actual program.

Built with C++ and SDL


Tic Tac Toe

You can’t learn how to program without creating good old tic tac toe. I created a console version of the game, with a fully functional AI. The AI chooses its moves randomly, but would go for a win if it saw two O’s in a row. It had logic to block you so that you’d never win, but to make the game playable it would only block you about 75% of the time.

Built with C++


Combat Simulator

When I was relatively new at programming, I scowered the internet for beginner projects to work on and found a forum post which outlined some overarching design requirements for a text based combat game. You were asked to create a combat simulator which had a player character with health, strength, armor, experience, and level. You had to have items that the player could find or buy, and you had to simulate combat of some sort taking all of this into account. Other than that, you had a good deal of freedom to do whatever you wanted with it. The main take away from this is that I got a better grasp on things like classes and objects.

Built with C++