Saturday, November 20, 2010

Why Leave NY

I’ve been asked why I would want to leave New York on a number of occasions. I’d like to talk a little bit about the issues I have. Before I begin though, I wanted to mention that New York City will always have a special place in my heart. From the city itself to the friends and family I am leaving behind, there are a lot of things about this place that I am going to miss dearly. I hope to be back as often as I can so that I don’t die from missing the place so much.

Now that the sentimental crap is out of the way, let’s talk about some of the reasons why I found a new home, all of these are game development related as you might guess. When I first came to New York, I was intrigued by the Indie scene. I thought I would enjoy being another developer who’s just trying to make cool games. What I learned, though, is that at this point in my life, I don’t actually want to be Indie. I’m still young and have a hell of a lot to learn before I can effectively do that.

So, since New York is mostly an Indie scene, we have the other issue of this place feeling really small. There are a lot of people in New York just trying to break into the industry. It’s great but also depressing at the same time. I seldom meet people who actually work in the industry. I’m happy to talk to aspiring developers who do Indie stuff at home and want help breaking in, but there comes a point where you ask, “Why are there so many of you and so few of us?” Well the answer is obvious. These are people who started on the east coast, and the tiny industry in New York can’t afford to hire them, so they sit in limbo hoping for a job. I was one of them for six months and believe me it sucks.

I don’t mean to seem snobby, saying that I’d rather be around people with game developer jobs and not just people hoping to get into the industry. There is just something to meeting people who have fifteen years of experience and have stories and tales of how they solved that one ridiculous problem that no one ever even thought about. Like I said, I love meeting the new people busting their hump trying to get into the industry, they are a group of people who inspire me to do things on my own outside of work, so if I could have both worlds that would be fantastic. Unfortunately, those worlds are split by three thousand miles of land.

Along the lines of the size of the game industry in New York, you will notice that there really aren’t a lot of game development houses that make anything sizeable. Now, I’m not talking about wanting New York to be the AAA game development scene. Actually, I would hate that. That’s not what New York is about, and it will never be what New York is about. What I mean is the games that are interesting and do well on marketplaces like Steam and Xbox Live and not just Facebook or whatever flash service the company decided to create, like most New York companies do.

New York is a great place to live and meet people and hang out with friends and family, but it’s just not what I’m looking for in terms of game development. I will be back as often as I can and welcome everyone to come visit me. You will always have a place to stay.

Tuesday, October 19, 2010

Clean Energy

I recently got into an argument with a conservative over clean energy and the different ways of producing it. The conservative sided with fossil fuels, as conservatives tend to do, while I, being the clean energy investor that I am, argued against the reasons not to switch to solar and wind power. The conservative, we’ll call him William or Bill for short, argued that there are too many areas that don’t receive enough sun to warrant the use of solar power. He also argued that the windmills used in wind power generation cause irreparable damage to the landscape, as erosion patterns are altered by the sea and trees must be cut down for windmills placed on land.

I will begin by talking about Bill’s solar power issue. It’s very true that certain areas will never receive enough sun to really make solar power viable. Seattle, for example, is the greyest city I’ve ever been to. The sun only comes out for four months of the year. There is no way you’re going to put a solar power plant down and hope to sustain the whole city indefinitely. In cases like those, there needs to be a combination of different clean energy generating technologies. Seattle is a great area of wind and hydro power because of the Puget Sound. I also propose another solution: Build a 30,000 foot tall solar generator that collects sun above the clouds. You’d never need to worry about weather conditions again.

Tackling Bill’s second argument of wind power ruining the landscape, I accept that it is a problem. But like many other problems, it can be solved. If we just gave up on something just because it has a problem, we wouldn’t have put a human on the moon. I admit that I don’t necessarily have a readily available solution to the problem, but I also am not a civil engineer. So, while it’s true that we shouldn’t ignore the drawbacks of wind power, we can’t simply drop the idea because of a few problems. In the spirit of this post though, I’d like to propose another solution: Build flying windmills that hover above the land and sea. This solves both needing to cut down trees and the erosion changes. This will also allow us to move the wind mills to higher wind concentrations.

In conclusion, I disagree with Bill saying that clean energy is not a valid solution. Bill also argued for the use of natural gas, since it is relatively cleaner than oil and coal. I won’t get into why continuing to use fossil fuels is silly, so I will leave it at that. What I will say though, is that there are better solutions to the energy problem and we have to trust our engineers to come up with them.

Thursday, September 2, 2010

Big Bang On Religion

There has been recent news about Stephen Hawking making the claim that it was not God’s doing that created the Big Bang. He believes that since gravity exists, it is a perfectly good cause for the creation of the universe from nothing. Now, I’m not going to sit here and try and argue against one of the most prominent astrophysicists of our time, but I can’t say that he’s necessarily right.

First, I’d like to remark on those of faith who would say that the universe necessarily had to be created by someone of a greater power. If it is your faith that this be true, then that is perfectly fine in my book. I personally am skeptical of either answer. It’s really impossible to prove, so believing either side is still a matter of faith.

