Monthly Archives: February 2012

Jellyfish forms

The Jellyfish VM is now running in fluxus on android – a kind of executable rendering primitive which defines it’s form (a 3D triangle list) in the same place as it’s behaviour (a vector processing program), in the primitive’s data array.

This provides a 3D procedural modelling VM loosely inspired by the Playstation 2 which is much faster than interpreting scheme (or Java) on ARM devices like android. There are also possibilities for genetic programming or touch based programming interfaces just like Betablocker DS (think 3D animation rather than music).

Triangles are written to by de-referencing a register that defines the start of the model data, which exists in program memory. It can be programmed with raw vectors for each instruction, and right now the VM is run for 10 cycles for each frame, although this will be configurable “in the future”. Here is a simple program that was used to make the screenshots:

(define jelly (build-jellyfish))

(with-primitive jelly
 (program-jellyfish
  (list
 ; data
   (vector 0 0 0)         ; time (increases by 1 each loop)
   (vector 2 2 -3)        ; shuffle data for converting (x y z) -> (z z x)
 ; code follows to build a vertex by rotation around an angle based on time
   (vector LDA 0 0)       ; load current time from address 0
   (vector LDL 135.3 0)   ; load value 135.3 (angle in degrees)
   (vector MUL 0 0)       ; multiply time by angle
   (vector SIN 0 0)       ; makes (sin(angle) cos(angle) 0)
 ; make a spiral by scaling up with time
   (vector LDA 0 0)       ; load time again
   (vector LDL 0.05 0)    ; load 0.05
   (vector MUL 0 0)       ; multiply to get time*0.05
   (vector MUL 0 0)       ; mul rotation vector by time*0.05
 ; move backward in z so we get some depth
   (vector LDA 0 0)       ; load the time again
   (vector LDL 0.03)      ; load 0.03
   (vector MUL 0 0)       ; multiply the time by 0.01
   (vector LDA 1 0)       ; load the shuffle vec from address 1 
   (vector SHF 0 0)       ; shuffle the x to z position
   (vector ADD 0 0)       ; add (0 0 x) to set z on current position
   (vector STI 0 REG_MDL) ; write position to model memory registers
 ; increment the index by 1
   (vector LDA 0 0)       ; load address
   (vector LDL 1 0)       ; load inc
   (vector ADD 0 0)       ; add them together
   (vector STA 0 0)       ; store at address loc
   (vector JMP 2 0))))    ; goto 2

Jellyfish

Lots of travelling lately and for me, time in airports and long train journeys are time for acts of random research. One of the recent fruits is a new imaginary processor (code name Jellyfish), largely based on Betablocker DS but with ideas stolen from the PS2 vector unit.

Like the PS2 VU it’s a vector processor, but each instruction is 96 bits wide (unlike the PS2 which is 128), enough to store 3 32bit values representing 3D vectors or colours. Like other Betablocker variants every combination of bytes are valid as a runnable program, so it will for example happily execute random junk.

There are currently 25 instructions, with vector operations like dot, cross product and length, and various instructions for reordering vectors. It’s targeted at running on ARM processors so it uses fixed point maths for battery friendliness.

This is an ascii-shot of the super exciting debugger running a similarly exciting program to rotate a vector around the z axis.

-- prog -- pc:11
004   sta 13.000000 0.000000
005   sin 0.000000 0.000000
006   sta 14.000000 0.000000
007   lda 14.000000 0.000000
008   lda 15.000000 0.000000
009   crs 0.000000 0.000000
010   sta 16.000000 0.000000
011 > jmp 0.000000 0.000000
012   0.000000 0.000000 0.000000
013   60.000000 0.000000 0.000000
014   -0.125977 -0.992020 0.000000
015   0.000000 1.000000 0.000000
016   0.000000 0.000000 -0.125977
017   0.000000 0.000000 0.000000
-- stk -- stk:0
  0.000000 0.000000 0.000000 : 199
  0.000000 0.000000 0.000000 : 200
> 0.000000 0.000000 -0.125977 : 201
  0.000000 1.000000 0.000000 : 202

Naked on Pluto/VIDA at ARCO2012 Madrid

