Aztez Development Blog
8Apr/102

Alpha Channel Problem In Unity

I just thought I would throw this out here because Unity has this unusual quirk and it has driven me (along with some other very talented developer friends of mine) to the brink of cosmic insanity. If you have ever created a texture in Unity that has an alpha channel but the alpha information in Unity is completely incorrect, then it's most likely because you have "empty pixels" in your RGB channels. What are empty pixels? Just think about anytime you've erased all the way through your layers in Photoshop and you can see the white and grey grid underneath. You can see that grid because you've removed color information from those areas and Photoshop just wants you to know that. Unity understands those empty pixels and will create an alpha channel for you if you have them in your image.

A quick and easy way to to test this out:

  1. Create a new layer at the bottom of the layer stack.
  2. Fill the whole thing with an arbitrary color.
  3. Re-save it and check it out in Unity. You should now see an alpha on the texture in Unity that looks like the alpha channel you intentionally created.

This happens because Unity has two different ways of recognizing transparent elements in a texture. One of these ways is through the alpha channel, and the other way is through empty pixels in the RGB channels. When it sees both it simply defers to the empty pixels. So all you have to do is fill those up with something so it knows it needs to look at the actual alpha channel. I hope this saves you some furious self-hair-removal. :)

15Feb/100

Behind The Scenes: Bridge To Tenochtitlan

Like I did in the Behind The Scenes: Marketplace post, I just want to pull the camera out again so you can see the Bridge environment in a different light. I think this environment ended up strangely photogenic, despite the fact that it is long and way less populated than the Marketplace. It had a lot to do with the fact that I managed to find a comfortable space in between function and composition and it didn't end up needing a ton of decorative objects. As always, this is a work in progress and will get a lot more love as the project continues.

The lake itself is quite barren, but the low angle of the game camera does a pretty good job of concealing that, especially with the patches of detail (chinampas, floating vegetation) that are close to the foreground.

I love this shot. This large platform all the way on the left hand side of the level is also quite barren, and I think it needs some more love. But I like the basic concept of wandering merchants on the outskirts of the city setting up shop and trying to hawk their wares as people go in and out.

The idea here is that there is a nexus that goes in and out of the city that farmers use to get to their canoes at the docks so they can maintain the floating gardens. If you go back and look at the Marketplace environment you can see these doorway nexus objects in a couple different spots; maybe this one leads directly into the Marketplace?

I just like this shot because I like these towers. It's as simple as that. But note the function! There are docks and canoes that will take guardsmen to and from the tower entrances.

And there she is from the sky. Note all of the awkward spaces! The lack of sufficient detail in many places! The abrupt endings to long chains of assets! I plan on filling this one out a little bit more but the general layout will remain the same. Good thing you won't see it from up here. ;)

Tagged as: , No Comments
13Feb/104

The Bridge To Tenochtitlan

I am absolutely delighted to share with you a new environment I have created in which to spill copious amounts of blood within. This is a (liberal) recreation of one of Tenochtitlan's many bridges. It was created using a small handful of the structural building blocks I created for the Marketplace, but with mostly brand new assets. I thought it would be really awesome to stage a battle on one of these thin bridges where you get to see the agricultural happenings of the locals as well as an outside view of the city walls. I want to use this environment to create the breathtaking sensation of what it must have been like to approach the legendary city. Use the left and right arrow keys to run and press the up button to jump.

As with the Marketplace, this environment is still very much a work in progress but the basic idea is definitely in place. That's not to say it didn't get some lovin'! Something I put some serious TLC into is the floating gardens, or "chinampas", in the background water. Because of the heavily aquatic nature of Tenochtitlan, floating gardens like this were integral to Aztec farming. I wanted to make sure these crucial objects were represented so I actually went and modeled some of the vegetables you would have seen in a place like this.

We've got pinto bean stalks on the left, corn in the middle, and amaranth on the right. Obviously there were many more things grown by the Aztecs than that, but these three staples provide good variety to the scene since you don't see them up close anyway. And since I'm showing you these and you can clearly see that there isn't actually any detail on a lot of these simpler objects, I'm gonna show you how I get them textured quickly and easily. I'm employing the exact same methodology I showed you in the Conservative Texture Usage post, except I'm using a startlingly simple texture.

The texture file you see in this image is an exact representation of the actual texture being used on these game objects; one half is solid white and one half is solid black. On the simple objects that don't need any textural detail, I just slap this guy on 'em and he pretty much takes care of everything for me. It's great because when I'm modeling I spend NO time meticulously arranging UV's, I just cram the UV's from the main body of the object into the upper half of the UV space and the outter ink object into the lower half. And since they're all using this material in the scene, I can take advantage of Unitys mesh combine functionality and turn a whole array of simple vegetables into one object. It's beautiful and fast and satisfying. :)

11Feb/102

Conservative Texture File Usage

I though I'd elaborate on a good point that Matthew brought up in the comments section of my "Creating Structures In Aztez" post. When referring to to the way I created one single texture and then used it on many different objects he said:

