maths – increpare games https://www.increpare.com let's try something out here... Fri, 18 May 2018 22:16:47 +0000 en-US hourly 1 https://wordpress.org/?v=4.8.2 Structuralism, The Canonical Formula, and Computer Games https://www.increpare.com/2008/10/structuralism-the-canonical-formula-and-computer-games/ https://www.increpare.com/2008/10/structuralism-the-canonical-formula-and-computer-games/#comments Thu, 30 Oct 2008 11:36:21 +0000 http://www.maths.tcd.ie/~icecube/?p=782 A copied/pasted selection of a thread from tigsource. There is certain amount of extra discussion there, but all the actual analyses are copied below. It’s a little messy (especially the opening description, which might anger some specialists immensely, should they be unfortunate enough to stumble across this page), for which I apologise.

After having played about a little bit today with things relating to structuralism, I thought it might be fun to try to apply Levi-Strauss‘s canonical formula of mythology to some games. (the closest I could find to a discussion of this nature on the web was this rather elementary discussion on gamedev.net).

The canonical formula looks like:

http://ded.increpare.com/cgi-bin/mimetex.cgi?\frac{f_x%28a%29}{f_y%28b%29}\Rightarrow\frac{f_x%28b%29}{f_{a^{-1}}}%28y%29

It’s supposed to depict some sort of transformation, with the fraction on the left representing some sort of relationship between the numerator and the demoninator, the arrow in the middle representing the transformation, and the fraction on the right a relationship between the permuted contents of its numerator and denominator. Basically, you can fill it out however you want. a-1 is supposed to be some sort of opposite of a. Also, generally either a and b represent characters, and x and y represent some properties, or vice versa. And generally f doesn’t mean anything. (I take that back. f indicates that there’s a functional relationship between its two arguments. ‘functional relationship’ means that one of its arguments is a property of the other, or is an action performed on/by the other. Basically by ‘meaningless’ I mean ‘not a variable’).

It all is a bit arbitrary, but there’s certainly a knack to describing things using it. Actual analyses follow below the fold

Example 1: Megaman boss battles

a: Shoot with x-buster
a-1: Shot by x-buster
b: Shoot with boss’s weapon
x: Megaman
y: Boss
=>:beat boss

So, ignoring f, the formula looks like

http://ded.increpare.com/cgi-bin/mimetex.cgi?\frac{{}_{\mbox{Megaman}}%28\mbox{shoots%20x-buster}%29}{{}_{\mbox{Boss}}%28\mbox{shoots%20boss%20weapon}%29}\Rightarrow^{\mbox{}}\frac{{}_{\mbox{Megaman}}%28\mbox{shoots%20boss%27s%20weapon}%29}{{}_{\mbox{Shot%20by%20x-buster}}}%28\mbox{Boss}%29

This can be read as: before you beat a boss, you each are equipped your respective weapons, but you kill him and take his weapon by shooting at him; in short:

=>

Exampe 2: Tetris

This is a little weaker, but anyway.

a: falling
a-1: rising
b: stationary
x: controlled piece
y: main body of blocks
=>: drop piece

mimetex.cgi?\frac{{}_{\mbox{controlled%20piece}}({\mbox{falling}})}{{}_{\mbox{main%20body%20of%20blocks}}(\mbox{stationary})}\Rightarrow^{\mbox{}}\frac{{}_{\mbox{controlled%20piece}}(\mbox{stationary})}{{}_{\mbox{rising}}(\mbox{main%20body%20of%20blocks})}

GB_Tetris.png

That is to say that, when you’re dropping a piece, the mass of blocks at the bottom don’t do anything, but when the piece has finished dropping, it stops moving itself, and adds to the mass of the main body of blocks at the bottom. (no, this doesn’t deal with getting lines: that would require another diagram … ).

Example 3: Pacman

a: eats
a-1: edible
b: freedom of movement
x: pacman
y: ghost
=>: get power pill

