# NodeJS Server question: colyseus with @babylonjs/core and havok

**URL:** <https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365>\
**Category:** Questions\
**Created:** [January 20, 2024, 12:58am UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365 "2024-01-20T00:58:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zalad](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zalad/32/37320_2.png) [@zalad](https://forum.babylonjs.com/u/zalad)\
**Post date:** [January 20, 2024, 12:58am UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365/1 "2024-01-20T00:58:05Z")

</div>

Hello BabylonJS Community,

I am currently developing a multiplayer game using `@babylonjs/core` and Colyseus. However, I’ve encountered some compatibility issues that I’m hoping to get some advice on.

**Overview of the Problem:**  
Previously, I integrated the colyseus server with my client and it worked fine. I wanted to implement physics and movement verification on the server to prevent cheating. I’ve attempted to integrate @babylonjs/core and Havok physics with Colyseus for the server-side logic, similar to what I was doing on the client. However, I’m facing difficulties due to what seems to be compatibility issues between Colyseus and the `@babylonjs/core` package, specifically with the modules types ESNext & CommonJS.

**Questions:**

1. Has anyone successfully integrated Colyseus with @babylonjs/core on a NodeJS server, and if so, could you share how you approached it?
2. Essentially question 1 is my only question, but if these two packages are(n’t) actually compatible, am I just approaching this in the wrong way?

Thank you!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [January 20, 2024, 2:00am UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365/2 "2024-01-20T02:00:12Z")

</div>

Maybe this can help [Using Havok for a headless server](https://forum.babylonjs.com/t/using-havok-for-a-headless-server/43029)

cc @RaananW as well

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [January 20, 2024, 8:24am UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365/3 "2024-01-20T08:24:03Z")

</div>

> [@zalad](#):
>
> Has anyone successfully integrated Colyseus with @babylonjs/core

Yes, see here: [[OPEN SOURCE] Multiplayer 3D RPG Using Colyseus](https://forum.babylonjs.com/t/open-source-multiplayer-3d-rpg-using-colyseus/35733) or on github: [GitHub - orion3dgames/t5c: Building a open source multiplayer 3d rpg using babylon.js and colyseus](https://github.com/orion3dgames/t5c).

---

<div class="post-metadata">

**Author:** ![zalad](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zalad/32/37320_2.png) [@zalad](https://forum.babylonjs.com/u/zalad)\
**Post date:** [January 20, 2024, 8:47pm UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365/4 "2024-01-20T20:47:09Z")

</div>

Thanks for the reply. I did come across that code, but the server doesn’t use @babylonjs/core.

@sebavan That post was what made me aware of NullEngine for the server. I was able to include ‘babylonjs’ rather than @babylonjs/core, and the server seems to accept it. but still have issues when it comes to using @babylonjs/loaders/glTF and similar. Is there another version of the glTF loader floating around that works similar to the ‘babylonjs’ package?

---

<div class="post-metadata">

**Author:** ![jeremy-coleman](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jeremy-coleman/32/15493_2.png) [@jeremy-coleman](https://forum.babylonjs.com/u/jeremy-coleman)\
**Post date:** [January 20, 2024, 10:20pm UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365/5 "2024-01-20T22:20:38Z")

</div>

All of the @babylon/modules are also published as cjs modules under the name babylon-module. So, babylon-loaders in that case. But note that they are single files, so you wouldnt do a nested import like babylon-loader/gltf or whatever, you just import babylon-loaders and get everything.

---

<div class="post-metadata">

**Author:** ![neu5](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neu5/32/24720_2.png) [@neu5](https://forum.babylonjs.com/u/neu5)\
**Post date:** [January 21, 2024, 2:22am UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365/6 "2024-01-21T02:22:01Z")

</div>

Hey, I have working Havok with NullEngine where I’m importing @babylonjs/core

> **[GitHub - neu5/babylonjs-nullengine-havok](https://github.com/neu5/babylonjs-nullengine-havok)**
>
> Contribute to neu5/babylonjs-nullengine-havok development by creating an account on GitHub.

But it’s without Colyseus. Anyhow, maybe this will help you.

---

<div class="post-metadata">

**Author:** ![zalad](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zalad/32/37320_2.png) [@zalad](https://forum.babylonjs.com/u/zalad)\
**Post date:** [January 21, 2024, 3:14am UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365/7 "2024-01-21T03:14:00Z")

</div>

> [@neu5](#):
>
> [GitHub - neu5/babylonjs-nullengine-havok](https://github.com/neu5/babylonjs-nullengine-havok)

Thanks for the reply, I did end up doing something similar to what you have, but with the babylonjs instead of @babylonjs/core. Apart from my server’s y=0 position being 1 unit higher than the clients y=0, it seems to be working now. My server has colyseus, havok, and headless babylonjs running.

Thank you everyone for your responses!

---

<div class="post-metadata">

**Author:** ![neu5](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/neu5/32/24720_2.png) [@neu5](https://forum.babylonjs.com/u/neu5)\
**Post date:** [January 21, 2024, 7:50am UTC](https://forum.babylonjs.com/t/nodejs-server-question-colyseus-with-babylonjs-core-and-havok/47365/8 "2024-01-21T07:50:10Z")

</div>

Great that you have found the solution 🙂  
If you don’t need any more assist regarding this topic please mark one reply as the solution (might be even your reply)
