Saturday, October 25, 2014

Experiments with Procedural Generation, Part 2

Conway's Game of Life

Tools: LUA, Love2D, ZeroBrane Studio

A friend of mine from college introduced me to the Game of Life when he built his own for class. Ever since then I've been interested in the subject and I've always wanted to write my own version of it. Since I was planning on learning about Cellular Automata this month, I figured the Game of Life would be a great starting point.



The rules of the Game of Life are:
- Any living cell that has fewer than 2 neighbors dies.
- Any living cell that has more than 3 neighbors dies.
- Any living cell that has 2-3 neighbors lives on.
- Any dead cell that has exactly 3 neighbors becomes alive.

These simple rules working together can create some extremely complex and seemingly-intelligent behavior, which is what makes the Game of Life so fascinating.

My implementation of it has pause/unpause, fast forward, stepping forward, and a series of brushes that should make it a little easier to create complex patterns.

Download the project here.

Controls:
Left Mouse Button - Place cell(s).
Right Mouse Button - Delete cell(s).
Space - Pause/unpause the simulation.
Enter - Fast forward when unpaused. When paused, step forward one tick.
Backspace - Clear the entire grid.
Mouse Wheel - Scroll through the brushes.
#1-6 - Select a specific brush.

Wednesday, October 22, 2014

Experiments with Procedural Generation, Part 1

Dungeon Generator

Tools: LUA, Love2D, ZeroBrane Studio

Since Itch.io is having a procedural game jam in November which I'd like to participate in, I decided it might be a good idea to use 1GAM to get some practice with procedural generation.

My October 1GAM project is a top-down rogue-lite shooter that takes place in procedurally generated dungeons where you fight procedurally generated enemies. The plan is to have a virtually unlimited amount of procedurally generated weapons and gear to collect and choose from. Because the end of the month is nearing I am likely only going to get a simplified version of this done by the end, but I am definitely going to continue working on this game past the end of the month.

The dungeon generation system is pretty powerful and flexible. I can completely change the look and feel of the dungeons being generated just by tweaking a few small settings.

Here are some dungeons generated using settings designed to create disorganized, cave-like dungeons with lots of open spaces:





In those screenshots, green and red tiles mark the entrance and exit of a level, blue marks a dead end which is a place where chests or other nice things can spawn, and cyan blocks mark big open spaces where we can potentially spawn a lot of enemies at once to create some big, interesting battles.

And here are some dungeons generated using settings designed to make more square, man-made looking dungeons with many straight hallways and corners, and few open spaces:





As you can see, just by having a few different predetermined settings to select from I can potentially generate a huge variety of levels that all feel and play completely differently.

1GAM (September 2014)

Tools: LUA, Love2D Framework, ZeroBrane Studio (an awesome open-source LUA IDE)


The title screen, with 3 AI fighting each other in the background.


My 1GAM project for September was a simplistic real-time planetary-conquest strategy game, similar to Galcon or Eufloria. Players fight for control of planets which produce ships, which you then use to conquer more planets. The game keeps going until one side eradicates all opposition. It's a genre that has been done plenty of times before, but it still isn't over-saturated. And it's a genre that I particularly enjoy, for some reason.


Fights are happening on multiple planets simultaneously.


What excited me most about this project, apart from making it in LUA, was the idea of writing an AI for the game. Though the behavior of the AI I planed was simple, it turned out well. It is both challenging and intelligent-feeling, and I could watch the AI fight itself all day long.

If you want to check the game out you can download it on GameJolt.

Next Month

Itch.io is having a procedural game jam in November, so as practice I am putting a lot of procedural generation into my project for October. I already have my procedural dungeon generator working, and I also made my own implementation of Conway's Game of Life to practice Cellular Automata. I will be doing a blog post on procedural generation to cover the two projects later.

RimWorld Zombie Apocalypse Mod (May 2014 - Present)

Tools: C#, MonoDevelop / Unity, ILSpy, XML

The first release of RimWorld Zombie Apocalypse came out on May 20th, and the mod has been in mostly-continuous development since then. At the time of writing this, between ModDB and NexusMods, Zombie Apocalypse has almost 40k hits and 11k downloads. Not bad for a mod for a game that is still in alpha and has only sold 50k copies.

Rimworld Zombie Apocalypse

Cornered survivors fight off a zombie hoard.

 

RimWorld