mimetex.cgi?\frac{{}_{\mbox{Pacman}}({\mbox{eats}})}{{}_{\mbox{Ghost}}(\mbox{freedom})}\Rightarrow^{\mbox{}}\frac{{}_{\mbox{Pacman}}(\mbox{freedom})}{{}_{\mbox{edible}}(\mbox{Ghost})}

Before you get the power-pill, you gotta be real careful where you go, but once you have it you don’t need to fear anybody, for the time being. And the ghosts become edible (and they also start trying to avoid you). Mmmm.

pacman4.jpg american_flag.jpg
=>
ghost-1.jpg

It’s one of these fun things to do. Kirby can be dealt with in a manner similar to megaman, but yoshi seems a lot more difficult (the most obvious candidate for inclusion in any formula here being the between the opposition between eating and giving birth. to an egg).

Interpreting things using the canonic formula can seen a bit arbitrary. Semiotic squares are much simpler, and can be handy for classifying entities in a game. For an off-the-cuff example, take pacman again. We take a two pairs of binary opposites, in this case “round/non-round” and “moving/stationary”, and we get the following diagram

moving not moving
round pacman4.jpg powerpill.jpg
not round ghost-1.jpg pill.jpg

Maybe I could have thought of slightly better categories if I had put more thought in ;), but they do at least allow us to distinguish these four entities from eachother. This sort of stuff is far less arbitrary than the canonical formula stuff: you get a computer to do the searching for things, and you don’t find yourself back-tracking half as often in attempts to squish your things into a big ol’expression like the CF.

The CF is chiefly used in anthropology to talk about differences between related myths. It should also be applicable to computer games to talk about the differences between different games in the same genre (indeed, it’s when one starts doing this that things end up getting a lot less arbitrary).

If one was being a little bit pretentious, and was okay with using Levi-Strauss’s (rather non-standard) terminology, one could describe the above interpretations using the CF as the study of megaman/tetris/pacman as myth :D


Example 4: Tetris Line Removal

Ah, here’s something for the tetris line-removal mechanism. So before, you have a piece that you control that is added at the top of the screen, while a line, only partially filled, sits at the bottom. When you actually fill a line, the line is removed, and the piece you controlled presumably ending up getting partially/wholly destroyed in the process.

a: added
a-1: removed
b: partial/non-existence
x: controlled piece
y: line
=>: line filled

mimetex.cgi?\frac{{}_{\mbox{piece}}({\mbox{added}})}{{}_{\mbox{line}}(\mbox{partial})}\Rightarrow^{\mbox{}}\frac{{}_{\mbox{piece}}(\mbox{partial})}{{}_{\mbox{line}}(\mbox{removed})}

tetris-dx_02.png

So, in less mathematical form, you have the transition from a picture of pieces being added at the top of the screen while you have all of these partially filled rows, but when a line is filled and removed, the piece that you controlled looses some (possibly all of) its blocks, as if to retore some cosmic balance ;)

Example 5: Lode Runner

A good fellow on the forum called joshg gave the following example (ref)

I’ll take a shot at it.

Let’s see, which game … how about Lode Runner.

Player(trapping) Player(freedom)
—————- => ————–
Robots(freedom) Trapped(Robots)

So the robots begin with the freedom to chase you down, and all you can do is lay traps. Once you trap them, you then have freedom to escape.

I found this to be quite a nice analysis myself.


Here’re another two:

Example 6: Yoshi’s Island

a: eating
a-1: eaten
b: life
x: yoshi
y: bad guy
=>: swallow bad guy

That is to say, Yoshi, in the process of eating the bad guy, takes his life, and gives birth to a new one (the egg).

Example 7: End-of-level Bosses

Super%20Mario%2064%20-%205.jpg

In general, boss sequences in game take place in enclosed spaces, where your movement is restricted. Also, bosses generally have much more elaborate movement patterns than normal bad guys. So there’s some sort of transfer going on: you’re loosing some freedom of movement, and the AI is getting it. And how does this happen? Well, by just progressing through a level, you’re eventually going to get to the boss (usually).

a: progresses
a-1: encountered
b: relatively restricted movement
x: player character (PC)
y: non-player characters (NPCs)
=>: encounter the boss


So, thus far we have the following oppositions between a and b in the various games

shoots with X/shoots with Y
falling/stationary
eats/freedom
adds/partial
trapping/freedom,

eating/life
progress/restricted movement

In each case, doing the former will, in a sense, get you the latter

Also, in each case so far x has been under the control of the player and y has been computer-controlled. I can’t think of any examples off hand where this is not the case, though there must be some. I’m going to have to go now and compare these examples to the traditional ones, see how they match up.

]]>
https://www.increpare.com/2008/10/structuralism-the-canonical-formula-and-computer-games/feed/ 2
The rack; the rack! https://www.increpare.com/2007/09/the-rack-the-rack/ https://www.increpare.com/2007/09/the-rack-the-rack/#comments Sun, 16 Sep 2007 17:02:43 +0000 http://www.maths.tcd.ie/~icecube/2007/09/the-rack-the-rack/ nobody expected it, not for a moment

(not due to me, but rather to an acquaintance; new to the internet I think though, so I’m taking the liberty of putting it up here).

]]>
https://www.increpare.com/2007/09/the-rack-the-rack/feed/ 4
In which the hero sketches something, for he hath not the strength to venture, unbidden, into more detail. Gerbes? He thinks not. https://www.increpare.com/2007/08/in-which-the-hero-sketches-something-for-he-hath-not-the-strength-to-venture-unbidden-into-more-detail-gerbes-he-thinks-not/ Tue, 14 Aug 2007 08:31:26 +0000 http://www.maths.tcd.ie/~icecube/2007/08/in-which-the-hero-sketches-something-for-he-hath-not-the-strength-to-venture-unbidden-into-more-detail-gerbes-he-thinks-not/ Hmm. This is going to be harder than I had initially thought now that I think of it. Basically, given three melodies that work in counterpoint they are written on three staves, one above the other. And we have the identity that the interval between the lower and middle voice added to the interval between the middle and upper voice will give the interval between the lower and upper voice. And we have rules that relate how these voices should interact with eachother.

However, one can still apply most of the rules quite well if we make things a little bit abstract and no longer require the above relationship [a,b]+[b,c]=[a,c] to hold, but rather that it hold only up to a certain constant interval I.

And what’s the sense in this? Well with this you still have three melodies, only now instead of all three being contrapuntally amenable, we have that any two of them are. I haven’t seen this expounded elsewhere, and given how practical it seems I thought I’d mention it here.

And why the devil did I want to mix up Fuchs with cohomology? Well, I was trying to figure out an easy example of a Gerbe :) (I failed, as it happened, but it’s quite teasingly close!).

And why this rambley ramble here as opposed to something more deliberate? Because I’ve been meaning to post this since November last year, that’s why. So this means I get to relax about it now. Chill, you know? And if anybody should wish for any explication I would be Only Too Happy to provide it.

]]>
Serial: Chapter 3: C – Columbus https://www.increpare.com/2007/02/serial-chapter-3-c-columbus/ Sat, 24 Feb 2007 17:36:58 +0000 http://www.maths.tcd.ie/~icecube/2007/02/serial-chapter-3-c-columbus/ Isaac, dearest,

I was leaving through the recently published memoirs of Christopher Columbus (curiously written in the third person; surely such an odd style cannot have been introduced by the translator, whatever other factual errors he makes), last year, and I felt you might be amused with the following story; at least insofar as it contrasts with your recent proof of the finiteness of the the geometrical space in this universe.

Ah, no point faffing about; I will just quote the passage from near the end of the book you now

Columbus sat in his study, overlooking Cádiz, with a Bible on his desk. He stared across to the horizon, and thought.

“How terrible it must be,t o be a highly situated savage, to see the world about you to the horizon and think there nothing more, to feel one’s self trapped on so small a disk of earth”.

Though, then he fancied that maybe a normal man might be able to live feeling so encaged, but not an explorer such as he.

