The Animal Farm

December 23rd, 2014


After many years, I’m sunsetting this blog. The WordPress installation has become cumbersome to maintain, the readership is low, spam is consistent, and other systems do the same things better.

I’m still going to keep it up here for those who want to comb through the archives, but updates will be few and far between.

But I’m not vanishing! I’ll just be posting on different places. Namely, Tumblr:
The Animal Farm Creations - my primary Tumblr
Pixel Space Horror - the Tumblr for my active side project

Both are very empty right now, but they’ll be evolving over time.

It was a good run!

One last trailing quote for the road…

September 25th, 2014

Robots Need Love Too

The newest dope game from Elephant Mouse, Robots Need Love Too, is now available for iOS devices. Here, have a link.

I was the Client Engineer on this title. ’cause that’s my job and stuff.

April 6th, 2014

More Thoughts on Unity

This is the follow-up to this post. It’s a bit more nitpicky.

For 2D games, the Mecanim animation controllers are not great. They tend to be just big webs where every state can go to every other state, which gets unmanageable when every animation has 4 directional variants. You can work around this though by playing states manually. In the cases where you need long chains of animations, the transition system is quite useful.

It’s weird how you setup animation events - not in that the editor design is bad, but that before you create an event you also have to have the method written out that will receive the event. Fine if you’re just one guy. But if your artist is working independently from your programmer, you either have to collaborate closely, your artist needs to learn rudimentary coding, or your programmer needs to edit animations. For some cases this is unavoidable - like when the events are complex - but most of the time you just want to fire off a named event and have code listen for that, and the artist should be able to handle the animation editing on his own.

There’s no good way to listen for when an animation ends. There really ought to be a clean way to do this, but there really isn’t.

Sprite Packing
Unity’s Sprite Packer does some things well and does some things very poorly.

One cool thing that it does is create a mesh out of the sprite instead of using a naive rectangle. This saves on fill-rate, requiring the pixel shader to run less often. It does increase raw triangle count and makes the vertex processor work a bit more, but that usually isn’t an issue.

One bad thing that it does is pack poorly! TexturePacker outperforms it pretty solidly. At first I attributed this to the complexities introduced by trying to fit together complicated meshes in a sheet rather than rectangles, but even if you turn off the Unity mesh generation, its packing is still worse.

I mentioned this in the first post, but there’s more:

Once you start downloading plugins from the Asset Store, your workspace gets really cluttered really fast. There’s absolutely no standardization on directory hierarchies or asset placement. Some plugins like to throw things in your root folder. Some plugins nest things 5 folders deep. Sometimes plugins use the same directories for the same ideas, sometimes they don’t. Sometimes a plugin will introduce direct conflicts with other plugins - especially hazardous on Android builds.

It rapidly escalates into a Huge Mess.

It boggles my mind that Unity couldn’t provide one serialization option that works on iOS with the binary stripping level at its maximum setting. Both the XML & Binary serialization choke. You have no choice but to roll your own. A lot of people recommend Google Protocol Buffers, but that has some weirdness associated that I didn’t want to drudge into.

Some clever usage of ISerializable and IDeserializationCallback can make binary serialization available if you’re willing to roll up your sleeves.

Curiosities & Miscellaneous
Screen.width and Screen.height return the wrong values in the editor. How crazy is that? They’re consistently half the actual pixel dimensions of the game view.

February 1st, 2014

Neptune’s Pride

Though I’ve been playing a small bit of Guild Wars 2, most of my gaming thoughts have been focused on the vicious warfare happening between me and my coworkers in Neptune’s Pride 2.

NP2 is a space warfare game, a 4X game focused on research, exploration, and destruction. The basic gameplay mechanics are simple - you amass armies and lunge them at your opponents, trying to conquer half the galaxy.

The primary “hook” is that games take place over a long, long time period, but you only need to spend a few minutes a day playing. Traveling between two close locations can easily take 5 hours. Researching technology takes days. A game can easily last multiple weeks.

It gives rise to a number of interesting strategies. If you’re up at 3AM, can you launch a sneak attack that catches your opponent unaware and ruins his morning? If your ships are attacking a planet 6 hours away, will they make it there before the opponent realizes and brings in reinforcements or upgrades their weapon technology?