RimWorld is a space colony sim and combat strategy game, heavily influenced by games like Dwarf Fortress. You start with 3 colonists who crash land on an unfamiliar planet, and you have to build up your base to survive. You defend your base from raiders, recruit new colonists, and eventually gather the resources and knowledge to build a new ship to escape the planet.

Even though the game is only in alpha, RimWorld has a really healthy modding community thanks to its impressive level of moddability. All of the objects in the game, their textures, and much of their functionality are defined in XML files. This makes tasks like adding simple items or changing an old item's texture really easy, meaning simple mods can be done by just about anyone even without previous modding or programming experience.

For mods that require more than the functionality defined in the XML you can throw a DLL in your mod's Assemblies folder and the game will automatically load it when it starts. And because it was made in .Net (Unity), the entire source can be viewed through something like ILSpy or NET Reflector.

 

Background

I had been looking for a game to mod for a while just to get the experience. I had no modding experience at all despite the fact that modding a game had been on my to-do list for a long time. When I found RimWorld it just seemed like the perfect game for me to start modding.

Most zombie games only capture part of the zombie "experience". The important things are usually all missing from games: bites, reanimation, the dread of having one of your loved ones bitten, the horror of friends and family members running around as corpses trying to eat you. For a while I had been longing for a game that actually did these things well, as I felt these were the things that truly made zombies scary.

Rimworld was a perfect fit for a real zombie experience:
- You only have a handful of colonists, which makes it much more tragic when a colonist is killed or bitten. Every life is precious.
- Lots of people die, and their corpses stick around until you bury them (at the time there was no crematorium built into the game). This is perfect for a "turning" mechanic.
- When I started working on the mod all of the enemies in the vanilla game were exactly the same, and all of the custom enemies from mods (of which there were only a couple) were nothing more than reskins of things that already existed, with no interesting or unique behavior. I figured a new enemy that truly added a unique dynamic to the game would interest many RimWorld players.

 

Making Of

I spent a week just going through Rimworld's code in NET Reflector and ILSpy, figuring out how everything worked together, and doing a lot of experimenting. The entire time I felt like I was just trying to find clever ways of breaking the game and doing things the dev never intended to be allowed. I often had to program around checks that were specifically there to prevent anyone from doing what I was trying to do, like forcing the character textures to render green instead of the skin tones, or hijacking the "Undefined" map condition state because it wasn't being used and there was no way to create my own at the time.

It took me two or three weeks, but finally I released the very first version of Zombie Apocalypse. The very next day the developer of RimWorld contacted me on their forums and asked me if he could feature the mod in the Alpha 4 release video. I agreed, of course, and I was made a private tester so I could get access to early builds of the game and update the mod in time for the Alpha 4 release.

Go here to see the Alpha 4 release article, and the video featuring the mod.

 

Zombie Apocalypse

The mod has evolved quite a bit since the first iteration in May, but here is the feature list as of version 1.0, released at the beginning of October:
The Zombie virus has gone airborne and the dead have started rising from their graves.
   
Gameplay video from the RimWorld Alpha 9 release of Zombie Apocalypse.

Zombies
- Zombies are mindless killers. They kill you and your enemies indiscriminately.
- Their bites are infectious. If a colonist is bitten you will get an alert. The colonist will slowly die of the bite, and then they will turn into a zombie immediately on death.
- They are 20% slower than colonists and other enemies, and can be easily killed with Cutting weapons like knives and swords.
- You can easily keep track of the origin of any zombie by looking at their names. A zombie that was spawned in a zombie hoard will simply be named "Zombie". If the zombie reanimated from someone who was originally living in your game, their name will be "Zombie [Name]". If they were a colonist there will be a pair of "*"'s surrounding their name.


Zombie Infection
- The Zombie Infection will affect any limb that is bitten by a zombie. This can be seen in the Health tab.
- The infection deals continuous damage to the infected colonist, until their inevitable death.
- Removing infected limbs will cure a colonist of the infection.


Zombie Hoards (raids)
- Zombies attack in large numbers.
- Zombies do not give up or flee.
- Zombie hoards always attack immediately.
- Zombie stragglers will be left behind, forcing you to leave your base to deal with them after the initial zombie attack is over.


Zombie Apocalypse/Airborne Zombie Virus
- The zombie virus goes airborne and affects all humans and corpses. All human corpses will start reanimating even if they were never bitten while living.
- This incident never ends. Once the virus goes airborne, everyone is infected.

 

