@shipload/sdk 1.0.0-next.51 → 1.0.0-next.53

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 (60) hide show
  1. package/lib/shipload.d.ts +471 -158
  2. package/lib/shipload.js +2320 -485
  3. package/lib/shipload.js.map +1 -1
  4. package/lib/shipload.m.js +2290 -484
  5. package/lib/shipload.m.js.map +1 -1
  6. package/lib/testing.d.ts +123 -8
  7. package/lib/testing.js +450 -19
  8. package/lib/testing.js.map +1 -1
  9. package/lib/testing.m.js +451 -20
  10. package/lib/testing.m.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/capabilities/crafting.ts +10 -1
  13. package/src/capabilities/gathering.ts +1 -1
  14. package/src/capabilities/hauling.ts +0 -5
  15. package/src/capabilities/modules.ts +6 -0
  16. package/src/capabilities/movement.ts +1 -1
  17. package/src/contracts/server.ts +293 -13
  18. package/src/data/capabilities.ts +18 -2
  19. package/src/data/capability-formulas.ts +5 -0
  20. package/src/data/entities.json +235 -20
  21. package/src/data/item-ids.ts +10 -0
  22. package/src/data/items.json +61 -0
  23. package/src/data/kind-registry.json +53 -1
  24. package/src/data/kind-registry.ts +5 -0
  25. package/src/data/metadata.ts +74 -5
  26. package/src/data/recipes-runtime.ts +1 -0
  27. package/src/data/recipes.json +895 -119
  28. package/src/derivation/capabilities.test.ts +105 -4
  29. package/src/derivation/capabilities.ts +162 -57
  30. package/src/derivation/capability-mappings.ts +2 -0
  31. package/src/derivation/crafting.ts +2 -0
  32. package/src/derivation/recipe-usage.test.ts +10 -7
  33. package/src/derivation/rollups.ts +16 -0
  34. package/src/derivation/stat-scaling.ts +12 -0
  35. package/src/entities/makers.ts +10 -1
  36. package/src/index-module.ts +29 -3
  37. package/src/managers/actions.ts +77 -46
  38. package/src/managers/construction-types.ts +2 -2
  39. package/src/managers/construction.ts +15 -15
  40. package/src/managers/plot.ts +1 -1
  41. package/src/nft/buildImmutableData.ts +55 -9
  42. package/src/nft/description.ts +99 -36
  43. package/src/planner/planner.test.ts +50 -41
  44. package/src/resolution/resolve-item.test.ts +1 -1
  45. package/src/resolution/resolve-item.ts +26 -11
  46. package/src/scheduling/availability.ts +7 -6
  47. package/src/scheduling/cancel.test.ts +40 -6
  48. package/src/scheduling/cancel.ts +21 -29
  49. package/src/scheduling/jobs.ts +71 -0
  50. package/src/scheduling/lanes.ts +29 -0
  51. package/src/scheduling/projection.ts +42 -25
  52. package/src/scheduling/task-cargo.ts +1 -1
  53. package/src/testing/projection-parity.ts +2 -2
  54. package/src/travel/reach.ts +4 -6
  55. package/src/travel/route-planner.ts +60 -49
  56. package/src/travel/route-simulator.ts +3 -7
  57. package/src/travel/travel.ts +14 -5
  58. package/src/types/capabilities.ts +9 -3
  59. package/src/types.ts +5 -3
  60. package/src/managers/flatten-gather-plan.test.ts +0 -80
@@ -27,6 +27,7 @@ export const capabilityNames: string[] = [
27
27
  'Gathering',
28
28
  'Warp',
29
29
  'Crafting',
30
+ 'Build',
30
31
  'Launch',
31
32
  'Hauling',
32
33
  ]
@@ -38,8 +39,17 @@ export const capabilityAttributes: CapabilityAttribute[] = [
38
39
  attribute: 'capacity',
39
40
  description: 'Cargo capacity added by hulls and installed Cargo Hold modules',
40
41
  },
