Saturday, December 15, 2012

Hello Worlds

I recently joined yet another mini contest at Kongregate called Procedurally Generated Graphics Content (PGGC) #3. The theme of this contest is Planet, which is what participants will try to generate procedurally with their programs. The entry I submitted is called “Hello Worlds,” and so far it seems to be the only one that is in 3D. Click on the picture below to try it out.

To create this application, I used a 3D graphics engine for Flash called Away3D. I closely followed the Globe Materials Tutorial at the Away3D website to create all the geometry, lighting, and special visual effects in my app. The code for creating the planets’ textures, however, is mine. I wrote all the routines for procedurally generating the height maps, diffuse maps, specular and ambient maps, and normal maps as well as the code for randomly choosing harmonious color combinations.

Personally, I like how the appearance of the planets surprise even me. Some planets don’t look particularly exciting, but some are beautiful, others look scary, and some are simply absurd. That’s my admittedly biased opinion of course. If you click long enough, you might actually come across a planet you like. On the down side, it takes time for my application to generate a planet. Depending on the speed of the computer used, planets can take between 9 seconds to over half a minute to create. Those are the speeds I observed on my core i7 computer and my old Pentium 5 computer.

Those who want to know more about this contest may find the forum thread on this topic here.

Friday, November 30, 2012

Post Mortem: Fat Men Can’t Jump

This is the first of hopefully many blog posts in which I dissect a game of mine after receiving feedback on it. The subject of this particular autopsy is my very first Flash game called “Fat Men Can’t Jump.” This game has the dubious distinction of being only one of two entries to the Game in Ten Days (GiTD) contest that did not get a single vote. Anyone who wants to try this game can find it here.

Most of the people who voted in the GiTD did not leave any feedback on my game. The few comments I received are like gold to me because they gave me clues as to what went wrong and what I could have done to improve the game. Below are the comments my game received with the names of the voters withheld.

A GiTD with an AI? Wow. Even if dumb. I wonder if plain holding space would remedy for “exact timing” :D
Hurray I won. But there is no replay value.
IDK how to bounce…
They may not be able to jump, but they can stick to the walls indefinitely. The collisions seem…broken in this game at the moment.

From what I can glean based on the above feedback, it seems that there are three main issues with this particular game:

  1. The game physics is broken. I must have spent only thirty percent of my total development time on the games physics and mechanics. Much of my time was spent on making art resources and figuring out how to customize the avatar’s appearance. Considering that the physics and mechanics of a game comprise its very essence, I should have spent seventy percent of my time on them instead.
  2. The mechanics of trying to hit the space key at the avatar’s precise point of collision was confusing to players. In my own play tests, I often found myself hitting the space key repeatedly in the hope that one of my key presses would coincide with the moment of impact. This does not make for good gameplay.
  3. The game is over fast. There are no additional levels or opponents to go up against beyond the first one.  Considering that the gameplay itself is bad, this may actually be a merciful blessing for my players, but the fact remains that people expect more from a game.

So there you have it – the three reasons why my first Flash game did not get any votes. If there are other reasons for it being bad, I’d love to hear them. I invite all readers who chose to try my game to post their feedback here. Your comments may help me improve my game development skills.

Sunday, November 11, 2012

A Funny Thing Happened on the Way to the Forum

Last month, someone posted a request on the Kongregate forums for an artist to collaborate with him on a Flash game he is developing. Despite already having my own project in the works, I liked his demo so much that I volunteered to work as the artist on his game.

At around the same time, another person posted on the Kongregate forums a request for a programmer to help her develop a tower defense game she designed. No one volunteered to help her then, although someone else gave her a link to a tutorial on how to make tower defense games in Stencyl. As she went through the tutorial, she would post a question on the forums about problems she sometimes encountered, and I would post my solutions for her.

After two weeks, one of the forum moderators announced an upcoming contest called GiTD # 27. “GiTD” stands for Game in Ten Days. It’s a game jam where interested parties may create Flash games within the prescribed period as soon as the contest theme is announced. After the deadline, forum members may vote for the two games that they liked the most, with the first choice getting two points and the second placer getting one point. After a short period, the votes are tallied, and the winner gets a prize as well as bragging rights. Participants who post their work-in-progress on day 7 for others to critique would automatically get two free music tracks that they may use in their entries and any other game they make from then on. Although I have never completed a Flash game of my very own before, I messaged the moderator, telling him that I was interested in joining this contest.