It also gives rise to novel diplomacy. Alliances and mischief are always part of any good war game, but they feel different when they’re evolving over the course of multiple days as opposed to multiple hours. You can research a tech for days, share it with an ally, and then be caught by surprise when you wake up at 6AM to find that ally just used that tech to invade your home world. You can play several sides against each other, comfortable that they won’t be able to reach you from the other side of the galaxy until they’re knocking at your door the next week.

And you’re doing this through private messages, so unlike a board game, you can plot out in secret and really hurt someone’s feelings.

This is all, of course, in addition to the normal stress of a space warfare game - deciding how to allocate your resources and what upgrades to focus on and where to send your armies.

My eastern front. Which is secure - don't get any ideas.

My eastern front. Which is secure - don't get any ideas.

It’s a really fun game. I strongly encourage giving it a try with some friends.

January 31st, 2014

Thoughts on NGUI

NGUI is regarded as one of the best UI frameworks for Unity. It’s constantly on the front page of the Asset Store, it has high reviews, and everyone I talk to swears by it. It’s good, but it has some serious failings. Let’s chat about it:

I put this first, because it’s a really glaring black mark on NGUI. It’s just not very well documented. Most ‘how to’ guides are in video form, which is not great if you want to get at information quickly. The small bit of text there is is… poorly written and confusing. The guide on UIGrid is a crazy mismash of information that leaves you more confused than enlightened. And 85% of the documentation is woefully out of date - they use the wrong class names, legacy workflows, or have just become plain wrong. It’s almost impossible to suss out exactly what your’e doing without painstakingly combing through examples or wildly guessing until you strike gold.

NGUI actually has a lot of stuff. It’s trivially easy (once you know how) to setup a table, make it scrollable, and rig it in such a way that it works across all resolutions. Complex widgets & interesting interactions are never terribly hard. In fact, I can’t think of a single widget I’d want that I can’t hook up in NGUI with a little effort.

I can’t speak a lot here - I haven’t dived too much into the localization system. But I do know at least one good thing and one bad thing. First the good: NGUI supports dynamic fonts as opposed to being exclusively bitmap font oriented, which is practically a requirement when you’re localizing to Asian languages. And the bad: the word wrapping for Asian languages is just wrong. They use a naive algorithm based exclusively on white space separation, and that’s just not good enough for most Asian languages. It’s a shame, since this is a pretty hard problem.

Unity 4.3 Integration
Unity 4.3 introduced 2D workflows as a first class citizen of Unity. NGUI quickly integrated it, but not in a particularly robust way - it’s impossible to use a Unity Sprite as a 9-slice. Which means if you want 9-slices, you’re forced to juggle NGUIs atlasing system & Unity’s. Not impossible, but not ideal. There’s nothing stopping them from doing this. I’ve dug into the code and seen how they render Unity Sprites, and the system could be extended to support 9-slices, but it’s not entirely trivial (NGUI has a system of complicated editors where setting up the right information is a little tricky).

That’s all I can talk about right now. I’d like to speak on performance, but I don’t know yet - I haven’t created a UI significantly complex enough to tax the system, and I’m unversed in Unity performance in general. So… let’s hope that doesn’t explode for me.

As of this writing, Daikon Forge looked like a decent competitor, but I couldn’t get the trial running on my system. There are certainly a few other solutions, and some of them might be good, I encourage you to explore them and let me know.

January 30th, 2014

Thoughts on Unity

I’ve been looking heavily at Unity these days, so much so that when I participated in Ludum Dare a couple months ago, I opted to make a jam entry with the engine.

There are some good things about Unity, some great things, some obnoxious things, and some little quirks. I’d like to discuss them here in no particular order.

Oh, how I’ve missed you C#. I’ve spent the last three years of my life coding exclusively in Objective-C. I’ve come to terms with Obj-C, much of my initial vitriol toward it has dulled, but I never grew to like it. I like C# though, and I’m constantly amazed at how much more comprehensive the C# standard library is; when I was porting over a lot of useful code, more often than not I found there was no porting required because C# already had an equivalent method in its library. I don’t know yet how well garbage collection performs on mobile - that worries me a bit given my experience on other platforms, but we’ll see.

Multiplatform Support
Unity touts itself as being completely multiplatform, and that’s true and it isn’t. It can certainly build to every platform, but there are gaping holes. There’s no such thing as a per-platform asset - there are *settings* on a per-platform basis, but you can’t, for instance, use one texture on Platform A and a different texture on Platform B without either loading both textures or sacrificing usability within the editor. This gets worse on mobile, where you certainly don’t want to load iPad Retina images on an SD iPhone, but getting around that is especially hard.