"It should probably also be noted how fantastic this approach is from a technical standpoint as it cuts the number of textures being used down completely."

This was intentional on my part, and for good reason. Whenever the game engine loads up an environment it has to "dig up" all these different assets out of the games files and then display them: 3d models, materials, textures, animations, etc. The basic idea here is that the less assets there are to dig up the quicker loading is going to be and the smaller your games overall file size will be (in software development, the overall size of a collection of files is sometimes called a "footprint"). Allow me to visually elaborate why this is so efficient in the context of Aztez.

Now before you understand how awesome this is, you must first understand the nature of materials. A material is a set of instructions that are used to tell the game engine how exactly to display that texture in the game once it's on the object. Under the hood they they are really just text; like I said, they're simply a set of instructions. Because of this, they have no substantial footprint as they merely "reference" the texture files they use. This means that you can have 100 different materials all creating completely different visuals with only one texture file. Obviously, they are crucial tools in 3d.

In this case here you can see here that one single material is employing one single texture but it is still being applied to a whole bunch of different objects. There are only three example objects in this image but in reality many more objects use that exact material, and I'm using this very same same technique with other materials across many other different objects. Thus far, we are only using a tiny handful of texture files to create our environments and characters, but even when we are done we will still be using a significantly fewer amount of textures than your average 3d game.

8Feb/102

Behind The Scenes: Marketplace

It's always been amazing to me how different an in-game environment looks behind the scenes than it does in tightly controlled game play. As scene builders (and I have happily constructed more environments in my life as a game developer than I can count) we have technical restrictions and we have to make the most out of what we've got. So the most sensible approach is to scrutinize the relative beauty of the scene from the viewpoint of the player, since ultimately that's all that matters. And this works! But as you soon as you pull the camera back, you get a totally different story and that's what I want to show you with the Marketplace environment. Remember - this environment is a proof of concept and is definitely going to change as the project continues. But these ideas ring true regardless.

You can see that there is nothing outside of the large walls to the left and right because there simply doesn't need to be. There are also no details in the ground space in front of the pyramids because that area will go completely unnoticed during actual gameplay.

The lack of any life on these platforms becomes really apparent when they become the center of attention. I realize you will most likely notice this as you play since they're not terrifically far away from the play area, so these parts will get some much needed love before this gets into anyone's hands.

That last shot is just to show you a very remote angle you'll never see in the game, because it's angles like this that really show off the inevitable errors in the world! There is no detail on the underside of that bridge object (because again, there simply doesn't need to be) and the water is just a gray plane. The ripples you see in the game are actually particle emitters that are attached to the flowers and canoes at a complete different point in the construction process. Furthermore, most of the structural objects have texture seams and they're very apparent down here. I'm showing you these things because they don't really concern me. Like I said before, I have a responsibility to make sure that what you actually have to stare at is at maximum sexiness and I have no intention of letting you down.

Tagged as: , 2 Comments
4Feb/105

Impact Effects

It is incredibly important to the combat sensation in an action game that it feels really amazing when you hit something else with your weapon. Aztez is no exception. Typically, a specific combination of visual cues is used to communicate successful impact and I have created a piece of Unity content that showcases the different effects Aztez will use. You can press z to perform an attack to see it in action, but you can also push keys 1 through 0 to view the individual effects.

Here is a breakdown of the individual effects:

1. Attack animation. Has a few frames of anticipation before throwing all of the upper body weight into a hefty attack. I find with attacks like this that the harder you swing the character's weight around the more brutal the attack will look.

2. Hit animation. The part of the character's body that gets hit must be quickly and painfully jacked around in order to feel good. There is some silly exaggeration in the way the poor character's head gets whipped around that helps drive the pain home.

3. Sword Swing. The widely utilized and easy method of communicating fast weapon movement. A large, animated shape indicates the movement of the weapon. In recent years this effect has been done with polygon "ribbons", but in Aztez I am using the traditional method of hand drawn frames.  Typically this shape is based on the general shape and size of the weapon in use, but sometimes it's done with a thinner trail that emerges from the tip of the weapon. When this effect is done well using proper animation principles, it will singlehandedly provide most of the charm of attacks.

4. Sword Dust. This effect is much more subtle, but it emphasizes the motion of the attack. It mostly resembles a layer of dust being thrown off the blade, hence the name. You can see this being put to great use in Diablo 3, which has AMAZING effects all around and has been a source of great inspiration. If you want to scrutinize some of them for yourself, go to their movie section and download the gameplay trailer. You can use Quicktime or VLC to scrub through frame by frame and see for yourself what kind of techniques they employ (you special effect aficionados should be doing this all the time anyway).

5. Successful Impact Effect. An abstract effect used to communicate that something has successfully struck something else. Very popular in beat-em-ups and fighting games alike, weapon-based or otherwise. This effect occurs at the point in space that the weapon connects with the target.

6. Sword Slash. Used to indicate that a blade of some kind has made contact with a body. This effect does not typically occur at the point in space that the weapon connects with like the Impact Effect does, but instead occurs in the general area. The most important aspect of this effect is the "direction" in which it occurs; it should be aligned to the angle at which the weapon struck the target. In this demo it's only occurring horizontally since the attack motion is so horizontal, but in the actual game it will occur much more dynamically because of the natural attack variety in combos.

7. Blood Explosion. There are actually three different things going on this effect: a large splatter that emerges from the impact point, tiny blobs, and tiny motion-stretched blobs. The way a thick liquid like this spews out of a point is very distinct; there should be enough stickyness and viscosity to be clumpy but the motion must break it apart realistically. Using this stack of three different effects is the best way to emulate that.

8. Blood Splatters. This effect is very simple; I'm simply creating a few flat sprites in slightly randomized locations. There are two different pieces of art for the sake of variety, and one of them slowly gets bigger over the course of it's slow lifetime to look like the blood is spreading out.

9. Ground Dust. Not terrifically realistic, but adds to the sense of impact and motion. I'm simply using this effect to imply that the attack was so brutal and hard that it blasted some dust off the ground the way a helicopter would.

10. Camera Shake. Pretty self-explanatory. A good camera shake contributes hugely to the feeling of power if done right. It might be a little strong in this particular case, but bear with me as I push these effects as far as I can. ;)