Reception

I've received a ton of support and encouragement on the RimWorld forums and elsewhere. Because of the popularity of Zombies and the need for an interesting new enemy in RimWorld, Zombie Apocalypse quickly became one of the most popular mods for the game.

It's really weird seeing the mod become so popular. The most recent version came out less than 3 weeks ago and it currently has almost 2300 downloads. That's over 750 downloads a week. Hundreds of people regularly play RimWorld with Zombie Apocalypse active, and several have even told me they'd never play the game without it. I've seen several Let's Plays with it. I've seen the mod mentioned in threads on Steam, Reddit, SomethingAwful, random forums I'd found through Google, and basically anywhere there are people talking about RimWorld. I even watched one streamer play with my mod active for ten hours straight. Twice.

And the mod isn't losing steam. With every new release it becomes more an more popular, and stays more popular. Since the release of v. 0.7.1 on September 10th there hasn't been a single day where less than 100 people have checked out my mod.

Since I released Zombie Apocalypse I had been hoping to make the top 100 mods on ModDB just for a little while, and it finally happened after I released v. 0.7.1 on September 10th. ModDB linked my release article for v. 0.7.1 on their Facebook page, which resulted in the mod spending much of the following week in the top 100 list, and even dipping as low as #30 at one point.

On NexusMods, Zombie Apocalypse just recently hit 1000 unique downloads, making me an officially recognized mod author there. It gives me access to a private forum that is only for reasonably popular modders. I don't have much use for it, but it's still nice.

The steadily increasing interest in the mod since the beginning is definitely helping to keep me motivated enough to continue working on it. Since RimWorld has already been Greenlit, I plan on continuing to support the mod well after the game is finally released on Steam. With a well polished Zombie mod that already has a sizable following hitting Steam right as the game launches, who knows how popular the mod might become once RimWorld takes off (and it will). It might even hit the #1 position on the top 100 list. Who knows?

 

Download The Mod

http://www.moddb.com/mods/rimworld-zombie-apocalypse/downloads
http://www.nexusmods.com/rimworld/mods/34/?

Wednesday, September 3, 2014

1GAM (August 2014)

Tools: C#, Unity game engine, Unity Editor

This was my first month doing the 1GAM challenge so I wasn't worried about making anything all that impressive. I was experimenting with the Unity engine's 2D physics features and figured I would turn it into a Flappy-Bird-style click-to-dodge game.

You are a triangle-ship flying through an asteroid field. Click to the left or right of the ship to dodge. Over time your ship speeds up and the asteroids get larger.

The asteroids start off small.

As time goes on your ship speeds up and the asteroids get larger.

When your ship explodes the pilot is ejected and the camera
follows him until you start over. 

 Play the game here.

I was planning on polishing the game up a bit more before the end of the month but then I wound up participating in Ludum Dare 30, and I've been working on the game I started during the competition ever since. 

Next Month

September's 1GAM game will be in LUA, using the Love2D engine. I'm still not quite sure what kind of game I will be making, but I think it will likely be a Galcon-style game where you fight over territories that auto-generate units over time, which you then use to capture other territories. I'll probably make a post with some screenshots once I have some progress to report.

Tuesday, August 5, 2014

Kubulio! (2009)

 Tools: C++, DirectX, Visual Studio 2008

Kubulio! was made by myself and three other students, back in 2009, in our Structures of Game Production (SGP) class. The class was split into groups of four students each, all programmers, and we had two months to design, prototype and develop a game from the ground up. We made a design doc, built a prototype in GameMaker Studio, diagrammed the whole game structure beforehand with UML, built tools to make the development easier, and then developed the game itself (in C++ and DirectX), all in the span of two months.

On the first day each group was given a genre at random which their game had to fit, and then they had an afternoon to brainstorm and come up with their game concepts. The genre we got was "Experimental", which gave us a whole lot of freedom compared to other groups. We could do basically anything we wanted as long as it hadn't been seen before.

Here is what we came up with:

Kubulio!
You are the deity assigned to protect Kubulio, a planet that is in the early stages of its development. It is entirely liquid rock, and you are to see that it is protected while it cools down naturally. Unfortunately, an evil race of aliens has other plans for your infant planet. They have sent several fleets of ships to artificially cool down the planet so they can colonize it, and use it in their evil plans to conquer the universe. It is your job to use the resources available to fend off the invaders.


