The Game That Never Was
Mindless ramblings about the perfect game-
The Coderack and Codelets
Posted on September 26th, 2009 No commentsI haven’t done anything substantial over the last few weeks, so I’ll just continue with my meaningless ramblings about a system that lacks any kind of clue if it is anywhere near feasibility. Originally I started this as one big post covering several topics, but now it is sitting here for two weeks at least as a draft, every few days I add some sentences and it still keeps on growing. So I’ll split it up into several posts and this is the first section.
I already talked a bit about Copycat and how its architecture could be used in games. Let me now try to explain this a bit more. A central component of the Copycat architecture is the Coderack and its Codelets, and I believe that it can be used to efficiently manage AI rules and subsystems even without designing a sophisticated cognitive model for the “Computer Game” domain. (The point of the Copycat project was to design such a model and validate that it actually works. I will simply ignore that fact and just use the underlying software architecture for my own purposes.) I will explain later what I believe the problem of current Game AI is and how the Coderack architecture could solve it – let me first try to explain what it is and how it works.
Codelets are small pieces of code that perform a simple function. Usually a single Codelet only implements a small step of a larger process and creates another Codelet that continues where the first Codelet stopped. In the case of Copycat such a ‘larger process’ could be recognizing the group of letter ABC as a successor group.
But the way that the Codelets are executed is not just sequentially running the steps of predefined processes – we wouldn’t need some special architecture for that. Instead Codelets are put onto the Coderack, each one with a certain priority. At each step a single Codelets is randomly, but weighted by priorities, chosen from the Coderack and executed. If the Codelet generates new followup Codelets, it can decide which priority they should have, i.e. it should decide how important or promising the followup action is and how much resources the system should spend on pursuing that path.
As a more concrete example take an imaginary path finding algorithm. Each Codelet implements a specific function of the algorithm, e.g. finding all possible steps that can be made from the start position and generate followup Codelets for each of them, with a priority based on some metric how close it gets me to the end position. High priority Codelets a chosen more often from the Coderack, so if the direct path is unobstructed, mostly those Codelets will be executed that build that path and just a little bit of CPU time is spend on exploring non-direct paths. But if the initially high priority Codelets die out, because they got stuck in a dead end, the algorithm will automatically move on to explore a lower priority path, while still avoiding the even lower priorities.
It is important to understand that this is not just a priority queue, which only picks on the highest priority item, while completely ignoring the rest. Because of the randomization a small amount of CPU time is given to low priority Codelets, so it is a bit more like a process scheduler that divides the available CPU time to various processes proportional to their priorities. But then it is not a classical process scheduler, because there are no real processes in the system. A certain sequence of Codelets could be seen as a micro-process, but there is nothing that is comparable with OS processes/threads, which are very long (by Codelet’s standards) sequences of steps that are execute from the beginning to the end.
I am not sure if this explanation makes any sense to my humble readers. If not (or if it does and you want to learn more about it), I refer you to the book Fluid Concepts and Creative Analogies: Computer Models of the Fundamental Mechanisms of Thought by Douglas R. Hofstadter. For now let’s move on to the problem that I am trying to solve.
-
Sign of life
Posted on September 6th, 2009 No commentsAlmost two month without a post. Did I mention that I suck at blogging?
I will not promise to do a better job from now on, because I know the chances are high that this won’t happen…
Didn’t I read somewhere that most blogs are dead or just have posts with excuses for no real updates? -
Bubble Tank
Posted on July 18th, 2009 No commentsOne image that formed in my head when thinking about Copycat at al is that of a water tank in which bubbles (the structures which are built up by the codelets) slowly form, shrink, disappear, grow, merge and finally reach the surface when they prove to be big, strong and stable. If the Fluid Analogies model of Copycat is really a valid approximation of what’s going on in hour own head, then this analogy opens up some nice interpretations.
The codelets slowly build structures based on the input – in the case of the human brain, nerve signals from our senses. They make connections, dig up possibly related memories and try to bring this into a coherent state. In the beginning this is very undirected and may produce complete nonsense, later the structures become less chaotic but might still be very far fetched and only when they really make sense they make it to the surface. The surface being the border between unconscious and conscious thinking.
Following the analogy further: what happens if we change some parameters of the system, for example lower or rise the surface or let bubbles rise faster or slower? If it is harder for a bubble to reach the surface – that is a certain interpretation of a situation make it to the conscious mind – then this bubble has to be very stable. The codelets have lots of time to grind away all irregularities and the existing memories enforce their expectations. In other words: boring, conventional and uncreative. And if you turn the wheel into the other direction: unconventional, often wrong, but sometimes there might be a solution that turns out to be very creative.
And if you push the wheel even further? Then you expose the conscious mind with the chaos of half-baked ideas, structures of mostly random connections which only made it to the surface, because they did not have to prove themselves. Which to me sounds very much like a description of paranoia, psychosis or other mental dysfunctions.
As an example: Someone might look into a dark cloudy sky. Add some flashes and distant thunder for the dramatic effect. This visual impression kicks off all kinds of cognitive processes in the subconscious mind. The result that bubbles up to the surface between subconsciousness and consciousness is usually something like “no picnic today, let’s check the movies,” or “where’s my umbrella?” But if the parameters are badly tuned it could also be “the aliens are preparing their invasion.” Or a bit less extreme: “let’s see what happens it a flash strike a kite.” Pretty stupid idea in my opinion, unless you’re a brilliant researcher.
The point is that every mind potentially has those crazy or plain insane ideas, they just don’t make it to the surface, because they loose the race against more conservative and thus more stable structures. Creative minds lower the bar and every once in a while they can find a gem. Insane minds get lost in a cloud of random bubbles that obfuscate their sight (unfortunately it seems to be hardwired into our minds that we willingly trust whatever makes it through the surface).
And here’s what triggered this particular bubble to form in my mind:
We’re all familiar with the stereotype of the tortured artist. Salvador Dali’s various disorders and Sylvia Plath’s depression spring to mind. Now new research seems to show why: a genetic mutation linked to psychosis and schizophrenia also influences creativity.
New Scientist Health, July 16, 2009: Artistic tendencies linked to ‘schizophrenia gene’
Via: KurzweilAI.net
-
Gamasutra: The History and Theory of Sandbox Gameplay
Posted on July 17th, 2009 No commentsSo I learned that “sandbox” is the name for what I’m thinking about. And I’m not the first to think about it. Surprise, surprise.
The main reason that this trend towards believable characters is compelling for sandbox play is that the characters are, at bottom, more dynamic and interactable. They help “sell” the game world because they seem more realistic. Not “realistic” in the sense that they can ever hope to pass the Turing test, but realistic enough that they’ll lull you into forgetting about their artificiality. The more intelligently the NPCs respond, the more the game feels like a free and open world.
-
Simulated Intelligence
Posted on June 28th, 2009 1 commentLet me first get some naming right. I will call the area that I intend to focus on “Simulated Intelligence” instead of “Artificial Intelligence.” I do this because what I will do here is not the real hard science that tries to build machines that really act like humans do, that have properties that qualify as real intelligence. I’m not trying to write software that could pass the Turing Test, I’m not even going into that broad direction. My idea is to create software (more specifically software components, vertical prototypes or whatever) which is a sufficient simulation of intelligence to create a good gaming experience.
In order to create a real AI, I would have to delve into Cognitive Science, trying to figure out who a mind works. I have not even the slightest clue how to do that, nor do I have the capabilities (for example access to medical equipment to “look” into someone’s brain, or the ability to make extensive surveys to do black box probing of the brain and extract interesting fact using statistical analysis). Instead I just pick up the research results of some real scientists, bend and abuse them and see if I can make some interesting use of them. You might want to call it “Applied Cognitive Science,” but I think that’s already more credit than it deserves.
So what exactly am I trying to achieve? Read the rest of this entry »
-
Mental compass
Posted on June 24th, 2009 No commentsAfter reading Hofstadter’s book a bit, in becomes more and more clear into which direction I should go. Artificial intelligence has been a topic of interest to me for a long time. Especially playing with the algorithm used to implement programs like copycat or jumbo has been something I wanted to do when I read the book the first time, though I never did it.
Of course I do not think that I can scale that thing up to create an AI that is smart enough to be a sufficient simulation of a human mind or just a NPC’s mind. More like a “decision engine” that tells what to do next based on some input, not unlike more traditional, rule based systems. But I have the faint hope that it could be more flexible and yield more natural results. Perhaps it could also be more resistant against deadlocks and infinite loops. Also I do not intend to use it for ultra complex subjects like dialogs (at least not right now, perhaps when I’m old and gray). I think the approach can be used in more abstract scenarios like building and populating towns. Well, we’ll see.
And for those who have no idea what I’m talking about, either read the book or wait until I write more about it.
-
Subversion repository
Posted on June 21st, 2009 No commentsI just create a project at code.google.com. Right now there’s only a little Python module called gltoy which I intend to use for toying around with OpenGL. So – not much to see here right now.
-
Procedural worlds
Posted on June 2nd, 2009 No commentsMy vision is a huge, realistic (within the given story setting) and highly detailed world. A world bigger than any team of designers could create in a reasonable lifetime. So instead of manually crafting the terrain, placing cities, houses and objects, you define rules and algorithms that create the world for you.
Or perhaps it is the other way round: I’m a hacker, not a designer. So the obvious way to create a fantastic world is to define such algorithms and rules and let the CPU do the dirty work.
-
About the author
Posted on May 24th, 2009 No commentsI’m located in Zürich, Switzerland and work as a Site Reliability Engineer (SRE) at Google. My job is about managing and administrating the stuff that is sitting behind Youtube and other Google properties that use some kind of video functionality. My job also involved writing some code, but that’s not the primary focus area.
Writing software has been the most entertaining occupation for me since I started dabbling with computers. Creating games was always high on the list, although there was always some other stuff on it as well, like math software, web content management and server administration systems. The list of software I actually published is very limited though.
I am not and never was a professional game developer. But I did stick my nose into that area and at some time even seriously considered getting a job in this industry.
I am not a hardcore gamer – but I must admit that we just recently bought a new computer for the sole purpose of playing recent games. I do enjoy playing games, mostly role playing games. So this site is about topics originating from this genre.
I do know what it takes to develop a serious software project. At my day job I have to deal with some really freaking huge systems – I can’t give you any numbers, but that’s for your own good, because they would simply blow your head away. And another significant part of that knowledge comes from trying and failing as well.
My time to pursue projects outside of my day job is very limited. The job is quite demanding (but fun) and I got family, so the opportunities for mindless hacking sessions are rather small.
I suck at blogging and my personal website is horribly out of data at the time of writing this.
-
Motivation
Posted on May 24th, 2009 No commentsWe all know the “perfect game.” We play a game and think “Wow, that’s cool, *but*…” If you are like me, then thousand of ideas pop up in your head – how you would do this better or that differently. Once the brain starts spinning, it produces step by step a blueprint of “the perfect game” – the ultimate experience (at least how far you’re able to envision it).


