Hi all, I’m new here. I’ve been slowly entering the independent game developer space over the past few years, and one of the major roadblocks I’ve encountered is getting a real-time collision engine up and running in an authoritative-server architecture. With the integration of the Havok physics engine into Babylon, I wanted to ask for the community’s opinions, advice, and comments on the feasibility of leveraging the Havok engine on my server.
Does the NullEngine provide access to the Havok engine at this time? Is it feasible to leverage it for tracking game-world collision detection? My strategy would be to use the Havok engine as a stand-alone resource in my server to handle collision detection, collision event dispatch, and object position and orientation. The actual physics may or may not use the Havok engine, as my games focus more on arcade physics than simulated physics, and I don’t know that much about the Havok engine yet.
So in general, I want to populate the Havok engine with my game objects and let it handle collision detection on the game server. There are other features I would need and I’m not sure yet if they are included in the Havok plugin, like client-side interpolation, the Havok AI tools and the Havok Cloth simulation tools. Regardless, just getting the collision engine checked off the list would be a huge step forward for me.
I would really appreciate any feedback, comments, or tips that anyone could provide. I am at the point in my development where I want to nail down the technology stack so I can move forward with creating a working infrastructure.
You can use Havok without a renderer because it’s not using a GPU.
This said, doing physics synchronization on the network is a complicated topic.
It’s a job on its own in game studios.
Here is some overview and related topics:
Even doing a simple falling body simulation + sync looks like a daunting task to me.
A small note - The Havok package might not be consumed correctly by node. This is because emscripten is adding references to fs and path in order to get that to work, and that leads to an issue for people compiling their project for the web. There are ways around it, but we wanted the default configuration to be web friendly. It depends on your build process.
When I try to run this inside node I get this error below.
Aborted(both async and sync fetching of the wasm failed)
failed to asynchronously prepare wasm: RuntimeError: Aborted(both async and sync fetching of the wasm failed). Build with -sASSERTIONS for more info.
Aborted(RuntimeError: Aborted(both async and sync fetching of the wasm failed). Build with -sASSERTIONS for more info.)
Uncaught RuntimeError RuntimeError: Aborted(both async and sync fetching of the wasm failed). Build with -sASSERTIONS for more info.
at abort (HavokTest\node_modules\@babylonjs\havok\lib\umd\HavokPhysics_umd.js:9:6495)
at getBinary (HavokTest\node_modules\@babylonjs\havok\lib\umd\HavokPhysics_umd.js:9:7021)
at <anonymous> (HavokTest\node_modules\@babylonjs\havok\lib\umd\HavokPhysics_umd.js:9:7451)
at processTicksAndRejections (internal/process/task_queues:96:5)
Is this because of the emscripten references? if so how do I build it so it works in a node environment for the null engine?
I followed the post you linked and just straight up injected the binary, and while I cannot see the sphere bouncing off the ground the console output shows the y position moving up and down which is enough confirmation for me lol.
thank you again for the help!
*in my previous post I was using UMD format by accident I meant to use ESM which I switched to now