One hour after having sent the moderator my message, I received another private message from the tower defense designer, who asked to chat with me over Skype. When I logged on, we discussed her game for a while, and I briefly looked over her game design document and artwork. Now I don’t know what possessed me at that point, but I told her that programming a tower defense game was so easy that I was tempted to do it for her. Perhaps it was my natural tendency to want to help people in any aspect of game development. Or maybe it was a moment of insanity. Whichever the case, I actually wound up volunteering for the job. I warned her, though, that I already had two other projects ongoing, so her project would be third on my list. She said that as long as her game was completed by December, she would be okay with that. GiTD # 27 had not yet officially started then, but when it eventually did, I wound up with four ongoing projects. Count them, four. I really am a mad game developer.

Well, the GiTD was over in ten days, so now I’m down to three projects. The sad part was that my entry did not get a single vote. I have no regrets about joining the GiTD though. Trying to cobble a working game together in such a short time frame was an amazing experience. Being accustomed to thinking things through before acting on my plans, I was completely yanked out of my comfort zone and forced to adopt a fast and disciplined way of working. At the end of it all, I can now honestly say that I’ve actually completed a Flash game. I would love to join another game jam, although I really ought to finish the projects that I’m helping others with before I do.

Thursday, October 25, 2012

My Main Man Max

I got pretty far with Michel Roger’s tutorial on making a human model in 3DS Max. Pictured here is my progress as of ten days ago. Unfortunately, Monsieur Roger did not explain how to make proper feet with toes. I’m sure I can figure that out on my own, but at this point, I realized that I need not go through all the trouble. There is a free and open source application called Make Human that allows you to configure human models to a variety of shapes, sizes, and ethnicities. With it, I can create a medium-res base mesh in minutes then adjust it in 3DS Max and ZBrush. From there, I can make clothes and accessories to suit whatever character I need.

My time spent in following the tutorial was not wasted, however. I learned a number of techniques that I have since applied to make other models. Even though Make Human is available for free, I highly recommend Monsieur Roger’s tutorial to anyone who wants to learn more about 3D modeling.

Monday, October 15, 2012

I Wanna Mold Your Hand

The two most difficult parts of the human body to draw or sculpt are the head and the hands. Having completed the former entirely within 3DS Max, I proceeded to do the latter. Truth to tell, the tutorial that I followed does not show how to model hands per se, but it does show how to model gloves. Pictured here is the fruit of my labor. Without the wrinkles and other surface bumps that characterize real hands, the model that I created looks like it fell off a mannequin. Regardless, what’s important to me is to have a base mesh that I can texture later. This hand model that I produced is more than adequate for that purpose.

Friday, October 12, 2012

Making a Man in Max

For the past three weeks, I’ve been trying to make a base human male model in 3DS Max. I had always used ZBrush to make human or humanoid models in the past, but I was never really satisfied with the geometry I came up with. They were always a haphazard mess of ill-placed vertices, especially in tight places such as between the fingers or toes. Consequently, I decided to make my base model using only 3DS Max.

I have a couple of books in my personal library that show how to make human models, but I had difficulty following them for various reasons. It wasn’t until I came across Michel Roger’s Joan of Arc tutorial that I finally made progress. The tutorial is still not all that easy for me to follow because it was originally written in French, and the English translation isn’t all that clear. Also, the tutorial explains how to make a manga-style girl, whereas I wanted to make a realistic-looking man. Nevertheless, it is a testament to how good the tutorial is that I was able to come up with the head shown in this blog post.

That reminds me… Time to change my avatar.

Tuesday, October 2, 2012

Jupiter: Character Design

Meet Jupiter, the ultimate boss in my upcoming game. Whereas the character design that I made for Ra took me a few days to finish, my design for Jupiter was done in a matter of hours. I had a pretty good feel for what Jupiter would be like as an opponent, which is evident in my concept art.

