Designing an object-oriented life simulation

team dawn
5 min readMar 6, 2018

--

Ed Perkins

Shortly before joining Makers Academy I completed a PhD in composition. My area of research examined how technology changes our musical behaviour and, amongst other things, I wrote simulations of social behaviour that generated music. One of my approaches was to model social interaction through an agent based model. The economic and political interactions of these agents generated data, which I then translated into musical relationships between instrumental players. With me so far? Good.

Some time later, I developed an idea for a similar system that focussed on identifiable personal behaviour and social interaction. Given the scale of the work and the fairly small audience numbers for this area of music, I wanted to reach a wider audience than I could by putting on a performance in a given location. I decided that by making the piece work in a web browser I would be able to reach a wider audience, and they could experience it any number of times whenever they wished.

I had one problem though, I didn’t have any experience in any web based software languages. Hmmm.

teamwork

So I had a crazy idea about a system that generated agents with social behaviour, and as of the last two weeks of Makers Academy, I knew I might be able to find some like minded people to share my idea with, and who might then agree to work on the idea with me. Fortunately for me, I knew exactly who would be up for it.

Jennifer Shepherd, Ellie Wem and Roland Vink (left to right)

Look at them, what a lovely bunch, I would happily work with them anywhere on anything. We had all worked together before in different configurations on previous projects at Makers and as well as being productive, we got on well socially, had shared interests and communicated well which in my experience is usually a recipe for a well-functioning team, a good learning environment and above all, an enjoyable experience. But this blog isn’t about teamwork, it’s about having (and now sharing) a crazy idea . We worked out exactly what that idea would be in one sentence (to a brief):

‘a procedurally generated socio-genetic model’

Whoa. What? Ok, let’s unpack this a little:

procedural generation . . .

means that instead of individually creating every version of ‘a thing’, you create a procedure that can generate any number of new and different ‘things’. This approach is used to generate large amounts of varied items rather than requiring a team of designers to create each one manually. Procedural generation is used in games formed of huge physical spaces, like No Man’s Sky, where apparently 18 quintillion different planets are available to visit.

Procedurally generated planets and environments in No Man’s Sky

sociogenesis . . .

is a field of study concerned with the origin and development of societies.

simulation . . .

meaning the imitation of a situation or process.

Is that better? Yes? Good. No? As a Maker’s Coach would say,

maybe do some research on it.

game of life

This project is inspired by the fields of cybernetics, genetics, social psychology, self-organising systems and emergence. The ideas of emergence and the spontaneous creation of structure are somewhat influenced by John Conway’s Game of Life:

John Conway’s Game of Life, 1970

The Game of Life is a ‘zero player game’ where the user interaction is to create an initial configuration and observe how it evolves, or, for advanced “players”, by creating patterns with particular properties.

dawn, an object oriented life simulation

Our vision is a browser window containing a number of basic shapes which we are calling cells. These cells each have a specific genetic fingerprint that creates their appearance and behaviour. They are able reproduce to create offspring that are somewhere on the spectrum of ‘genetic’ traits between those of the parents . The cells have a finite span of existence and death can be accelerated if attacked by others. Yep, our cells, like most of us, can traverse the tricky path between being both lovers AND fighters.

They each have a set of atributes that they find attractive in a partner, and conversely a set that they dislike. They are able to both attract and repel each other based on their assesment of another cell. If the cell is feeling amorous, they may romantically pursue another cell. If that cell does not find that cell attractive, or isn’t in a receptive mood, the cell will repel the amorous cell, or possibly beat the living daylights out of it. It’s a cruel, cruel world.

For later versions, there will be a feature where users can create basic cells and set environment parameters. The goal for the user will be to seed their world using a schema that can best sustain life, developed through trial and error over multiple interactions with the simulation.

In this first instance, we need to reach MVP #V1 in two days.

So how is this going to work?

We began with some basic diagramming to determine our user interactions and features:

User Interaction/Feature diagram

Then we generated some user stories for the MVP:

as an observer
because I am interested in life simulations
i want to see a basic cell

as an observer
so that there is variation in cells
i want to see two different cells

as an observer
so the cells seem more realistic as living creatures
i want to see them move

as an observer
so that the cells can interact
i want an event to occur when they collide

as an observer
so that more cells can be created
i want the cells to create another cell on collision

After chatting through some of the technologies we thought we might use, we came up with our own models of how we thought our classes might interact:

Possible class interactions in ‘dawn’

We each had two minutes to present our idea before we settled on a mutually agreed approach for MVP.

We did it!!!

We completed our project and acheived much more than we thought we would, you can now check out dawn on github and read all our versions and user stories . If you just want to see the project in action you can go straight to the live version of dawn.

--

--

team dawn

creating a procedurally generated socio-genetic simulation.