Of course these will improve over time and may change entirely. I'm aware of the fact that some of this might not hold up when there are lots of enemies on the screen getting the shit beat out of them and I might have to rework some of the effects so they stand out or don't distract the player. But the proof of concept you see here was successful in that we know we can make something feel brutal and awesome.

Tagged as: , 5 Comments
3Feb/100

Character Construction

In this image we have 4 characters you will see in the game. There are many more than this, and I'll show them to you as time goes on. But you can see that these 4 character concepts share the same physical proportions and it's only their equipment that sets them apart from each other. This applies to the rest of the cast as well.

This was an entirely conscious desicion that serves multiple purposes. From a creative standpoint, I knew up front that I didn't want to spend any time writing a story or developing characters; Ultimately I know that people play beat-em-ups because they want to experience exciting combat...not to be a part of some nonsensical melodrama. None of the characters in Aztez will have a distinct face (though they will have facial expressions we will use as gameplay cues) and none of them will speak. I feel that in the context of a game like this, those things simply aren't important.

From a technical standpoint, it greatly narrows down the amount of character assets I have to manage. Every character you see in the game will be built on top of one base character model, and will simply have different equipment assets attached to them at key points to set them all apart. I will do character animations on one individual rig that any character can use since they're all essentially the same dude with different gear.

Knowing that the gear is the characterizing factor here made it easy to settle on a system like this and gave me that much more reason to push the form in this game. The ultimate challenge with these characters is making sure I can distinguish them all from each other when they all have the same body. The solution in this case is with distinct helmets attached to the head, distinct loincloths attached to the crotch, distinct jewelry attached to the arms, etc. So in the rig there are dummy objects at specific points that I can snap an object to in Unity and once the right combination of gear is attached I can smash it all into a prefab object.

Take a look at this character proof of concept I made in Unity. I made it to be absolutely sure with myself that these principles held up in practice. Concept art is NOT in-game art, after all, and you can never be sure until you're seeing the characters the way the player will see them.

To reinforce the idea of "ensuring I see what the player will see" I slapped an idle animation on them and faced them both left and right to be safe. It was quick and dirty but it gave me the proof I needed; these characters look like sex. Time to move forward. :)

Tagged as: , No Comments
2Feb/107

Creating Structures In Aztez

When I set out to build the first environment as a proof of concept, I took an unusual approach by creating a texture that I was going to use on my 3d models BEFORE I created any 3d models. This texture is just a collage of interesting Aztec-inspired patterns that tile properly.

Once I was done with the image I went into Maya and started building modular structures that the player could view from the top or the sides, and in some cases from the bottom as well. I didn't really have specific designs in mind when I started modeling; I was acting on more of an impulse I had developed by looking at Aztec structures for years and years. Once the object was done I applied the texture and started arranging it in real-time until it looked good. As with the model, I did not have a specific angle of attack when I began this process. It both cases, it was a very quick and very satisfying process and it is exactly how I built all of the modular pieces that the existing environments are built from. Using this method I was able to build the marketplace proof of concept environment in under a week.

As you can see in the progression, the outline around the object is what completes it. This outline is an integral part of the game's style and is applied to all environment objects. I create this outline in the traditional manner: once the object is complete, I create a duplicate of the object, scale it up a very small amount, texture it black, and then invert the faces so they face inside out. The scaling part requires a little bit of love; often times the outline object does not require the same amount of faces and things get a little goofy around corners but it's nothing a reasonably experienced modeler can't massage out. This is what you're actually looking at when you're gazing upon these magnificent structures in the game environment.

Here is a repost of the environment mock I created for the "call to arms" page I created previously. You can use the left and right arrow keys to run and the up arrow to jump. You can't run very far left and right, but it's a good showcase of the visual style.

http://www.benruiz.net/aztez/animation_poc1.html