Like all the Roman gods, Jupiter appears as a marble relief, which makes him tough to destroy. Being the end-game boss, Jupiter is especially strong and sturdy. His head is small, relative to his body, which gives the impression that he is a giant of a man. His thunderbolts, forged for him by the god Vulcanus, are the most lethal weapons in the entire game.

Even when fighting, Jupiter retains a merry disposition. After all, the word “jovial” was taken from Jove, another name that Jupiter is known by. His appearance and demeanor were inspired in part by Brian Blessed, whose roles in Flash Gordon, Henry V, and the Blackadder comedy series left an indelible impression in my mind.

Jupiter’s huge arms are clearly discernible in his silhouette. His overall shape is like a pillar, which evokes strength and durability. For all intents and purposes, Jupiter is immune to direct attacks. Players will have to figure out how to defeat him. (And since I haven’t designed the boss battles yet, so will I.)

Saturday, September 22, 2012

Ra: Character Design

The eponymous hero of my upcoming game, Ra, needs an appropriate image to depict him. Being based on a god who was worshipped in ancient times, Ra has many pictures on the Internet that I can use as a basis for making my own version of this character. After trying out different variations, I finally settled on the design shown below.

Though it may not look it, the above picture took days for me to complete. In this blog post, I explain my character design process and the reasons for painting Ra the way I did.

My first step was to decide on what I wanted Ra to be. The back story of the game is that Ra and his fellow deities ruled comfortably over the spiritual lives of Egyptians until Octavian, the adopted son of Julius Caesar, conquered Egypt. At this point, Octavian was strongly inclined to abolish the worship of Egyptian gods, a move that his advisers warned him against. Nevertheless, the Roman gods were only too happy to give Octavian a nudge in the desired direction by kicking the Egyptian gods from their places of power. Only Ra, the strongest of the Egyptian gods, found the strength to drag himself up after his fall and to try to impress the local mortals sufficiently to have them worship him again. Only then will he find the strength to defeat the Roman gods and restore all Egyptian deities to their rightful thrones.

I want Ra to be an avenging hero, sort of like The Count of Montecristo and Sam Raimi’s Dark Man. I don’t want the game to be serious, however, because I have a soft spot for comedy. If a game idea makes me laugh, I’m inclined to implement it. Instead of portraying the gods as actual living beings, I’m going to depict them as wall art trying to vandalize each other. This design decision has the advantage of allowing me to put in floating obstacles, as I explained in my previous blog post.

Without worshippers, Ra is so weak that he hobbles like a man at Death’s door. When he happens upon Egyptian mortals, they will softly chant his name, giving him the strength to stand upright and walk normally. By striding before his worshippers, Ra can get them to chant louder until he gains the ability to run extremely fast and jump impossibly high. When hanging on to a nail on the wall, Ra can swing himself ever faster until he flies away like a gymnast, his body whirling and blazing like the sun. At the height of his power, Ra can crush Roman soldiers without coming to harm. Against their gods, however, Ra will need both his smarts and his strength to defeat them.

With this description in mind, I wanted to build Ra like an athlete, more of a gymnast and sprinter than a wrestler or bodybuilder. When I painted him, I started by drawing his silhouette with an eye toward hinting at his athletic prowess.

The broad shoulders and narrow waist suggest that Ra is the athletic type. His arms are muscular but not overly hypertrophied, and his calves are long and well-defined. These convey the idea that he relies more on speed and quick bursts of power than brute strength and tank-like endurance. His head is oddly shaped, like an eagle in profile. This is a departure from how Ra was depicted in ancient times. The top of the original Ra’s head, along with the overall shape of his face, was round, which suggests a love for comfort and relaxation. By giving Ra a more angular, aquiline profile, I depicted him as a dynamic and dangerous character.

When painting the rest of Ra, I relied mostly on the ancient sources to guide me, although I decided to make his arm bands light green instead of red to add variety to the mostly warm colors. It was with Ra’s face that I made some subtle but important differences. Instead of making his eye round, I made it narrow and slanted to give him that pissed-off Clint Eastwood look. I reshaped the black mark on Ra’s face to make it look like an avenging superhero’s mask. Finally, I gave Ra a furious frown on his beak. This is one angry bird that no pig will want to take on.