42
+ {
43
+ capability: 'Storage',
44
+ attribute: 'drain',
45
+ description: 'Fixed normal-travel drain contributed by an installed Cargo Hold',
46
+ },
41
47
  {capability: 'Movement', attribute: 'thrust', description: 'Propulsion force'},
42
- {capability: 'Movement', attribute: 'drain', description: 'Energy consumed per movement'},
48
+ {
49
+ capability: 'Movement',
50
+ attribute: 'drain',
51
+ description: 'Total installed energy consumed per tile of normal travel',
52
+ },
43
53
  {
44
54
  capability: 'Energy',
45
55
  attribute: 'capacity',
@@ -64,6 +74,12 @@ export const capabilityAttributes: CapabilityAttribute[] = [
64
74
  description: 'Energy consumed per second while crafting',
65
75
  },
66
76
  {capability: 'Crafting', attribute: 'quality', description: 'Modifier on output quality'},
77
+ {capability: 'Build', attribute: 'speed', description: 'Build progress per second'},
78
+ {
79
+ capability: 'Build',
80
+ attribute: 'drain',
81
+ description: 'Energy consumed per second while building',
82
+ },
67
83
  {capability: 'Launch', attribute: 'range', description: 'Maximum launch distance'},
68
84
  {capability: 'Launch', attribute: 'capacity', description: 'Maximum mass per launch'},
69
85
  {capability: 'Launch', attribute: 'drain', description: 'Energy consumed per launch'},
@@ -80,7 +96,7 @@ export const capabilityAttributes: CapabilityAttribute[] = [
80
96
  {
81
97
  capability: 'Hauling',
82
98
  attribute: 'drain',
83
- description: 'Energy consumed per target during haul-beam operation',
99
+ description: 'Fixed normal-travel drain contributed by an installed Tractor Beam',
84
100
  },
85
101
  ]
86
102
 
@@ -9,6 +9,7 @@ export type SlotConsumerKind =
9
9
  | 'gatherer'
10
10
  | 'loader'
11
11
  | 'crafter'
12
+ | 'builder'
12
13
  | 'storage'
13
14
  | 'hauler'
14
15
  | 'warp'
@@ -47,6 +48,10 @@ export const SLOT_FORMULAS: Record<SlotConsumerKind, Record<number, SlotConsumer
47
48
  0: {capability: 'Crafting', attribute: 'speed'},
48
49
  1: {capability: 'Crafting', attribute: 'drain'},
49
50
  },
51
+ builder: {
52
+ 0: {capability: 'Build', attribute: 'speed'},
53
+ 1: {capability: 'Build', attribute: 'drain'},
54
+ },
50
55
  storage: {
51
56
  0: {capability: 'Storage', attribute: 'capacity'},
52
57
  1: {capability: 'Storage', attribute: 'capacity'},
@@ -1,7 +1,8 @@
1
1
  [
2
2
  {
3
3
  "entityItemId": 10200,
4
- "slots": []
4
+ "slots": [],
5
+ "baseHullmass": 100000
5
6
  },
6
7
  {
7
8
  "entityItemId": 10201,
@@ -31,7 +32,8 @@
31
32
  "outputPct": 80,
32
33
  "maxTier": 1
33
34
  }
34
- ]
35
+ ],
36
+ "baseHullmass": 4000000
35
37
  },
36
38
  {
37
39
  "entityItemId": 10202,
@@ -61,7 +63,8 @@
61
63
  "outputPct": 100,
62
64
  "maxTier": 1
63
65
  }
64
- ]
66
+ ],
67
+ "baseHullmass": 100000
65
68
  },
66
69
  {
67
70
  "entityItemId": 10203,
@@ -76,7 +79,8 @@
76
79
  "outputPct": 200,
77
80
  "maxTier": 1
78
81
  }
79
- ]
82
+ ],
83
+ "baseHullmass": 100000
80
84
  },
81
85
  {
82
86
  "entityItemId": 10204,
@@ -91,7 +95,8 @@
91
95
  "outputPct": 200,
92
96
  "maxTier": 1
93
97
  }
