@MLRTachyon Oh thanks! <3 Good luck :) (Today)

@naughtysecrets Oh sorry, I removed the password from the beta branch, and didn't update the main thread about it. Magic fixes everything :o (Today)

@naughtysecrets The beta branch should take care of any game breaking issues. Is there something specific that isn't working for you? (Today)

@EdgeOfProphecy @FourbitFriday UGH they're just making it worse with every update (Today)

@FourbitFriday hope you didn't update your bed right before going to sleep (Today)

@amora_b I think more games should just suddenly pause after 40 minutes or so with just a message box that says "Hey, fuck you." (Today)

@MllePilgrim @infinite_ammo Gotta be quick about it if you want to keep up with me. (Yesterday)

@MllePilgrim @infinite_ammo they were delicious (Yesterday)

Luigis new final smash is pretty weird t.co/5DNaLrZLRr (Yesterday)

@Demruth My small rural home town in the US got a roundabout a few years ago. People actually protested it, and take routes to avoid it... (Yesterday)

@infinite_ammo The rich get richer. (Yesterday)

@infinite_ammo "hey guys if we split this 500 piece sushi party platter 5 ways..." (Yesterday)

@snakepixel His recovery is insane (like almost all chars in this game) You can do your air jump, then side B and jump cancel out of it! (Yesterday)

@snakepixel Bowser Jr is who I'm trying to get good with! I love his back air and his air attack after ejecting from the flyer thing. (Yesterday)

@ADAMATOMIC @MattThorson [187] xX Crosspwned j0nEz Xx (Yesterday)

@MattThorson Billy Barnacle (but his business card says William Barnacle) (Yesterday)

@MattThorson Crossbow Jones (Yesterday)

@rabbit_nabokov Or I guess just a script that takes in a number as an argument and spits out the string for 0 - 9? (Yesterday)

@rabbit_nabokov If you want 1 to give you "One" then the best bet would be to make a ds_map with the numbers as keys and the string as value (Yesterday)

@rabbit_nabokov Key string should be a string of characters pressed by the keyboard, or are you talking about the number keys? (2 days ago)

follow
search
posts filed under: general

2014 - 11 - 18 / 4:07 pm / general

Visual Studio Asset Class Generator

Visual Studio Asset Class Generator

One of the key things I learn from every game jam is what the major knots are in my work flow. The past two jams I did with Otter had a common issue: getting assets from my assets folder to the game was annoying!

I don't like to rely on strings in my code to reference things. A typo can cause a major headache, especially when referencing a path to a file that needs to be loaded. Usually I like to just keep an Assets.cs class that has a bunch of static references to various file paths. Something like this:

class Assets {

static string Asset(string str) {
string assets;
#if DEBUG
assets = "../../Assets/";
#else
assets = "Assets/";
#endif
Console.WriteLine("[ASSET] Register asset {0}.", assets + str);
return assets + str;
}

public static string ImageIcon = Asset("img/icon.png");

public static string ImagePalette = Asset("img/palette.png");
public static string ImageTile = Asset("img/tile.png");
public static string ImageTiles = Asset("img/tiles.png");

// and so on...


This makes it so I can just do something like this later:

public Image Image = new Image(Assets.ImageIcon);


Instead of having to remember that the path to the icon whenever I want to use it, I just keep a reference to it in once spot. This drastically reduces the amount of typos I could possibly hit, and it also makes it easy to bring up with auto complete and intellisense stuff.

However the process of saving out a png, then remembering the exact path to the png, and then opening up Assets.cs and adding lines to it for every new asset every single time becomes a giant pain. The more assets I have, the more complicated this becomes, and the more I'm modifying the assets folder the more annoying it gets! Back when I was using Flash I created an asset generator script to overcome this, so why not just do the same for C#? Wouldn't it be awesome to just be able to click a button in Visual Studio and have an Assets.cs generated from the files in my Assets folder?!

Download AssetClassGenerator.exe (v1.0 Windows 11kb)

This program will execute in the console and build an Assets.cs file based off of the Assets folder in your project directory. This was built with my specific use case in mind so this may not be an exact fit for your needs currently. read more

3 Comments

2014 - 11 - 13 / 4:07 pm / general

Super Sky Sisters Timelapse

Super Sky Sisters Timelapse



Make sure to watch it in full 1080p at 60 frames per second, yeah!

The game isn't out yet, but you can watch me make it at hyper speed over the course of 48 hours. The game ended up getting a bunch of awards at the game jam, including second place overall which is pretty cool!

No Comments

2014 - 11 - 12 / 3:20 pm / general

Dev Log: Game Jammin

Dev Log: Game Jammin

Whoops I've totally neglected my blog for the past week or so. I spent last week working on some minor Otter things, as well as getting ready for a local game jam. Then I jammed for 48 hours last weekend!

Image

Image

Here's some shots of what I ended up making:

Image

Image

Image

Image

I also recorded a timelapse, and that'll be coming pretty soon!

3 Comments

2014 - 11 - 2 / 4:22 pm / general

Index Palette Shader

Index Palette Shader

A few months ago I made and released a game jam game that featured a cool shader based off of Dan Fessler's HD Index Painting tutorial. The idea is to take a normal image and render it with an extremely limited palette. Essentially it's like a game boy shader, and with the help of a dither map texture it actually creates the illusion that there are more colors than there actually are.

Image

The game jam version of the shader was rather clunky, and required the game to manually render a dither texture over the entire screen. Yesterday I spent some time figuring out how to apply the dither directly in the shader itself to make it more general purposed. Here's the entire shader:

#version 130
uniform sampler2D texture; // The main input texture (the screen.)
uniform sampler2D palette; // The palette texture.
uniform float shift; // The shift amount on the palette texture.
uniform float offset; // The offset for the random noise generation.
uniform float screenScale; // The current scale of the screen. (1x, 2x, etc)
uniform vec2 screenSize; // The size of the core game screen (320 x 240)
uniform float noiseAlpha; // The amount of alpha the noise should have.

// A weird way to generate a random number with a vec2 seed.
float rand(vec2 co){
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

void main() {
// The size of the game window.
vec2 screenSizeScaled = screenScale * screenSize;
// The pixel coordinate being operated on.
vec2 pixpos = gl_TexCoord[0].xy;

// Get dither pixel
vec2 overlayCoord = floor(gl_FragCoord.xy / screenScale);
// Get 1 or 0 based on the pixel location.
float overlayPixelColor = mod(overlayCoord.x + overlayCoord.y, 2);
// Dither is black and white every other pixel.
vec4 overlayPixel = vec4(overlayPixelColor, overlayPixelColor, overlayPixelColor, 1);

// Scale the frag position to match the screen scale
vec2 scaledpos = floor(pixpos * screenSizeScaled);
// Adjust the position based on the scale of the screen.
scaledpos -= mod(scaledpos, screenScale);
// Convert back to 0 - 1 coordinate space.
scaledpos /= screenSizeScaled;

// Get base color.
vec4 pixcol = texture2D(texture, pixpos);

// Mix dither texture.
pixcol = mix(pixcol, overlayPixel, 0.1);

// Determine the brightness of the pixel in a dumb way.
float gray = (pixcol.r + pixcol.g + pixcol.b) / 3;

// Round it to the nearest 0.25.
gray = round(gray / 0.25) * 0.25;

// Add some noise.
gray += (rand(scaledpos + offset) * 2 - 1) * noiseAlpha;

// Map the palette to the pixel based on the brightness and shift.
pixcol = texture2D(palette, vec2(gray, shift));

// Multiply through the gl_Color for final output.
gl_FragColor = pixcol * gl_Color;
}


The shader does require a 2d texture for the palette itself. For this game the palette I used was this:

Image

The "shift" uniform in the shader determines the Y coordinate to sample the palette on. A shift of 0 will sample the top most Y, and a shift of 1 will sample the bottom most. You can use this to dynamically change the palette during the game.

The shader needs to have the "screenScale" uniform set to the current scale of the screen. This will make sure that the pixel size is corrected for the dither and the noise. The shader also needs to know the "screenSize" in order for the noise pixels to be the correct size. You can also just set the "noiseAlpha" to 0 if you don't want any of that stuff to show up.

To make the noise change every update the "offset" value should be set to a random float 0 - 1 every update.

Here's what the game looks like without the shader:

Image

And turning on the shader:

Image

Neat!

No Comments

2014 - 10 - 27 / 7:38 pm / general

Dev Log: Snakes and Skeletons

Dev Log: Snakes and Skeletons

The struggle of building creatures out of skeletons and bones continues this week as I try to finish up a Snake class for Otter! One of my other goals with enemies is to be able to construct enemies out of "snakes" of entities. Basically have a series of pieces all following the next piece like a slithering snake.

Image

I already had the ground work for this laid out last week, but today I dug into it some more so that I could actually have each piece of the snake be an entity with a skeleton. Now I can build crazy enemies and objects out of snakes composed of skeletons all animating! The next step is going to be going back to the game project itself and plugging some of this stuff in, as well as cleaning up the code as much as I can in order to have it be useful for people other than me.

No Comments

2014 - 10 - 24 / 9:44 pm / general

Dev Log: More Skeletons!

Dev Log: More Skeletons!

This past week has been spent working on some Otter technology for implementing my own skeleton and bone systems.

Image

But Kyle why aren't you using Flash or Spine or Spriter or some other way to implement bone animation!?

Well in regards to flash, I've seen what is necessary for writing a flash file interpreter and I am totally not interested in going down that path at all. Flash is already a giant pain to use for just frame by frame animation, and I've used to create animations way back in my flash cartoon days of college, and that is something I don't want to relive. I wish Flash got an overhaul in regards to its UX, but that'll never happen, so I don't want to rely on it.

In regards to Spine and Spriter, I already use Spine for pure art based skeletons. The thing about Spine is that I actually cannot include the Spine runtime for Otter by default -- it has to live in a separate repository. This is because it is a violation of the Spine license to distribute the runtime to users who may not have purchased the full version of Spine. That is the main issue there, and also I have no idea how to use the Spine skeletons for what I want to do, nor do I know how to create Spine skeletons on the fly at runtime. I would use Spriter, but so far I have not seen any C# runtimes or APIs that don't have major issues.

Image

I ended up just creating my own since I felt that takes less time than learning how to use another tool, and since I have a very simple use case for this I can just jam out my own solution in a relatively quick time. I don't have any need for complicated animation files or animation blending or anything like that. This system is mostly designed to manipulate Entities in Otter, so that I can create big bad enemies built out of multiple pieces.

Also it may end up being the case that these enemies will be created at run time procedurally. If that is the case, I would have no idea how to implement that using Spine, Spriter, or Flash's systems.

No Comments

about

About

Hi there, my name is Kyle, and I'm a kid disguised as a grown up. I'm making video games and living the indie game developer life in Tempe, Arizona. Here you will find my thoughts, games, websites, doodles, and other stuff like that. I worked on Snapshot, Offspring Fling, and a whole bunch of other games. I also created and maintain Otter, a 2d game making framework. If you want to get a hold of me use the form on the bottom of the page, leave a comment, or just tweet at me. I try to post three times a week. Thanks for stoppin' by! You're the coolest.

facebook

videos

Do you want to make a Let's Play of one of my games, or a just a video featuring footage of my games? You have my full permission to do so! Even if you are monetizing your videos, you still have my full permission to use any footage from any of my games. Go for it!

contact

Your message has been sent! Thanks :)
SEND MESSAGE