The color of Ra’s skin was picked to closely match the red ochre pigment that was used for painting skin tones on Egyptian wall art. All the other colors were precisely chosen for their harmoniousness with Ra’s skin color.

Despite the stiff pose of this character, I was satisfied with the design that I came up with. It took me a few days to complete, but I feel that all this effort was worth it.

Thursday, September 20, 2012

Ra, Ra, Ra!

While daydreaming some time last year, I saw in my mind’s eye a 2D sidescroller set in ancient Egypt. The player’s avatar was the god Ra, who ran across a green field while throngs of people waved pompoms and chanted his name. “Ra! Ra! Ra,” they cried. The louder the people chanted his name, the faster the avatar ran, which caused his worshippers to chant even louder. The challenge for the avatar was to hurdle obstacles as he neared them. If he tripped on an obstacle, the people in the background would groan, but they would softly cheer him on as he resumed his run and picked up speed.

The type of game I had envisioned is called an auto-runner. “Canabalt,” created by Adam Atomic in 2009, was the first game of this genre. The mechanics of Canabalt is simplicity itself. The avatar runs across a procedurally generated landscape and accelerates over time. The player has no direct control over the speed that the avatar runs and has absolutely no control over his direction. The only thing the player can do is to press the space bar to make the avatar jump. Players have to time their jumps properly to hurdle obstacles and cross chasms. One false move, however, and it’s game over.

I tried to prototype my idea in GameMaker, but the result wasn’t particularly engaging. I then tried to implement it as a rhythm game, but it played even worse. Stymied, I put my game idea in the backburner for the better part of a year.

Last month, I was searching for other game engines when I came across Stencyl, an interesting tool that uses code blocks to keep users from making syntax errors. The program that I downloaded, version 2.1, allows you to quickly make complete games using any one of several kits. Best of all, the free version of Stencyl has the full feature set for making Flash games. After tinkering with Stencyl for a week, I had prototyped my Ra game as a platformer. Even with minimal implementation, the prototype was fairly engaging and held a lot of promise.

One of the abilities I wanted Ra to have was rolling under low-hanging obstacles, similarly to how ninjas roll away in Tenchu: Stealth Assassins. Implementing the roll was easy enough, but I couldn’t figure out how to show the obstacles without making them look like they were floating in the air. In a whimsical game such as those in Nintendo’s Mario series, floating blocks and platforms are not out of place. In a game set in ancient Egypt, however, those same features would stick out like a sore thumb.

The solution came to me while I was daydreaming again. Why not depict Ra and the Egyptians as animated hieroglyphs on a wall? All floating obstacles would then be wall paintings as well and would therefore be completely appropriate to the game world.

Brilliant, I thought to myself.

This gave rise to another idea. I wanted Ra to be able to swing and flyaway like a gymnast on uneven bars. The question is, how do I depict bars in a two-dimensional world? The answer that came to me was that not everything in the game world had to be two-dimensional. I could have nails jutting from the wall and allow Ra to latch on to them for his acrobatic stunts.

Yet another idea came to mind. Why not add a little excitement to the game by giving Ra some enemies to fight? I could have him fighting the Romans, who supposedly banned the worship of the local gods after conquering Egypt. (This never happened historically, so I’m going to have to use my artistic license here.) In keeping with the theme of having all characters as wall art, the Romans would appear as either mosaics, which are easy to break to pieces, or marble reliefs, which are much more durable. Roman soldiers would make excellent minor enemies for Ra to shatter, but for the end-of-level boss fights, only the major gods of Rome in glorious marble would do.

I knew I had picked the right theme for my game when lots of ideas sprang from it almost effortlessly. I could even see the blurb now:

Avenge yourself and your fellow deities as Ra, Egyptian god of the sun. Drive your worshippers wild to increase your power by undertaking impressive feats of athletic prowess. Steel yourself for wall-to-wall action as you battle the soldiers and gods of ancient Rome in this rousing game of hieroglyphic proportions.

Things are looking good for Project Ra, I’d say.

Sunday, September 16, 2012

