Tuesday, January 30, 2007

Passports

All hail, a new dumping ground for thoughts beyond of "Random". Now there's "Life", something that hails more of a questioning of modern relics. Passports, currency, government, etc. being of these things to be questioned of their efficaciousness. It is intended to go deep into the roots of what we are, but, being completely ignorant of all the philosophical thought that has come before it... Enjoy!

Also, notice the added links!

To begin, let's define the purpose of a passport. It's used as a document to determine if a person can enter a country or not. Sort of like Country A trusts Country B, so they let their accountable citizens travel. How do we decide which citizens? Use the top tier and have them sign off on the authenticity and integrity of the person.

Let's take three small communities (A,B, and C) for example. C's people are completely untrustworthy; or so speculation goes, so no-one from C can enter A or B. A or B trust each other, and people wish to travel, but to leave a good impression, only a select few can travel.

If A, B, and C are small communities, each consisting of about 20 people. Under such circumstances, people from the community know exactly know should come and go. It's small, and can manage itself.

Let's bring the population up to maybe about 100 each. There will some bad apples in all 3 communities. C currently is being punished for no reason. A and B interchange people, but they now need guards to ensure that only those that are allowed travel. Still, it's a small community, and guarding the borders is relatively trivial.

Population boom, 10 000 people in each community. There are troubled people in each community. C is still being unfairly punished. A and B still interchange people, but having a few guards managing the borders is no longer reasonable -- the population is so big that it now needs police to keep the calm. As well as people outside verifying the borders.

Why verify the borders? so no evil comes in. But why? there are equal numbers of trouble-makers in A, B, and C. Each has their own police force. Only thing that they are attempting to stop is the spread of the crime; which is still leaking through the borders. Those that want to circumvent the system will manage; unless if easily rooted out by the nation.

In our non-fictitious world, people are just re-exported to where they came from.

The idea of the passport is good: guarantee that people going to another country originate from somewhere, and that they are somewhat screened. The downside: are countries too big to issue such control? The populations are massive; people no longer have to escape their community to reach anonymity. It's in the looming office building on the other side of the street.

Build a wall? Go right ahead; tunnels will be built, people adapt. And how can you be 100% sure that someone has not fooled the system.

Building a new electronic system? will people care about it? will all employers care?

Passports, like government, are an opt-in process. People can make a big fuss out of them and follow their every indication, or just do as though they mean nothing. Traffic ticket? It's your taxes that go to paying those officers that give out tickets. Income tax? It's just an agreement between enough people that it must be done: if 100% of the people disagreed, an no-one filed it one year, the government could yell and scream all it wanted, whine, complain, but theres no way it could imprison everyone at once.

Right now, we are opting in for passports. Well, governments (which we keep well funded) opted in for passports.

Are passports a good idea? of course; but at their current scale, they probably are somewhat of a joke (in the west that is).

Am I suggesting that everyone revolt against what they don't like about the government? Be careful of your decisions. It has to be practically unanimously agreed upon. 50% doesn't cut it (more than 50% take part in file-sharing, and under that logic it would become legal). Will people break under the pressure of the "leader"? (the ones we pay to lead the country are quite powerful, and have access to the military to make the population comply, no? - unless the military is against the government; which you have another issue at hand). So, the quick answer is no.

Is this an over-simplified version of things? of course; it's just here to make you think -- it has opened doors of thought in my mind as well. Excellent for creative writing.

Sunday, January 21, 2007

Vegetarian?

Here's some food for thought. Notice that foods, previously made without peanuts, still had traces of peanuts in them (from being manufactured with foods made with other nuts). Now that allergies are a big thing; we're aware of this -- next thing will probably making vegetarians aware of exactly what traces of animal could be in their food.

Or, is this overly paranoid? Some just put the extra labels to not be blamed if ever an alergic reaction were to occur.

Saturday, January 13, 2007

Self Filtering vs. Objectivity

I'm probably one of the few people to complain about this, since it probably is so rampant. But I have an issue with white lies, and skewed objectivity. It's taken me about 20 years just to read the implicit hits from my parents to know what they actually think, and it's annoying. They complain of the facades that they're parents wear, unaware of their own facades.

Now that the angry-man's rant is over, let's get on to the meat of the subject. Is it best to try to make someone feel better, or be completely objective and always tell them what you think.

I'm pro objectivity. For one simple reason, it may hurt the person at first, but they'll be stronger because of it. They're head won't be as swelled afterwards. Before College, I never had any subjective impression on how I draw, and thought I was good. Now, I can better evaluate what I can do, now I know what to look for. If I had a bit more subjectivity in the critiques, I probably would have been better.

However, I can't deny the uses of filtering, lying to encourage someone to keep on going. Parents, must, by nature, see good in their children, be biased towards what they do. Why? learning anything needs time, and if my parents were blunt, then they would have always said that it could be better; that some of it was crap. Faced with such criticism in any field, it would be impossible to believe that I was good at anything.

In the end I became a software developer... why? video-games, and since the computer provided a means of escape, and QBasic seemed to offer all the escape I needed. Want to see the family dog succeed at a level eerily similar to super-mario bros? Code it! Want to be in a star-trek away mission? Code it! Want to fly a plane? Code it! And the list went on. As I wanted something, just coding it would do. If I didn't feel like coding, I'd meditate in front of the blue screen.

Then College came, and with objectivity entering my means of escape, I was opened to new worlds. Those included OpenGL, DirectX, Photoshop, etc. New worlds opened, possibilities emerged.