“God has set forth, he had been told, a bigger cage for us in which to live, many orders of magnitude larger than the disk to our horizon, yet finite nonetheless. More than enough to go on exploring for generations”, he reassured himself.

And yet, he felt he could not accept this: How could God imbue the greatest of his men with the spirit of exploration, if there might be some age, maybe in a few centuries, when there will be no to explore, to discover, to find, on this planet. He would have verify this himself, to see the edge of the world with his own eyes, or alternatively spend the rest of his life travelling farther and farther out, boundless.

With this monumental task in mind, he petitioned the king for enough gold to sail for five years continuously west and, after five years petitioning, he was granted this sum.

One year of eager preparations passed before he was ready to set sail to see if the Atlantic actually had an edge. Six months at sea and land ahoy! What joys he experienced, what vindication: some islands, then a whole new expanse of land – the Vatican said that there was nothing west of Europe: they were wrong, he now knew!

This meant for him one of two things: We live on a much, much larger world than the Vatican claim, or alternatively, and his personal theological views led him to regard this as being much more likely: the world is infinite in extent, that one can travel forever in any direction without reaching an edge – this would be the only possible world he could see god having created – otherwise what a cruel fate would await the noble pursuit of exploration!

Okay, so here there’s a big chapter about America, which I’m not going to quote for you in full, but essentially what happens is that I decide that I must move south along the coast, because, even if it does go on forever in both directions, the only alternative is to give up and go back and there’s no way I’m gonna do that. So we travel down around, and west for a few more months, until hitting land again. Bang. And they anchor. And, lo, what’s this? A VILLAGE. Sweet. Then:

Shortly after entering the village, he found that he himself did find the people look quite familiar, some words of their language, their customs, from his travels east of India; had these people, from the other side of Europe, travelled here first, made these vast journeys? The very notion seemed impossible; the Indians and Chinese hated sailing, he knew. And yet, as his crew went further inland, he began to find more and more similarities until there was no doubt left: they were in China.

This world repeated itself then, he realized – it was not Rome’s disk, nor was it an explorer’s world – “What a cruel trick to play”, he thought “To think, if you had a powerful enough telescope you might catch sight of yourself, looking away, that the world was, despite all of it’s illusions, really finite in extent; that one might still sail west forever, but never come across anything new, that the world was finite – there were no barriers to travel, but, nonetheless, there was only a finite amount to discover in it – how cruel a discovery for an explorer to have make!

Of course, *everyone* knows that Galileo believed the earth to be shaped like an aubergine. So this casts everything, really, in to the most terrible of doubts, don’t you think? But then again, it is a charming story, neh?

Anyway, I hope to see you in the new year.

Yours,

xxx

Nicolas

]]>
My favourite calculation: Combination tones https://www.increpare.com/2007/02/my-favourite-calculation-combination-tones/ Wed, 21 Feb 2007 19:55:46 +0000 http://www.maths.tcd.ie/~icecube/2007/02/my-favourite-calculation-combination-tones/ Hmm, so in the interest of subscribing to this mathematical carnival what’s doing the rounds now, I’m writing something specifically mathematical in nature, my favourite elementary derivation. I’m trying to make it understandable and brief – if anyone is having trouble following, I can help in the comments.

Okay, so lets say we’re hearing a signal given by f(t); let’s assume it’s periodic. Now, to monitor what we hear, we have to view this as a sum of sine waves

f=a*sin(t)+b*sin(2t)+c*sin(3t)+ …

so a,b,c represent the frequencies we hear of frequency 1,2,3, etc, and the bigger the coefficient the bigger the amplitude.

Lets look at two really simple sounds, pure sine waves of different frequencies sin(at), and sin(bt). SO, they each have exactly one frequency present.

Now, so what if there were some non-linearity of our hearing system. That is what if, when someone plays f=sin(at)+sin(bt), we don’t actually hear this, but rather something more complicated.

So, the simplest way of such a thing being non-trivial is to introduce a quadratic non-linearity (ignoring coefficients…we’re thinking that because “all” functions can be taylor expanded as f(t)+f(t)2/2+f(t)3/3!+…, the next best thing to having just f(t) is to having the first two terms).