94
- ]
98
+ ],
99
+ "baseHullmass": 100000
95
100
  },
96
101
  {
97
102
  "entityItemId": 10205,
@@ -106,7 +111,8 @@
106
111
  "outputPct": 200,
107
112
  "maxTier": 1
108
113
  }
109
- ]
114
+ ],
115
+ "baseHullmass": 100000
110
116
  },
111
117
  {
112
118
  "entityItemId": 10206,
@@ -126,59 +132,267 @@
126
132
  "outputPct": 100,
127
133
  "maxTier": 1
128
134
  }
129
- ]
135
+ ],
136
+ "baseHullmass": 100000
130
137
  },
131
138
  {
132
139
  "entityItemId": 10207,
133
- "slots": []
140
+ "slots": [],
141
+ "baseHullmass": 100000
134
142
  },
135
143
  {
136
- "entityItemId": 20200,
137
- "slots": []
144
+ "entityItemId": 10208,
145
+ "slots": [
146
+ {
147
+ "type": "crafter",
148
+ "outputPct": 75,
149
+ "maxTier": 1
150
+ },
151
+ {
152
+ "type": "crafter",
153
+ "outputPct": 75,
154
+ "maxTier": 1
155
+ },
156
+ {
157
+ "type": "crafter",
158
+ "outputPct": 75,
159
+ "maxTier": 1
160
+ },
161
+ {
162
+ "type": "crafter",
163
+ "outputPct": 75,
164
+ "maxTier": 1
165
+ },
166
+ {
167
+ "type": "crafter",
168
+ "outputPct": 75,
169
+ "maxTier": 1
170
+ }
171
+ ],
172
+ "baseHullmass": 100000
138
173
  },
