I moved to a new URL! Check it out!

posts dated from: november 2014

Dev Log: Otter Updates

Dev Log: Otter Updates
Some crazy updates happening in the dev branch of Otter recently! Here's the scoop on what's been going on:

* Changed how Entities are Added to the Scenes. The Entity's Added() method now fires when the Entity is actually added to the Scene at the end of the current frame. The Added method also fires after all Entities in the adding queue have been added.

This means that if you're adding a player object, and then an enemy object afterwards, and the player object needs to reference the enemy object in its Added() method it should be possible to do so.

* In a similar fashion the Components have been changed in regards of when their Added() method is called. Components in the add queue are added at the beginning of Added, UpdateFirst, Update, and UpdateLast, and their Added method will fire when they are actually added to the Entity from the queue.

* GetComponent can now return Components that are still in the adding queue if none are found on the Entity itself.

* GetComponents() returns a list of Components of a certain type.

* Axis now has access to Up Down Left Right buttons. Very handy for having to check for button presses on an Axis and not having to create 4 separate buttons to do so.

* Repeat has been changed to two bools RepeatX and RepeatY.

* Util.Log() now behaves like a format string call (similar to Console.WriteLine())

* BitmapFont support is coming along and now supports data for three different bitmap font generators, as well as support for standard monospaced fonts.

* RichText characters can now be accessed and manipulated individually. This means you can do stuff like animate properties of characters yourself instead of relying on the mark up in strings.

* Other minor clean up and fixes that should make stuff better overall.

In other Otter updates be sure to follow the journey of Otter Pup 681!

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.

Doodle Post

Image

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!

Doodle Post

Image

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!