Unity 3D vs libgdx: 2D performance



Did you read my previous post about 2D frameworks for Unity 3D? I was curious how their performance compares to my favourite framework for game development: libgdx.

Again, I tested everything on my Xperia Play (on iOS you'd get roughly similar performance using an iPhone 4). My test consists of a single background sprite (640x960 px, static) and three animated sprites (all frames were packed into a single atlas texture to reduce draw calls).
Every touch spawned 10 sprites, every second touch spawned another 100 sprites (randomly selected from these three types). Sprites go from the top of the screen to the bottom of it and are deactivated and reused later (except for the libgdx test, read below). Here are the results:

Sprite countOrthello 2Dex2DSpriteManager 1SpriteManager 2libgdx
5057 fps60 fps60 fps60 fps60 fps
10018 fps60 fps60 fps60 fps60 fps
1506 fps58 fps60 fps60 fps60 fps
2004 fps52 fps60 fps60 fps60 fps
3001 fps35 fps60 fps58 fps60 fps
5001 fps22 fps58 fps52 fps60 fps
10001 fps11 fps45 fps39 fps60 fps
1500-6 fps33 fps-59 fps
2000-4 fps26 fps-43 fps
3000--17 fps-33 fps

It's worth noting that the libgdx version was built in a rush and I didn't try very hard to optimize it (the sprites aren't even deactivated/reused, because LAZY). Still, the performance is pretty great - that's one of the reasons why I love libgdx!

Comparison of 2D frameworks for Unity 3D

Unity 3D becomes a weapon of choice of many game developers. Amount of Unity-powered games is growing rapidly especially on mobiles. As the name implies, Unity 3D is suited better for 3D games and the vanilla editor is not a good tool to make 2D games. But there are a lot of frameworks that try to tackle this problem; let's see what they're worth!


Orthello 2D (Free/$35)

It has a free version (with quite a lot of features) and a Pro version. I tested the Free version.
The good: Orthello comes with loads of handy classes. You can import texture sheets and atlases easily, create animated sprites, tween their parameters, check collisions and input... All with just a Free version! It's well documented, with a nice user guide.
The bad: Orthello's performance is... Well, bad. Very bad. Apart from this it imposes some restrictions (e.g. you have to use an orthographic camera, you should create sprites from pre-made prefabs etc.). It loses a lot of flexibility because of this.


ex2D ($25/$35)

ex2D will set you back $25/$35 (depends on whether you purchase from the Asset Store or directly from authors), but there is a free evaluation version available.
The good: ex2D provides a few tools for creating atlases and sprite animations. You'll be using them straight in the Unity editor, and you'll like them 'cause they're good. I liked the whole workflow for ex2D and I set up my test fastest using this library.
The bad: Documentation is a little bit lacking and contains a lot of grammar errors.


SpriteManager 1 (Free)

This is a free and minimal sprite library. The only thing it does is rendering sprites and sprite animations. It is also the fastest one.
The good: great performance! SM consists of 3 classes, which aren't even MonoBehaviours. I liked the flexibility that comes from it.
The bad: SM consists of 3 classes, so yeah, you'll be coding a lot of things yourself. The lack of atlas importer hurts the most (you have to type in UVs for every sprite in the atlas...).


SpriteManager 2 ($149)

It's a developed version of SpriteManager 1, armed with tools for creating atlases and animations.
The good: the performance is still great, it's almost as flexible as SM1 too. But you can use simple atlas and animation editors this time around!
The bad: it still just renders sprites; if you need collision/input handling, scrolling backgrounds etc., you'll have to code it. And while the editors do the job, they're a little bit rough. SM2 is rather expensive.


2D Toolkit ($65)

I don't own it and unfortunately there is no free version, so I couldn't test it!


Performance

I'm mostly interested in mobile performance. I tested all of these frameworks on my Xperia Play (on iOS you'd get roughly similar performance using an iPhone 4). My test consists of a single background sprite (640x960 px, static) and three animated sprites (all frames were packed into a single atlas texture to reduce draw calls).
Every touch spawned 10 sprites, every second touch spawned another 100 sprites (randomly selected from these three types). Sprites go from the top of the screen to the bottom of it and are deactivated and reused later. Here are the results:



Sprite countOrthello 2Dex2DSpriteManager 1SpriteManager 2
5057 fps60 fps60 fps60 fps
10018 fps60 fps60 fps60 fps
1506 fps58 fps60 fps60 fps
2004 fps52 fps60 fps60 fps
3001 fps35 fps60 fps58 fps
5001 fps22 fps58 fps52 fps
10001 fps11 fps45 fps39 fps

In my opinion you should choose between SpriteManager and ex2D. Both SpriteManagers are very fast and very flexible. It's up to you how you extend it for the needs of your game. If you don't care about money, buy SM2 and save yourself coding a read-sprite-from-atlas tool. I'd recommend ex2D for less experienced programmers. ex2D's excellent tools will get you up and running in no time, performance is sufficient and the framework itself is pretty cheap.
Now go and make some games!

Thoughts on Sword & Sworcery EP

Okay, the full name of this game is Superbrothers: Sword & Sworcery EP, I know. That's because the art is made by Craig "Superbrothers" Adams, and because the music (by Jim Guthrie) plays an important part here (hence the EP), and because the game consists mostly of swordsmanry and sorcery. Whew.
It was released on iPad, followed by iPhone, followed by PC (version tested) and almost immediately gained worshippers everywhere. In this post I'm going to tell you how much I didn't like this game.

So what's it about? You play as Scythian, a female warrior. There are a few locations, a few characters to interact with, a few puzzles and very few items. It plays like a streamlined adventure game, in which you mostly click on things and see what happens. There's also some swordfighting involved - enjoyable, but just for a while.
I wrote about Blackwell games recently and praised them for streamlining the genre, but it's gone too far in Sworcery. They stripped the enjoyable bits as well. Let's take a look at the most basic thing: puzzles. Almost all of them revolve around clicking on certain objects in certain order. I beat most of them by clicking randomly on these objects. Maybe there actually is some thought behind them (explaining the particular click order), but I noticed it in just one puzzle. So this part of the game was equally boring and frustrating, as "solving" these puzzles isn't rewarding at all.
Apart from it you'll be walking a lot. While I enjoyed the animations, it wasn't enough to keep me engaged in long walks.

But! These things aren't the core of Sworcery, you'll say. It's all about the atmosphere, the wackiness, about exploring this world, music and graphics. Ok.
I didn't like the graphics. It certainly is specific and distinct from "regular" pixel art. But it also has a washed-out color palette and tends to shape everything from rectangles, which makes everything look very similar. Fortunately, music is just great and I listen to the soundtrack quite often. One can hear bits of IDM, chiptunes or even post-rock here. It's very eclectic, enjoyable and totally worth a purchase. (it's already inclued in the Steam version of S&S)
Let's get on to this wackiness!
Sworcery is split into a few episodes. In-between them you'll meet the Narrator. He breaks the fourth wall a few times and speaks directly to you, the player (art!). He tells you how much it will take to complete a certain episode and encourages you to take a break when you finish it. At some point the game even suggests you to take a two-week break to complete a single task. That's pretty brilliant, actually. I felt that someone here cares about my time and strives to provide the best experience. I love being suggested how to approach a specific game to make the most out of it, even if it's a simple text like "Play in a dark room with your headphones on" in Amnesia.
But this goes too far at times. The Narrator implies (numerous times) that it's very important to... turn on Twitter integration. Every line of text in the game fits in a single tweet and you are allowed (and sometimes encouraged) to tweet it. While it's an interesting idea, I found the writing to be rather bad. Its overuse of plural forms and slang makes it irritating at least. Someone wants you to look for a thing: "Not another fetch quest amirite?" (which is followed by a fetch quest, yes, and stating it beforehand doesn't make it any better). You find the Megatome artifact at some point: "We found the Megatome & we are awesome" (Tweet this!). Oh, the Megatome. It's a book that allows you to read every character's thoughts. They show up in the Megatome just like status updates on Twitter or Facebook. This got me excited; it was very interesting to talk to someone and then check out his "thought updates" about our talk.
Unfortunately, it quickly boils down from Thoughtter to HintBook, as the characters seem to think only about helping you in your tasks or boss fights. Pity! I hoped that Twitter integration would somehow be connected to the Megatome, but no. It doesn't have any gameplay meaning. In fact, the whole social aspect of Sworcery didn't seem to have any meaning to me. "Let's comment on social media by putting it into our game & we are awesome!"

Actually, that pretty much sums up my experience with Sworcery. It's like the developers telling me that they're all awesome and force me to watch their awesomeness in action. And that it's art and I should tell all my Twitter friends about it. It even has a bear with a penis which hums like a man, so it's definitely art.
And I think it's just very self-righteous.

But follow me on Twitter, will you?

Thoughts on Blackwell


Blackwell is a series of classic point and click adventure games from the New York -based developer, Wadjet Eye Games. There are four episodes available: Legacy, Unbound, Convergence and Deception. I picked up first three of them in a bundle from Indie Royale. I'm not a fan of adventure games, but people said these are pretty good, so I just fired up Blackwell Legacy one day. And immediately fell in love.
Blackwell games are centered on Rosangela Blackwell, a shy and closed-in book reviewer from a small newspaper. One day Joey Mallone appears in her life. He's a ghost of (apparently) private investigator from 1920s. Actually, we don't know anything sure about him... which makes things interesting. He says he's bound to Rosa, he can't leave her and that they have to seek for ghosts and help them get to "the other side". Actually, he seems to have a connection with other women in Blackwell family: he haunted Rosa's aunt Lauren and her grandmother. They ended up in a psychiatric hospital... So, Joey and Rosa seek for ghosts haunting various places in NY and help them get to the "other side". These ghosts rarely remember why they're dead; they mostly don't even know they're dead.
You solve ghost cases by investigating what made them die, and sometimes you get to know more about your family and Joey.
Does it all sound dull? Or maybe like a ghost story for teenage girls? I read a few reviews before playing and though exactly that. I was so wrong!
The first thing that hit me was the writing. It's excellent. Dave Gilbert (head of Wadjet Eye and author of Blackwell games) isn't very wordy, but somehow manages to slip lots of personality between every character's lines. People in Blackwells are actual people, not just clue-dispensers or obstacles. Voice acting helps here and is mostly good, though some lines seemed kinda off (but just a few ones). Dialogues are witty and genuinely funny at times. I enjoyed every conversation a lot. In Blackwell Unbound you get to play as Rosa's aunt, Lauren, who is a slightly depressed and constantly smoking lady. Her arguments with Joey are even more entertaining.
The story itself is truly engaging. It feels like a tv series, with separate cases being episodes - and with a bigger story involving main characters, which is spun over all of them.
Then there's a subtle, jazzy soundtrack, perfectly fitting for late-night strolls through NY. Art direction is a little different in every game. I liked it the most in the 3rd one (Convergence), it reminded me of Gabriel Knight. Beautiful backgrounds and character portraits were a pleasure to watch. That's why I was disappointed to see Deception's (4th one) art, which is more upbeat and comic-like. Actually, that's my only complaint about Blackwells: I'd like them to be somewhat darker. Unbound felt a bit like that and I'd love to see more sinister elements in the other ones as well.

I finished the first three, immediately bought the fourth one and finished it as well. After playing I felt that I actually like adventure games. I tried a few others (5 Days A Stranger, Technobabylon) and was frustrated - but it helped me to understand why I liked Blackwells so much.
Gilbert strived to minimize all the things that annoy me in point and click games. Let me write them down:

  • pixel hunting - clickable objects in Blackwell are rather big, and if something important has to be small (like a key), it's always somehow highlighted.
  • lots of items and item combinations - puzzles in Blackwell are mostly based on gathering clues, not items. If you hear about something new, you can talk about it with others and look it up on the web (Rosa has a computer and can use Oogle search). You rarely have more than 3-4 items. Then there's the notepad. Rosa collects all the clues there and it acts somewhat like a second inventory. You can use these clues in conversations (that is: ask people about them). Clues can be combined to form new ones; I liked that, it made me feel like I'm actually figuring things out by myself. Very cool, but underused feature!
  • lots of locations and backtracking - I hate to find and item in Room 1 and have to go to Room 10 to use it. Blackwell solves it by using a city map - from this "hub" I can go to any location, which consists of 1-2 screens. Additionally, if a location is not needed later in game, it just disappears from the map. Nifty!
  • nonsense puzzles, like use matches on cheese to build a helicopter. Puzzles in Blackwell are... I wanted to say that they're easy, but it's not true. I'd call them intuitive. And even if you get stuck, using everything on everything is actually doable, because you have just a few items and locations at a time.
  • interface - most point and clicks use some form of the SCUMM standard: you have a few standard actions (look at, use, pick up, talk) and apply them to items/characters on screen. I hate it. Let's say there is a room, doors are locked and there's something shiny on the floor. Click to show action menu, click "Look at", click on the item. It's a key. Click, actions, click, "Pick up", click key. Click to show inventory, click key, use, click door. Action menu, use, door. Opened!
    Blackwell uses a very simplified interface: right mouse button means "look", and the left one means "use". "Use" is the most obvious action on given object: talk to people, open door, pick up item etc. Also, to open the inventory I just need to hover the mouse at the top of the screen. These facilities might seem minor, but they make a big difference to me.

Gilbert understands the genre, but improves greatly upon its flaws. I can't recommend the Blackwell series enough... They're a bliss to play, don't miss out on that!
You can get them on Steam, GOG, Desura and directly from Wadjet Eye.

Ludum Dare 23 post-mortem

I always wanted to take part in Ludum Dare, but every time there were some important things going on in my life. This time I made it, thanks to my wonderful wife! She took our kids to her parents and I had at least 24 hours of free time. I walked with them to the train station and started to think about my game on my road back. Wait, I started to DESIGN my game then, sounds better. The theme was "Tiny world". So I had an idea of a simple god-game, played on a single screen. You must take care of your followers, but your only power is to create and destroy land. It's kinda surprising that all these design choices actually made it into final game!


First things first: play it here!

These are my ratings:
#100 Innovation 3.71
#114 Theme 3.67
#157 Audio 3.17
#201 Humor 2.77
#252 Mood 3.00
#255 Overall 3.28
#358 Graphics 3.02
#455 Fun 2.76

(there were 1402 entries)

Now, it's time for the classic post-mortem!

What went right

1. Technology
I chose to write my game in Java, using libgdx. I ended up using Universal Tween Engine as well. I'm familiar with both of them and feel comfortable using them. I set up my projects in the blink of an eye, thanks to gdx-setup-ui. There were literally no moments of fighting with any of these libraries. I just coded my game as I wanted to. Fun fact: I used Tween Engine for a lot of things, including terrain generation!

2. Hard design choices
I wanted to keep my basic principles (single screen, no direct influence on followers) and it helped me to actually finish the game. I had lots of additional ideas, expanding and even neglecting the base ones, but I quickly realized that if I won't stick to some choices, there's no way I'll finish it in 24h.

3. Not using sfxr/bfxr for sound
Most of LD entries are using some variations of above programs. While they're neat tools to quickly make old-school sounds, I don't really like these sounds. It's annoying to play dozens of games which basically sound almost the same. I recorded all my sounds using a simple microphone (or even my phone). I screamed, hit my desk, threw my children's toys, knocked on the sink etc., then quickly edited all of these in Audacity. It was kinda fun and I think it doesn't sound too bad.

4. Making a game
Yeah! That's the thing I'm most proud of - I created a game from scratch!

What went wrong

1. Playability
My game doesn't feel very fair and fun. (I got the worst place in Fun category, not without a reason!) Unfortunately, I was running out of time and I knew I won't be able to implement features I wanted to... So for the last 1 hour I just balanced all gameplay factors to make it winnable (and not too easy). I was aware that the player doesn't feel involved. But I hope to fix it in some post-compo versions!

2. Sticking to procedural generation
At the beginning I thought that it'd be cool to make a game with no pre-made textures. I wanted everything to be created at runtime. There was no reason to do it and I lost some time before I started drawing anything. Remember kids, don't do anything that slows you down!

3. No tutorial
Again, I had no time to create a decent tutorial, so I just wrote an instruction in the README file and on the LD page. Not everyone reads these things nowadays... Some people were totally confused with my game and never tried to understand it. It's my fault!



I'm very glad I took part in Ludum Dare. A few years ago I was very into painting; I remember that peculiar feeling of filling an empty canvas with an image straight from my head. There's something inexplicably amazing in the act of creation. Ludum Dare made me feel this again - especially that I managed to drive my work into a state of (partial) completion.

Thoughts on Limbo


You've probably heard a lot about Limbo. This critically acclaimed platform-puzzler won a few awards here and there. Yet, I felt disappointed when playing way too often.
It's a very bleak game. Starting from gorgeous greyscale visuals, which set the game's tone. There's no literalness in this aesthetics, every object is represented just by its silhouette. It leaves a room for imagination - which is always good in games. There's absolutely insane attention to detail: tree branches sway in the wind, spider's web leftovers remain sticked to the boy's body after getting free of the web, small rocks fall down when you're sliding down the hill... A separate sentence is needed to cover the boy's animation: it's unbelievably fluid, goes from one animation to another with no visible seams; the boy always puts his foot adjacent to the ground. Every detail is so damn good that you'll stop noticing it after a while. Everything works like it should, you won't see a single graphical glitch in the whole game. Hats off.
Audio adds depth to the atmosphere. Most of the time you'll only hear sounds of your own footsteps and environment. There are no words in Limbo. No human voices. Almost no perceptible music; it makes you feel lonely and hopeless.
Audio and animation is almost exactly what I'm aiming for in Cavery... Enough gushing, let's get to the gameplay! And the disappointment.

Warning - MASSIVE SPOILERS AHEAD!


Uncertain of his sister's fate, a boy enters LIMBO.

That's all we know about the story and setting. You start in a forest. It's quiet, calm and somewhat unnerving. You learn how to run, jump and die. You will die a lot, in gruesome ways. The boy doesn't scream, he almost always dies in absolute silence - which makes deaths even more unsettling.
Then there's the spider.


If you're still reading this, you've probably finished the game already, so you know about the spider. It's absolutely phenomenal, terrifying and is the thing you'll remember the most from Limbo. I was scared, felt completely helpless and absolutely vulnerable facing him. This spider embodies fear and proves that we're all at least a little arachnophobic. There's something... disturbing about its movement. Also, there's no dramatic music when you're trying to run away - it actually strenghtened my adrenaline rush. Interesting.


All of a sudden, I see some people. They're looking at me, but I can't reach them. They run away after a while. Oh, the spider again. Am I running away from him, or am I chasing these people? Seeing them lightened hope in me; I thought there's some kind of settlement and I'll be safe there, with them.


Oh, so there is the settlement. Burning.
Who set their village on fire? That wasn't the spider... So there's something even more ominous in this world?
I can see them again. But... they're running away. From me. Am I the one they fear? They even set some traps to kill me...


Somebody's sitting there! He won't run away. I'm going to talk to him. Is he wounded? Maybe he needs help?
Wha-


Planks broke under my body and we fell down, but this man had a rope wrapped around his neck. I killed him... I didn't want to, but I did - and felt bad and guilty about it.


Let's recap: after spending a hour with Limbo, I felt fear, vulnerability, curiosity, sadness and guilt. When a game made you actually FEEL such things? Yeah, I don't remember as well.
This is where Limbo was brilliant.
And then? You enter some kind of a factory and solve physics puzzles. Stacking puzzles. Water puzzles. Gravity puzzles. There's no background story attached to it (like with the spider, people and their village), they're just obstacles you need to pass through. And it goes on, and on, and on... Yes, the game made me feel something again. Frustration.
The puzzles itself are actually inventive and pretty hard at times, but you're forced to repeat them many times, because they often involve an arcade challenge as well. A timed jump, quick run and jump, choosing the right ladder to jump on... There's nothing entertaining in repeating an already solved puzzle, just because you failed at applying this solution. I had to force myself to get through all these challenges. Boring and frustrating task!
It's worth noting though, that Limbo pulls it all off without any inventory and with just a single action button. The amount and diversification of activities is quite impressive.

Suddenly the game ends. You go straight from an arcade challenge (repeated about 15 times in my case) to the final scene. You fall in beautifully slow motion through a mirror (?) to a forest.


Am I again at the point where I started? The boy lies down, but stands up after a long while. I go forward. There's a ladder leading up and a girl; looks like she's digging in the ground. Is this my sister? She notices me and the game ends.


But after the credits there's another scene, looking similar. There are some differences: a rope is hanging from the ladder, and there are swarms of flies in places where they stood a while ago.


I think they're both dead, one of them hanged herself. Judging by their positions, it was her. So, the boy died in some circumstances, and she hanged herself from grief? I don't know. But I like when a game (a movie, a book) asks questions and forces me to think.
But was it neccessary to put me through all these puzzles and challenges? It felt so out of place, so game-y; where the rest strives to innovate. That's why I'm so disappointed.

Still, it's a game you should play. And share your interpretation with me!

Thoughts on Hard Reset

I had some problems with Hard Reset. In a nutshell: it's a FPS which tries to be a cyberpunk Serious Sam. But Sam was rather funny and absurd, and Hard Reset attempts to be serious. So, you shoot robots, get better weapons, shoot more robots, rinse and repeat. There are quite a few moments of first-person platforming, which NEVER works (sorry, Mirror's Edge, but yeah).
Also, the story is really bad. I tried to follow it for a while, but when these bland characters began to talk about "injecting AI matrices" (or something), my mind just turned off.

And it was the best thing I could do to play this game. You see, Hard Reset should be consumed with your senses, not your intellect. The most obvious thing is what's being thrown at your eyeballs: shiny robots, dirty alleys, houses and skyscrapers, it all looks spectacular. There's a great attention to detail here, from raindrops falling on streets, through various ads to random ships flying above. If you just stand for a while and look around, there's always something going on (and I don't mean the fights). There's also a lot of stuff that you can destroy. In fact, you should. Hard Reset wants you to launch "environmental kills" as often as possible: destroy a computer, which causes electrostatic pain to nearby robots; blow up a barrel or gas pipe, inviting some cyborgs to the party etc. You can destroy many other things, just for the sake of destruction - and that's cool. Lights get broken and suddenly it's dark. I remember myself trying to destroy lights in early days of FPS games, I was always impressed when a game let me do it.
But it's the gameplay where your senses, your instinct are most important. A big gorilla robot runs into you with lots of small robots. You apply an electric shock to them by destroying a device and send a rocket or two in their general direction. There's a shooting cyborg in the distance, you switch to machine gun, zoom in and kill him. A few smaller robots survived your rockets, you switch to shotgun and blow them to pieces just before they jump to your throat. And it all lasts 4 seconds. You feel like a total badass, and it lasts longer than 4 seconds.
It's all about quick, twitch decisions. Yes, it's repetitive, but when you pull off another action like this, it always makes you feel good. You can see Wild Flying Hog's focus on destruction; they worked so hard on it, that I spent half of my ammo just shooting around to destroy unimportant things. I'm almost sure the shotgun doesn't track if any bullet hits anything, it seems like it hits everything on the screen that's not far from you. And you know what? It's great. No matter how many of those little, pesky robots jump at you, shotgun will send them flying.
Hard Reset nods to older FPS games. Do you remember when an FPS game told you "Secret found!"? There are cracked walls, which you can blow up to access some of the secrets (Duke Nukem 3D!). Cyborgs, which remind me heavily of Stroggs from Quake 2. Boss fights! Bossess are really big (like they should be) and these fights were properly hard. The whole game was pretty challenging (I played on Normal). Lots of reviewers complained about too rare checkpoints, but I had no problem with them.
It's worth mentioning that it's a PC-only game, and it shows: not only the graphics are great, but you also get a menu with lots of options, including "Exit to system" and "Skip launch movie". These should be mandatory for any game! Why most games let me quit only using their main menu? Why most games force me to watch some hardware/middleware ads before playing?

Flying Wild Hog's message to console gamers?


I enjoyed this quite a lot, applied in average doses (1-2 levels per day). It's available on Steam and Desura



But seriously, first person platforming?

Powered by Blogger