-
November 22, 2008
Computation
ScienceWhat is computation? If you look into the online edition of the Merriam-Webster dictionary you will find that it is a synonym for calculation. And then apparently things get very tough to define, because clicking on calculation tells us that it is “the process or an act of calculating”, calculating being “making calculations”. This circular reasoning has a certain religious argument aftertaste to it. Still, we can all agree that computation (as so many other things) is like porn: it may be hard (SNORT) to define, but we know it when we see it.

But definitely, if you want to be able to have some theoretical results for computer science you need to have a clear definition. Sure you can do a lot going simply by the gut feeling, but we know from the history of mathematics that natural definitions can lead to problems (see the Russel’s paradox). In the need of formal definition a trick much used (or at least that is my feeling) in math is, instead of giving a clear definition (however you would manage to do that) for something and then creating a model for it, they create a model and define the meaning of the concept through it. There is more than one model our days, but the most common is the so-called Turing Machine. Problems are computable if one can write a program for a Turing Machine that solves the problem for any instance (or tells you there is no solution). No known models are more powerful than the Turing Machine (apparently not even quantum computers). Powerful is here used in the sense of being able to solve a problem algorithmically with it. Maybe another day I’ll write about Complexity Theory, i. e. if we can solve a problem and, if the answer is ‘yes’, how difficult it is to do so.
-
November 14, 2008
Who’s your expert?
Chomsky is my beer-buddy, GeneralTV experts are a plague. Really, this has gotten out of hand! For every damn tidbit of “fact” an “expert” needs to be “interviewed”! But the worst part is: over the whole polemic bawling the real expertise simply drowns. Observe:
This is just fun. Mr. Schiff is probably laughing his ass off right now. Aside from that, what really cracks me up is the appearance of Ben Stein — the guy that landed and epic fail with his wanna-be documentary about “Intelligent Design”.
Hopefully that teaches news programs something… ah, just kidding. They’ll never learn.
-
-
November 12, 2008
Vector geometry, part one.
TutorialIn the following weeks I plan on writing several articles about collision detection in 2d games, especially for flash. But before that I have to create some common ground which I intend to do with the following posts.
The topic at hand is basic geometry and how to express it usefully in programs. Starting at the most basic element, a point is a tuple of two coordinates (x, y) or (x1, x2) . Points are pretty useless in games, especially since vectors can be misused to ‘emulate’ them. Mathematical a vector is an element of a vector space which satisfies a number of properties (which are interesting, but not really useful in this context).
The fun thing: vectors in 2d euclidean geometry (which I’ll call simply vectors from now on) look exactly like points; they too contain two coordinates (x1, x2). The difference lies in the geometric interpretation and the operations attached to it: a vector is seen as an arrow that points into the direction indicated by the coordinates. Just imagine an arrow drawn from the origin (0,0) up to the point (x1, x2). This arrow is what we call a vector. Note that the vector itself is not “fixed in space”, it describes a direction, not a position.
In contrast to points we can add, subtract and even multiply these arrows — and all those operations have a simple, geometric meaning. I’ve prepared some simple .swfs that contain the important formulas as well as a graphical demonstration of how the operation can be interpreted (try dragging the arrow’s pointy ends around).
-
November 3, 2008
Stop using hitTest()
Tutorial
Every now and then I go over to the Kirupa forum and look around for interesting topics on actionscript game programming (with Flash, I’m not really into Flex). About every tenth post in the game programming area deals with some kind of collision detection or collision response problem. About 99% of those posts can be answered very simple: stop using hitTest().


