Using babylon as renderer-only

Does anyone have tips for the following use case?

I want to drive application logic completely outside of Babylon - probably in Rust/wasm. It’ll be using an ECS and reacting to changes might not be so straightforward, rather I’d need a way to sync the ecs state as a whole with babylon right before rendering.

This is just a rough idea, and it’s vague/fragile/under-construction - but conceptually, I’d love to hear some ideas of how to decouple Babylon from state management in an environment that isn’t so “reactive”.

Thanks!

Hi @dakom and welcome to the forum. For the ignorant (ie me) what do you mean by an ECS, I found over 100 possibilities via google.

@JohnK I think he’s talking about an Entity Component System.

@dakom, welcome to babylonjs! I am new babylon as well, but I am also interested in hearing people’s strategies on managing state.

1 Like

You might want to look into using Observables? I know BabylonJS uses them a bunch to manage reacting to events.

https://doc.babylonjs.com/how_to/observables

I was inspired by this article, maybe you’d find a good jumping off point.

pinging @Deltakosh?

Edit: Oh hey someone else on the forum kinda agreed with me!

2 Likes

@JohnK- yeah @belfortk is right, Entity Component System :slight_smile:

Hmmm the observables looks interesting! Will look into that :slight_smile: