Looking for Advice on Building a Data-Oriented Design Application

Goal: I’d really appreciate your advice on how to build a web application using an event-based, data-oriented design. This is for an immersive data visualization application.

Questions: 1. What are the steps in each PlayCanvas render loop, from client, to engine, and back to client? 2. How can I take advantage of GPU computations in this loop, to handle query operations on data; not just graphics operations? 3. Does your ECS pattern reduce garbage collection? 4. Would the core application logic (query operations) be outside of PlayCanvas, for example in node.js?

Architecture: The backend will be processing event-driven queries; connected via real-time streaming API to front-end; which will handle UI event triggers. The goal is to not pass the data in objects which require garbage collection. So I will be using your ECS approach in some way not yet determined. This is inspired by Unity’s new approach of streaming data to client with trimmed down pipeline in server (jobs system that uses multi-core processors and vertex buffers to maximize use of GPU computations). Here’s a link yo it if interested: DOTS - Unity’s new multithreaded Data-Oriented Technology Stack

By the way, love your engine! I want to use PlayCanvas to build the immersive web applications of the future.

Thanks!
Mike

Are there any specific reason for using a DOD approach besides garbage collection prevention?

It’s worth pointing out that Javascript doesn’t have an equivalent to a C# struct where it’s a value type, everything are objects (https://medium.com/@benastontweet/lesson-1b-javascript-fundamentals-380f601ba851)

Unfortunately, the only way I know of to avoid garbage collection in JS is to use objects pools and reuse objects.

Thanks @yaustar for clarifying JS limitations and the object pooling idea; I’ll explore this more.

To your question on why DOD; maybe its not necessary. I might be using the wrong words here. Broadly stated, I’m trying to re-conceptualize using a game engine for immersive data visualization applications. The goal is to stream data from server dynamically based on user interaction.

So this might mean dynamically loading data (views) as batches into scene objets. For example; if I were trying to stream time-lapsed statistical data (ie stock prices) using something like a music visualization asset, (like the image snapshot below) I’m not sure how that would work in terms of game objects. If you have any insight on this I’d appreciate it.

1 Like

Sounds like you have three components:

  • The backend
  • The client for the connection
  • The visualisation

I would either keep the client and visualisation separate with some glue code so the two can communicate with each other or have the two be part of the same codebase.

In terms of the visualisation, I can imagine the scene only having one Entity and it generates and updates the mesh/meshes for the visualisation (possibly even using shaders). UI etc will of course need to use it’s own set of Entities but the main visualisation should only need the one.