The current UI system is pretty laughable for a large project. The only real options are in the Asset Store. Unity has been working on a new UI system, but I have it on good authority that they’ve been working on that UI system for forever and that I probably shouldn’t hold my breath.

This falls under one of those ‘great’ categories. Physics systems are hard; I’ve coded a few and never really got a good handle on the area. With Unity, though, it’s really just setting up some colliders and tweaking parameters. It’s not a solution to everything - good platformer or car physics is still hard - but it’s a really nice starting point.

The Unity editor is pretty good. It’s intuitive, powerful, and easy. It’s also incredibly extensible, allowing you to easily create custom editors & functionality when necessary. Conversely, MonoDevelop is not that great - the Intellisense is horrid, the autoformatting is obnoxious and hard to configure properly, and the debugging can feel wonky. Plus it doesn’t interface very well with the main editor: half the time I double click to open a file, I get the wrong file or the wrong project entirely. It’s not unusable, but I probably liked Xcode more, and that’s… unfortunate.

External Plugins
I’ve had to interface with Obj-C land for a few custom plugins, and it was really, really pleasant. Just wrote some code, and Unity pulled it into the Xcode project seamlessly. It’s not perfect though - there’s no proper way to add frameworks or change the Xcode project’s linked libraries without modifying the Xcode project manually. That’s Apple’s fault though. They just didn’t provide a way to modify Xcode project files outside of Xcode. A few clever people have reverse engineered the Xcode format for doing this, but it’s a brittle and dangerous solution.

Asset Store
The Asset Store is awesome. There’s a ton of stuff in there, and it’s mostly reasonably priced. Not a lot to say here though - it’s just full of good stuff.

That’s enough for now. It’s just a small look at the toolset, and I’ll probably have more to say in the future. There have been some hiccups, some larger than others, but you’ll have those with pretty much any system. Overall, it’s been a perfectly pleasant experience.

May 1st, 2013

Old Game Ideas, v1: High Noon

Thought I’d take some time to re-explore some of my older game ideas. They may have already been presented in this space, but many of them are so old that even I barely remember them.

We’ll start with High Noon, a project I started up in college and restarted at various points to little success.

At its core, it’s a turn-based strategy game set in the Wild West. Before each battle, the player picks a team of thusly stylized units. Each unit has base stats (weapon, range, damage, etc) and a couple special powers. Each turn you have action points you can spend to move your characters around and attack.

Pretty simple setup. This was designed to be relatively small - no real player progression aside from acquiring new units, no story to speak of, just quick battles.

Back when I first thought of it, asynchronous play didn’t exist as a widespread concept, but I think it’s a pretty natural fit.

Might make a good Unity learning project? I’m already tinkering in my off-time (side note: I’ve ported a sizable portion of my procedural building generation, and it’s looking pretty snazzy). Asynchronous is hard/costly to do cross-platform, but Game Center is a viable option for iOS-only.

April 7th, 2013

A Brief Discussion on Bioshock Infinite

Spoilers Ahead. Deal with it.

Bioshock Infinite was a good game, though somewhat lacking in the gravitas of the original Bioshock.

A lot was made of this big floating city in the sky, and beautiful as it was, generally it just felt like a normal city. A normal hard to navigate city, since I could never keep track of which skyline would take me where. There was a sky and some ground, and most of the time I forgot I was perpetually in the air. I tend to prefer bright and accessible games, but it’s undeniable that Rapture set a mood that made it a character unto itself.

Columbia sets a mood more with what fills the environment. Much like Rapture is a picture of Objectivism gone wrong, Columbia is a comment on Exceptionalism and Nationalism taken to their nasty extremes. Here it does an excellent job. My favorite portion was when they introduce Fink and his establishment, focusing on labor exploits that are very much rooted in American history. His talk seems almost satirical - like the heightened rhetoric of Ryan - but it’s a reflection of a reality that still partially exists. It’s masterfully done.

The narrative had some pacing issues. Near the middle there is a series of fetch quests, cheapened by the fact that every time you get near the thing you’re fetching you simply jump to another world where the thing you were fetching had already been fetched. Time starts to (seem to) skip around erratically, and without actually accomplishing anything you’re in the middle of a bloody revolution.

