Zombie Mansion with shaders and post-processing

January 22, 2015 at 9:03 am (Game Development, Graphics, Java, Processing) (, , )


Update: Full project description here

I finally got around to retrofitting my older projects with the new hotness. I am now rendering the scenes with shader programs, which gives me a lot of nice options for how the scenes look. I can do lots of fancy stuff with them including doing neat things to the screen after the scene has been drawn. Here’s a quick example of one of the things I’ve already tried. It’s a ripple effect I applied to the screen; it looked awful, but I was getting 60 frames per second with it (which is good).

jan17_2015_screen effect gone wrong1

Advertisements

Permalink Leave a Comment

Project: DarkWolf2D (2D Dungeon Crawler)

January 10, 2015 at 4:30 pm (Game Development, Games, Graphics, Java, Processing, Programming, Rant, Uncategorized, Video games) (, , , , , , , , )


Over the holidays, I had some time to upgrade the core code for my game engine. I’ve upgraded the version of Processing that I use as well, which means I can use shaders for rendering along with some of the nicer JSON loading features. While I have a “version 2” of my engine working though, I haven’t yet retro-fitted it into my Zombie Mansion yet. This is coming in the future, but for “proof” that my code works, I’ve been putting together a small game based on a design I had in a dream. It’s the “basic” version of the idea, which means no multiplayer and no nice graphics.

The idea is for a dungeon crawler action game that takes ideas from the MOBA genre. I know how it sounds, but it’s actually a very basic idea and it’s already half built. It’s a player-vs-environment game right now where the player begins at level 1 for each dungeon and has to level up as they progress to bosses. The theme for it is an alternate history WW2 where the characters are different classes such as “US Medic”, “Russian Sniper”, or “French Resistance Fighter”. Each class has a basic attack and a list of abilities they can level up and use. I’m keeping the XP system as simple as I can (although I’ve never built one before), and I’m not using any items for the game right now.

