<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Sup. I’m Sakunthala Panditharatne, first year maths student, graphics/ iOS/ RoR programmer, and exhibitionistic autodidact. 
Email me, for whatever mad purpose:  sp668@cam.ac.uk </description><title>the imaginary hackathon</title><generator>Tumblr (3.0; @theimaginaryhackathon)</generator><link>http://theimaginaryhackathon.tumblr.com/</link><item><title>WILTW #18: Interpreting</title><description>&lt;p&gt;So last week I was reading about shape grammars. This week, I wrote an interpreter. Hopefully next week I&amp;#8217;ll start making some sort of programming language for shape grammars, sort of like LOGO, I guess.  That&amp;#8217;s the plan.&lt;/p&gt;
&lt;p&gt;&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;I wrote the interpreter in Ruby, which is slow, but a functional language, which makes things a lot easier. Kind of based it on &lt;a href="http://norvig.com/lispy.html"&gt;Peter Norvig&amp;#8217;s article on writing a LISP interpreter in Python&lt;/a&gt;, which is a fantastic article: I knew nothing about interpreters before this week, and it taught me to write one. It&amp;#8217;s not on rubygems yet because I couldn&amp;#8217;t think of anything to name it. Also because it&amp;#8217;s basically useless at the moment.&lt;/p&gt;
&lt;p&gt;Anyway, my &amp;#8220;language&amp;#8221; at the moment is basically LISP. All the shape grammar stuff will come through a library for this language. It would have been better in the first place just to write a library for another functional language, but hey, I learned to write an interpreter. Gimme a break. It&amp;#8217;s &lt;a href="https://github.com/m0nologuer/mystery/blob/master/interpret.rb"&gt;on github here&lt;/a&gt;, but it&amp;#8217;s seriously bad and shouldn&amp;#8217;t be used by anyone. Here&amp;#8217;s the kind of program it&amp;#8217;ll accept:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;[&lt;strong&gt;begin&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[&lt;strong&gt;define&lt;/strong&gt; x [+ 1&amp;#160;3]] &lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[&lt;strong&gt;define&lt;/strong&gt; y curr_pos] &lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[&lt;strong&gt;define&lt;/strong&gt; z [~ [+ x 2] [norm y] 4]] &lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[&lt;strong&gt;define&lt;/strong&gt; l [+ x z]] &lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[&lt;strong&gt;move&lt;/strong&gt; l] &lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[&lt;strong&gt;point_down&lt;/strong&gt;] &lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[&lt;strong&gt;return_to&lt;/strong&gt; x] &lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-tab-span"&gt; &lt;/span&gt;[&lt;strong&gt;point_down&lt;/strong&gt;]&lt;/li&gt;
&lt;li&gt;]&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;It&amp;#8217;s pretty heavily modelled on LOGO, as you can guess. &lt;strong&gt;curr_pos&lt;/strong&gt; is the position of an imaginary pointer, &lt;strong&gt;point_down&lt;/strong&gt; just records your point on the output file, &lt;strong&gt;return_to&lt;/strong&gt; moves the imaginary pointer to whatever vector you feed into it, &lt;strong&gt;move&lt;/strong&gt; moves the pointer in a direction (i.e. adds a vector to the imaginary pointer). &lt;/p&gt;
&lt;p&gt;What I was planning to do was add some new functions (written in the language) like &amp;#8216;triangle&amp;#8217;, or &amp;#8216;recursive triangle&amp;#8217;, in a similar vein to &lt;a href="http://recursivedrawing.com/"&gt;recursive drawing&lt;/a&gt;. However whilst writing this post I&amp;#8217;ve realised a library for Ruby would do a far better job. Hopefully I&amp;#8217;l have that on here next week.&lt;/p&gt;
&lt;p&gt;On the other hand, learning Sanskrit is turning out to be really fun. Also I read &lt;a href="http://www.quora.com/Linguistic-Relativity/If-language-influences-thinking-what-is-the-best-language-to-complement-English/answer/Kiran-Kadav"&gt;this answer on Quora&lt;/a&gt; and now I &lt;em&gt;have&lt;/em&gt; to learn it.&lt;/p&gt;</description><link>http://theimaginaryhackathon.tumblr.com/post/27511225738</link><guid>http://theimaginaryhackathon.tumblr.com/post/27511225738</guid><pubDate>Wed, 18 Jul 2012 18:32:03 -0400</pubDate><category>interpreting</category><category>compiler</category><category>language</category><category>logo</category><category>shape grammar</category></item><item><title>WILTW #17: Cloudcuckooland</title><description>&lt;p&gt;Meh, this isn&amp;#8217;t going to be a very interesting blog post. Read at your own peril.&lt;/p&gt;
&lt;p&gt;&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Books&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The Birds - Aristophanes&lt;/em&gt; This play was exactly to my tastes; rude and flamboyant, fantastical and hysterical, operating on some twisted comedic half-logic and totally exaggerated. It&amp;#8217;s total slapstick buffoonery. It&amp;#8217;s the Classical equivalent of a musical. I was enchanted by the wacky utopia of Cloudcuckooland, so naturally I started making a game adaptation. Let&amp;#8217;s see how far this goes.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The Age of Gold - HW Brands&lt;/em&gt; This was a history of the gold rush in the US West, but reads more like a novel than a history book. I mainly read this because I liked the film &lt;em&gt;There Will Be Blood,&lt;/em&gt; but the characters in H.W. Brands&amp;#8217; book turned out to be far more appealing - and it is a book mainly about characters, highly personal stories of immigrant treasure-hunters from all over the world. Incredibly romanticised for a history book, at least until the last quarter which is a more conventional historical analysis.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tech&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Been reading up on some more procedural art. I read this &lt;a href="http://www.vision.ee.ethz.ch/~pmueller/documents/procedural_modeling_of_cities__siggraph2001.pdf"&gt;SIGGRAPH 2001 article&lt;/a&gt; which uses L-systems to generate buildings and cities. This got me reading about &lt;a href="http://shapegrammar.org/GEdit/paper.pdf"&gt;shape grammars&lt;/a&gt;. I&amp;#8217;m starting to think it&amp;#8217;d be really cool to have a functional programming language for 3D graphics (something like Logo, but better).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Other&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve learned to read and write the devanagari script, but that&amp;#8217;s as far as I&amp;#8217;ve gotten in one week with Sanskrit. Hopefully next week will be better. As described &lt;a href="http://theimaginaryhackathon.tumblr.com/post/26786705890/fun-with-teeth-5-adaptation"&gt;in the other post&lt;/a&gt;, I&amp;#8217;ve realised something that is (I think) important about game storytelling. And that&amp;#8217;s it fot this week.&lt;/p&gt;</description><link>http://theimaginaryhackathon.tumblr.com/post/27044715583</link><guid>http://theimaginaryhackathon.tumblr.com/post/27044715583</guid><pubDate>Thu, 12 Jul 2012 07:09:00 -0400</pubDate><category>games</category><category>graphics programming</category><category>programming</category><category>sanskrit</category><category>tech</category><category>the birds</category></item><item><title>Fun With Teeth #5: Adaptation</title><description>&lt;p&gt;Video game adaptations are nearly unheard of, whilst film adaptations are abundant to a fault. Is this because of a difference in the video game and film industries, or the two media themselves? I hope it&amp;#8217;s the former. Of all the possible explanations for this phenomenon, the most disappointing is that it&amp;#8217;s more difficult to tell a story with a video game. &lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve just started programming/designing a video game adaptation of Aristophanes&amp;#8217; &lt;em&gt;The Birds&lt;/em&gt;. &lt;em&gt;The Birds&lt;/em&gt; is a flamboyant comedy first performed in 414BCE in Ancient Athens. It&amp;#8217;s about two disillusioned Athenians who decide to seek the help of the birds to build a utopian city in the clouds called &lt;a href="http://tvtropes.org/pmwiki/pmwiki.php/Main/Cloudcuckooland"&gt;Cloudcuckooland&lt;/a&gt;. They plan to include intercept offerings to the gods, build a wall to stop riff-raff coming in (remember, this city is only accessible &lt;em&gt;from the sky&lt;/em&gt;) and let the birds take the place of the gods. However, all the foolish plans don&amp;#8217;t fall through; the mad idealism actually prevails. It&amp;#8217;s a big, over-the-top, hysterical and often crass comedy about a place. I instinctively knew this would make a good video game.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://www.toptenz.net/top-10-video-games-based-on-books.php"&gt;few adaptations of novels and the like &lt;/a&gt;that have been made generally use one of two approaches. Either the game makes an awkward McLuhan-esque mistake and gives you a film punctuated by spurts of pretty typical gameplay, or it crafts an environment and lets you explore, thereby letting you (the player) discover the story. This is what&amp;#8217;s good about the storytelling of &lt;em&gt;Bioshock&lt;/em&gt;, &lt;em&gt;Portal&lt;/em&gt; and to some extent &lt;em&gt;Enslaved.&lt;/em&gt; They concentrate on building the setting, and guide the player through it in a way that they discover the story.&lt;/p&gt;
&lt;p&gt;There are exceptions, of course - &lt;em&gt;Braid&lt;/em&gt; does a good job of telling the story partially through game mechanics. This is cool, but it seems to me like a really unnatural way of telling a story. It&amp;#8217;s true that the the essential part of a game are it&amp;#8217;s incentives and rewards, but the complicated parts of human nature that you&amp;#8217;d want to explore in a serious story aren&amp;#8217;t the parts about responding to incentives and rewards. Broad aims and goals, maybe, but unless your game is about a ruthless monomaniac - and I suppose the protagonist of &lt;em&gt;Braid&lt;/em&gt; &lt;strong&gt;is&lt;/strong&gt;-, game mechanics aren&amp;#8217;t the best way to capture a part of the human experience.&lt;/p&gt;
&lt;p&gt;Luckily, video games, at least since the 1990s, have another component: the setting. By this I mean not only the lavish 3D universes of modern video games, but also the music, the non-player characters and what they say - essentially everything but the game mechanics and cutscenes. In other words, I mean the game world. I think that the most natural way to tell a story through a video game is to make a setting and let the player explore it. Maybe I instinctively thought of making an adaptation because the story of &lt;em&gt;The Birds&lt;/em&gt; was so setting-centric. (Interestingly, the story of Cloudcuckooland is quite similar to the story of &lt;em&gt;Bioshock&lt;/em&gt;&amp;#8217;s Rapture&amp;#8230;) &lt;/p&gt;
&lt;p&gt;If there is a certain kind of story best told through a video game, it seems that there should be certain kinds of stories best told in other media. And this is the case - long, complex, introspective stories make good novels but not good films. Maybe it&amp;#8217;s time for game designers to recognise that video games are not about incentives and rewards, but about settings and exploration. Let&amp;#8217;s scrap the cutscenes and the levelling up and bring on the living, breathing, digital world.&lt;/p&gt;</description><link>http://theimaginaryhackathon.tumblr.com/post/26786705890</link><guid>http://theimaginaryhackathon.tumblr.com/post/26786705890</guid><pubDate>Sun, 08 Jul 2012 17:51:00 -0400</pubDate><category>Cloudcuckooland</category><category>video games</category><category>games</category><category>game design</category><category>the birds</category><category>The Medium is the Message</category><category>bioshock</category><category>setting</category><category>storytelling</category><category>games are art</category><category>braid</category></item><item><title>WILTW #16: I'm somewhat pleased to say I can't really sum it up in the title</title><description>&lt;p&gt;This has been the first week of my summer holiday, and having no obligations means I can use all my time to indulge my batshit interests. They&amp;#8217;re not really connected, so I&amp;#8217;m just going to list everything out. I&amp;#8217;m aware that this is a horrendous structure for a blog post, but I don&amp;#8217;t really write this for an audience; I write this just as a way of becoming clearer about what I think. So, uh, sorry imaginary readers.&lt;/p&gt;
&lt;p&gt;&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Books&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Against Interpretation - Susan Sontag&lt;/em&gt; I&amp;#8217;ve been reading this on and off for ages but I&amp;#8217;ve finally finished it, and it&amp;#8217;s just fantastic. It&amp;#8217;s a collection of essays written in the 60s about (then) contemporary culture. Sontag is an incredibly cogent and precise writer, and part of the reason I read this was to improve my writing. And it&amp;#8217;s culture commentary, so if anything it&amp;#8217;s a good guide on what to read next. But most of all, her ideas are brilliant. I really enjoyed this, especially &amp;#8220;The Imagination of Disaster&amp;#8221;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The Art of Always Being Right - Arthur Schopenhauer&lt;/em&gt; This was kind of funny, but nothing that special. It&amp;#8217;s essentially Schopenhauer listing logical fallacies, except with a really cynical misanthropic tone. His idea of &amp;#8220;The Will&amp;#8221; comes through a bit, but otherwise it doesn&amp;#8217;t really mention his philosophy. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Doctor Faustus - Christopher Marlowe&lt;/em&gt; I&amp;#8217;m not sure whether this play is skeptical of science, or whether Faustus is just a tragic hero in the role of the Enlightenment-era scientist. I felt the imagery was really extreme - grotesque demons, even Satan himself, Helen of Troy, Faustus &lt;em&gt;punching the Pope.&lt;/em&gt; I also thought it was a little strange how after making the pact, Faustus doesn&amp;#8217;t really gain anything. I suppose this means the play isn&amp;#8217;t really about the temptation of material gain, but the hubris in thinking one can get it through illegitimate means (selling your soul to the Devil is &lt;em&gt;very&lt;/em&gt; illegitimate, methinks). Faustus&amp;#8217; mistake isn&amp;#8217;t as much greed as it is thinking he knows better than the religious tradition.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tech&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been reading some of the &lt;a href="http://kesen.realtimerendering.com/sig2012.html"&gt;SIGGRAPH 2012 papers&lt;/a&gt; and they look really fantastic, as always. Anyway a few thoughts:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;My first thought was that &lt;a href="http://www.cs.cornell.edu/~srm/publications/TOG12-cloth.html"&gt;these people&amp;#8217;s results&lt;/a&gt; would make a good normal map generator of sorts. (Or maybe a mesh generator that could be used with some instancing stuff, I dunno.) Unfortunately their paper isn&amp;#8217;t publicly available so I don&amp;#8217;t know exactly what the method is.&lt;/li&gt;
&lt;li&gt;I haven&amp;#8217;t been keeping up with fluid simulation so I&amp;#8217;ve just learned that &lt;a href="http://www.cs.ubc.ca/labs/imager/tr/2012/Schechter_SIGGRAPH12_GhostSPH/"&gt;ghost SPH is a thing&lt;/a&gt;. From what I understand, this doesn&amp;#8217;t actually involve any ghosts. Instead, they use air particles (&amp;#8220;ghost particles&amp;#8221;) as well as fluid particles, so there are never any particles at the edge of the simulation, which caused problems with SPH before. &lt;/li&gt;
&lt;li&gt;&lt;a href="http://vladlen.org/publications/a-probabilistic-model-for-component-based-shape-synthesis/"&gt;Now this is something really cool&lt;/a&gt;. I was interested in this kind of thing before I saw this, so maybe I&amp;#8217;m a little biased. Combine this with procedural art and laborious 3D modelling is over. I haven&amp;#8217;t read the article yet but I love the idea. Hope to program this next week.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://zurich.disneyresearch.com/~wjarosz/publications/sadeghi11physically.html"&gt;Rainbows&lt;/a&gt;! This one was apparently written by Disney, so I guess we&amp;#8217;re going to be seeing this in films soon. It&amp;#8217;s an incredibly detailed explanation of interference patterns and reflection of light at the level of microscopic water droplets. Seems to be a kind of ray tracing-based thing. My first thought was &amp;#8220;isn&amp;#8217;t this going to be a a bit slow?&amp;#8221; And yeah, their render took 350 minutes. Maybe this could be adapted into a less complicated model could be used for games and other real-time things.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Other&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Saw this &lt;a href="http://www.vam.ac.uk/content/exhibitions/exhibition-british-design/"&gt;exhibition on British design since WWII&lt;/a&gt; at the V&amp;amp;A yesterday. It was a lot better than I expected. Original Bowie costumes, Damien Hirst&amp;#8217;s art from the 90s, clothes from Vivienne Westwood and Malcolm McLaren&amp;#8217;s shop &amp;#8220;Too Fast To Live, To Young To Die&amp;#8221; - I was impressed. And it was really nicely curated. They didn&amp;#8217;t just hang things on walls, walking through the exhibition was an experience. I would heartily recommend. I thought it was kind of funny how they claimed Apple products as British, because Jony Ive was born in London.&lt;/p&gt;
&lt;p&gt;In other news, I&amp;#8217;ve decided to start learning Sanskrit. The book arrived yesterday and it looked so horrendous I was too scared to start. I&amp;#8217;m already a passive speaker of &lt;a href="http://en.wikipedia.org/wiki/Sinhala"&gt;Sinhala&lt;/a&gt;, but I&amp;#8217;m not sure that&amp;#8217;s going to be much help. I find it really weird that the European (Romance, Germanic, etc) languages come from the same basic root language as Sanskrit. And here I thought I was learning a new language family. Anyway, wish me luck!&lt;/p&gt;</description><link>http://theimaginaryhackathon.tumblr.com/post/26518007967</link><guid>http://theimaginaryhackathon.tumblr.com/post/26518007967</guid><pubDate>Wed, 04 Jul 2012 18:18:23 -0400</pubDate><category>wiltw</category><category>V&amp;amp;A</category><category>Sanskrit</category><category>siggraph</category><category>susan sontag</category><category>schopenhauer</category><category>faustus</category><category>doctor faustus</category><category>sph</category><category>3d graphics</category><category>graphics programming</category></item><item><title>Fun With Teeth #3: A Cute Lil' Diophantine Equation</title><description>&lt;p&gt;I came across this easy but strange maths puzzle about a Diophantine equation, equations that can only have integer solutions:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;img height="25" src="http://www.texify.com/img/%5CLARGE%5C%21x%5E2%20-%202y%5E2%20%3D%201.gif" width="128"/&gt;&lt;/p&gt;
&lt;p&gt;The smallest non-trivial integer solution is x=3, y =2. What is the next smallest?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;!-- more --&gt;
&lt;p&gt;This is a pretty easy problem but it kind of loops into itself, so I had to blog about it. Anyway, rearranging:&lt;/p&gt;
&lt;p&gt;&lt;img height="16" src="http://www.texify.com/img/%5Cnormalsize%5C%21y%5E2%20%3D%20%28x%2B1%29%28x-1%29/2.gif" width="128"/&gt;&lt;/p&gt;
&lt;p&gt;We know that both (x+1) and (x-1) are multiples of two, and either (x+1) or (x-1) must be a multiple of four. We also know, as (x+1) and (x-1) have a difference of two, that they can&amp;#8217;t share any factors greater than two. However, (x+1)(x-1)/2 is a perfect square, so both (x+1) and (x-1) must have a factor other than two or four that is a perfect square. Let&amp;#8217;s assume it&amp;#8217;s (x-1) that&amp;#8217;s the multiple of four&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;img height="13" src="http://www.texify.com/img/%5Cnormalsize%5C%21x%2B1%20%3D%202m%5E2.gif" width="80"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="12" src="http://www.texify.com/img/%5Cnormalsize%5C%21x-1%20%3D%204n%5E2.gif" width="72"/&gt;&lt;/p&gt;
&lt;p&gt;So&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;img height="12" src="http://www.texify.com/img/%5Cnormalsize%5C%212m%5E2%20-%204n%5E2%20%3D%202.gif" width="96"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="12" src="http://www.texify.com/img/%5Cnormalsize%5C%21m%5E2%20-%202n%5E2%20%3D%201.gif" width="88"/&gt;&lt;/p&gt;
&lt;p&gt;Tah dah! We&amp;#8217;re back where we started. Now if we plug in the smallest solution to the original Diophantine equation, i.e. m = 3, n = 2, we get (x+1) = 18, (x-1) = 16. (Using the trivial solution gives us the smallest solution.) This leads us to the next smallest solution x=17, y = 12. It&amp;#8217;s also proved there&amp;#8217;s an infinite number of solutions, since you can just keep plugging in values for the next smallest ones.&lt;/p&gt;
&lt;p&gt;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&lt;/p&gt;
&lt;p&gt;EDIT: I&amp;#8217;ve been pretty boneheaded and written this whole article about a pretty well known phenomenon. I kind of expected that was the case. Oh well. You can read about &lt;a href="http://en.wikipedia.org/wiki/Pell's_equation"&gt;Pell&amp;#8217;s equations&lt;/a&gt; here. &lt;/p&gt;</description><link>http://theimaginaryhackathon.tumblr.com/post/13463689124</link><guid>http://theimaginaryhackathon.tumblr.com/post/13463689124</guid><pubDate>Mon, 28 Nov 2011 15:18:00 -0500</pubDate><category>Diophantine equation</category><category>maths</category><category>math</category><category>derp</category></item></channel></rss>