What I wanted to talk about, though, is the idea of infinity. Those of faith believe God is infinite in time, space, and knowledge. When asked how this could be possible, the response is usually that God is a mystery that we can’t even begin to comprehend, and should we come close to understanding, how head’s would explode like a watermelon strapped with C4. Why, then, is it impossible to accept that the universe could possibly be infinite in time. If it’s ok to accept that nothing created God, then why isn’t it acceptable that nothing created the universe? It’s an insanely incomprehensible concept either way, but this is the reason why I would accept both sides of the argument.

Aside from that, there was commentary about the Stephen Hawking statement that said that it was a dangerous statement to make. The commentator claimed that Hawking was forcing people to make a choice between religion and science, in which case most people would pick religion. That statement really rubbed me the wrong way. I don’t see it as forcing a choice at all. There is always a compromise to be made between the two. The compromise has over the years shifted drastically toward the side of science, but there is still plenty of give and take to be had. One of my coworkers made a good comment on this when we were discussing it. He said that religion and science don’t necessarily even exist in the same realm. They are tools to explain different things and don’t actually intersect a lot of the time.

Friday, August 6, 2010

Digital Marketing

We’ve reached an interesting age as far as marketing and sales. When you are sold or given something in person, we are very accustomed to turning things down. We say, “No thank you,” and walk away without another thought. We might even vehemently be against being sold something that we don’t want; throwing a fit that someone could be bold enough to try to sell you something. Think about all the offers a place like Gamestop makes you when you go to buy something and you’ll realize how annoyed you were after the fifth offer.

Now that’s something that’s been going on since the beginning of society. Think back to the bustling markets where salesmen would bark their wares at people. The interesting new age we’re in is in digital marketing and sales. We’ve started to actually flip which side of the coin we’re on. We start saying yes to things just to get a process over with or to make something go away. Installers are a great example of this. It’s practically an epidemic of useless packaged software. Everything is defaulted to saying yes so unsuspecting users end up with an exorbitant amount of programs or features that they would never need or even use.

There’s something about humans that makes them buy things they don’t actually need. That’s why there were men shouting in markets in the first place. They were hoping to sell something to someone who didn’t actually need it. It’s not to say that they weren’t successful, but right now, the chance of success if growing. People are growing accustomed to saying yes, and it’s somewhat frightening.

It gets worse. Companies are now collecting our credit card information and saving them for future purchases. We’ve reached a point where unsuspecting individuals accidentally say yes to pay money for something they might think is just another random piece of free software. You might be thinking that they get what they deserve if they’re not paying attention. The point is that it’s hardly even their fault these days. People get bombarded with information that it can sometimes be hard to pay attention to everything.

Friday, July 9, 2010

Society Regresses

In Ancient Rome, they held gladiatorial events at the Coliseum. Murder was a commonplace event that the crowd cheered for. In this day and age, we like to think that we’ve become more civilized since then. Yet, on a daily basis we see death and destruction. What’s worse is the fact that if the culprits aren’t brought to justice and their ultimate demise, there are those among us that are not satisfied. Have we really come that far from the days of the Coliseum?

A suicide bomber reigned down terror in a tribal region in Pakistan killing over fourty. Some will claim that those in the region are nothing but uncivilized animals. “They know nothing but killing,” I hear. I make the claim that we are no different. Police officer accidentally shoots a suspect in the back, killing him. I am not here to defend this officer. He pulled a gun, claiming that he thought it was a tazer. How you could make this mistake is absolutely beyond me.

Put on trial, he was convicted of accidental manslaughter. The spectators at the Coliseum were quite unhappy with this judgment. They call for the thumbs down for Caesar. The crowd, those who consider themselves the enlightened few in California, started rioting over the fact that the officer was not given a harsher conviction. A society that claims to value life regresses to Hammurabi’s code, calling that we take an eye for an eye or else we shall destroy the cities we live in. The livelihoods of business owners completely destroyed is somehow a valid response to officer’s sentence. We still have a long way to go before we can consider ourselves civilized.

Saturday, June 19, 2010

Patriotic Competition

President Obama made his first speech to the nation from the Oval Office this week and his closing remarks made me think. He discussed that lawmakers must push for energy reform the in the US and inaction will cost us, and the environment, more in the long term than it could possibly in the short term. Obviously, it’s going to be tough and it could end up being just hot air, but it really struck a chord with me. Given the US’s constant desire to be the best, I feel like the US could lead in clean energy if we push hard enough.

However, this feeling of pride in the US’s desire to be the best was recently challenged. It was the attempt of others to show that my pride in my birthplace is not just pointless, but actually counter-productive. I was told that we should be trying to worry about it globally, making sure everyone is advancing rather than just our home country.

While there is some truth to this, the fact that my pride of my homeland was challenged bothered me and I wondered why. Not only did I wonder why I was bothered, I wondered why I had pride for where I was fortunate enough to be born, since it was just random luck to be born here. Then I realized that being proud of anything is the same concept. Everything in this world is random chance. The world is chaotic in nature, therefore everything you could possibly be proud of came about by random chance. If you’re an artist and you’re proud of it, then you’re proud that your brain was randomly wired a certain way.

