This is another post in the Lessons Learned series. Today’s lesson: immediate-mode GUIs
I’ve you have ever worked with Win32, GTK, or pretty much any GUI toolkit I know of, you’re probably used to treating the GUI as a bunch of controls. If you need a button on the screen then you create an instance of the Button class and add a pointer to that button to the Window object. Then behind the scenes Windows or GTK or whatever handles the rendering and processing of the button. All you have to do is wait for the user to click it.
This is another post in the Lessons Learned series. Today’s lesson: art
Chickens n Kittens has to run on a lot of different platforms on a wide range of screen sizes. Everything from an iPhone 4 with 640 lines of resolution to a retina display iPad with 1536 lines of resolution, and even higher for some PC displays. That’s quite a wide range! So in order to make sure the game looks just as good on a 640 display as a 1536 display, it contains multiple copies of each art asset in multiple sizes.
Hopefully this becomes a series of Lessons Learned. This is the first lesson is how we improved in-game text loading.
This is what Chickens n Kittens looks like when you view the island at an angle.Nearly everything is flat! The few things that aren’t are the particles (smoke and feathers) and the hovercraft. Those are “billboards,” which just mean those are images that are oriented to always face the camera, no matter where the camera is. That’s why the hovercraft looks like it’s about to crash into the ground nose-first.
Notice how the chickens in the background look rather pixelated? That’s because of the way the 3D hardware does texturing. There are ways to fix that, like anisotropic filtering, but I don’t need to, since the camera will never be sitting at this low angle in the actual game.
This is Part 7 in the Making Of Chickens n Kittens series. Part 6 is here.
If you read Part 4 then you know that CnK was originally written in C++, but was then rewritten in C# with XNA in order to run on the XBox. But with the redesign that was done (see Part 6) it was obvious that the best platform for CnK was not the XBox 360, rather mobile devices with touch screens, like phones and tablets. This created a problem. By using XNA that meant CnK could run on the Windows Phone 7, but nothing else. And who even has a Windows Phone 7, anyway?
The choice was to either re-rewrite CnK in C++ so that it could run on Android and iOS, or buy licenses for MonoTouch, which at the time would have been about $400 for an iOS license and another $400 for an Android license. We went with the former. In late 2011 work began on re-rewriting CnK in C++. But so much of CnK, everything from math to the graphics to sound, was dependent on XNA, but XNA was only usable using C#, not C++. So what happened? Nxna, an XNA clone with the same (or at least very similar) API that works in C++ and runs on iOS and Android devices.
Time will tell whether it was worth it to spend all that time re-rewriting…
This is Part 6 in the Making Of Chickens n Kittens series. Part 5 is here.
As you could see from Part 5, using clay still doesn’t look all that great. But even worse, the game still just isn’t that much fun. The idea of the player controlling a little guy on the ground, running around and throwing grenades and firing rockets, just isn’t as much fun as expected. One of the core gameplay mechanics is precisely killing the kittens while avoiding harming the chickens, yet playing with grenades and rockets via a guy on the ground is practically impossible. Big changes are needed.
In the screenshot below you can see the game as it existed in the beginning of 2012. By changing the game to a point-and-click-to-fire kind of thing we’ve solved all sorts of problems. Now the core gameplay mechanic works and the game is a lot more fun. And by simplifying the perspective we can also simplify the art, which is good, development-timeline-wise.
Here is a screenshot of what the menus looked like. That’s Eggman, the snarky guide who was originally intended to accompany you and give you tips and help as you needed. He got removed later on.
It’s been too long since the last update. CnK is not dead, and to prove it, here is a brand new screenshot.
The plain blue sky seemed boring, so now there are clouds floating peacefully by. And now the toy icons hug the sides of the island. This was so that the cursor/finger doesn’t have to travel as far to select a new toy.
These aren’t the only changes that have happened in the past few months, but the other changes will have to wait for another post.
This is Part 5 in the Making Of Chickens n Kittens series. Part 4 is here.
Skeletal animation is tricky to get working correctly, and once it works you still have the task of creating all the art. That means fully animated models for the player, kitten, and chicken. That’s a lot of work, and the game is taking too long already. It’s time for a new strategy.
Now the kittens, chickens, and player are represented by 2D sprites. Much easier to program. But that still leaves the art. How will it be created?
In this screenshot we were experimenting with using clay. The rubber duckies are placeholders for kittens, but you can see the idea with the chickens. Once the chicken was created it was put on a turntable, and a camera took a snapshot of the object from each possible orientation that the player would see it in the game.
See the stars around the player (the guy in the middle)? If the player happened to get too close to an exploding grenade (for example, if it bounced off the fence and landed next to the player) they would be stunned for several seconds and stars would fly around.
This is Part 4 in the Making Of Chickens n Kittens series. Part 3 is here.
Now that the island is floating in the sky, how do the kittens even get to the island? Well, the most obvious answer is they parachute in.
See the peppermint near the top of the screen? That is actually a parachute. There is a kitten hanging below it. There is another kitten just entering the scene on the upper right. Okay, obviously those aren’t kittens. Those are placeholder spiders we used while working on the skeletal animation.
See the rainbow colored contraption at the top of the screen? That is the catapult. It was eventually removed from the game, but the idea was the player could grab a kitten, load it into the catapult, and launch it into the blue. You could aim the catapult using a spyglass that even had a slick refraction effect. The catapult was eventually removed because it didn’t really add anything to the game. Why should the player spend all the time and effort required to catch a kitten, carry the kitten over to the catapult, load the catapult, and fire? It was easier just to throw a grenade.
One last major change from Part 3 is that the entire game has been ported from C++ and OpenGL to C# and XNA. That gave us the ability to run the game on the Xbox 360, which seemed like a great idea.
This is Part 3 in the Making Of Chickens n Kittens series. Part 2 is here.
The water is a waste of time. For one thing, it uses way too many hardware resources and creates a few gameplay problems. Can the player swim? Can the player drown? Is the player blocked from going too far into the water by some invisible barrier? And the biggest question of all- can chickens and kittens drown?
One rule from the very beginning that has never changed is that the kittens never suffer. They may explode into a spectacular shower of blood and gibs, but they don’t suffer. So the water has to go.
Now the island is floating in the sky, and a fence prevents the player or chickens or kittens from leaving. The chickens and kittens and player all have new art (the white thing in the middle is the player. He was missing his textures when this screenshot was taken). And look at the new mini-map in the top-left corner of the screen.
When the island was in the middle of the ocean the plan was that kittens would swim or arrive by boat somehow to the island. But now that it’s a floating island with a fence, how should the kittens arrive to the island in the first place?