For rendering, it’s a 2D game with no character animations; just a static side-shot image. This should keep the dev cycle pretty low for now. I also have a feature backlog that I’m considering making public, but for now I’ll only do that if I have anyone comment that they actually care to look at it. It’s a list of all the features that I plan on implementing (some are basic things like “add audio to the game”, and it functions as my “todo” list. As I build in features, I mark them as “Complete” and they shuffle to the bottom of the list for storage.

Edit: Added a screenshot. It’s very basic and you can’t really see anything worthwhile. Just showing that I can at least render the player in a level. I’ll make a video later.

First screenshot of DarkWolf2D

First screenshot of DarkWolf2D

 

Permalink Leave a Comment

Markov Chains for Procedurally Generated Textures

October 22, 2014 at 5:48 pm (Computer Science, Game Development, Graphics, Processing, Programming) (, , , , , )


As anybody who’s spent time on this blog knows….well, anyway, I’ve spent a while working on my game on and off. One of the time consuming processes of this was to build textures and level details. All of the art from the screenshots was created by hand using classic MS Paint (not the new-fangled one that comes with Windows 7). One particularly tedious aspect was making bookshelf textures. I had to manual rearrange books and come up with different combinations of books that I thought would be “believable” by the player and not repetitive.

Well, here’s where my new project comes in! Last weekend I spent a few hours writing an algorithm that would generate shelves of books for me. Why is this interesting though? Couldn’t I have just randomized the books and called it a day? Well, the problem with strict randomization is that it looks ugly. It would just be a mish-mash of different coloured books, which is fine for a modern bookstore but as my game takes place in the 1920’s-1940’s, it felt more appropriate to have a bit more organization. Essentially, in older libraries you would be more likely to find books that looked similar because of binding techniques of the days. You’d also find more books that were series of something that would have the same style of cover instead of just a colourful, different cover.

The goal for this project was to generate shelves that had clusters of books. To achieve this, I used a Markov Chain algorithm that would place each book on the shelf one at a time. Depending on the book it would place, it would favour specific types of books for the next book. There is still a randomized aspect to the algorithm, but it is more constrained depending on the state.

Below is a screenshot comparing some of the results of the algorithm to a strictly randomized approach. As you can see, both are somewhat random, but the shelf on the left shows more groupings of similar books.

Procedurally generated texture comparison

Procedurally generated texture comparison

 

 

Permalink Leave a Comment

Aftermath of Zombie Mansion Alpha 1 Build

July 18, 2014 at 12:40 pm (Game Development, Games, Graphics, Java, JavaScript, Processing, Programming, Video games) (, , , , , , )


So at this point in time I’ve had multiple people play through my game demo. The results were actually better than I thought. I think only one person wasn’t able to run it (still not entire sure why, but that’s future Jake’s problem now). There were a couple major issues, but those were found and fixed as well. One of the bugs was that I didn’t include the assets for the 3D objects, so when the players entered the room with columns, the game crashed. There was also some scripting errors driven by not having necessary images wrapped up in the resources archive. Logging definitely helped out there.

The last major issue is unsolved, but lies with some code I threw together for the level selection screen. I think some of the click events aren’t going through, or it’s not loading the levels properly. I think this may have something to do with that particular tester running the game through a zip file though. I was shocked to find out that it worked period though.

I got some pretty decent feedback from one tester in particular though. He gave not only bug reports, etc, but opinions on controls, aesthetics, and game flow as well. Most of those things were explained away as “placeholder” stuff, but still; it was useful information to know what a tester/player is thinking when they see that stuff. When I show most people my game, I need comments like “looks neat and retro” or “I like the camera spin feature”, but not enough people pay attention to tiny details.

Anyway, that’s the update. I haven’t had free time to cut a second build or to work on new levels or anything.

Permalink 2 Comments

Automation 4 U

June 28, 2014 at 2:29 pm (Computer Science, Game Development, Games, Graphics, Java, JavaScript, Processing, Programming, Rant, Teaching) (, , , , , , , )


So, this will be nothing new for some of you. This isn’t even something new to me; I have a day job where I’m a professional software engineer and we do this at my job all the time. I’m talking about automation and automated processes. This could be anything in your project development process where you have the computer automatically do something for you. An example could be a script that backs up your files to a different drive that you can just run when you want. It could be as complex as a build step that automatically deploys your binaries or runs unit tests.

My disclaimer: A lot of this is technical stuff and directed towards programmers, but even if you’re a graph artist, you can still benefit from this. Everybody that uses computers for projects will need to back up their files for instance.

I’ve only recently realized just how important this all is for regular, personal projects. I’ve always known that it saves time, but my initial mindset was that I’d rather get my project up and running and THEN waste time implementing the time-saving stuff after I get it together. I’ve been reading this book I bought from Amazon that talks about indie gaming from a business, “get your act together” perspective. The book can be found here. I’m still reading it, and some may or may not agree that it’s a good book, but it provides some good ideas for how to take your hobby projects to the next level and keep your process renewable. This means saving time and money on mundane processes, etc.

I am still in the process of automating many aspects of my project, but it really crept up on me just how much time I was wasting on manual things. Here are some of the processes I perform just for my Zombie Mansion project:

  • Backing up files from two areas on my system to my external hard drive
  • Deploying JAR files from my Eclipse solution to my Processing solution to use in my game
  • Removing alpha channels from sprite sets (I built a tool to do this, but it’s still manual)
  • Putting together standalone builds of the game software
  • Packing and compressing image resources for game builds
  • Merging animation sequences together for access by the game engine

These are just things I thought of off the top of my head this morning. Some of them will be easier to do than others, and some of them are specific to my project. All of them eat up time though and are tedious things. Here are a few tips and ideas for how I plan on solving some of these issues though. Please read through just in the off chance that it inspires something or gives you an idea or two.

Deploying JAR files to another solution

For this, I intend on using ANT with Eclipse. This is pretty much a standard for serious Java projects, but it’s taken me a long time to start to improve my processes (usually I want to work on the fun stuff or the stuff that has a visual out-come). Visual Studio has its own build steps and things you can run. Alternatively, you could write a script/BAT file that will grab the files from your output directory and deploy them. This doesn’t require a full set-up of a 3rd party tool and it should be quick to do. It just might break and won’t be as robust.

Backing up project files

This is something I’m already part way through implementing. I’ve written most of a BAT script that will grab the project files from specific directories and dump them in one area so I can back them up (it will optionally zip them as well). To make it a bit easier, I’ve started using virtual drives, but this isn’t necessary. If you’re interested in what virtual drives are or how to set them up easily, email me or post a comment. I can give you some resources or just write an article. Here is a snippet of what I have so far (I’ve been taking bits and pieces from the interwebs, so most of it is borrowed code anyway).

I wanted to dump the files into a folder that would be timestamped so I wouldn’t have to worry about overwriting anything. This is one way of how you’d accomplish it using a BAT script in Windows:

set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
set year=%date:~-4%
set month=%date:~3,2%
if "%month:~0,1%" == " " set month=0%month:~1,1%
set day=%date:~0,2%
if "%day:~0,1%" == " " set day=0%day:~1,1%
set datetimef=%day%-%month%-%year%_%hour%-%min%
echo %datetimef%
xcopy "C:\Test\A" "C:\Test\B\Backup\%datetimef%" /E /I

This will copy everything in your source directory (the first argument) and store them in a custom folder with a timestamp. You can use multiple source directories as well if you have things spread out like I do by just putting in an extra line. The last two arguments are switches to tell XCOPY to use the full source directory (and children) and to assume I mean the destination should be a folder.

Removing alpha channels from image resources

This one will be a bit more complicated. I have a tool I wrote to do this, but I want to streamline this. Now, I wrote up a full project plan with a product backlog, but then I realized even that was too ambitious. I plan on taking some items from the list, but I also plan on it being a purely script-based tool. It will run on the command prompt and will use my engine’s scripting engine for customization (as opposed to using config files). At this point in time, it’s cheaper for me to use scripts than config files since I don’t have a streamlined approach to reading them yet. ANYWAY, I will be writing this as a project in my game engine solution and it’ll have a unit test project to go with it. I’m still working out what tests I will need for it since it works with images, but it’ll be centered on testing the RGB values of generated images before and after the script runs. It’ll also test image sizes for when I add the feature to compile multiple animation sequences together.

Anyway! To summarize this; automation is good. It saves a HUGE amount of money (time is money). If you ever have dreamed of selling a game, you NEED to get in the habit of doing this. The more you do it, the easier it will become and the more effective you will be with your time. Be as lazy as possible with your projects; that’s why we’re programmers! (Although you don’t need to be a programmer to benefit from this).

 

 

Permalink Leave a Comment

Playable Demo Impending

June 5, 2014 at 7:13 pm (Art, Game Development, Games, Graphics, Java, Processing, Programming) (, , , )


Today I finalized the resource unpacking code for Zombie Mansion (name pending). I can now protect the art asset files and unpack them in memory. This means I’m close to releasing a playable level of the game! Note: It currently is playable, but I don’t have a public build right now.

Permalink Leave a Comment

New Screenshots!

April 14, 2014 at 8:43 am (Game Development, Games, Graphics, Java, Processing, Programming) (, , , )


I got some time this weekend (and inspiration) and decided to work on replacing the borrowed tilesets so I can get closer to finishing a short demo for my game. I have a bunch of new floor tiles and walls now, and even went as far as to add new code for some missing features. I wanted to have interactive wall components (for example, for the player to be able to examine paintings, etc.), and have them work the same as the furniture does (furniture gets an outline when you are in range to search it). So it looks nice now. The wall paintings function the same as frontwalls, so you can only see them when the camera is in position, but you can see the coloured highlight regardless of direction. Here’s a few screenshots (one of them is an old one to show off the 3D pillars I added a while ago.

 

Permalink Leave a Comment

Quick and Accessible Inversion of Control

March 14, 2014 at 1:37 pm (Computer Science, Games, Graphics, Java, Processing, Programming, Rant, Teaching, Video games) (, , , , , )


So by now you’ve probably at least heard of the magical beast known as “Inversion of Control”. You may even understand what it is. If you’re in this boat, why aren’t you using it more often?? (if you are, you can read the rest of this article with your head held high).

There are tons of places on the interwebs where you can learn all about Inversion of Control (or IOC), so it doesn’t make sense to write up a detail explanation and then have people correct me on it. The short version of it is that it lets you defer your problems to someone else (future you for example). You allow the implementation to be abstracted in such a way that you can conveniently inject it in such a way that would make your college programming professor proud and/or confused.

For this example, I am going to use PicoContainer and Processing. PicoContainer is an IoC library for Java, although you could implement what it provides yourself through a variety of techniques I won’t tell you about here. The idea is just to show you a brief intro to what it can look like. In my example, I have a Graph object. It is the “M” of our MVC, and we want to separate the “V” from it. This means that the bit of code that draws the graph on the screen is going to be extracted. The kicker is that the way we abstract it will allow us to re-skin the graph in whatever way we want, whenever we want. We just inject a new view without changing the model layer and we’re good to go.

/**
  This is our interface for abstracting the View from the model
*/
public interface GraphView {
  public void draw(PGraphics g, Graph graph); 
}

/**
  This is our Model: The object we want to abstract the view from.
*/
public class Graph {
  private MutablePicoContainer graphConfig = null;

  public Graph() {
     graphConfig = new DefaultPicoContainer();
  }

  public MutablePicoContainer getGraphConfig() {
      return graphConfig; 
  }

  public void draw(PGraphics g) {
     // I'd recommend caching the view ahead of time to remove overhead
     GraphView graphView = (GraphView)graphConfig.getComponent(GraphView.class);
     graphView.draw(g, this);
  }
}

Now here is the part that makes it all work. I’ve written this in Processing code, but it is essentially simplified Java anyway. In this snippet of code (although it is a working program if you include the previous snippets), I instantiate our Graph object and then inject a View. In this example I’m just showing the power of IoC by including an anonymous implementation of a View object. In the “real world”, you would have written it as a standard Java object.

import org.picocontainer.*;

Graph graph = null;
void setup() {
  graph = new Graph();
  graph.getGraphConfig().addComponent(new GraphView(){
      public void draw(PGraphics g, Graph graph) {
        g.pushStyle();
        g.stroke(200);
        g.noFill();
        g.ellipse(25, 25, 10, 10);
        g.popStyle();
    }    
  });  
}
void draw() {
  background(0);
  graph.draw(g);
}

Now to summarize, we have accomplished our goal of abstracting the view of the graph from the data represented by the graph object itself. This means that we could completely re-skin the visual representation of our graph without touching any of our previously written code. If we wanted to draw the draw in 3D, we could just inject a new implementation. If we want it to be rendered using only ASCII characters, we got this. In the case that you still don’t see the value of this, consider a game you’re probably writing right now in your spare time:

You have a general “GameCharacter” class that both the PlayerCharacter and AiCharacter classes inherit from (Because you’re object-savy and generally good-looking). Both of these allow you to draw the characters differently. What happens when you decide to add new AiCharacters that act exactly the same, but look different? Well, you could throw in an IF statement and just check a state variable…. OR you could abstract the view, just like in our example! When you construct the AiCharacter objects, you inject a View object that will do all the drawing. As an object-oriented purist, you feel content, and as a game developer you feel pleased that you were able to trim off an “IF” statement from your render loop. You high five yourself.

Permalink Leave a Comment

Flashback: A younger, more innocent Jake from college

February 21, 2014 at 10:03 am (Computer Science, Games, Graphics, Programming, Video games) (, , , , )


So I’ve tracked down an article from one of my old colleges that talks about my Capstone project. My team it to the finalist round and was beaten down by a team that had a fancy theory about making money automatically on the stock market (yeah…true story…). Anyway, the project was a bunch of fun and it was my first “official” team/tech lead experience. Here is the link.

EDIT: Here’s a link to one of the images from the article.

Jake Seigel (me), Scott Turner, Paul Alcaine

 

Permalink 4 Comments

Impending game demo (by request only)

January 7, 2014 at 1:33 pm (Computer Science, Games, Graphics, JavaScript, Processing, Programming, Video games) (, , , )


So I’m working on getting some levels ready for a demo finally. I need to re-skin the levels to not use *ahem* borrowed art assets before I can do that though. Eventually, I’ll probably post it or public access, but for now it will be released by request only.

Permalink Leave a Comment

Next page »