Browsed by
Tag: DMSP

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.

No more testing inferno

No more testing inferno

If you have spent time trying out the endless opportunities contained in the art of programming you know how frustrating testing can be. Endless nights and days with an endless amount of  changing variables and recompiling. A missing semicolon, a misspelled word, well, the reasons to frustrations are many.  I know how it is, and I feel with you, you have my sympathy when you trying to clear up a for-for-for-for loop with ten different curly brackets, and that’s just for the search algorithm. When you then have additional twenty logic switches to check the conditions of your variables and maybe alter them, then life can be quite hard. If you are working on a big project, you probably have test functions, and ways to find and correct these problems without much hazzle, but what if you want to change the values instantly? Or if you are just making a little sketch after an idea and have no intention spending lots of time on the “run-stop-change-run” iteration? Too much flickering can easily remove the fun from your projects, and what about instant gratification. Everyone love some instant gratification, and here is a little program which can give you instant gratification and probably make your life a little bit better, or just give you a moment of joy. I do not want to promise you anything, but hopefully this little fix can help you with your testing inferno.

The program is inspired by the possibilities of Open Sound Control which we implemented into our Digital Media Studio Project to control sound signals sent from Processing and played in Max MSP. This little experiment consists of Processing sketch with a listener, waiting for variables to arrive over port 4000 (you can of course change all the parameters as you like), and a Max MSP patch with 5 sliders coding values from 0 to 255 and sending them.
Files:

Max MSP patch

Processing Sketch

Picture from test1

Picture from test2

DMSP: A little Game

DMSP: A little Game

The Non-linear Narrative group, where I’m one of the members, handed in the first assignment in the Digital Media Studio Project on Friday. Together with Brendan, Tom, Gary and Elias I’m working on creating a story which is determined by a random computer model in combination with some pre-written elements. This approach poses some difficulties in the manner of how to superimpose story elements on something which has elements of randomness, and where you are without total control.

We have chosen a digital approach using a computer simulated world where programmed agents influence the story as they move around and collide with each other. This computer model can be combined with auditory and visual elements to create a multimedial experience. We already have a basic computer model, some stunning visuals and interesting sound. Since our submission for the first assignment is a web page I thought I could share a link to the link here so you could have a look. We also have a blog where we try to share thoughts and ideas on our assignment.

If you want to try out the computer model, or play around with the Source Code. I’ve added different versions of the program here for you to download.

Files for Download

Source Code (Processing) with all files.

Source Code (Processing) just .pde file.

Windows.

Mac OSX.

Linux.

 

 

Enjoy

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.

Non-linear Narratives and Agents in Processing

Non-linear Narratives and Agents in Processing

The last weeks my Digital Media Studio Project group and I have been spinning around ideas on how to make a non-linear narrative based on a computer model using agents. This is an interesting way of taking advantage of Object Oriented Modelling, since the agents have attributes and methods relevant to humans. The model is based upon a matrix consisting of two arrays, this model is ideal to represent geographical space, and especially maps seen from above because of the resemblance. We are going to create a story based upon the collisions created in the model, and the aesthetic world will be set to New York and made in a Film Noir characteristics. If you want to know more about the project, you can visit the project’s blog here.

The model we have been playing around with is created in Processing, which is an easy-to-learn version of Java created by MIT to teach programming. It is a great tool, and makes programming easy with accessible functionality built in and much documentation on their web page. Since it’s running on Java you also have the powerful tools and all the packages of this language right at your fingertips. You can download Processing from here, and since it is Open Source, you can play around. It is free, as Richard Stallman would say, as in free beer and in free speech. If you download it and play around, you can find our current (alpha) version here. Enjoy.