Emulation Tool for conveyors and storage and retrieval machines

Hi there,

since I mainly work in the fields of SAP I am considering an own tool for emulation of conveyor systems.

We need a tool that can interact with PLCs and simulate boxes or pallets going through photo sensors or passing barcode scanners.

SAP Extended Warehouse Management comes with its own MFC (material flow controller) that communicates with the PLCs. PLCs get information from sensors like barcode scanners, etc.

Such scanning point are considered control points where the PLC needs routing information from MFC.
After having recieved this information via telegramm, PLC triggers a drive like a conveyor´s motor.

What i want to achieve is pretty much like a “multi-player game” that only shows the current status either in 2D or 3D in an arbitrary number of clients. Client-side interaction is not necessary.

Current status in this case means which pallet with which ID is where in the system.
Simulation (like the movement of palettes on conveyors or the events when a pallet passes a scanner) needs to run on a server that has a connection to the PLCs. Whenever anything changes, Server has to send update information to all connected clients accordingly.

What I couldn´t solve so far ist the following:

  • Is Node.js the best way to do the server-side stuff from a babylon.js point of view?
  • Can I model the system in a different way and just use coordinates in comination with a jpg-layout of the system?
  • What (other) advantages does babylon.js offer to get all this achieved?
  • Pushing from the server to the clients or should the clients pull from the server?

Actually I need a point of entry. Any help appreciated.


Hello Markus and welcome!

We are pretty agnostic regarding server side technology but I would probably recommend Node.js just to keep the same language on both side

We have several games already using this technique.

Keep in mind that babylonjs would be mostly for client side (even though you can also use it server side to run simulation for instance but that does not seem to be your need here)

Language wise we support either JavaScript or typescript

TLDR: having node.js sending data using websocket to multiple bjs clients is not a problem and was already done multiple times

Hi @Topper. Take a look at the Colyseus multiplayer game server for node.js . It’d work well for your use-case. There’s a BabylonJS + Colyseus: Multiplayer Boilerplate git repo you can use as a starting point or for learning (although the node packages might need updating). It’s a lot easier starting with this than rolling everything yourself with node, socket.io, webpack and other intricacies.


Thanks a lot guys.

I´m gonna have look into Colyseus since this looks pretty promising.



i was checking on this colyseus thing as well as the mentioned Boilerplate but there´s something i still don´t unterstand:

  • BJS will only be running client-side
  • state management will be server-side by colyseus

But I´m still struggeling with the follwing:

The API room state shows, how players are created or deleted server-side:

But how does it work, when a client creates a new BJS-object client-side?
Let´s say I have my conveyor-setup renderend in two connected clients A and B based upon information
that comes from the backend. So every client would see the same scene and “the same” BJS objects.

Now, client B creates a box in BJS (e.g. a simple pallet) via button.

How does it work that in client A´s scene the box appears as well?

I think I´m completely wrong and when client B presses his button, i have to let the server know that I want to spawn a box with width = xxx, height = yyy and length = zzz at position = (a, b, c) and broadcast these information to all clients so that every single client can do its BJS-stuff by itself, right?

Am I on the wrong path?


Hi @Topper. Some of these questions are best asked on the Colyseus forum or Gitter chat (the core developer Endel Dreyer is very responsive).

There’s a number of ways to use the framework depending on the application but it’s recommended that all state management be done by using Colyseus as an authoritative server. Clients send requests and Colyseus server mutates the state and broadcasts change patches (changed state variables) to all clients which then render the updated state. State changes are not recommended directly on the client.

I’ve probably botched some of the terminology but that’s the general gist as I understand it.

1 Like

Thanks for your fast reply, inteja.

@ all

Has there ever a multi-player game or app with BJS and Colyseus been developped by one of the forum users?

I mean by using this boilerplate?

I’m working on a non-game application that started with the boilerplate. I’m not aware of what else the boilerplate has been used for.

There’s the BJS Shell Shockers multi-player first-person shooter which uses node, express and websockets on the server side, just like Colyseus but I think that game predates a stable Colyseus release and they rolled their own multi-player server code.

@ inteja

I´m trying to get along with this boilerplate which turns out to be a time-consuming thing bc documentation is not noob-level (actually what i would would need). :joy:

I got the webpack-dev-server for the clients and the web socket server to spawn.

When i start the client app in the browser i can see this well known BJS scene.

But I´m getting this in the browser´s error log:

Any idea what went wrong?

Thanks und BR,

Hi @Topper … looks like a bug in the latest version. I replicated your reported issue, reported to Endel and he was able to replicate also and is looking into it. I’d encourage you to ask Colyseus or boilerplate related questions on the Colyseus chat or forum.

Hi again @Topper. Endel just fixed this.