@threedog/terrain-noise 0.1.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +20 -0
  2. package/index.js +3 -3
  3. package/package.json +5 -2
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # @threedog/terrain-noise
2
+
3
+ Optional terrain generator for [threedog](https://www.npmjs.com/package/threedog): noise hills, `island`, `canyon` or `plain` shapes, rivers and a biome rule table. It decides the shape of the world only; ground colors belong to the game's style (keyed by the biome names). Without it the engine's ground is flat.
4
+
5
+ ```sh
6
+ npm install @threedog/terrain-noise@0.5
7
+ ```
8
+
9
+ This describes 0.5.0: `npm install @threedog/terrain-noise@0.5` (games made in the [repository](https://github.com/penstic123-code/ThreeDog.js-Game-Engine) already have it).
10
+
11
+ ```js
12
+ import { openWorld } from 'threedog';
13
+ import { terrainPreset } from '@threedog/terrain-noise';
14
+
15
+ engine.use(openWorld({ seed: 7, camera: 'follow', terrain: terrainPreset({ shape: 'island' }) }));
16
+ ```
17
+
18
+ Also exported: `riverAt(x, z, n)`, `BIOMES` (the default rule table) and `terrainStrings`. Types are in `index.d.ts`. The height and ground-type functions run in terrain workers, so a game's own replacements must be pure (read only their parameters and `Math`).
19
+
20
+ Docs ship with the engine: `node_modules/threedog/docs/AI.md` and `docs/recipes/`. Peer dependency: `threedog`. MIT license.
package/index.js CHANGED
@@ -3,9 +3,9 @@
3
3
  // ground; a game passes this preset (or its own height / groundType functions) explicitly:
4
4
  // import { terrainPreset } from '@threedog/terrain-noise';
5
5
  // engine.use(openWorld({ seed: 7, camera: 'follow', terrain: terrainPreset({ shape: 'island' }) }));
6
- // Why its own package and not part of a style pack: the shape of the world (where hills, rivers and forests are) is gameplay, and a style
7
- // pack holds looks only (packages/engine/docs/recipes/09-style-pack.md). Swapping the look must never move a river. The colors of these ground types belong
8
- // to whichever style pack the game uses (lowpoly: style.terrain.biomeColors, keyed by the names below).
6
+ // Why its own package and not part of a style: the shape of the world (where hills, rivers and forests are) is gameplay, and a style
7
+ // pack holds looks only (packages/engine/docs/recipes/09-style.md). Swapping the look must never move a river. The colors of these ground types belong
8
+ // to whichever style the game uses (e.g. style.terrain.biomeColors, keyed by the names below).
9
9
  // height and groundType run in terrain workers, so they are pure: they read only their parameters (n.params is the options below) and Math.
10
10
  // The ground type names are plain strings that vegetation rules, style colors and a game's footstep map match by name.
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threedog/terrain-noise",
3
- "version": "0.1.0",
3
+ "version": "0.5.0",
4
4
  "description": "Optional terrain generator for threedog: noise hills, island, canyon or plain shapes, rivers and a biome rule table (world shape only, no colors)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -10,6 +10,9 @@
10
10
  },
11
11
  "homepage": "https://github.com/penstic123-code/ThreeDog.js-Game-Engine#readme",
12
12
  "type": "module",
13
+ "engines": {
14
+ "node": "^20.19.0 || >=22.12.0"
15
+ },
13
16
  "main": "./index.js",
14
17
  "types": "./index.d.ts",
15
18
  "exports": {
@@ -24,6 +27,6 @@
24
27
  "*.d.ts"
25
28
  ],
26
29
  "peerDependencies": {
27
- "threedog": "^0.1.0"
30
+ "threedog": "^0.5.0"
28
31
  }
29
32
  }