Skip to content

Commit 974e99d

Browse files
committed
Version bump, removed obsolete stuff
1 parent 07d8247 commit 974e99d

File tree

19 files changed

+109
-200
lines changed

19 files changed

+109
-200
lines changed

apps/derivean/package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@
2727
"@react-three/drei": "10.0.4",
2828
"@react-three/fiber": "9.1.0",
2929
"@react-three/postprocessing": "3.0.4",
30-
"@tanstack/react-query": "5.67.2",
31-
"@tanstack/react-router": "1.114.13",
32-
"@tanstack/zod-adapter": "1.114.13",
30+
"@tanstack/react-query": "5.67.3",
31+
"@tanstack/react-router": "1.114.17",
32+
"@tanstack/zod-adapter": "1.114.17",
3333
"@use-pico/client": "4.0.44",
3434
"@use-pico/server": "4.0.21",
3535
"@xyflow/react": "12.4.4",
3636
"dependency-graph": "1.0.0",
3737
"file-saver": "2.0.5",
38-
"fp-ts": "2.16.9",
3938
"graphology-shortest-path": "2.1.0",
4039
"graphology-traversal": "0.3.1",
4140
"graphology": "0.26.0",
@@ -54,19 +53,19 @@
5453
"zod": "3.24.2"
5554
},
5655
"devDependencies": {
57-
"@iconify/json": "2.2.315",
56+
"@iconify/json": "2.2.316",
5857
"@iconify/tailwind": "1.2.0",
5958
"@modyfi/vite-plugin-yaml": "1.1.1",
60-
"@tailwindcss/vite": "4.0.12",
61-
"@tanstack/router-plugin": "1.114.13",
59+
"@tailwindcss/vite": "4.0.13",
60+
"@tanstack/router-plugin": "1.114.17",
6261
"@types/file-saver": "2.0.7",
6362
"@types/react-dom": "19.0.4",
6463
"@types/react": "19.0.10",
6564
"@types/three": "0.174.0",
6665
"@use-pico/eslint-config-eslint": "5.0.11",
6766
"@vitejs/plugin-react": "4.3.4",
6867
"eslint": "9.22.0",
69-
"tailwindcss": "4.0.12",
68+
"tailwindcss": "4.0.13",
7069
"typescript": "5.8.2",
7170
"vite-plugin-dynamic-import": "1.6.0",
7271
"vite-plugin-top-level-await": "1.5.0",

bun.lock

Lines changed: 48 additions & 33 deletions
Large diffs are not rendered by default.
Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
1-
use noise::{NoiseFn, Perlin};
1+
use noise::{
2+
Billow, Blend, Fbm, MultiFractal, NoiseFn, Perlin, RidgedMulti, ScaleBias, Seedable, Turbulence,
3+
};
24

35
pub fn source(seed: u32) -> impl NoiseFn<f64, 2> {
4-
Perlin::new(seed)
6+
// Parameters for deep ocean
7+
const BASE_FREQUENCY: f64 = 0.125;
8+
const TURBULENCE_FREQUENCY: f64 = 1.0;
9+
const TURBULENCE_POWER: f64 = 0.25;
10+
11+
// Base noise for deep ocean depth variation
12+
// Use ridged multi-fractal for deeper trenches and canyons
13+
let ridged = RidgedMulti::<Perlin>::new(seed)
14+
.set_frequency(BASE_FREQUENCY * 0.5)
15+
.set_lacunarity(2.18)
16+
.set_persistence(0.65)
17+
.set_octaves(6);
18+
19+
// Scale the ridged noise to create deeper trenches
20+
let base_ridged = ScaleBias::new(ridged).set_scale(0.65).set_bias(-0.8);
21+
22+
// Billow noise for smoother ocean floor areas
23+
let billow = Billow::<Perlin>::new(seed + 1)
24+
.set_frequency(BASE_FREQUENCY * 0.3)
25+
.set_lacunarity(2.0)
26+
.set_persistence(0.5)
27+
.set_octaves(4);
28+
29+
// Scale billow to be slightly higher than ridged
30+
let base_billow = ScaleBias::new(billow).set_scale(0.45).set_bias(-0.6);
31+
32+
// Perlin noise for the blend control
33+
let control = Fbm::<Perlin>::new(seed + 2)
34+
.set_frequency(BASE_FREQUENCY * 0.2)
35+
.set_lacunarity(2.0)
36+
.set_persistence(0.5)
37+
.set_octaves(4);
38+
39+
// Blend between ridged and billow to create varied ocean floor
40+
let blend = Blend::new(base_billow, base_ridged, control);
41+
42+
// Add turbulence for more realistic and chaotic ocean floor
43+
let turbulence = Turbulence::<_, Perlin>::new(blend)
44+
.set_seed(seed + 3)
45+
.set_frequency(TURBULENCE_FREQUENCY)
46+
.set_power(TURBULENCE_POWER)
47+
.set_roughness(3);
48+
49+
turbulence
550
}

packages/@derivean/root-ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
},
3131
"peerDependencies": {
3232
"@hookform/resolvers": "4.1.3",
33-
"@tanstack/react-query": "5.67.2",
34-
"@tanstack/react-router": "1.114.13",
33+
"@tanstack/react-query": "5.67.3",
34+
"@tanstack/react-router": "1.114.17",
3535
"react-hook-form": "7.54.2",
3636
"react": "19.0.0"
3737
},
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @format */
22

33
import type { Tile } from "@derivean/chunk";
4-
import { HSLA, hslaToRgba, mapNoiseToColor, type Color } from "@derivean/utils";
4+
import { HSLA, noiseToGrayscale, type Color } from "@derivean/utils";
55

66
export namespace withColorMap {
77
export interface Props {
@@ -16,12 +16,7 @@ export namespace withColorMap {
1616
export const withColorMap = ({ tile }: withColorMap.Props): Color.RGBA => {
1717
const color = HSLA([0, 0, 0, 1]);
1818

19-
return hslaToRgba(
20-
mapNoiseToColor(tile.biome.deep_ocean, {
21-
min: HSLA([220, 100, 30, 1]),
22-
max: HSLA([200, 80, 60, 1]),
23-
}),
24-
);
19+
return noiseToGrayscale(tile.biome.deep_ocean);
2520

2621
// return hslaToRgba(color);
2722
};

packages/@derivean/terrain/src/utils/withGenerator.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
/** @format */
22

33
import { type Chunk as WasmChunk } from "@derivean/chunk";
4-
import { type Chunk, type GameConfig, type Noise, type XZ } from "@derivean/utils";
4+
import { type Chunk, type GameConfig, type XZ } from "@derivean/utils";
55
import { withColorMap } from "./withColorMap";
66

77
export namespace withGenerator {
8-
export interface Layer {
9-
level: number;
10-
noise: Noise;
11-
biome: Noise;
12-
}
13-
148
export namespace Generator {
159
export interface Props {
1610
x: number;

packages/@derivean/utils/src/fp/fpClamp.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/@derivean/utils/src/fp/fpCombineNoise.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)