139
174
  {
140
- "entityItemId": 20210,
175
+ "entityItemId": 10210,
176
+ "slots": [
177
+ {
178
+ "type": "generator",
179
+ "outputPct": 80,
180
+ "maxTier": 1
181
+ },
182
+ {
183
+ "type": "engine",
184
+ "outputPct": 80,
185
+ "maxTier": 1
186
+ },
187
+ {
188
+ "type": "any",
189
+ "outputPct": 60,
190
+ "maxTier": 1
191
+ }
192
+ ],
193
+ "baseHullmass": 3200000
194
+ },
195
+ {
196
+ "entityItemId": 10211,
141
197
  "slots": [
198
+ {
199
+ "type": "generator",
200
+ "outputPct": 85,
201
+ "maxTier": 1
202
+ },
142
203
  {
143
204
  "type": "engine",
205
+ "outputPct": 85,
206
+ "maxTier": 1
207
+ },
208
+ {
209
+ "type": "gatherer",
144
210
  "outputPct": 100,
145
- "maxTier": 2
211
+ "maxTier": 1
212
+ }
213
+ ],
214
+ "baseHullmass": 3600000
215
+ },
216
+ {
217
+ "entityItemId": 10212,
218
+ "slots": [
219
+ {
220
+ "type": "generator",
221
+ "outputPct": 85,
222
+ "maxTier": 1
223
+ },
224
+ {
225
+ "type": "engine",
226
+ "outputPct": 85,
227
+ "maxTier": 1
146
228
  },
229
+ {
230
+ "type": "loader",
231
+ "outputPct": 100,
232
+ "maxTier": 1
233
+ }
234
+ ],
235
+ "baseHullmass": 3600000
236
+ },
237
+ {
238
+ "entityItemId": 10213,
239
+ "slots": [
147
240
  {
148
241
  "type": "generator",
242
+ "outputPct": 85,
243
+ "maxTier": 1
244
+ },
245
+ {
246
+ "type": "engine",
247
+ "outputPct": 85,
248
+ "maxTier": 1
249
+ },
250
+ {
251
+ "type": "builder",
149
252
  "outputPct": 100,
150
- "maxTier": 2
253
+ "maxTier": 1
254
+ }
255
+ ],
256
+ "baseHullmass": 4400000
257
+ },
258
+ {
259
+ "entityItemId": 10214,
260
+ "slots": [
261
+ {
262
+ "type": "generator",
263
+ "outputPct": 85,
264
+ "maxTier": 1
265
+ },
266
+ {
267
+ "type": "engine",
268
+ "outputPct": 85,
269
+ "maxTier": 1
270
+ },
271
+ {
272
+ "type": "hauler",
273
+ "outputPct": 100,
274
+ "maxTier": 1
275
+ }
276
+ ],
277
+ "baseHullmass": 4400000
278
+ },
279
+ {
280
+ "entityItemId": 10215,
281
+ "slots": [
282
+ {
283
+ "type": "generator",
284
+ "outputPct": 85,
285
+ "maxTier": 1
286
+ },
287
+ {
288
+ "type": "engine",
289
+ "outputPct": 85,
290
+ "maxTier": 1
291
+ },
292
+ {
293
+ "type": "storage",
294
+ "outputPct": 100,
295
+ "maxTier": 1
296
+ }
297
+ ],
298
+ "baseHullmass": 5000000
299
+ },
300
+ {
301
+ "entityItemId": 10216,
302
+ "slots": [
303
+ {
304
+ "type": "generator",
305
+ "outputPct": 90,
306
+ "maxTier": 1
307
+ },
308
+ {
309
+ "type": "engine",
310
+ "outputPct": 90,
311
+ "maxTier": 1
151
312
  },
152
313
  {
153
314
  "type": "gatherer",
154
315
  "outputPct": 100,
155
- "maxTier": 2
316
+ "maxTier": 1
156
317
  },
157
318
  {
158
319
  "type": "gatherer",
159
320
  "outputPct": 100,
160
- "maxTier": 2
321
+ "maxTier": 1
322
+ }
323
+ ],
324
+ "baseHullmass": 4000000
325
+ },
326
+ {
327
+ "entityItemId": 10217,
328
+ "slots": [
329
+ {
330
+ "type": "generator",
331
+ "outputPct": 90,
332
+ "maxTier": 1
161
333
  },
162
334
  {
163
- "type": "any",
164
- "outputPct": 80,
335
+ "type": "engine",
336
+ "outputPct": 90,
337
+ "maxTier": 1
338
+ },
339
+ {
340
+ "type": "gatherer",
341
+ "outputPct": 100,
342
+ "maxTier": 1
343
+ },
344
+ {
345
+ "type": "storage",
346
+ "outputPct": 100,
165
347
  "maxTier": 1
166
348
  }
167
- ]
349
+ ],
350
+ "baseHullmass": 4800000
168
351
  },
169
352
  {
170
- "entityItemId": 20211,
353
+ "entityItemId": 20200,
354
+ "slots": [],
355
+ "baseHullmass": 100000
356
+ },
357
+ {
358
+ "entityItemId": 20210,
171
359
  "slots": [
360
+ {
361
+ "type": "generator",
362
+ "outputPct": 100,
363
+ "maxTier": 2
364
+ },
365
+ {
366
+ "type": "generator",
367
+ "outputPct": 100,
368
+ "maxTier": 2
369
+ },
172
370
  {
173
371
  "type": "engine",
174
372
  "outputPct": 100,
175
373
  "maxTier": 2
176
374
  },
375
+ {
376
+ "type": "gatherer",
377
+ "outputPct": 100,
378
+ "maxTier": 2
379
+ }
380
+ ],
381
+ "baseHullmass": 5760000
382
+ },
383
+ {
384
+ "entityItemId": 20211,
385
+ "slots": [
177
386
  {
178
387
  "type": "generator",
179
388
  "outputPct": 100,
180
389
  "maxTier": 2
181
390
  },
391
+ {
392
+ "type": "engine",
393
+ "outputPct": 100,
394
+ "maxTier": 2
395
+ },
182
396
  {
183
397
  "type": "hauler",
184
398
  "outputPct": 100,
@@ -189,6 +403,7 @@
189
403
  "outputPct": 100,
190
404
  "maxTier": 2
191
405
  }
192
- ]
406
+ ],
407
+ "baseHullmass": 7040000
193
408
  }
