@woosh/meep-engine 2.118.8 → 2.118.11
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/build/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +202 -410
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +202 -410
- package/editor/ecs/component/editors/Sampler2DEditor.js +2 -4
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +55 -55
- package/samples/generation/generators/interactive/mir_generator_place_buff_objects.js +21 -23
- package/samples/generation/generators/mir_generator_place_bases.js +20 -20
- package/samples/generation/generators/mir_generator_place_road_decorators.js +11 -11
- package/samples/terrain/editor.js +3 -3
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts +1 -19
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
- package/src/core/bvh2/binary/2/BinaryUint32BVH.js +10 -78
- package/src/core/bvh2/bvh3/build_triangle_morton_codes.js +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +9 -7
- package/src/core/collection/array/isArrayEqualStrict.d.ts.map +1 -1
- package/src/core/collection/array/isArrayEqualStrict.js +2 -2
- package/src/core/collection/array/iterator/ArrayIteratorSequential.d.ts.map +1 -1
- package/src/core/collection/array/iterator/ArrayIteratorSequential.js +3 -4
- package/src/core/collection/queue/Deque.d.ts.map +1 -1
- package/src/core/collection/queue/Deque.js +1 -1
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts +9 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.js +29 -0
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +0 -8
- package/src/core/geom/3d/morton/{Morton.d.ts → v3_morton_encode.d.ts} +1 -1
- package/src/core/geom/3d/morton/v3_morton_encode.d.ts.map +1 -0
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.js +2 -2
- package/src/core/geom/3d/morton/v3_morton_encode_transformed.js +2 -2
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +7 -10
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +4 -49
- package/src/core/math/gaussian.d.ts.map +1 -1
- package/src/core/math/gaussian.js +4 -1
- package/src/core/math/physics/pdf/pdf_GGX.d.ts +3 -3
- package/src/core/math/physics/pdf/pdf_GGX.d.ts.map +1 -1
- package/src/core/math/physics/pdf/pdf_GGX.js +7 -6
- package/src/core/math/sinc.d.ts +8 -0
- package/src/core/math/sinc.d.ts.map +1 -0
- package/src/core/math/sinc.js +13 -0
- package/src/core/model/ObservedBoolean.js +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.d.ts +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.js +7 -7
- package/src/core/model/object/validatedObjectValueByKey.js +1 -1
- package/src/core/model/reactive/transform/{ReactiveTypeInferrence.d.ts → inferReactiveExpressionTypes.d.ts} +1 -1
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.d.ts.map +1 -0
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.js +60 -0
- package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
- package/src/core/process/delay.d.ts.map +1 -1
- package/src/core/process/delay.js +6 -0
- package/src/core/process/task/TaskGroup.d.ts.map +1 -1
- package/src/core/process/task/TaskGroup.js +3 -8
- package/src/core/process/undo/ActionGroup.d.ts.map +1 -1
- package/src/core/process/undo/ActionGroup.js +6 -9
- package/src/core/process/worker/WorkerProxy.d.ts +12 -3
- package/src/core/process/worker/WorkerProxy.d.ts.map +1 -1
- package/src/core/process/worker/WorkerProxy.js +10 -1
- package/src/core/process/worker/extractTransferables.d.ts +3 -2
- package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
- package/src/core/process/worker/extractTransferables.js +32 -12
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +3 -1
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.d.ts +2 -17
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.d.ts.map +1 -1
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.js +2 -118
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.d.ts +0 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.js +1 -6
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts +5 -5
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +20 -28
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.js +2 -2
- package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +3 -1
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +4 -0
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.js +4 -0
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.d.ts +1 -1
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +12 -12
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/STSpace.js +14 -16
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.d.ts +17 -0
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.d.ts.map +1 -0
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.js +118 -0
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts +2 -2
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.js +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.d.ts.map +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +2 -2
- package/src/engine/graphics/render/forward_plus/materials/FPlusDebugMaterial.js +3 -3
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +31 -52
- package/src/engine/graphics/texture/sampler/sampler2d_to_texture.d.ts +10 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_texture.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{Sampler2D2Texture.js → sampler2d_to_texture.js} +5 -5
- package/src/engine/graphics/texture/sampler/{copy_Sampler2D_channel_data.d.ts → sampler2d_transfer_data.d.ts} +2 -2
- package/src/engine/graphics/texture/sampler/sampler2d_transfer_data.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{copy_Sampler2D_channel_data.js → sampler2d_transfer_data.js} +1 -1
- package/src/engine/graphics/texture/sampler/writeSampler2DDataToDataTexture.js +2 -2
- package/src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.js +0 -3
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts +6 -3
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +9 -12
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +20 -23
- package/src/engine/intelligence/mcts/StateNode.d.ts.map +1 -1
- package/src/engine/intelligence/mcts/StateNode.js +76 -102
- package/src/engine/logging/Logger.d.ts.map +1 -1
- package/src/engine/logging/Logger.js +7 -9
- package/src/engine/logging/LoggerBackend.d.ts.map +1 -1
- package/src/engine/logging/LoggerBackend.js +7 -7
- package/src/generation/grid/actions/ContinuousGridCellAction.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellAction.js +6 -8
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js +20 -22
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +23 -28
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +7 -10
- package/src/generation/grid/generation/GridTaskSequence.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskSequence.js +2 -5
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.d.ts → GridTaskActionRuleSet.d.ts} +1 -1
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.d.ts.map +1 -0
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.js → GridTaskActionRuleSet.js} +13 -16
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +51 -53
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +20 -23
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.js +38 -39
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.js +8 -11
- package/src/generation/grid/generation/road/PathEndPoint.d.ts.map +1 -1
- package/src/generation/grid/generation/road/PathEndPoint.js +8 -10
- package/src/generation/grid/generation/road/RoadConnection.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnection.js +4 -5
- package/src/generation/markers/GridCellActionPlaceMarker.d.ts.map +1 -1
- package/src/generation/markers/GridCellActionPlaceMarker.js +7 -5
- package/src/view/common/LabelView.d.ts.map +1 -1
- package/src/view/common/LabelView.js +0 -3
- package/src/core/geom/3d/morton/Morton.d.ts.map +0 -1
- package/src/core/model/LinearValue.d.ts +0 -88
- package/src/core/model/LinearValue.d.ts.map +0 -1
- package/src/core/model/LinearValue.js +0 -140
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.d.ts.map +0 -1
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.js +0 -54
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.d.ts +0 -9
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.js +0 -11
- package/src/engine/graphics/geometry/MikkT/m_getPosition.d.ts +0 -14
- package/src/engine/graphics/geometry/MikkT/m_getPosition.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getPosition.js +0 -20
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.d.ts +0 -21
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.js +0 -22
- package/src/engine/graphics/texture/sampler/Sampler2D2Texture.d.ts +0 -10
- package/src/engine/graphics/texture/sampler/Sampler2D2Texture.d.ts.map +0 -1
- package/src/engine/graphics/texture/sampler/copy_Sampler2D_channel_data.d.ts.map +0 -1
- package/src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.d.ts.map +0 -1
- /package/src/core/geom/3d/morton/{Morton.js → v3_morton_encode.js} +0 -0
|
@@ -1,34 +1,31 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import { weightedRandomFromArray } from "../../../../core/collection/array/weightedRandomFromArray.js";
|
|
1
3
|
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
2
4
|
import { Behavior } from "../Behavior.js";
|
|
3
|
-
import { weightedRandomFromArray } from "../../../../core/collection/array/weightedRandomFromArray.js";
|
|
4
5
|
import { WeightedElement } from "./WeightedElement.js";
|
|
5
|
-
import { assert } from "../../../../core/assert.js";
|
|
6
6
|
|
|
7
7
|
export class WeightedRandomBehavior extends Behavior {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {WeightedElement<Behavior>[]} elements
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
__elements = [];
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @type {function(): number}
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
__random = seededRandom(91512);
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {Behavior|undefined}
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
__selected = undefined;
|
|
32
29
|
|
|
33
30
|
/**
|
|
34
31
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateNode.d.ts","sourceRoot":"","sources":["../../../../../src/engine/intelligence/mcts/StateNode.js"],"names":[],"mappings":"wBAKU,MAAM;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"StateNode.d.ts","sourceRoot":"","sources":["../../../../../src/engine/intelligence/mcts/StateNode.js"],"names":[],"mappings":"wBAKU,MAAM;;;;;;;;;AAyDhB;;GAEG;AACH;IAEI;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,QAFU,MAAM,CAEL;IAGX;;;OAGG;IACH,UAFU,MAAM,CAEH;IAEb;;;OAGG;IACH,gBAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,QAFU,IAAI,sBAAU,CAEV;IAEd;;;OAGG;IACH,OAFU,IAAI,GAAC,eAAU,CAEZ;IAEb;;;OAGG;IACH,MAFU,SAAS,CAEQ;IAG3B,+BASC;IAED;;OAEG;IACH,gCAuCC;IAED;;;;;OAKG;IACH,sEAFa,MAAM,CAyBlB;IAGD;;;;;OAKG;IACH,sBAJW,MAAM,QACN,MAAM,UACN,MAAM,QAchB;IAGD;;;OAGG;IACH,cAFa,OAAO,CAInB;IAED;;;OAGG;IACH,cAFa,OAAO,CAInB;IAED;;;OAGG;IACH,iBAFa,eAAU,CAmCtB;IAED;;;OAGG;IACH,4DA4BC;CACJ;yBAxTwB,eAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MoveEdge } from "./MoveEdge.js";
|
|
2
1
|
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { MoveEdge } from "./MoveEdge.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
@@ -14,20 +14,6 @@ export const StateType = {
|
|
|
14
14
|
NoMoves: 5
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param {number} x
|
|
20
|
-
* @param {number} y
|
|
21
|
-
* @return {number}
|
|
22
|
-
*/
|
|
23
|
-
function computeCertainty(x, y) {
|
|
24
|
-
if (x === 0) {
|
|
25
|
-
return 1;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return x / y;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
17
|
/**
|
|
32
18
|
*
|
|
33
19
|
* @param {MoveEdge} move
|
|
@@ -64,108 +50,70 @@ function computeScore(move, totalPlayouts, totalUncertainPlayouts) {
|
|
|
64
50
|
return score;
|
|
65
51
|
}
|
|
66
52
|
|
|
67
|
-
const traverseState = function () {
|
|
68
53
|
|
|
69
|
-
|
|
70
|
-
const stack = [];
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
*
|
|
74
|
-
* @param {StateNode} node
|
|
75
|
-
* @param {function(StateNode)} visitor
|
|
76
|
-
*/
|
|
77
|
-
function traverseState(node, visitor) {
|
|
78
|
-
const stackOffset = stackPointer;
|
|
54
|
+
let stack_pointer = 0;
|
|
79
55
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
n = stack[stackPointer];
|
|
87
|
-
|
|
88
|
-
visitor(n);
|
|
89
|
-
|
|
90
|
-
if (n.isExpanded()) {
|
|
91
|
-
|
|
92
|
-
const moves = n.moves;
|
|
93
|
-
const numMoves = moves.length;
|
|
94
|
-
|
|
95
|
-
for (let i = 0; i < numMoves; i++) {
|
|
96
|
-
const moveEdge = moves[i];
|
|
97
|
-
|
|
98
|
-
if (moveEdge.isTargetMaterialized()) {
|
|
99
|
-
const target = moveEdge.target;
|
|
100
|
-
|
|
101
|
-
stack[stackPointer++] = target;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
//cleanup
|
|
108
|
-
stack.length = stackOffset;
|
|
109
|
-
stackPointer = stackOffset;
|
|
110
|
-
}
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @type {StateNode[]}
|
|
59
|
+
*/
|
|
60
|
+
const stack = [];
|
|
111
61
|
|
|
112
|
-
return traverseState;
|
|
113
|
-
}();
|
|
114
62
|
|
|
115
63
|
/**
|
|
116
64
|
* @template State, Action
|
|
117
65
|
*/
|
|
118
66
|
export class StateNode {
|
|
119
|
-
constructor() {
|
|
120
|
-
/**
|
|
121
|
-
* How deep is the node in the tree
|
|
122
|
-
* @type {number}
|
|
123
|
-
*/
|
|
124
|
-
this.depth = 0;
|
|
125
67
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
68
|
+
/**
|
|
69
|
+
* How deep is the node in the tree
|
|
70
|
+
* @type {number}
|
|
71
|
+
*/
|
|
72
|
+
depth = 0;
|
|
131
73
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @type {number}
|
|
77
|
+
*/
|
|
78
|
+
wins = 0;
|
|
137
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Number of leses in the subtree of this state
|
|
82
|
+
* @type {number}
|
|
83
|
+
*/
|
|
84
|
+
losses = 0;
|
|
138
85
|
|
|
139
|
-
/**
|
|
140
|
-
* total number of explored playouts
|
|
141
|
-
* @type {number}
|
|
142
|
-
*/
|
|
143
|
-
this.playouts = 0;
|
|
144
86
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
87
|
+
/**
|
|
88
|
+
* total number of explored playouts
|
|
89
|
+
* @type {number}
|
|
90
|
+
*/
|
|
91
|
+
playouts = 0;
|
|
150
92
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @type {number}
|
|
96
|
+
*/
|
|
97
|
+
heuristicValue = 0;
|
|
156
98
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
99
|
+
/**
|
|
100
|
+
* parent node, previous state
|
|
101
|
+
* @type {null|StateNode}
|
|
102
|
+
*/
|
|
103
|
+
parent = null;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
*
|
|
107
|
+
* @type {null|MoveEdge[]}
|
|
108
|
+
*/
|
|
109
|
+
moves = null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
* @type {StateType}
|
|
114
|
+
*/
|
|
115
|
+
type = StateType.Undecided;
|
|
162
116
|
|
|
163
|
-
/**
|
|
164
|
-
*
|
|
165
|
-
* @type {StateType}
|
|
166
|
-
*/
|
|
167
|
-
this.type = StateType.Undecided;
|
|
168
|
-
}
|
|
169
117
|
|
|
170
118
|
bubbleUpHeuristicScore() {
|
|
171
119
|
let r = this.parent;
|
|
@@ -335,6 +283,32 @@ export class StateNode {
|
|
|
335
283
|
* @param {function(StateNode)} visitor
|
|
336
284
|
*/
|
|
337
285
|
traverse(visitor) {
|
|
338
|
-
|
|
286
|
+
const stackOffset = stack_pointer;
|
|
287
|
+
|
|
288
|
+
stack[stack_pointer++] = this;
|
|
289
|
+
|
|
290
|
+
let n;
|
|
291
|
+
|
|
292
|
+
while (stack_pointer-- > stackOffset) {
|
|
293
|
+
|
|
294
|
+
n = stack[stack_pointer];
|
|
295
|
+
|
|
296
|
+
visitor(n);
|
|
297
|
+
|
|
298
|
+
if (n.isExpanded()) {
|
|
299
|
+
|
|
300
|
+
const moves = n.moves;
|
|
301
|
+
const numMoves = moves.length;
|
|
302
|
+
|
|
303
|
+
for (let i = 0; i < numMoves; i++) {
|
|
304
|
+
const moveEdge = moves[i];
|
|
305
|
+
|
|
306
|
+
if (moveEdge.isTargetMaterialized()) {
|
|
307
|
+
stack[stack_pointer++] = moveEdge.target;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
339
313
|
}
|
|
340
314
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../../src/engine/logging/Logger.js"],"names":[],"mappings":"AAGA;
|
|
1
|
+
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../../src/engine/logging/Logger.js"],"names":[],"mappings":"AAGA;IACI;;;;OAIG;IACH,iBAAc;IAEd;;;;;OAKG;IACH,oCAFa,OAAO,CAUnB;IAED;;;;OAIG;IACH,uCAFY,OAAO,CAUlB;IAED;;;;OAIG;IACH,WAHW,QAAQ,GAAC,MAAM,WACf,MAAM,QAmBhB;IAED,qBAEC;IAED,qBAEC;IAED,sBAEC;CACJ;yBA5EwB,eAAe"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { LogLevel } from "./LogLevel.js";
|
|
2
1
|
import { assert } from "../../core/assert.js";
|
|
2
|
+
import { LogLevel } from "./LogLevel.js";
|
|
3
3
|
|
|
4
4
|
export class Logger {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.backends = [];
|
|
12
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
* @type {LoggerBackend[]}
|
|
9
|
+
*/
|
|
10
|
+
backends = [];
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* Add a logging backend, this is a structure that handles incoming log messages.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoggerBackend.d.ts","sourceRoot":"","sources":["../../../../src/engine/logging/LoggerBackend.js"],"names":[],"mappings":"AAEA;
|
|
1
|
+
{"version":3,"file":"LoggerBackend.d.ts","sourceRoot":"","sources":["../../../../src/engine/logging/LoggerBackend.js"],"names":[],"mappings":"AAEA;IAGI;;;OAGG;IACH,cAAsB;IAGtB;;;OAGG;IACH,YAFa,QAAQ,GAAC,MAAM,CAI3B;IAED;;;OAGG;IACH,YAFW,QAAQ,QAIlB;IAED;;;;;OAKG;IACH,WAJW,QAAQ,WACR,MAAM,GACJ,IAAI,CAIhB;CACJ;yBArCwB,eAAe"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { LogLevel } from "./LogLevel.js";
|
|
2
2
|
|
|
3
3
|
export class LoggerBackend {
|
|
4
|
-
constructor() {
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* @type {LogLevel|number}
|
|
9
|
+
*/
|
|
10
|
+
level = LogLevel.Info;
|
|
11
|
+
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContinuousGridCellAction.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/actions/ContinuousGridCellAction.js"],"names":[],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"file":"ContinuousGridCellAction.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/actions/ContinuousGridCellAction.js"],"names":[],"mappings":"AAAA;IAEI;;;;OAIG;IACH,sBAAsB;IAGtB;;;OAGG;IACH,2BAEC;IAED;;;;;OAKG;IACH,iBAJW,MAAM,qDAMhB;IAED,iBAEC;IAED;;;;;;;;OAQG;IACH,wDALW,MAAM,KACN,MAAM,YACN,MAAM,8BAKhB;IAIL;;;OAGG;IACH,qCAFU,OAAO,CAE4C;CAP5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContinuousGridCellActionSetTerrainHeight.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js"],"names":[],"mappings":"AAQA;
|
|
1
|
+
{"version":3,"file":"ContinuousGridCellActionSetTerrainHeight.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js"],"names":[],"mappings":"AAQA;IAEI;;;OAGG;IACH,eAFU,SAAS,CAEE;IAErB;;;OAGG;IACH,mBAAwC;IAGxC,iDAeC;IAED,iFAsDC;CACJ;yCAzFwC,+BAA+B;0BAF9C,uDAAuD"}
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
1
2
|
import { lerp } from "../../../core/math/lerp.js";
|
|
2
3
|
import { min2 } from "../../../core/math/min2.js";
|
|
3
|
-
import {
|
|
4
|
+
import { obtainTerrain } from "../../../engine/ecs/terrain/util/obtainTerrain.js";
|
|
4
5
|
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
5
|
-
import { assert } from "../../../core/assert.js";
|
|
6
6
|
import { CellFilterLiteralFloat } from "../../filtering/numeric/CellFilterLiteralFloat.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ContinuousGridCellAction } from "./ContinuousGridCellAction.js";
|
|
8
8
|
|
|
9
9
|
export class ContinuousGridCellActionSetTerrainHeight extends ContinuousGridCellAction {
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {Sampler2D}
|
|
14
|
+
*/
|
|
15
|
+
heightSampler = null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Target height
|
|
19
|
+
* @type {CellFilter}
|
|
20
|
+
*/
|
|
21
|
+
target = CellFilterLiteralFloat.from(0);
|
|
18
22
|
|
|
19
|
-
/**
|
|
20
|
-
* Target height
|
|
21
|
-
* @type {CellFilter}
|
|
22
|
-
*/
|
|
23
|
-
this.target = CellFilterLiteralFloat.from(0);
|
|
24
|
-
}
|
|
25
23
|
|
|
26
24
|
initialize(seed, ecd, grid) {
|
|
27
25
|
super.initialize(seed, ecd, grid);
|
|
@@ -57,8 +55,8 @@ export class ContinuousGridCellActionSetTerrainHeight extends ContinuousGridCell
|
|
|
57
55
|
const gs_x_1 = g_width - 1;
|
|
58
56
|
const gs_y_1 = g_height - 1;
|
|
59
57
|
|
|
60
|
-
const u = x / gs_x_1;
|
|
61
|
-
const v = y / gs_y_1;
|
|
58
|
+
const u = gs_x_1 > 0 ? x / gs_x_1 : 0;
|
|
59
|
+
const v = gs_y_1 > 0 ? y / gs_y_1 : 0;
|
|
62
60
|
|
|
63
61
|
const hs_x_1 = h_width - 1;
|
|
64
62
|
const hs_y_1 = h_height - 1;
|
|
@@ -68,16 +66,16 @@ export class ContinuousGridCellActionSetTerrainHeight extends ContinuousGridCell
|
|
|
68
66
|
|
|
69
67
|
//round down to nearest integer
|
|
70
68
|
const x0 = Math.floor(s_x);
|
|
71
|
-
const x1 = min2(hs_x_1, Math.ceil(s_x
|
|
69
|
+
const x1 = min2(hs_x_1, Math.ceil(s_x ));
|
|
72
70
|
|
|
73
71
|
const y0 = Math.floor(s_y);
|
|
74
|
-
const y1 = min2(hs_y_1, Math.ceil(s_y
|
|
72
|
+
const y1 = min2(hs_y_1, Math.ceil(s_y ));
|
|
75
73
|
|
|
76
|
-
for (let _y = y0; _y
|
|
74
|
+
for (let _y = y0; _y <= y1; _y++) {
|
|
77
75
|
//convert coordinates to grid space
|
|
78
76
|
const _gy = (_y / hs_y_1) * gs_y_1;
|
|
79
77
|
|
|
80
|
-
for (let _x = x0; _x
|
|
78
|
+
for (let _x = x0; _x <= x1; _x++) {
|
|
81
79
|
|
|
82
80
|
//convert coordinates to grid space
|
|
83
81
|
const _gx = (_x / hs_x_1) * gs_x_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskDensityMarkerDistribution.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskDensityMarkerDistribution.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridTaskDensityMarkerDistribution.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskDensityMarkerDistribution.js"],"names":[],"mappings":"AAwBA;IA4BI;;;;;;OAMG;IACH,2EAHW,eAAe,SACf,MAAM,qCAgBhB;IA/CD;;;OAGG;IACH,oBAAe;IAEf;;;OAGG;IACH,kCAAc;IAEd;;;OAGG;IACH,OAFU,eAAe,CAES;IAElC;;;;OAIG;IACH,eAAW;IA2BX;;;;;;;OAOG;IACH,6EAkFC;IAED;;;;;;;;;OASG;IACH,kBARW,MAAM,sBAEN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,IAAI,CAkIhB;IAGD,iDAkEC;CACJ;kCA3WiC,yBAAyB;gCAT3B,gDAAgD;iBAI/D,oCAAoC;sBAC/B,yCAAyC"}
|
|
@@ -19,41 +19,36 @@ import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
|
19
19
|
* @param {number} radius
|
|
20
20
|
*/
|
|
21
21
|
function estimateDensityTarget(radius) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return area;
|
|
22
|
+
return Math.PI * radius * radius;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
|
|
28
25
|
export class GridTaskDensityMarkerDistribution extends GridTaskGenerator {
|
|
29
|
-
constructor() {
|
|
30
|
-
super();
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @type {CellFilter}
|
|
30
|
+
*/
|
|
31
|
+
density = null;
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {GridCellActionPlaceMarker}
|
|
36
|
+
*/
|
|
37
|
+
action = null;
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {NumericInterval}
|
|
42
|
+
*/
|
|
43
|
+
scale = new NumericInterval(1, 1);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* RNG seed offset
|
|
47
|
+
* @type {number}
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
__seed = 0;
|
|
49
51
|
|
|
50
|
-
/**
|
|
51
|
-
* RNG seed offset
|
|
52
|
-
* @type {number}
|
|
53
|
-
* @private
|
|
54
|
-
*/
|
|
55
|
-
this.__seed = 0;
|
|
56
|
-
}
|
|
57
52
|
|
|
58
53
|
/**
|
|
59
54
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskExecuteRuleTimes.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskExecuteRuleTimes.js"],"names":[],"mappings":"AAUA;
|
|
1
|
+
{"version":3,"file":"GridTaskExecuteRuleTimes.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskExecuteRuleTimes.js"],"names":[],"mappings":"AAUA;IAUI;;;;OAIG;IACH,iDAFW,MAAM,4BAShB;IApBG;;;OAGG;IACH,4BAAY;IAEZ,cAAU;IAgBd,iDA+EC;CACJ;kCA1GiC,yBAAyB;sBAHrC,yCAAyC"}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
+
import { BitSet } from "../../../core/binary/BitSet.js";
|
|
2
|
+
import { PI_HALF } from "../../../core/math/PI_HALF.js";
|
|
3
|
+
import { randomIntegerBetween } from "../../../core/math/random/randomIntegerBetween.js";
|
|
1
4
|
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
2
|
-
import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
3
5
|
import Task from "../../../core/process/task/Task.js";
|
|
4
|
-
import { TaskSignal } from "../../../core/process/task/TaskSignal.js";
|
|
5
|
-
import { BitSet } from "../../../core/binary/BitSet.js";
|
|
6
6
|
import TaskGroup from "../../../core/process/task/TaskGroup.js";
|
|
7
|
-
import {
|
|
7
|
+
import { TaskSignal } from "../../../core/process/task/TaskSignal.js";
|
|
8
8
|
import { actionTask } from "../../../core/process/task/util/actionTask.js";
|
|
9
|
-
import {
|
|
9
|
+
import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
10
10
|
|
|
11
11
|
export class GridTaskExecuteRuleTimes extends GridTaskGenerator {
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
14
|
*
|
|
17
15
|
* @type {GridCellPlacementRule}
|
|
18
16
|
*/
|
|
19
|
-
|
|
17
|
+
rule = null;
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
count = 1;
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskSequence.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskSequence.js"],"names":[],"mappings":"AAGA;
|
|
1
|
+
{"version":3,"file":"GridTaskSequence.d.ts","sourceRoot":"","sources":["../../../../../src/generation/grid/generation/GridTaskSequence.js"],"names":[],"mappings":"AAGA;IAQI;;;;OAIG;IACH,sBAHW,iBAAiB,EAAE,GACjB,gBAAgB,CAQ5B;IAjBG;;;OAGG;IACH,UAFU,iBAAiB,EAAE,CAEf;IAelB,iDA2BC;CACJ;kCAnDiC,yBAAyB;sBADrC,yCAAyC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
2
1
|
import TaskGroup from "../../../core/process/task/TaskGroup.js";
|
|
2
|
+
import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
3
3
|
|
|
4
4
|
export class GridTaskSequence extends GridTaskGenerator {
|
|
5
|
-
constructor() {
|
|
6
|
-
super();
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
*
|
|
10
8
|
* @type {GridTaskGenerator[]}
|
|
11
9
|
*/
|
|
12
|
-
|
|
13
|
-
}
|
|
10
|
+
children = [];
|
|
14
11
|
|
|
15
12
|
/**
|
|
16
13
|
*
|
|
@@ -24,4 +24,4 @@ export class GridTaskActionRuleSet extends GridTaskGenerator {
|
|
|
24
24
|
build(grid: any, ecd: any, seed: any): any;
|
|
25
25
|
}
|
|
26
26
|
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
27
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=GridTaskActionRuleSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridTaskActionRuleSet.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskActionRuleSet.js"],"names":[],"mappings":"AAGA;IAcI;;;;;;OAMG;IACH;;;;QAFa,qBAAqB,CAejC;IAhCD;;;OAGG;IACH,yBAAa;IAEb;;;OAGG;IACH,YAFU,MAAM,CAED;IAwBf,2CAEC;CACJ;kCAzCiC,4BAA4B"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
2
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
+
import { GridTaskGenerator } from "../../GridTaskGenerator.js";
|
|
3
3
|
|
|
4
4
|
export class GridTaskActionRuleSet extends GridTaskGenerator {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
this.resolution = 1;
|
|
19
|
-
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @type {GridActionRuleSet}
|
|
9
|
+
*/
|
|
10
|
+
rules = null;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @type {number}
|
|
15
|
+
*/
|
|
16
|
+
resolution = 1;
|
|
20
17
|
|
|
21
18
|
/**
|
|
22
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskConnectRooms.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH;
|
|
1
|
+
{"version":3,"file":"GridTaskConnectRooms.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH;IAqDI;;;;;;;OAOG;IACH;;;;;QAFa,oBAAoB,CAiBhC;IA1ED;;;OAGG;IACH,qBAAe;IAEf;;;OAGG;IACH,wBAAoC;IAEpC;;;OAGG;IACH,yBAFU,MAAM,EAAE,CAShB;IAEF;;;OAGG;IACH,uBAFU,MAAM,EAAE,CAahB;IAEF,kBAAc;IAEd;;;OAGG;IACH,uBAAa;IA4Bb;;;;;OAKG;IACH,sCAHW,OAAO,GACL,IAAI,CAqChB;IAED;;;;;;OAMG;IACH,qBALW,MAAM,KACN,MAAM,6BAEN,MAAM,QA8DhB;IAED;;;;;;;OAOG;IACH,mCANW,OAAO,aACP,WAAW,6BAEX,MAAM,GACJ,OAAO,CAwFnB;IAED;;;;;;;;OAQG;IACH,gBAPW,MAAM,KACN,MAAM,aACN,MAAM,6BAEN,WAAW,aACX,MAAM,QAuEhB;IAED;;;;;;;OAOG;IACH,mCALW,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,GACN,SAAS,CAyBrB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,0BAEN,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,QAWlB;IAED,iDAuEC;CACJ;kCAxfiC,4BAA4B;oBAT1C,kCAAkC;iBAErC,uCAAuC;uBANjC,mCAAmC;0BAUhC,0DAA0D;sBAH9D,4CAA4C"}
|