I moved to a new URL! Check it out!

posts dated from: may 2014

Doodle Post

Image

Offspring Fling Humble Store Sale

Offspring Fling Humble Store Sale
Just a quick heads up that Offspring Fling is available DRM free for 50% off over at the Humble Store! I'm not sure how long the discount lasts, but if you're still aching for a copy of the game then now's your chance to save a few bucks.

It's hard to believe it's been over two years since the game came out. It seems like only yesterday I was crunching 18 hours a day to get it ready for a release on Steam... those were fun times. The morning it actually launched I hadn't slept for 30-something hours, so that was pretty intense. Hopefully I can avoid that situation with future game launches.

Doodle Post

Image

Dev Log: To Batch or not to Batch

Dev Log: To Batch or not to Batch
One of the things gnawing at me over the past few months is the rendering performance of Otter. So far it hasn't really been a problem, but I've only made a couple of low resolution prototypes and a game jam game with it so far. For my current project, a 1920 x 1080 resolution game, I started to worry about the rendering time as I add more and more assets to it.

So I was thinking "Hey maybe I can add some kinda sprite batching to Otter like XNA or Monogame has!" The basic concept is that it is very expensive to switch textures when rendering things with a GPU, so you take a bunch of sprites that all share the same texture and try to mash them together into one draw call from the video card. This way you can render all your sprites but you don't have to switch textures for every single one of them.

To start on this I basically tore down a bunch of rendering code in Otter. This was a few days ago, and since then I do have some sort of basic sprite batch working. In a little example I have 1000 sprites rendering with the same texture and as far as the video card knows it's actually only 2 renders... but so far I actually don't think this has affected performance at all!

I'm using SFML.Net for the core rendering of Otter. Everything that goes to the video card to show up on the screen goes through SFML's Draw functions. So far according to my small tests it seems that the video card isn't really having any issue switching textures a thousand times, but something before that is actually causing the slow down.

It seems that just going through and appending vertices to a vertex array in SFML.Net is just really slow. For example Otter's RichText class suffers from a pretty big performance hit if it's used to render a lot of text, like enough letters to cover the entire screen. This is pretty odd since RichText.cs in Otter is pretty much a copy of SFML's own text class from the C++ source! Almost the same code in C# runs almost 10x slower than C++, and of course this is not a big surprise since C# has a bunch of extra stuff with the managed memory and garbage collection. Still, it is pretty discouraging to realize. (Another tough one is the Tilemap class, which will suffer from big slow down during real time modification of a huge tilemap due to the rebuilding of the VertexArray!)

So right now I'm still reorganizing a bunch of code in Otter's rendering stuff. Hopefully the API will remain mostly unchanged, but right now my hope is that using texture atlases in Otter becomes smoother and actually has a performance benefit. Yay programming.

Dev Log: Using Config Objects

Dev Log: Using Config Objects
One of the recent changes in Otter is the ability to configure the RichText object with a RichTextConfig object. This was inspired by something I saw some friends of mine doing in their project. Instead of having a long drawn out list of possible parameters for the creation of an object, instead you can pass in a config object that has all of those parameters set. Here's a quick example.
//In a static class that holds all the Config objects
public static RichTextConfig RTSkyCellStat = new RichTextConfig() {
ShadowColor = G.Colors.Dark,
OutlineColor = G.Colors.Dark,
OutlineThickness = 3,
CharColor = G.Colors.Light,
ShadowY = 3,
Font = Assets.FontHud,
MonospaceWidth = 16,
FontSize = 28
};

And creating the RichText object with this looks like this:
public RichText TextHealth = new RichText("600", Config.RTSkyCellStat);

One of the coolest things about using a Config object is that one Config object can be used for a bunch of different RichText objects. This means that I can define common styles of RichText in a static class somewhere and reuse them as much as I want, so if I need to change something across all of those RichText objects all I need to do is change the config.

I'm not sure if this is the best method of doing this in C# land but so far it seems to be working pretty well. I'm also using Configs for a lot of my UI elements as it lets me define a couple of different styles for panels and buttons and reuse them for elements that share similar roles.

Dev Log: Menus

Dev Log: Menus
I've been a little bit in a heads down mode over the past couple days while working on my video game. I've been posting some updates over on my Twitter in the form of little screenshots and animated gifs, but haven't really written about anything in awhile!

One of the big hurdles to overcome to get this game into a real, actual playable state is making a good menu system. The game is going to be relying a lot on menus for the player to build things in the world, change their equipment, check their status, and who knows what else. I tried looking into some menu frameworks, but I've fallen back onto just making my own menu classes and hard coding everything.

Image


Everything you see here is just made up of two classes: Menu, and MenuButton. Menu can have a list of child Menus, and a list of MenuButtons. MenuButtons have callbacks and such for when they are clicked, rolled over, rolled off, and other handy things. Since everything in this game is controlled by a cursor of some sort, the menu's are a little bit easier to design. Also for now all I have to worry about are buttons. I haven't gone down the path of text input or scroll bars or selection lists, so for now just two little classes will suffice.

Almost all the art in the menus are also made up of NineSlice graphic objects in Otter. NineSlice panels make it really easy to design UI, since the same texture can be used for any size panel. For more info on how NineSlices work, check this out.

That's it for now. Hoping to get a nice logo and officially say what the name of this game is soon (although I've been tagging these posts with the name of it for a few weeks now I think.)