194
409
  ]
@@ -70,6 +70,7 @@ export const ITEM_HAULER_T1 = 10106
70
70
  export const ITEM_WARP_T1 = 10107
71
71
  export const ITEM_BATTERY_T1 = 10108
72
72
  export const ITEM_LAUNCHER_T1 = 10109
73
+ export const ITEM_BUILDER_T1 = 10110
73
74
  export const ITEM_CONTAINER_T1_PACKED = 10200
74
75
  export const ITEM_SHIP_T1_PACKED = 10201
75
76
  export const ITEM_WAREHOUSE_T1_PACKED = 10202
@@ -78,6 +79,15 @@ export const ITEM_FACTORY_T1_PACKED = 10204
78
79
  export const ITEM_MASS_DRIVER_T1_PACKED = 10205
79
80
  export const ITEM_MASS_CATCHER_T1_PACKED = 10206
80
81
  export const ITEM_HUB_T1_PACKED = 10207
82
+ export const ITEM_WORKSHOP_T1_PACKED = 10208
83
+ export const ITEM_ROUSTABOUT_T1_PACKED = 10210
84
+ export const ITEM_PROSPECTOR_T1_PACKED = 10211
85
+ export const ITEM_TENDER_T1_PACKED = 10212
86
+ export const ITEM_WRIGHT_T1_PACKED = 10213
87
+ export const ITEM_TUG_T1_PACKED = 10214
88
+ export const ITEM_PORTER_T1_PACKED = 10215
89
+ export const ITEM_WRANGLER_T1_PACKED = 10216
90
+ export const ITEM_DREDGER_T1_PACKED = 10217
81
91
  export const ITEM_PLATE_T2 = 20001
82
92
  export const ITEM_FRAME_T2 = 20002
83
93
  export const ITEM_PLASMA_CELL_T2 = 20003
@@ -479,6 +479,13 @@
479
479
  "tier": 1,
480
480
  "subtype": "launcher"
481
481
  },
482
+ {
483
+ "id": 10110,
484
+ "mass": 960000,
485
+ "type": "module",
486
+ "tier": 1,
487
+ "subtype": "builder"
488
+ },
482
489
  {
483
490
  "id": 10200,
484
491
  "mass": 1900000,
@@ -527,6 +534,60 @@
527
534
  "type": "entity",
528
535
  "tier": 1
529
536
  },
537
+ {
538
+ "id": 10208,
539
+ "mass": 1900000,
540
+ "type": "entity",
541
+ "tier": 1
542
+ },
543
+ {
544
+ "id": 10210,
545
+ "mass": 1600000,
546
+ "type": "entity",
547
+ "tier": 1
548
+ },
549
+ {
550
+ "id": 10211,
551
+ "mass": 2400000,
552
+ "type": "entity",
553
+ "tier": 1
554
+ },
555
+ {
556
+ "id": 10212,
557
+ "mass": 2400000,
558
+ "type": "entity",
559
+ "tier": 1
560
+ },
561
+ {
562
+ "id": 10213,
563
+ "mass": 2400000,
564
+ "type": "entity",
565
+ "tier": 1
566
+ },
567
+ {
568
+ "id": 10214,
569
+ "mass": 2400000,
570
+ "type": "entity",
571
+ "tier": 1
572
+ },
573
+ {
574
+ "id": 10215,
575
+ "mass": 2400000,
576
+ "type": "entity",
577
+ "tier": 1
578
+ },
579
+ {
580
+ "id": 10216,
581
+ "mass": 3600000,
582
+ "type": "entity",
583
+ "tier": 1
584
+ },
585
+ {
586
+ "id": 10217,
587
+ "mass": 3600000,
588
+ "type": "entity",
589
+ "tier": 1
590
+ },
530
591
  {
531
592
  "id": 20001,
532
593
  "mass": 4800,
@@ -69,14 +69,61 @@
69
69
  "capabilityFlags": 4,
70
70
  "zCoord": 0,
71
71
  "defaultLabel": "Station Hub"
72
+ },
73
+ {
74
+ "kind": "workshop",
75
+ "classification": "OrbitalStructure",
76
+ "capabilityFlags": 20,
77
+ "zCoord": 0,
78
+ "defaultLabel": "Workshop"
72
79
  }