So, anyway, now when someone plays a signal f(t), we don’t hear f(t), but rather f(t)+f(t)2

So, what results from this? Well, we have to break down f(t)+f(t)2 to being a sum of sine waves first.

f(t)+f(t)2=sin(at)+sin(bt)+ (sin(at)+sin(bt))2
=sin(at)+sin(bt)+sin(at)2+sin(bt)2+2sin(at)sin(bt)

looking up trig tables and decomposing further we get (ignoring coefficients)

=sin(at)+sin(bt)+cos(2a)+cos(2b)+sin(a+b)+sin(a-b)

Ah, so look at this. We might be led to deduce from this that, if non-linearities were present, when someone plays two frequencies at the time, we will also perceive sounds playing at double either frequency, their sum, and their difference.

Now, the multiples of a and b can be reasonably expected to be masked by overtones (though it is possible to bring them out), but the difference (and, to a lesser extent, the sum), on the other hand, can be controlled very easily, just by bringing the two source sounds closer together or further apart. And, indeed, we can quite easily hear them.* Which is darnedly neat.

I like this calculation so very, very much because it’s surprisingly fruitful; whenever I feel like I’m loosing my faith in the power of Taylor expansions, I go through this derivation again.

The phenomenon was first noted by Tartini, the derivation was by Helmholtz, and these extra tones are sometimes called Tartini tones or, more commonly combination tones.

What’s also interesting, by the by, is that these effects are actually quadratic: I remember, the first time I heard an example (they can be found on the interweb quite easily, here for instance), I was listening to them with earphones, and the strength of the combination tone totally overwhelmed the two base ones. But, when I played it on speakers, it was much weaker relative to these tones, and if I went too far away, I couldn’t hear it at all.

*okay; this is a lie, actually the third order terms are the easiest to hear, corresponding to things like 2a-b…and there’s an explanation for this (check out Dave Benson’s notes if you want to know more).

]]>
Serial: Chapter 2:C/A – Blackness https://www.increpare.com/2007/02/serial-chapter-2ca-blackness/ Tue, 20 Feb 2007 16:34:30 +0000 http://www.maths.tcd.ie/~icecube/2007/02/serial-chapter-2ca-blackness/ I was alone, and in darkness. It stretched out forever, and yet it was not a vertigo I felt at the feeling of this expanse, but rather found myself suffocating at the immediacy and intimacy of the blackness.

]]>
Serial: Chapter 2: A – Riemannian https://www.increpare.com/2007/02/serial-chapter-2a-riemannian/ Sun, 18 Feb 2007 23:22:22 +0000 http://www.maths.tcd.ie/~icecube/2007/02/serial-chapter-2a-riemannian/ In a dream again, I found myself in a labyrinth. This was not a labyrinth of walls, though, it was a labyrinth of space and, instead of feeling claustrophobic confinement, I felt the oppression of a space too rich, too rich and dense, to meaningfully comprehend.

This was a desert, with occasional rocks, trees, allowing me some orientation with respect to my world and, yet, I couldn’t shake off a feeling of general disorientation.

I set my sight on a particular tree, which was standing next to a sharply jutting piece of sandstone several paces away. I made my way towards it, or rather, tried to – I found after one or two paces these to be on the periphery of my vision, though a little closer – I turned to face them again, and stepped forward: walking towards this tree was like keeping one’s balance on a bicycle – it took constant corrections.

I picked up a small stone, some black, rough stone, from the sand, and tossed it forwards a short distance; I found that I was getting the hang of this desert, and was able, with some small exertion of effort, to walk to it and pick it up again, though I could only move but slowly.

I picked up two stones, and made an effort to toss them both t the same point a few metres away. Indeed, they looked to land rather closely together. And, yet, as I walked towards one, I found the other getting further and further away, until, by the time I had reached my destination, the other one was almost as far from me as I was now from the point at which I had thrown it.

The geometry of this place was…thick; it seemed that even the slightest error in orientation, on a walk of but a few paces, could result in you being further away than when you started.

I then knew, as one does in dreams, that my destination – the place where I needed to go, was many miles away, that I could spend a lifetime of lifetimes trying to find it and, even if someone could point me in its rough direction from where I was, I would have little chance of ever finding it.

]]>
Serial: Chapter 2: C – Cube https://www.increpare.com/2007/02/serial-chapter-1c-cube/ Fri, 16 Feb 2007 23:22:02 +0000 http://www.maths.tcd.ie/~icecube/2007/02/serial-chapter-1c-cube/ I fell asleep to find myself standing on an interior wall of a cube. There was no gravity it seemed, though I was, it seemed, bound to walk on it’s surface.

This was not too small a chamber; it stretched almost a hundred metres in each direction, and the isolation or artifice of this situation did not in and of itself worry me. But, after a few minutes of exploration had passed, I noticed that this cube was not as spacious as it had seemed to me at first glance.

I stood at one corner and asked myself “Would it matter me if I was to stand at any other corner?” With this thought I could feel the space I had perceived contract about me. I thought “At this corner, is there any difference between facing one other corner, or any other one?” And with this, and all it’s variations and implications, I felt my freedom disappear, to be replaced with a noose, tightening about my neck.

]]>
Serial: Chapter 1: C/A – High Dim. https://www.increpare.com/2007/01/serial-chapter-1ca-high-dim/ Fri, 26 Jan 2007 00:47:15 +0000 http://www.maths.tcd.ie/~icecube/2007/01/serial-chapter-1ca-high-dim/ The following night I had another dream: I awoke inside the dream, to find myself breathing deeply, calmly, in some spacious, geometrical environment. I looked about, trying to take in in my surroundings, only a fear began to grab at me: the space was uninhabited by anything else, it just went on forever in all directions, and yet there was more: as it dawned upon me that I was in a space of dimensions many more than three, that space was going to infinity not merely in three directions, but twenty – this frightened me, I found myself unable to move, praying for some relief to the immense extent of this world.

My prayers were suddenly answered: I found myself trapped in a cramped prison cell; trapped between forty different walls on forty different sides.

]]>
Serial: Chapter 1: C – Quotient https://www.increpare.com/2007/01/serial-chapter-1c-quotient/ https://www.increpare.com/2007/01/serial-chapter-1c-quotient/#comments Wed, 24 Jan 2007 00:41:31 +0000 http://www.maths.tcd.ie/~icecube/2007/01/serial-chapter-1c-quotient/ It took me some time to get to sleep that night. When I did, my fears blossomed into a nightmare:

I was, alone, in a dining room, with a heavy mahogany table and the walls were covered with a rich velvety wallpaper. Silver service laid on lace tablecloth, adorned about with plates of food.

In contrast to the evening’s fears of expanses, I now began to feel uncomfortably contained in my body, in this oppressive room; my apprehensions grew with every breath, and then I noticed some changes that restricted my enclosure upon me in a way I could not have expected:

There were no straightforward physical barriers developing, nor did the walls begin to close in on me; rather I began to perceive things differently – or rather, the reality of the situation changed. I had been looking at the contents of my plate, glancing fearfully away from it up to the ceiling every so often, lest it come crashing down upon me. But then the changes began: suddenly, the lampshade on the ceiling and the plate on the table were not separate things, but rather one thing; still the lampshade and the place, but now thoughts of separating them were impossible.

I pulled my eyes away from this transfiguration, allowing my sight to escape to the door, only the door was now not only the door, but simultaneously the lower shelf of the bookcase on the opposite end of the room, and then the bookcase as a whole became the bookcase and the table; this room was folding in on itself, but in no straightforward way; I tried then to look down, and found that the floor had become the floor and the ceiling, and then, all at once, up was combined with down.

I suddenly awoke, with the thought “What must be becoming of me?”

]]>
https://www.increpare.com/2007/01/serial-chapter-1c-quotient/feed/ 3