3rd Party Packages

3rd Party Packages

Contribute - Click on the “Edit this page” link at the sidebar to add more packages.

This page contains a curated list of third-party npm modules that can help you with specific tasks on the backend, frontend, or both.

Random Number Generator

When building procedurally generated content, use a predictable random number generator. This way, you can reproduce the same content across clients without having to synchronize the generated output.

Entity-Component System (ECS)

An Entity-Component System is a design pattern used mostly in game development. This pattern can help you build complex systems in a more modular way.

Spatial Partitioning

Spatial partitioning is a technique used in game development to optimize collision detection and other spatial queries.

Use a quadtree for 2D queries. For triangle meshes, a bounding volume hierarchy (BVH) accelerates raycasts and shape queries against level geometry. three-mesh-bvh requires no DOM or WebGL, so the same collision code runs on the backend and in the browser.

Physics

Avoid running an entire physics engine on the backend. You can use a physics engine to calculate collisions and other physics-related computations.

3D Physics

2D Physics

Loading 3D Models in Node

An authoritative server often needs the same geometry the client renders, for collision or raycasts. The GLTFLoader from three.js expects browser APIs, so it does not run under Node.

Convert the model at build time instead of at server boot. Read the .glb once, write the triangles you need into a compact binary, then load that file from both the backend and the frontend.

Profanity Filter

When allowing user-generated content, you may want to filter out profanity from the messages.