@adatechnology/game-animals-three 0.4.5 → 0.4.6
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.
- package/dist/index.global.js +79 -18
- package/dist/index.global.js.map +1 -1
- package/package.json +4 -4
package/dist/index.global.js
CHANGED
|
@@ -105,7 +105,7 @@ var GameAnimalsThree = (() => {
|
|
|
105
105
|
var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
|
|
106
106
|
var SWING_LEAD_SECONDS = { punch: 0.07, kick: 0.09, shove: 0, blade: 0.05, blunt: 0.1, chop: 0.11 };
|
|
107
107
|
|
|
108
|
-
// ../game-audio/dist/chunk-
|
|
108
|
+
// ../game-audio/dist/chunk-C2K7XN2K.js
|
|
109
109
|
var DISTANCE_CURVES = {
|
|
110
110
|
/** The game's `sfx`: `vol / (1 + d² × 0.004)`, cutoff `/ (1 + d × 0.01)`, silent below 0.01 (jogo L62091–62092, L62101). */
|
|
111
111
|
game_sfx: { model: "inverse_square", k: 4e-3, cutoffK: 0.01, minGain: 0.01 },
|
|
@@ -540,6 +540,7 @@ var GameAnimalsThree = (() => {
|
|
|
540
540
|
burst: 20,
|
|
541
541
|
burstSpacing: 0.06
|
|
542
542
|
};
|
|
543
|
+
var CATALOG = new Map([...SFX_CATALOG, ...SFX_IMPACTS].map((entry) => [entry.id, entry]));
|
|
543
544
|
var PT = {
|
|
544
545
|
group: "Som",
|
|
545
546
|
name: "Painel de som (arquivos e C1\u2013C10)",
|
|
@@ -614,9 +615,9 @@ var GameAnimalsThree = (() => {
|
|
|
614
615
|
strengths: { light: "leve", medium: "m\xE9dio", heavy: "forte" },
|
|
615
616
|
states: { file: "A", synth: "S", missing: "F" },
|
|
616
617
|
criteria: { C1: "C1 Sincronia", C2: "C2 Certo p/ a\xE7\xE3o", C3: "C3 Dist\xE2ncia", C4: "C4 Posi\xE7\xE3o", C5: "C5 Varia\xE7\xE3o", C6: "C6 Volume", C7: "C7 Intensidade", C8: "C8 Cauda", C9: "C9 Rajada", C10: "C10 Escuta" },
|
|
617
|
-
metrics: { source: "1 \xB7 Fonte do que tocou", chosen: "1 \xB7 Escolhido", matrix: "2 \xB7 Matriz", last: "\xDAltimo tocado", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Prefer\xEAncias", state: "5 \xB7 Medi\xE7\xE3o", count: "1 \xB7 Cat\xE1logo" },
|
|
618
|
+
metrics: { source: "1 \xB7 Fonte do que tocou", chosen: "1 \xB7 Escolhido", matrix: "2 \xB7 Matriz", last: "\xDAltimo tocado", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Prefer\xEAncias", state: "5 \xB7 Medi\xE7\xE3o", count: "1 \xB7 Cat\xE1logo", unlicensed: "1 \xB7 Arquivo sem licen\xE7a" },
|
|
618
619
|
run: { idle: "parada", measuring: "medindo\u2026", done: "pronta", failed: "falhou", recording: "gravando\u2026", recorded: "grava\xE7\xE3o baixada" },
|
|
619
|
-
words: { none: "\u2014", hidden: "? (revele)", prefers: "prefere", approved: "aprovado pelo dono" },
|
|
620
|
+
words: { none: "\u2014", hidden: "? (revele)", prefers: "prefere", approved: "aprovado pelo dono", local_file: "arquivo do pacote local", sdk_file: "grava\xE7\xE3o do SDK", synth: "s\xEDntese do SDK" },
|
|
620
621
|
sources: { sdk: "SDK", user: "seu som", synth: "sintetizado" },
|
|
621
622
|
probe: "Fonte do som",
|
|
622
623
|
wall: "Parede (oclus\xE3o)",
|
|
@@ -687,9 +688,9 @@ var GameAnimalsThree = (() => {
|
|
|
687
688
|
environments: { indoor: "indoor", outdoor: "outdoor" },
|
|
688
689
|
strengths: { light: "light", medium: "medium", heavy: "heavy" },
|
|
689
690
|
criteria: { C1: "C1 Sync", C2: "C2 Right sound", C3: "C3 Distance", C4: "C4 Position", C5: "C5 Variation", C6: "C6 Level", C7: "C7 Strength", C8: "C8 Tail", C9: "C9 Burst", C10: "C10 Listening" },
|
|
690
|
-
metrics: { source: "1 \xB7 Source of what played", chosen: "1 \xB7 Chosen", matrix: "2 \xB7 Matrix", last: "Last played", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Preferences", state: "5 \xB7 Measurement", count: "1 \xB7 Catalogue" },
|
|
691
|
+
metrics: { source: "1 \xB7 Source of what played", chosen: "1 \xB7 Chosen", matrix: "2 \xB7 Matrix", last: "Last played", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Preferences", state: "5 \xB7 Measurement", count: "1 \xB7 Catalogue", unlicensed: "1 \xB7 File without licence" },
|
|
691
692
|
run: { idle: "idle", measuring: "measuring\u2026", done: "done", failed: "failed", recording: "recording\u2026", recorded: "recording downloaded" },
|
|
692
|
-
words: { none: "\u2014", hidden: "? (reveal)", prefers: "prefers", approved: "approved by the owner" },
|
|
693
|
+
words: { none: "\u2014", hidden: "? (reveal)", prefers: "prefers", approved: "approved by the owner", local_file: "local pack file", sdk_file: "SDK recording", synth: "SDK synthesis" },
|
|
693
694
|
sources: { sdk: "SDK", user: "your sound", synth: "synthesized" },
|
|
694
695
|
probe: "Sound source",
|
|
695
696
|
wall: "Wall (occlusion)",
|
|
@@ -760,6 +761,66 @@ var GameAnimalsThree = (() => {
|
|
|
760
761
|
};
|
|
761
762
|
}
|
|
762
763
|
var sceneMany = (count, make2) => Array.from({ length: count }, make2);
|
|
764
|
+
var hz = (midi) => 440 * 2 ** ((midi - 69) / 12);
|
|
765
|
+
var layer = (note, beat, wave, level) => {
|
|
766
|
+
const [at, midi, beats] = note;
|
|
767
|
+
const length = beats * beat;
|
|
768
|
+
return {
|
|
769
|
+
at: at * beat,
|
|
770
|
+
duration: length,
|
|
771
|
+
source: { kind: "osc", wave, frequency: { set: hz(midi) } },
|
|
772
|
+
envelope: [[0, 1e-4, "set"], [0.01, level, "linear"], [Math.max(0.02, length * 0.9), level * 0.35, "linear"], [length, 1e-4, "exp", "fixed"]]
|
|
773
|
+
};
|
|
774
|
+
};
|
|
775
|
+
function radioTrack(spec) {
|
|
776
|
+
const beat = 60 / spec.bpm;
|
|
777
|
+
const recipes = Array.from({ length: spec.bars }, (_, bar) => {
|
|
778
|
+
const inBar = (notes) => notes.filter((n) => n[0] >= bar * 4 && n[0] < bar * 4 + 4).map((n) => [n[0] - bar * 4, n[1], n[2]]);
|
|
779
|
+
const layers = [
|
|
780
|
+
...inBar(spec.bass).map((n) => layer(n, beat, "triangle", 0.16)),
|
|
781
|
+
...inBar(spec.chords).map((n) => layer(n, beat, "sine", 0.05)),
|
|
782
|
+
...inBar(spec.melody).map((n) => layer(n, beat, spec.wave, 0.07))
|
|
783
|
+
];
|
|
784
|
+
return { id: `${spec.id}_${bar}`, bus: "world", duration: 4 * beat, layers, falloff: { model: "none" } };
|
|
785
|
+
});
|
|
786
|
+
return { song: { id: spec.id, barSeconds: 4 * beat, bars: recipes.map((r) => r.id) }, recipes };
|
|
787
|
+
}
|
|
788
|
+
var chord = (bar, root, minor = false) => [[bar * 4, root, 4], [bar * 4, root + (minor ? 3 : 4), 4], [bar * 4, root + 7, 4]];
|
|
789
|
+
var bassLine = (roots, pattern) => roots.flatMap((root, bar) => pattern.map((b) => [bar * 4 + b, root - 12, 0.9]));
|
|
790
|
+
var TRACKS = [
|
|
791
|
+
// a bright pop loop: I–V–vi–IV in C
|
|
792
|
+
radioTrack({
|
|
793
|
+
id: "radio_track_pop",
|
|
794
|
+
bpm: 112,
|
|
795
|
+
bars: 4,
|
|
796
|
+
wave: "square",
|
|
797
|
+
bass: bassLine([48, 55, 57, 53], [0, 1.5, 2, 3]),
|
|
798
|
+
chords: [...chord(0, 60), ...chord(1, 55), ...chord(2, 57, true), ...chord(3, 53)],
|
|
799
|
+
melody: [[0, 76, 1], [1, 74, 0.5], [1.5, 72, 1.5], [4, 74, 1], [5, 76, 1], [6, 79, 2], [8, 76, 1], [9, 74, 1], [10, 72, 2], [12, 72, 1], [13, 74, 1], [14, 72, 2]]
|
|
800
|
+
}),
|
|
801
|
+
// a syncopated loop in A minor, the bass on the off-beats
|
|
802
|
+
radioTrack({
|
|
803
|
+
id: "radio_track_groove",
|
|
804
|
+
bpm: 100,
|
|
805
|
+
bars: 4,
|
|
806
|
+
wave: "triangle",
|
|
807
|
+
bass: bassLine([57, 62, 64, 57], [0, 0.75, 1.5, 2.5, 3.25]),
|
|
808
|
+
chords: [...chord(0, 57, true), ...chord(1, 62, true), ...chord(2, 64), ...chord(3, 57, true)],
|
|
809
|
+
melody: [[0.5, 72, 0.5], [1.25, 76, 0.75], [2.5, 74, 1], [4.5, 77, 0.5], [5.25, 74, 0.75], [6.5, 72, 1.5], [8.5, 71, 0.5], [9.25, 74, 0.75], [10.5, 76, 1.5], [12.5, 72, 0.5], [13.25, 69, 2]]
|
|
810
|
+
}),
|
|
811
|
+
// a slow blues-like loop in F with a swung melody
|
|
812
|
+
radioTrack({
|
|
813
|
+
id: "radio_track_slow",
|
|
814
|
+
bpm: 76,
|
|
815
|
+
bars: 4,
|
|
816
|
+
wave: "sine",
|
|
817
|
+
bass: bassLine([53, 58, 53, 60], [0, 2]),
|
|
818
|
+
chords: [...chord(0, 65), ...chord(1, 58), ...chord(2, 65), ...chord(3, 60)],
|
|
819
|
+
melody: [[0, 72, 1.5], [1.67, 75, 0.33], [2, 77, 2], [4, 74, 1], [5, 72, 1], [6, 70, 2], [8, 72, 1.5], [9.67, 69, 0.33], [10, 65, 2], [12, 67, 1], [13, 70, 1], [14, 72, 2]]
|
|
820
|
+
})
|
|
821
|
+
];
|
|
822
|
+
var RADIO_TRACKS = TRACKS.map((t) => t.song);
|
|
823
|
+
var RADIO_BANK = { id: "vehicle_radio", sounds: TRACKS.flatMap((t) => t.recipes), loops: [] };
|
|
763
824
|
var FOLEY_FALLOFF = {
|
|
764
825
|
model: "inverse_square",
|
|
765
826
|
k: 0.02,
|
|
@@ -1366,11 +1427,11 @@ var GameAnimalsThree = (() => {
|
|
|
1366
1427
|
...s.splash ? [sceneNoise({ type: "bandpass", f: s.splash.f * take.f, f2: s.splash.f2 * take.f, q: 1.4, d: s.splash.d * take.t * weight ** 0.4, vol: s.splash.vol * gait.vol * take.v * weight ** 0.5 })] : []
|
|
1367
1428
|
];
|
|
1368
1429
|
}
|
|
1369
|
-
var quieter = (level, layers) => layers.map((
|
|
1370
|
-
const gain =
|
|
1371
|
-
if (typeof gain === "number") return { ...
|
|
1372
|
-
if (Array.isArray(gain)) return { ...
|
|
1373
|
-
return
|
|
1430
|
+
var quieter = (level, layers) => layers.map((layer2) => {
|
|
1431
|
+
const gain = layer2.gain ?? 1;
|
|
1432
|
+
if (typeof gain === "number") return { ...layer2, gain: gain * level };
|
|
1433
|
+
if (Array.isArray(gain)) return { ...layer2, gain: [gain[0] * level, gain[1] * level] };
|
|
1434
|
+
return layer2;
|
|
1374
1435
|
});
|
|
1375
1436
|
var recipe = (id, layers, falloff, bus = "world") => ({ id, bus, pan: true, layers, falloff, sources: ["sdk"] });
|
|
1376
1437
|
var takeId = (id, index) => `${id}_${String(index + 1).padStart(2, "0")}`;
|
|
@@ -1386,7 +1447,7 @@ var GameAnimalsThree = (() => {
|
|
|
1386
1447
|
(take) => quieter(LANDING_LEVEL, [
|
|
1387
1448
|
// both feet, a hair apart, then the knees taking the weight (a low body thump) and the clothes settling
|
|
1388
1449
|
...footLayers(surface, take, GAITS.run, LANDINGS[landing2].weight),
|
|
1389
|
-
...footLayers(surface, { ...take, v: take.v * 0.6 }, GAITS.run, LANDINGS[landing2].weight * 0.6).map((
|
|
1450
|
+
...footLayers(surface, { ...take, v: take.v * 0.6 }, GAITS.run, LANDINGS[landing2].weight * 0.6).map((layer2) => ({ ...layer2, at: (typeof layer2.at === "number" ? layer2.at : 0) + 0.018 * take.t })),
|
|
1390
1451
|
sceneTone({ f: 60 * take.f, f2: 38, d: 0.14 * LANDINGS[landing2].weight * take.t, vol: 0.22 * LANDINGS[landing2].weight ** 0.7 * take.v, delay: 0.02 }),
|
|
1391
1452
|
sceneNoise({ type: "bandpass", f: [1800, 2600], q: 0.8, d: 0.18, vol: LANDINGS[landing2].cloth * take.v, delay: 0.04 })
|
|
1392
1453
|
]),
|
|
@@ -1432,7 +1493,7 @@ var GameAnimalsThree = (() => {
|
|
|
1432
1493
|
fall_damage: (take) => [
|
|
1433
1494
|
...BODY.body_fall(take),
|
|
1434
1495
|
sceneNoise({ type: "highpass", f: 2800, d: 0.02, vol: 0.35 * take.v, delay: 0.01 }),
|
|
1435
|
-
...voice({ f0: 170, f1: 110, d: 0.32, fA: 650, fB: 1150, noise: 0.25, vol: 0.32 })(take).map((
|
|
1496
|
+
...voice({ f0: 170, f1: 110, d: 0.32, fA: 650, fB: 1150, noise: 0.25, vol: 0.32 })(take).map((layer2) => ({ ...layer2, at: 0.08 }))
|
|
1436
1497
|
],
|
|
1437
1498
|
player_hurt: voice({ f0: 150, f1: 105, d: 0.26, fA: 620, fB: 1100, noise: 0.3, vol: 0.35 }),
|
|
1438
1499
|
player_breath_run: (take) => [
|
|
@@ -2903,8 +2964,8 @@ var GameAnimalsThree = (() => {
|
|
|
2903
2964
|
const face = faces[i];
|
|
2904
2965
|
f3(face[2] + offset, face[1] + offset, face[0] + offset);
|
|
2905
2966
|
}
|
|
2906
|
-
const
|
|
2907
|
-
offset = vlen *
|
|
2967
|
+
const layer2 = steps + bevelSegments * 2;
|
|
2968
|
+
offset = vlen * layer2;
|
|
2908
2969
|
for (let i = 0; i < flen; i++) {
|
|
2909
2970
|
const face = faces[i];
|
|
2910
2971
|
f3(face[0] + offset, face[1] + offset, face[2] + offset);
|
|
@@ -3705,8 +3766,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
3705
3766
|
const isChicken = species.id === "chicken";
|
|
3706
3767
|
const isLapwing = species.id === "southern_lapwing";
|
|
3707
3768
|
const flying = clip === "run" && !isChicken;
|
|
3708
|
-
const
|
|
3709
|
-
rig.phase += dt * (flying ? isVulture ? 1.1 : 4.5 :
|
|
3769
|
+
const hz2 = clip === "run" && !flying ? species.runHz : clip === "walk" ? species.walkHz : 0;
|
|
3770
|
+
rig.phase += dt * (flying ? isVulture ? 1.1 : 4.5 : hz2) * 2 * PI;
|
|
3710
3771
|
const targetHeight = flying ? rig.size * 1.2 : 0;
|
|
3711
3772
|
rig.trunk.position.y += (targetHeight - rig.trunk.position.y) * Math.min(1, dt * 3);
|
|
3712
3773
|
rig.legs.forEach((leg, index) => {
|
|
@@ -3769,8 +3830,8 @@ uniform mat4 uNodes[${nodes.length}]; attribute float aNodeIndex; attribute vec3
|
|
|
3769
3830
|
if (rig.jaw) rig.jaw.rotation.x = 0.25;
|
|
3770
3831
|
return;
|
|
3771
3832
|
}
|
|
3772
|
-
const
|
|
3773
|
-
rig.phase += dt *
|
|
3833
|
+
const hz2 = (clip === "run" ? species.runHz : clip === "walk" ? species.walkHz : 0) * (rig.infected ? 1.2 : 1);
|
|
3834
|
+
rig.phase += dt * hz2 * 2 * PI2;
|
|
3774
3835
|
const gait = clip === "run" ? species.gallop ? gaits.gallop : gaits.trot : gaits.walk;
|
|
3775
3836
|
const amplitude = clip === "run" ? 0.62 : 0.34;
|
|
3776
3837
|
const flex = clip === "run" ? 1.15 : 0.75;
|