Near the end there’s the classic “giant information dump” to reveal things they couldn’t fit naturally into the narrative but needed to reveal for a full conclusion to make sense. It’s something Eternal Sonata did, though Eternal Sonata did it much worse. It’s not terrible - they provide subtle hints throughout the game where you could possibly piece bits of it together, and once it all fits there are even subtler clues in the game that seem a lot more clever. Still, there could have been more organic revelations.

Comstock, for all his importance, didn’t measure up. Andrew Ryan was a fantastic antagonist, constantly menacing you through the dreary Rapture. Comstock tries, and he has a few shining moments near the end of the game, but he’s mostly of little consequence while you tear down his army. Fitzpatrick is equally unimpressive - you don’t have a lot of time to warm to her before Elizabeth gets all stabby.

Gameplay didn’t really bring anything new to the table. Guns were guns, Vigors were (mostly rehashed) Plasmids, the end. The skylines added a little twist, and it’s clear they wanted me to use those by how much Gear they gave that was skyline-centric, but I never found much success there outside of hurriedly running away from a Handyman. It was good gameplay - a solid FPS - but nothing we didn’t see in 2007.

I found myself missing the Big Daddies, the terrifying battles that left me within an inch of my life and completely out of ammo. Even though I always knew when they were coming and had time to plan and lay traps. The closest equivalent we had here were the Handymen. They were good - seeing one of those hulks tear an airship in half before charging you was certainly harrowing - but I think there were three of them in the entire game? Maybe I should crank the difficulty up.

I know most of this discussion has focused on the negative, and it sounds like I don’t appreciate the game when set beside its predecessor, but understand that if it were half of the original Bioshock it’s still miles ahead of every shooter and the vast majority of games. When I’m thinking about games as art, wondering whether I could make a strong argument for any mainstream releases, Bioshock 1 & Infinite are the games I reach for first.

March 13th, 2013

Fun With Chess

A week ago I sat down and programmed a basic chess implementation with full support for hot-seat play. It includes most of the rules except for conditions where you can force a draw.

It even includes en passant, which hardly anyone knows. For those unversed: if an opponent moves a pawn two spaces for its first move and it ends up side by side with one of your pawns, you can take the opponent’s pawn by moving your pawn into the space that was skipped over.

And for those not sure about how castling works: if you have an unmoved king and an unmoved rook, and the king is not in check, and there is a clear path between the two pieces, and the king would not move into or through a space that puts him in check, you can move the king two spaces toward the rook. You then move the rook to the other side of the king (jumping the king, essentially). This generally puts the king in a more defensible location and puts the rook in a more active role in the game.

The rules I haven’t implemented: the fifty move draw rule states that if there are no captures and no pawn moves in fifty consecutive turns by each player, a player can claim a draw. The threefold repetition rule states that if the board is in the same state three times with the same player to move, a draw can be claimed (I probably won’t implement that one). Pawn promotion is when a pawn makes it to the other side of the board and can be exchanged for any piece.

So yea. I guess RPG Chess is happening.

When I get some free time again, my next step is to setup the Game Center rig and see if I can’t get asynchronous play going. After that, i want to add a framework for using character powers.

And after that, the world.

February 20th, 2013

Third Game Idea of 2013

This blog may just turn into assorted game ideas/executions for the foreseeable future. That wouldn’t be its worst use.

Slots SLAM!

It’s a cross between a slot machine game & a match three game. You spin the machine, and symbols come up. When they do, you can then move them Bejeweled style to form matches. You can’t make a move unless it forms a match. New pieces do not fall in from the top.

When you’re satisfied that you’ve made all the matches you can, you spin again to get new symbols.

You’re awarded based on the number of matches and any combos. If you manage to match all the symbols without hitting the spin button, you’re awarded a ‘Jackpot.’

You’re penalized based on how many symbols are left on the screen when you hit the spin button. If you hit a certain threshold, the game ends. Alternatively, there’s a timer that your’e racing against to get the highest score. Alternatively alternatively, you have a set number of ‘coins’ you can use to spin & you gain coins with certain matches & the game ends when you run out. I’m sure there are other game modes that can be mined here, but those are just the two blatantly obvious ones.

It’s a more casual game than what I generally focus my time on, but I think there’s an idea here. Maybe something for a Game Jam?