Thursday, September 9, 2010

Maybe it's a cultural thing

I've been getting to work very early hoping that I can do my own work before the real work starts. Today was a little different, I got some weird sleep after some odd dream of being chased by a gun-wielding maniac. I just didn't have the full motivation to get going.

Instead, I read the news. Today was depressing.

There is some supposed Quran burning in central Florida on Saturday, some real winners there. It has sparked a firestorm of complete idiocy in this country. I read another story about how most people in Ohio think God will take care of global warming and people need not worry. Last but not least, I read some long conversation about video game addiction, and I weep inside both for the victim of the addiction and the fact that I'm not playing games anymore. Ugh..

America has become a depressing place for an intellectual. Instead of the "American Dream" of growing up, earning based on your hard work, and doing what you want in life, you are stuck working for other people because that is the only opportunity that exists. You want to make something grand out of your life, but you are limited by lack of education. I am a very smart person - and yet I still have to play by the rules that people that are too scared to lose theirs have set up. When I eventually naturalize to some European or Asian country in a few years, it will be one of the greatest days of my life. I can't wait to leave this shithole. Last night on the news, I hear the German Chancellor talk about European freedoms. They have freedoms of speech and religion, they are safe from the worst crimes and you really can't go toting around a gun everywhere you go. People are important - not some multinational global corporation calling all of the shots and making sure that the low classes stay low. I will definitely be some polyglot at that time. What's an even richer factoid is that most Americans are learning Spanish as their second language to deal with the increased flood of Mexicans who live in this country now. If they were to naturalize to Europe, they would end up living in the poorest shittiest country in Europe! (ok, eastern europe is a true shithole, but Spain is just a fucking joke).

As humans, we are living in a truly strange time for "animals". I don't see dirt and grime, I don't have to hunt for my food, I don't really have any animal left in me to do these things anyway. I sleep on a space-age bed with processed blankets in a room that has scientifically proofed air filtration and cooling systems.

But I'm not happy.

My wife experiences complete anxiety - she's not worried about eating her next meal or getting enough water to live another day. She is worried about global catastrophe, about getting enough sleep for a night so she can do her homework. Homework for somebody else so she can prove to an employer that won't pay her her fair salary to make sure crazy people are ok. What a country.

I, on the other hand, just want to play with information and science. I want to create a program that would simulate life. I want to create a program that would interface cleanly with a person's mind and let them go through different stages and tunnels and understand a completely different part of themselves reflected back at them through the world they create. Of course, that sort of software takes time - and resources - and I have to do work for other people because the kind of software I want to create doesn't look like it's going to generate any money in the short term (the kind of money people are really worried about now!)

I am really excited for December 21st, 2012. I think that is the turning point for the world. There is going to be a lot of shit going on in the 6 months up to that point, and then the 6 months afterward.

more later.

Tuesday, September 7, 2010

construct

Ever watch The Matrix? Remember that part where Neo is on the Nebuchadnezzar and Morpheus loads him into the first white area? Morpheus calls it "The Construct Program".

I've been a real computer programmer for about 8 years. My background is different than your usual software engineer, though. I graduated from DigiPen Institute of Technology in Redmond, WA in 2007 - a Bachelor in Real-Time Interactive Simulation.
Real-Time - lighting fast
Interactive - you can change it as its happening
Simulation - computer worlds.

I'm a video game programmer.

Your usual software engineer is good at creating data processing applications. I'm good at creating computer simulations. It's a distinction I deal with every day at the office, every office I've ever worked at. Most other engineers don't understand this distinction and think that I have less education than them. Turns out, my mind works "per-frame" and theirs looks at a different big picture that allows for less interaction and less simulation ability.

This distinction isn't important for the rest of the post, but it is important to point out for someone that doesn't know too much about programming video games. Games are a very special piece of software - they must operate a subset of commands very quickly 30 times a second as well as produce 1-2 million colored boxes in that same time so the user can see the progress of it.

When I first was tasked to create one of these simulations, I was completely naive. I had a barebones program that could display computer-generated fireworks in real-time. It did not allow any user input to change the fireworks. Today, I'm running 4 cores trying to synchronize how the physics and artificial intelligence systems work with drawing them in a breathtaking real-time world. Oh, how times have surely changed.

Ignorance is truly bliss. Back then, things were so simple. If i wanted to "press A to continue", i sat on something called a block that "listened" for the user to press the A button. If i wanted to navigate a menu, each box of the menu was some specific call to draw a rectangle at a location, and as the mouse's cursor's math was between some decidedly tweaked numbers (if the cursor's location is greater than 128 and less than 228 and the Y is between 50 and 100 and the left mouse button is down this frame but wasn't last frame, then tell the program that some button was pressed!!!)... today, things are a lot more "smart" where a menu button has it's own structure and coordination with the input system (oh yea, it's a system now) to check to see if a callback needs to be called because the button was hovered over and actually clicked.

I had lost my job this February. I was really excited to be home again - i could work on a brand new engine! I had programmed a physics simulation a few months before and had thought long and hard about programming a Deferred Lighting engine. That is a special way to visualize a computer world with a large number of lights - i only light things that you see from your perspective. Before this, I could only have a few lights in the world because every single object, no matter if you could see it or not, would deal with all of the lights in the world. I had a very fundamental naive knowledge of how to program this. Before this engine, I had really just got something called a Render Target working the way I wanted it to, and the entire engine could look at all of the render targets at any time.