Now I'm a University student. I know that I learned the most in my beginning College years, and feel as dumb as ever. Up until now, my greatest mistake was to not know myself. To just let things flow.

Now, I'm starting to know myself. The reasons for the ways I am can be traced back to what I don't like about my parents. Things which sound stupid, which I must correct. Self-examination has made me a better person. I now know that the pessimist in my classes was a realist, and knew what he was talking about. I now know why my best friend seemed to have drifted away.

And from knowing myself, I can tell when people are annoyed since they do exactly what I'd do, try to shake them off.

Oi, and to say this blog was supposed to be a test of being able to remain on a subject, and coherently follow an arguement, yet again I followed my heart.

All this to say, if you're reading this, the filtering will make you feel good, but don't dwell on it. Relive life through every moment you can. Turn down the stereo, put yourself in the other's shoes, figure out how you can improve yourself. That is more important than what celebrity is getting a divorce, it gives you a barometer to how you affect people, and how you can leave a more positive impression.

The past defines the present. The present will determine your future. If you can't tap into the past to exploit it's resources, there is no way you can hope to greatly improve the future.

Friday, January 12, 2007

Collision Detection as Rasterization

The easiest method to collide objects takes n factorial time. That is, compare each and every object with each other.

Now, the smarter methods involve using quad-trees, arrays, graphs -- essentially any method to minimize the search path given a region.

Let's assume the following:
  • Memory is cheap
  • Small world
  • Looks right preferred over perfection


Given that, let's work on the 2D problem (some games can be represented as 2D problems in a 3D environment -- for example, if the number of objects to collide on the y-axis is little, and the level spans quite a distance on the x & z axis). And, we'll use this example. Let us assume that we have access to a big array, about 1024x1024 which can be used to represent a view of the world from the top.

Each element of the array can be thought of as a pointer to a sprite object. All that we have to do is then "render" the level onto this bitmap of pointers. It'll tell us exactly what object is colliding with which other object. I'm currently using this in one of my games since some sprites have very odd/ever changing shapes. Also, this must not be a new/clever technique since other games have over-sized morphing objects.

But, here comes the interesting part: we have hardware to do rasterization. If we only had 4 objects, we could assign each object to a specific element (RGBA) and render the scene from above without the land/useless detail. Any time a pixel is shared between two objects, then it could be used to raise a red flag. The more clever may want to use the individual bits (but since everything is done in floating-point, I'm not sure how exact the colors 1,2,4,... are when normalized. Also, the other problem is that the bitmap has to be brought back to the host -- which uses quite a bit of bandwidth.

On the other hand, rasterizing on the CPU takes away time that would normally be used for AI/other game logic.

For those who want the most speed, they should read the articles on quad-trees, etc. in Game Programming Gems. These provide smarter/proven ways of doing collision detection than this little rant.

Monday, January 8, 2007

A few notes about GameLib

Well, the time to post GameLib is getting closer. I've been keeping a little SVN database on my local machine to keep track of it. Once commit #7 (this is after a years worth of coding) is done, the system will have a very mature implementation for matrices (now it's quite basic), and have it's own entry-point (the current one is platform-dependant).

What does GameLib look like in code? It's OOP design was partly inspired with DirectX compatibility in mind (that I wouldn't have to do too many hacks to port it). Well, let's say it has the following interfaces/objects (and more):

  • Object - handles reference counting/allocation tree

  • IString - handles static strings

  • I3D_Device - access to state of currently-rendering-to 3D device. Also allows creation of sub-objects from device.

  • ILight - A light, allocated from the device

  • ITexture - A texture,

  • IGPUDataPool - Use this to prevent loading the same image twice into memory (retains pooled objects with weak references)

  • IVertexBuffer - Used for holding everything that is needed to describe a mesh

  • IInputDevice - Used for getting input from a game-pad, etc.

  • IState - Used with the finite-state machine (game is loaded up in a state).



I'm still wondering about initialization; but will code it as follows (since booting up the system is getting more complex every day). Right now, I'm debating whether having a struct be filled, or having an object that can be queried and can return errors.

Also, the exceptions are used only in cases of extreme failure, and should not be used to manage program state (once the library gets out).

And for the license, do I have to pre-pend it to the start of each file? If so, then that'll take a bit more time before the first upload.

All this, to say that it exists, I've spent a year or so on it, but I just haven't gotten to uploading it yet.

Friday, January 5, 2007

Pattern Recognition

Working on an assignment, recalling some information in articles from MIT on Face Recognition, something about the uncanny nature of humans being able to memorize and recognize millions of faces. This has given me a few questions; as if we were to take various cats that look the same to us and see if the computer could find differences between them visually (not behaviourally).

Back to the topic of the uncanny ability to recognize faces; then I recall the idea of the "creative interlocutor" -- something that another teacher probably put a bit more emphasis on. More or less the importance that we put creating associations among various items.

We compare color.
We compare shape.
We compare smells.
We compare sounds.

If we see something with a wooden texture, then we don't expect a clanging sound when knocking on it; something that could happen if someone were to paint the texture on a piece of metal.

We auto-associate unrelated items based on previous experience.

For example, a few weeks ago the Jewish community was attacked by the community at large for a frivolous event. It was massive mis-associations. Like what's happening to people in the middle east. Massive mis-associations based on previous knowledge. Our minds are wonderful things, but we have to keep it in check from extrapolating what is false.

Noise might just as well be noise, and not a pattern to apply to the whole.