npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adatechnology/game-crowd-three

v0.6.6

Published

three.js drawing for @adatechnology/game-crowd: every agent, body on the ground and civilian as instances (a literal port of the team game's hordeRender and npcRender: view culling, LOD with hysteresis, attack pose, the pose by state), the renderer on the

Readme

@adatechnology/game-crowd-three

The three.js drawing of a @adatechnology/game-crowd crowd. Thousands of agents in a few draw calls: every crowd type is baked by the rich builder into its variants at three levels of detail (the instanced bodies of @adatechnology/game-characters-three), and each frame every agent, every body on the ground and every civilian becomes one instance of the right batch. three.js is passed in by the host; the package never imports it.

It is a literal port of the team game's drawing (jogo.js G 67079-67136 ZVAR, hordeRender; G 68469 PB; G 70177-70184 npcRender):

  • View culling: past √30 m, an agent more than 0.35·d + 3 m behind the view is left out; nothing past 200 m.
  • Level of detail at 18 and 55 m with 1.5 m of hysteresis, kept per agent (store.lod).
  • The attack pose in at 1.6 m from the target, out at 2.2 m, kept per agent (store.attackPose); the crowd reads it back (a striking agent does not turn to its velocity), as in the game.
  • The pose by state (dormant fallen, airborne leap, eating, pile step and grab as attack, swing and calling as scream, crawl), the bloater's swelling, the eyes out without the skull or on a dormant body.
  • Bodies on the ground on their own variant (near within 18 m), darkening 70% over their life and shrinking in the last 60 s; a body that was not an agent goes on the plain body batch.
  • Civilians one baked body each, a child 0.66 high and 0.75 wide, the bite showing.

Every number is in src/data/render.json with its source line, and the poses by state are options. The golden game-crowd-render.json (the game's hordeRender and npcRender on the 11 scenes of the horde and the survivors, recorded in node:vm by tools/characters-catalog) is replayed instance by instance by the tests.

Install

pnpm add @adatechnology/game-crowd-three three

Browser without a bundler (the global is GameCrowdThree; the kit's engines are bundled in, three.js is yours):

<script src="https://unpkg.com/@adatechnology/game-crowd-three/dist/index.global.js"></script>

Usage

import * as THREE from 'three'
import { createCrowd } from '@adatechnology/game-crowd'
import { createCrowdRenderer, CROWD_SOUND_BANK, HERD_SOUND_IDS } from '@adatechnology/game-crowd-three'
import { createBestBuilder } from '@adatechnology/game-characters-three'
import { undeadCrowdPack, UNDEAD_TYPES } from '@adatechnology/game-characters-undead'

const crowd = createCrowd({ pack: undeadCrowdPack(), seed: 7, target: player })
const best = createBestBuilder(THREE, { types: UNDEAD_TYPES.map((t) => ({ name: t.name['pt-BR'], eye: parseInt(t.eye.color, 16) })), random })
const renderer = createCrowdRenderer(THREE, {
  crowd,
  builders: { buildBest: (spec, lod) => (best.setLOD(lod), best.build(spec)), topMaterial: () => best.topM() },
  typeName: (type) => UNDEAD_TYPES.find((t) => t.id === type.id)!.name['pt-BR'],
  civilians: { list: () => civilians.list, body: (n) => bodyOf(n) },
})
scene.add(renderer.group)
audio.register(CROWD_SOUND_BANK) // groan, runner_groan, scream_hoarse and the herd's calls

// every frame, after crowd.update
renderer.update(dt, { camera: { x: camera.position.x, z: camera.position.z }, viewYaw, target: { x: player.state.x, z: player.state.z, alive: player.state.alive } })
renderer.lodCounts // [near, middle, far]

A type is baked the first time one of its bodies is drawn (bake() does them all at once). Without three.js, createCrowdInstances gives the same instances to any drawing.

createHerdView(THREE, { herd, flock, drawer, species }) draws game-crowd's herd with the animals' own rigs (game-animals-three's createAnimalsThree(THREE) is a drawer as it is) and the vultures gliding over the bodies.

Test area

createCrowdTestModule({ pack, builders, ... }) (crowd_area, only the generic contracts) puts a horde in the room, drawn on the instanced path, hunting the room's camera as a game-player body, with civilians, the herd, a region model (game-infection) and nine scenarios. Sounds go to host.audio (the bank is registered there), effects to host.effects (CROWD_EFFECTS maps them to the Oficina de VFX recipes). The content comes in by option. examples/crowd-test-area loads it with the kit's own packs (CrowdArea.loadInto(room), sala-multidao.html), and examples/interactables-test-area carries it too.

Em português

Desenho three.js da multidão do game-crowd: cada tipo assado nas variantes e em três níveis de detalhe, cada agente, corpo no chão e civil como uma instância. Porte literal do hordeRender e do npcRender do jogo (corte pela vista, nível de detalhe com histerese de 1,5 m, pose de ataque de 1,6 a 2,2 m, pose por estado, corpo que escurece e encolhe). A área de teste (crowd_area) põe uma horda caçando o corpo do jogador na sala.