Browsed by
Tag: Non-linear Narratives

Nonlinear narrative

Nonlinear narrative

If you are a frequent reader on this blog you have probably seen the earlier updates on the computer game I created together with Tom, Brendan, Gary and Elias last semester. If this is your first time here, or you just visited by accident earlier: welcome! You can find more information about the process clicking the ‘DMSP’ banner in the word cloud in the right toolbar.

It has been an interesting process from the early stage definition and clarification of what we want to do and how to do it, to the creation of code, and sewing everything together. It has been beneficial also to gain some programming experience, as I got the ability to brush  some dust off  of my java knowledge, and to learn more about visual programming and the great (and efficient) Processing “language”.

The project is now over, but your adventure has just begun. On the project’s website you can download the code and start gaming. The source code is also published in case you want to have a look, or build on it yourself. Enjoy!


Above: The in-game screen with the detective’s desk, and various interactive objects. The map over New York City and a text-feed printing out content as the player explores the city.


Nonlinear Narrative in Processing

Above: The processing IDE with the beginning of the draw method pictured. You can find the code on the project’s homepage as well as everything else needed to get the game run.


The master thesis process has now begun, and I expect to post more frequently with progress from this.

New version of Non-linear narrative

New version of Non-linear narrative

As the second semester in my master program is moving towards the end I have some content I want to share with you all. Beside the digital marketplace course and a reading course I have been working on a digital media studio project, or as we call it, the DMSP. In this course sound designers, the digital design media students, the composers and some of us, the digital media and culture students, have been working together on different projects using all kind of technology to solve a huge variety of tasks. From the presentations I had the pleasure to visit I have seen, and in some cases tried, everything from the controlling four spheres with four joystick and entertaining video about an unlucky rabbit, to projection mapping, a tactile translation program, a three dimensional game in Blender and a mobile music generator utilizing the navigation functionality on Android phones.

Together with Brendan, Tom, Elias and Gary I was in the Non-Linear Narrative Group, a group whose mandate were to a certain degree more conceptual than methodological. It has been very interesting, and I have got to know the visual Java-based programming environment Processing very well.  The project has evolved in a process based on agile programming techniques, with relative frequent iteration of code and content. From version 0.001 which consisted of a grid with ellipses  from programming code, we now have a running interface with a desktop filled with tools, a map, a text feed, and an interesting sound system utilizing Max MSP over Open Sound Control.

Even though the project is not all over, I’m going to give you the ability to run the program on your computer, but since the program still need some adjustments we have not branched out a running code for Windows, Mac OSX and Linux. Instead you can download this. The source code will need the Processing programming environment and a couple of libraries. Processing, and links to the libraries can be found here.

If you have patience to wait yet another week or two, we will release a stand alone version without these requirement in a couple of weeks.

Picture: The desk, from which our protagonist explores the criminal world of New York City. Animation is by Tom O’Rourke.

Object Oriented Programming

Object Oriented Programming

This post is written as a blog post on the Digital Media Studio Project blog Non-Linear Narratives.

In this post I want to discuss some aspect of object oriented programming, and some philosophy behind the non-linear computer program in its current version.

The program is built in Processing, which utilizes the Java programming language, and is ideal to make sketches with its easy-to-create graphical user interface (GUI). Processing has a clear division between its two runtime methods which are crucial for its execution: setup runs once as the program is started, and draw runs perpetually during runtime. The advantage using processing lies in the flexibility the user interface, and the simple instructions which has to be done to get action onto the screen. The threshold to get a visual representation is much lower than e.g. Swing. Since Processing is built on Java, we can also benefit from the strong usability, the many packages developed and the basis of object oriented programming.

In the case of Java the magic words for object oriented programming are class, new and ‘.’ (punctuation). The class name is used in the beginning of a class, and is followed by a descriptive name where the first letter, by convention, should be in capital. Two curly brackets are placed to mark the beginning and the end of the class. The class does not need an explicit constructor, but if you want to send some attributes to the class when you initialize it you should make one. The ‘new’ keyword is used to express that a new object should be created – or instantiated – from the class (Thanks to Kebman pointing this out). Metaphorically can we perceive the class as a mold, and the objects as casts created from this, and which constructor defines the customization.  This is followed by the name of the class and attributes encapsulated in parenthesizes. The ‘.’ is used to call upon a method, or to access or alter one of the attributes contained by the class. This is done by placing the punctuation mark in between the pointer to the class and the attribute or method you want to access, call or alter.

The object oriented programming has been changing the way the world is represented within the computer since it was first invented in Simula 67 by computer scientists Ole-Johan Dahl and Kristen Nygård in the 1960s. Today this method is deeply integrated in many computer languages such as C#, Java, Lisp and PHP. Its advantages lies in the possibility of modularisation, encapsulation, messaging and abstraction as well as a way of representing reality which can be traced back in the history of philosophy.

Well, let us move from the syntax and history to the more philosophical ideas behind this way of perceiving the world. Do you remember Plato, the old Greek philosopher. He operated with two different world of existence. In his metaphysics things did not only exist in their earthly being, but also in a world of ideas. Without discussing whether this is a good or a true way of experiencing the world let us just keep the idea in our head (Plato’s concept) as we move to a more language bound example, the difference between the ‘the actor’ and ‘an actor’, here the former is the decisive actor standing in front of you in the queue, or in the neighbouring area, while an actor could be any actor, however ‘an actor’ could not be ‘an area’. So there are some distinctive features which separates actor from area. Let us agree upon these as the attributes, functions and relationships held by the classes.

With this, hopefully a bit confusing in mind, let us move on to a visual representation of our program.

This is a Unified Modelling Language (UML) class diagram of the program so far. If you remember that we spoke about the setup and draw class in the Processing language, or the Actor and Area. Well here is everything we need to know (attributes) and do (methods), as well as the relationships between them. Let us have a closer look at the class Area. This class has three attributes: it knows its X and Y position in the grid, as well as which actors who are currently visiting. What the area can do is to sign an actor in and out, and, return a binary boolean result whether something is bound to happen in the respective tile. (The execution of the program is all orchestrated by the all mighty control class, and the draw method.) The interesting thing which could happen here is depending on whether the tile has more than one visitor, as you may know, if this is the case then three possible actions can take place (in the current version represented by three separate recordings): Two victim meet, two suspects meet or one suspect and victim meet.

The classes Victim and Suspect are in the current version just used to identify the different objects, but can be expanded to act differently. Since they share the common superclass actor, they are in this version acting the same way.

The classes we see here is the mould. It is the idea, to use Plato’s term. As the program starts up the setup method calls upon a creation method in the control class which creates objects from the classes. How many are dependent on global variables set in the program, but currently we are operating with 16 times 16 areas (256 in total), 6 suspects and 2 victims. If we take a closer look at the areas these are stored within an double array Area[16][16] which is a great way of representing a map, and works very good with double loops to iterate through.

I hope this post was able to explain the concept of object oriented programming more than it caused confusion. The current version of the program code can be found here. Enjoy.