Naked on Pluto entered the world of contemporary art last week as part of the VIDA/telefonica exhibit at the ARCO 2012 art fair in Madrid. This was the culmination of a lot of work making the game into an installation format, which represented the library as the centre of control and surveillance in Elastic Versailles. The installation consists of books printed from information stored in the game archives over the previous year, slogans and glowing LED books on the walls. We also had terminals running the game with the projection of the live game world in a circle in the middle of the space.

Most installations I’ve been involved with have tried hard to break the conventions of the art gallery, in this case we were very aligned with them, and we wanted to create a highly formalised space, all right angles, straight lines and consistent colours of blue, dark grey and white. VIDA’s crew of architects and builders put in a lot of effort for us to achieve this, and were also very helpful tweaking it according to our strange requests.

During the opening event and later on, it was interesting to see perhaps two different types of visitor. The older, perhaps more contemporary art focused groups had an extremely short attention span and presumably had their heads tuned to search out beautiful objects, and so were not really engaging with the work much. The younger visitors however were tending to stay longer, even logging in to Facebook in order to try the game (and alarmingly, sometimes leaving themselves logged in). I think the initial hook for this engagement were the slogans on the edges of the bookshelves – for future installations we need to consider different strategies for setting the scene, as it will need to change with different locations and context.

One of the great things about these events is meeting the other artists (and VIDA award winners) who were setting up and exhibiting their work – Paul Vanouse with Ocular Revision, Sebastian Muellauer and Toni Nottebohm with Protei and Verena Friedrich with Transducers. These projects are an interesting combination, with more finished and specifically designed for installation work (Ocular Revision, Transducers) mixing with the more in progress, or conceptual things like Naked on Pluto as software art, or Protei, which is a large collaborative project still very much in active development.

Check out the main Naked on Pluto blog.

Betablocker DS code patterns (part 2)

Following on from the last installment of Betablocker DS coding patterns, this time looking at some very short programs that are nicely controllable by the livecoder – including some actual audio examples here (embedding seems broken on archive.org).

Both these example programs are 16 bytes long, and require 3 concurrent threads to be running over different parts of the program. Each thread has a simple purpose, the first loads a byte and plays it as a sound repeatedly, the second one increments the byte that the first is playing, and the third periodically resets the byte to a constant value.

The first example simply plays the byte as a note – resulting in an arpeggiator style sound. After writing the code, the performer can change the speed of each of the three threads to get quite a bit of variety. For example, the slower the resetting thread runs, the longer the pattern will be before it repeats.

The second example is very similar, but is slightly modified to play a sequence of different sounds rather than notes, to become a drum sequencer. The second instruction is also changed from a “push literal” to a “push contents of address” which results in the program playing a part of memory as a sequence. We can control the start address location with the reset byte, write directly to this part of memory, and fiddle with the other thread’s speed to get even more complexity.

Germination X: striving for simplicity

In late December the Mobile Life Centre in Stockholm ran the first focus test for Germination X, and last week I met up with them to get the feedback in detail. Even for a small study of 5 players, this was very detailed – but the broad conclusions were that the underlying ‘ecological model’ of permaculture is being communicated very effectively via the game – the players got the idea of this quickly through playing, without it being explicitly communicated in a didactic manner.

On the downside, the role of the spirits were not clear to players at all – confusion from the quantity of messages, players constantly logging out to see what was going on from the public message timeline, and both the characters emotional state and connections between them and the permaculture plant layers were completely lost in the noise. Added to this, with the short duration of the study (1.5 hours) the pick power restriction was a massive problem, leaving players with nothing to do for long periods of time.

With more focus studies planned I’ve updated the game to deal with some of these issues as best I can:

Pick power is now recharged much faster. To balance this out, and add to the challenge of foraging for seeds and fruit they now regrow much slower and are harder to find in the world.

The way spirit messages are dealt with is now completely overhauled. All messages they send are viewable by all players all the time. They are displayed as speech bubbles by the spirits, making it clearer that they are responsible for them. They are now filtered out of players timeline messages to avoid problems with spamming too many messages.

There are also a bunch of updates to improve responsiveness of the world and make reactions to player’s activity faster to experience. Plant no longer gain health from nearby plants which are ill, which means reactions to new plants happen faster. The season length is shorter again (10 minutes for a full year cycle). Some optimisation of the mongodb code dealing with message dispatching means I’ve been able to double the refresh rate of the game (number of world tiles updated per second) while also reducing overall server CPU usage.