But today, which is why I'm tying today, I want to lay everything about the construct down somewhere so my brain can thouroughly process this information properly. Talking to my wife is great, but until she responds back with actual answers, it will be easier to just tell the vast interwebs what I'm feeling and everything will be ok in the end.

I had drawn a few ideas on paper for a new threaded construct program. I'm only calling it "construct" because that was the concept from The Matrix that my wife actually understood. I wanted the user to be able to drag and drop any asset from his desktop into the program at any time, and have it show up as a usable asset. This was a huge difference from previous engines, these were ones that had big bulky asset management schemes that required everything to be plotted in some XML document and linked up to objects individually. lame. A better system exists.

After working at two different companies do I realize that a threaded program is the only way to go. Now that everything has more than one processor (xbox = 2, ps3 = 6, my home pc = 4) I should be writing simulations that can take advantage of all of these processors. I was so naive about that, too. I just sat down and banged out a system where different threads would run different processes, one for rendering, one for input, one for simulation, one for...... and magically it would all work! And it didn't. I had issues where I just simply couldn't deal with the entity format without memory problems. When you thread, two processes can't read the same memory at the same time. So much for that.

Last week, I sat down and designed a system that would work. 4 threads; Simulation, Render, Loading, and Synchronization. It is a beauty. Render would be one frame behind Simulation. Synchronization would be in lock with those two threads. Came up with an object format that would work. Came up with enough data to transmit between the two easily and with a small data format. Everything may work this time around.

So why am I still so anxious? I just suck at this or something. Honestly, I don't know where to start. I wanted to write this post to talk about it. Now I've talked about 200 other things to set it all up for you. Such is my life.

To start, I had to create a system to lock the sync thread between the render and sim threads. That was not as hard as it sounds, but it took 5 minutes to come up with a decent algorithm. I am essentially creating 4 gates. Sim and Render wait for their own gate to be opened, walk through it, and lock it behind them. When it's done, it unlocks one of two gates that the Sync thread is sitting behind. When Sync goes through its 2 gates, it locks those gates behind it, syncs everything, and then unlocks the sim gate and the render gate. Sweetness.

To load things, messages are generated in the sim thread and sent during a Post Message step to the loading thread. When the object is done loading, it sends a message back to the Sim thread that the asset is ready.

Today, I was starting to write the render thread. I was really stressing out about this. Render needs to order and cull things to render before it starts to draw. It needs to order them in a special way. What is all an asset? What is the least amount of information needed to draw things? God this is a crazy world.

If I have time to work on it tonight, I'll post how it went. I feel good about this. I just want to make the first level of Zelda64 from tools in the construct. God i have so fucking far to go.


Tuesdays are sometimes like Mondays

I had a good Labor Day weekend. Lots of rest, even though I wanted to spend time programming on the construct. There will be time to work on it in the future, but I definitely want to work on it right now. It sucks!

At work, nothing is going right. I am supposed to write up some documents for programming the next stage of the game. Unfortunately, nobody really knows what that is. It is not my job to create these documents without design input. Some people have already created a few game types, some things they want to see for next game, and level pitches. I don't know. My job is an AI programmer. There is some ideas for AI, but almost all of the pitches include head to head play with real players and not with whatever the fuck random characters we want doing tricks in the world instead. I feel like the other people on my team in my department have no idea how to do some of the things they should know how to do (especially for their pay scale!) and yet they are allowed to make the big decisions. I don't hate my job, I just wish it were a little bit better.

Japanese takes another interesting turn. I feel like I'm getting better at listening myself. Our exchange student said that exact thing 2 days ago when I asked her what had improved the most. I think that she doesn't understand construction on a few things, but overall she is doing quite well for someone just dropped into a society completely different than her own. I feel she will be a lot more comfortable speaking both English and Japanese around us in a few months, I hope that is soon enough for us, too.

Today I just really wanted to work on my own project. At work, nonetheless. But, I can't do that. I spent a lot of time creating something that would work, but it's not working. I fail, yet again. I don't know what to do! I have a beautiful and complex system in my head that I want to put in the computer. For some reason, I just can't make it work because I either don't have the time or don't have the concentration.

new blog time, gonna write something else

Thursday, September 2, 2010

Frustration Thursday 90210

Shit all around. Frustration from every angle. Discomfort. Unhappiness. Sounds great for a Thursday.

On one hand, I have simple frustration from everyday things. Things that, regardless of my mood and the people around me, are frustrating. A great example is American politics. No matter how I feel, some asshole with a louder megaphone is going to say something that makes people around me agree with him; and these are usually things that I do not agree with at all.

On the other, I have frustration from things I'm encountering today. Coworkers are unusually loud today, a project I'm trying to work on in my spare time is not going at all like I want it to.

So I'm frustrated.

I don't have a lot of solutions for this feeling. It's just a stressy mess and I live with it.

I thought this blog post would help, but my fingers are not even cooperating with me.

Fuckkkk