A New Beginning

Two months ago was the beginning of the end for me. Having modded Neverwinter Nights 2 on an on-and-off basis for the past four years or so, I could feel my interest in it flagging like an anchor sinking in the sea. I enjoyed the time I spent creating modules and custom content for NWN2, but I felt that I had already learned everything worth learning from it. If I am to grow any further, I have to cut my ties to NWN2 and create videogames of my own.

It wasn’t easy to choose which of the many platforms to develop for. I thought at first of jumping on the iDevice bandwagon and developing apps for it, but the investment in time and resources I would have had to make just wasn’t worth it. I didn’t have a Mac, a developer’s license, and the software to make apps. These aren’t cheap, but neither are they so expensive as to keep me out of the running.  However, considering the likelihood that my first few apps won’t sell well enough to justify the annual cost of the developer’s license alone, I decided to search elsewhere for a platform to cut my teeth on.

What about consoles? I may not be able to make a retail console game, but I can make small, downloadable games for WiiWare or Xbox Live. The entry barrier for making Xbox Live games is much lower than that for WiiWare, although for indie games, there is still the issue of an annual membership fee to be paid. What’s especially great about Xbox Live is that Visual Studio Express and the XNA Game Studio, software that can be used for developing Xbox games, are free. A low entry barrier means that the competition is plentiful, however, and it may be difficult to be noticed in the crowd of cheap, downloadable games.

On the other hand, with so many people developing mobile apps and indie console games, I wondered if making games for the PC wasn’t such a bad idea. I know that PC sales have been taking a beating as mobile devices become more and more powerful, a trend that isn’t likely to change anytime soon. Nevertheless, this does not mean that the percentage of households with PCs has been declining. Households may not be getting new PCs as often as before, but they may still be running old but serviceable PCs. If so, then there may be decent demand for PC games that don’t require powerful hardware to run. That would be good news for me if it were true because I’m not about to churn out the next Skyrim or Call of Duty all by my lonesome.

The more I thought about it, the more I liked the idea. There are no license fees to be paid for making PC games, and many of the software tools are free. Considering the very low risks involved, PC development seems to be the way for me to go at this time. It’s a niche market, to be sure, but it’s a good niche for starting out with.

Having decided on the platform, I searched the Internet for a good game engine to use. PCs are finicky machines because most of them are not engineered and assembled by a single manufacturer. Consequently, a game that works perfectly on one PC may run into problems on another. This reason alone is enough to justify acquiring a reliable game engine to mitigate potential problems on PC compatibility. Add to that the fact that development time is lower when using a good game engine, and the question of whether to get one becomes a no-brainer.

So which of the many available PC game engines should I get? Some, such as Multimedia Fusion 2 and Torque 3D, cost money to acquire, but there are also several good engines that are free. Unity3D is a popular engine for making 3D games, and it has a version that is free to download, but I want to stick to 2D game development for now because 3D assets take longer to make. I know that 2D games can be made with Unity3D, but it would be like going against the tide just to make it work. There is another popular engine called GameMaker that comes in a free version, but it is so lacking in essential features that one might as well purchase one of the paid versions to get any real work done. Other free engines that are worth mentioning include Construct Classic and the Wintermute engine. All of these produce executable files, which means that developers need to address the problem of how to market and distribute the files while ensuring that they don’t get pirated (much).

After looking into the matter a bit, I realized that it is possible to develop free-to-play browser-based games and still make some money from them. Flash games in particular can be sold to sponsors on, or they may be uploaded to sites such as Kongregate or Newgrounds, which offer a percentage of ad revenue to developers. We’re not talking big money here, but we’re not dealing with the kind of risks that triple-A developers go through either. It isn’t even necessary to have Adobe Flash Professional to make a Flash game. Developers on a tight budget can make Flash games using only free software. If their game development ventures become successful, they can purchase Flash later.

Hence, I’ve decided to make a Flash game for my initial foray into indie game development. My first game may or may not be popular, but I hope to learn from my experiences and eventually make better games in the future.

The end of my NWN2 modding days marks a new beginning for me. I do not know how successful I will be on this journey, but one thing is certain. I will never know unless I take the first step.