73
80
  ],
74
81
  "templates": [
75
82
  {
76
83
  "itemId": 10201,
77
84
  "kind": "ship",
85
+ "displayLabel": "Ship"
86
+ },
87
+ {
88
+ "itemId": 10210,
89
+ "kind": "ship",
78
90
  "displayLabel": "Roustabout"
79
91
  },
92
+ {
93
+ "itemId": 10211,
94
+ "kind": "ship",
95
+ "displayLabel": "Prospector"
96
+ },
97
+ {
98
+ "itemId": 10212,
99
+ "kind": "ship",
100
+ "displayLabel": "Tender"
101
+ },
102
+ {
103
+ "itemId": 10213,
104
+ "kind": "ship",
105
+ "displayLabel": "Wright"
106
+ },
107
+ {
108
+ "itemId": 10214,
109
+ "kind": "ship",
110
+ "displayLabel": "Tug"
111
+ },
112
+ {
113
+ "itemId": 10215,
114
+ "kind": "ship",
115
+ "displayLabel": "Porter"
116
+ },
117
+ {
118
+ "itemId": 10216,
119
+ "kind": "ship",
120
+ "displayLabel": "Wrangler"
121
+ },
122
+ {
123
+ "itemId": 10217,
124
+ "kind": "ship",
125
+ "displayLabel": "Dredger"
126
+ },
80
127
  {
81
128
  "itemId": 10202,
82
129
  "kind": "warehouse",
@@ -117,6 +164,11 @@
117
164
  "kind": "hub",
118
165
  "displayLabel": ""
119
166
  },
167
+ {
168
+ "itemId": 10208,
169
+ "kind": "workshop",
170
+ "displayLabel": ""
171
+ },
120
172
  {
121
173
  "itemId": 20210,
122
174
  "kind": "ship",
@@ -125,7 +177,7 @@
125
177
  {
126
178
  "itemId": 20211,
127
179
  "kind": "ship",
128
- "displayLabel": "Hauler"
180
+ "displayLabel": "Tug"
129
181
  }
130
182
  ]
131
183
  }
@@ -26,6 +26,7 @@ export type EntityTypeName =
26
26
  | 'warehouse'
27
27
  | 'extractor'
28
28
  | 'factory'
29
+ | 'workshop'
29
30
  | 'container'
30
31
  | 'nexus'
31
32
  | 'plot'
@@ -133,6 +134,7 @@ export const ENTITY_SHIP = Name.from('ship')
133
134
  export const ENTITY_WAREHOUSE = Name.from('warehouse')
134
135
  export const ENTITY_EXTRACTOR = Name.from('extractor')
135
136
  export const ENTITY_FACTORY = Name.from('factory')
137
+ export const ENTITY_WORKSHOP = Name.from('workshop')
136
138
  export const ENTITY_CONTAINER = Name.from('container')
137
139
  export const ENTITY_NEXUS = Name.from('nexus')
138
140
  export const ENTITY_PLOT = Name.from('plot')
@@ -152,6 +154,9 @@ export function isExtractor(entity: {type?: Name}): boolean {
152
154
  export function isFactory(entity: {type?: Name}): boolean {
153
155
  return entity.type?.equals(ENTITY_FACTORY) ?? false
154
156
  }
157
+ export function isWorkshop(entity: {type?: Name}): boolean {
158
+ return entity.type?.equals(ENTITY_WORKSHOP) ?? false
159
+ }
155
160
  export function isContainer(entity: {type?: Name}): boolean {
156
161
  return entity.type?.equals(ENTITY_CONTAINER) ?? false
157
162
  }