Enemies will use cooling weapons to try to solidify the planet and make it habitable. The game will be over when the planet’s temperature becomes too low. Use your godlike powers to warp space-time, and manipulate the planet’s lava to kill enemies. Pull and push the lava by creating distortions in gravity.


Download the final game and GameMaker prototype:
http://www.mediafire.com/download/1s2n92n49zdl40k/Kubulio!.7z

Each person in the group was responsible for a different aspect of the game. I was responsible for any "Gameplay" elements of the game, so I programmed the enemies, all of the "physics", the orbiting mechanics for enemies and lava that is near the planet, etc. Since the gameplay elements turned out to be something like 80% of the code James took a few of them off my plate after he was done with the "tech" side of things, but I still got to work on most of the fun features.

My favorite feature that I worked on for the game actually isn't visible in the final version, with the lava particles turned on. To show the heat level of the lava blobs when they were represented by circle sprites instead of particles, they actually changed color based on their temperature, ranging from yellow for hot, to brown for cool/solid, to blueish-white for freezing. Since each blob is constantly exchanging heat with cooler blobs next to them, when a cold blob hit the planet you would see an awesome ripple of coolness go through the lava as the temperature evened out between the blobs. There was something extremely aesthetically pleasing about that effect, and I was disappointed that we didn't manage to translate that to the particle effects. Given more time we would have gotten it working, but it was very low priority during the pre-release crunch.

All-in-all, SGP was my favorite experience at Full Sail. Our group was extremely happy with the end result, and feedback from our class and others who played the game was extremely positive. Sure, it's not as polished as you'd expect from a published game from a professional developer, but the quality is pretty high for the amount of time and the kind of resources we had to work with.

And at least it's better than Flappy Bird.

Wednesday, July 30, 2014

Flash RTS Game (2007)

Tools: ActionScript 2.0, Flash MX 2004

For my final project at my first college, back in 2007, I decided to make a simple top-down Command and Conquer style RTS game in Flash MX 2004. I never got around to writing any real AI for the game, but I made a simple defend-your-base style demo that showed off the completed features of the game.


The game comes complete with buildings that you can place where you want, including turrets for defending your base against enemies; 6 different ground units to use in combat, including an engineer that can be used to capture enemy buildings (the enemy sends engineers to capture your buildings too!); and a working minimap that shows the location of all buildings and units, and can be clicked on to move the camera anywhere on the map.

Enemy units start spawning a couple minutes in. It starts off slow and then ramps up over time. The game ends when you kill the enemy HQ or they kill yours.

You can play it here:

Controls:
Left click, drag and release to select a group of units.
Shift + left click to place buildings and move units.(Flash uses Right Click for its menu by default).
Move the camera by moving your cursor to the edge of the screen, or by clicking on the minimap.

Buildings:
Headquarters - If you lose your HQ the game is over.
Power Generator - Powers your buildings.
Oil Well - Generates money.
Turret - Automatically fires at enemies who come within range.
Barracks - Used to recruit units.

Units:
Rifleman - Short range ground unit.
Sniper - Long range ground unit.
Rocket Man - Deals a lot of damage to structures.
Scout - Increases the range of snipers when it stands next to them.
Medic - Heals nearby units.
Engineer - Repairs friendly buildings and captures enemy buildings.

Monday, July 28, 2014

Building an Online Portfolio

I figured it's about time I built an online portfolio to show off some projects I've worked on in the past. I was considering adding a "Projects" section to my resume, but if I did that I would have to limit the number of things I talked about and/or the amount of detail I went into. This will probably work out better since it's public and can be shared with anyone, instead of just employers.

I plan on making this a hybrid between a portfolio and a blog, so I can talk about other side projects and experiments that I am working on. I also plan on participating in the 1 Game A Month challenge soon(tm) (or maybe even the 1 Game A Week challenge! We'll have to see how motivated I am when the time comes...), and it would be nice to have a place to blog about that as well. I think I will likely just post everything as blog posts, and have a "Portfolio" tab that will summarize all of the most important things for employers. I should be able to use the tagging system to tag things as "Portfolio" and then just have a tab in the navigation bar that links to a search for everything with that tag. Or something.

The template of the blog is going to be pretty bare for a while, since I have no idea how I want it to look. I figured it's best to get the content up first and then worry about the template later. That's basically the standard programmer attitude towards any kind of art anyway...