Now that I was assured that being proud of my fortune wasn’t actually silly, I wondered what exactly I’m proud of. I realized that, more than anything else, I’m proud of what this country was founded on and what this country means to the world. I wouldn’t be alive if this country wasn’t what it is. My family comes from literdally two ends of the planet and yet they came together here because they felt the US was a better life than what they had. I am part of a country with an enormous immigrant population and a large amount of immigrants their families have gone on to do amazing things in this country because of the resources and the ability to be great if you work hard. I am proud of that.

Friday, June 11, 2010

Tangent Space At A Quick Pace

It is amazing when you finally have all the pieces of a puzzle click right into place. This is a post for the techies; all the other kids can follow along if you want. Kiyome and I have been working on some graphics research lately. The latest concept we’ve been tackling is normal maps. Just like there is more than one way to slap a misbehaving husband, there is more than one way to implement a normal map. You can either slap him in the arm, which is somewhat effective and may more may not get him to stop whatever he’s doing, or you can slap him right across the face and leave a big red imprint, effectively shutting him up for a while. For normal maps, you can either have your map be in object space, that is the reference frame based on the object’s orientation, or you can have the normal map be in tangent space, which is the frame based on the surface of the object.

We chose to go with slapping the husband straight across the face. This method is somewhat involved in the fact that you have to understand what the tangent space really means and what it means to transform vectors into tangent space. When I set off to do this, I went in armed with a very brief, maybe twenty minute introduction into tangent spaces from two years ago. For those of you who are still wondering, yes this does mean I went in without really knowing what I was wondering.

Simply applying the sample code we found produced results that had the sort of normal map effect on it, however there were major errors. First of all the light looked like it was in the totally wrong direction, but even weirder is the fact that the light was bounces off of spots on the tortoise that didn’t make any sense.

Our first thought was that the normal texture must’ve been wrong. We went into Photoshop and together inspected the properties of the normal map. We attempted altering the color components of the normal map in vein. This is where that note about not understanding what I’m doing comes into play. I will explain later why altering the texture makes no sense and has barely any effect.

So after some tweaking and coming up with ideas to debug the shader, the program that does the drawing, I realized that our light vector, the vector from the vertex, a point on the surface, to the light source, was being transformed in the reverse order from the other transforms in the shader. When I reversed it, it seemed to produce far better results. At first I thought it might have actually been correct.

I moved on and added in a feature to move the light around the model to see how the light acts as is goes across. Unfortunately, the light was moving in a very weird direction with respect to how the light moved without the normal map. This of course set off red flags leading me to believe that we were still wrong. It got worse when I realized that the light was actually still highlighting areas that it shouldn’t.

I decided to try toying with values in the pixel shader, this is the shader that does the per pixel calculations onto the screen. I’d like to make a brief note. In the pixel shader, the normal and light vectors are in tangent space. So then I started thinking about what it means to alter a value in tangent space and I realized that it’s impossible to alter a single component to produce a meaningful effect for the entire model because this is tangent space. This is the reason why it didn’t make any sense to alter the normal map, since the normal map is tangent space vectors. You see, in world space, the space whose reference frame is the same for all objects in the world, a normal vector can go in any direction, and changing something like the X component will tweak the component across the entire model in the same way. However, in tangent space, most normals are actually in the Z direction. Negating the X component usually has no effect, but also it is completely dependent on where on the model that particular tangent space is.

So then things started really clicking. What it meant to transform from world space into tangent space in particular was a really important piece of math that I needed to understand. The reason why the light vector operation was reversed was because the tangent space matrix was a matrix that goes from object space to tangent space. Since the light vector was in world space, I needed to transform the light vector by the inverse of the tangent space matrix.

So the light vector was now correct as far as the math is concerned, but I was still not getting proper results. So I decided to take a look at the tangent space matrix. The matrix is composed of the Tangent, BiNormal, and Normal. The Normal is a vector sticking straight out from the point on the surface. The Tangent is a vector perpendicular to the Normal, and is tangents the surface. And the BiNormal is the vector perpendicular to those two. These three vectors create a space.

There is a necessary operation here though. These three vectors come into the vertex shader, the drawing program that handles the points on the model that create the overall shape of the model, in object space. It is the job of the vertex shader to transform these three vectors into world space. You might think to just apply the world matrix transform to these vectors but there’s a final piece of understanding that I knew but didn’t apply until now.

You see, when you transform the surface of a model from object space to world space you use a world matrix to orient, scale, and move the surface. However, the tangent space of the surface cannot be transformed the same way. There is a theorem and proof that shows this better than I could ever explain so either trust my words or go look it up.

Even though I had known this, my false notion that you didn’t necessarily need to apply this came from the fact that I had been learning a lot of HLSL, high level shader language, programming from DirectX samples, and DirectX samples don’t seem to ever follow this rule. What the reason is I will never know, but that doesn’t really matter all that much. Once I applied this bit of knowledge to my own shader and transformed the basis of the tangent space by the the transpose of the world matrix, everything finally came into place. The light was finally moving across the model properly. The higher detail was apparent in the model, and there were no strange artifacts due to things being lit improperly.