Data Oriented Architecture

Data Oriented Architecture

In computing, data-oriented design is a program optimization approach motivated by efficient usage of the CPU cache, used in video game development.

The approach is to focus on the data layout, separating and sorting fields according to when they are needed, and to think about transformations of data.

Wikipedia


To be honest, when I was coding the architecture of Mus 3D, designing the seventh iteration of the code, I had so many problems that decided to throw away a good part of the code and to start with a new approach. I created a new branch in git and started to experiment.

Later, before going to sleep, I talked with myself:

- "Jorge, essentially, what your are implementing is a post office: the incoming network datagrams from the players are like letters. Let me explain the steps, Jorge:"

- "Ok Jorge, I am all ears", I answered

This is a very simplified recipe of how Mus 3D, -and other online games systems-, work.


Looking through the OOP prism, each letter had been a not-always-easy marriage between data and logic. Was difficult to manage, adding new methods without changing other places in the code was close to impossible. And, the worst of all, there was an incipient lack of flexibility. Each bit of the code I changed seemed to affect several other places in the basecode.


So, I started to wonder "How would the ancients solve this problem?".

I remembered Ford and his assembly line, and "Eureka! That could be the solution!"



In an assembly line, each car (or motobike, if you prefer motorbikes), is travelling through a line, the cars are quiet, in silence, just waiting to be transformed into a finished product.

They do nothing, they just wait, are transformed and moved. The employees (or robots) are the ones that do all the work, the ones that add new elements, or transform the existing ones. Some of them make verifications, write down words and figures in paper, of perform other actions. Some of them do nothing, just observe.

Each employee (or robot) makes a little transformation, adds a step, and the trip continues to the next employee, until the car is finished.

Following this metaphor, let me explain how the Data-Oriented-Architecture of Mus 3D works. I will give a more complete explanation about this exciting approach in my next posts, I promise (they are still being cooked).


Meanwhile, let me give some hints in advance:


This could be a brief description of the process happening inside a data assembly line.


At first sight, this architecture seems to open a bunch of new exciting posibilities, doesn't it? It opens new points of view, new approaches to think, ...


So, more specific details will be given in my next posts (with pictures!), meanwhile, here I put some videos that I have found about the topic.






See you in the next post!


Jorge Gascon Perez



This web uses cookies propias y de terceros para obtener datos estadísticos de la navegación de nuestros usuarios y mejorar nuestros servicios.
Si acepta o continúa navegando, consideramos que acepta su uso.
Puede obtener más información aquí.