@ak--47/dungeon-master 1.0.0 → 1.2.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 (104) hide show
  1. package/README.md +7 -7
  2. package/dungeons/technical/ad-spend-schema.json +128 -0
  3. package/dungeons/technical/ad-spend.js +116 -0
  4. package/dungeons/technical/anonymous-users-schema.json +92 -0
  5. package/dungeons/technical/anonymous-users.js +102 -0
  6. package/dungeons/technical/array-of-object-lookup-schema.json +191 -0
  7. package/dungeons/{array-of-object-lookup.js → technical/array-of-object-lookup.js} +12 -5
  8. package/dungeons/technical/experiments-schema.json +203 -0
  9. package/dungeons/technical/experiments.js +168 -0
  10. package/dungeons/technical/foobar-schema.json +362 -0
  11. package/dungeons/{foobar.js → technical/foobar.js} +3 -3
  12. package/dungeons/technical/group-analytics-schema.json +241 -0
  13. package/dungeons/technical/group-analytics.js +151 -0
  14. package/dungeons/technical/mirror-strategies-schema.json +84 -0
  15. package/dungeons/technical/mirror-strategies.js +126 -0
  16. package/dungeons/technical/nested-objects-schema.json +145 -0
  17. package/dungeons/technical/nested-objects.js +207 -0
  18. package/dungeons/technical/retention-cadence-schema.json +37 -0
  19. package/dungeons/{retention-cadence.js → technical/retention-cadence.js} +2 -3
  20. package/dungeons/technical/sanity-schema.json +185 -0
  21. package/dungeons/{sanity.js → technical/sanity.js} +4 -2
  22. package/dungeons/technical/scale-test-schema.json +70 -0
  23. package/dungeons/technical/scale-test.js +90 -0
  24. package/dungeons/technical/scd-schema.json +467 -0
  25. package/dungeons/{scd.js → technical/scd.js} +20 -10
  26. package/dungeons/technical/simple-schema.json +362 -0
  27. package/dungeons/{simple.js → technical/simple.js} +7 -7
  28. package/dungeons/technical/simplest-schema.json +724 -0
  29. package/dungeons/{simplest.js → technical/simplest.js} +7 -7
  30. package/dungeons/technical/text-generation-schema.json +1062 -0
  31. package/dungeons/{text-generation.js → technical/text-generation.js} +24 -11
  32. package/dungeons/vertical/community-schema.json +579 -0
  33. package/dungeons/vertical/community.js +794 -0
  34. package/dungeons/vertical/devtools-schema.json +601 -0
  35. package/dungeons/vertical/devtools.js +843 -0
  36. package/dungeons/vertical/ecommerce-schema.json +604 -0
  37. package/dungeons/{ecommerce.js → vertical/ecommerce.js} +43 -5
  38. package/dungeons/vertical/education-schema.json +5686 -0
  39. package/dungeons/{education.js → vertical/education.js} +70 -39
  40. package/dungeons/vertical/fintech-schema.json +630 -0
  41. package/dungeons/{fintech.js → vertical/fintech.js} +107 -56
  42. package/dungeons/vertical/fitness-schema.json +530 -0
  43. package/dungeons/vertical/fitness.js +808 -0
  44. package/dungeons/vertical/food-delivery-schema.json +36728 -0
  45. package/dungeons/{food.js → vertical/food-delivery.js} +67 -26
  46. package/dungeons/vertical/gaming-schema.json +438 -0
  47. package/dungeons/{gaming.js → vertical/gaming.js} +29 -16
  48. package/dungeons/vertical/healthcare-schema.json +549 -0
  49. package/dungeons/vertical/healthcare.js +775 -0
  50. package/dungeons/vertical/insurance-application-schema.json +485 -0
  51. package/dungeons/{insurance-application.js → vertical/insurance-application.js} +41 -31
  52. package/dungeons/vertical/logistics-schema.json +574 -0
  53. package/dungeons/vertical/logistics.js +799 -0
  54. package/dungeons/vertical/marketplace-schema.json +533 -0
  55. package/dungeons/vertical/marketplace.js +850 -0
  56. package/dungeons/vertical/media-schema.json +4749 -0
  57. package/dungeons/{media.js → vertical/media.js} +103 -19
  58. package/dungeons/vertical/rpg-schema.json +2491 -0
  59. package/dungeons/{rpg.js → vertical/rpg.js} +87 -60
  60. package/dungeons/vertical/sass-schema.json +3128 -0
  61. package/dungeons/{sass.js → vertical/sass.js} +65 -26
  62. package/dungeons/vertical/social-schema.json +620 -0
  63. package/dungeons/{social.js → vertical/social.js} +76 -17
  64. package/dungeons/vertical/travel-schema.json +580 -0
  65. package/dungeons/vertical/travel.js +742 -0
  66. package/index.js +20 -16
  67. package/lib/core/config-validator.js +286 -1
  68. package/lib/core/context.js +16 -5
  69. package/lib/core/storage.js +2 -0
  70. package/lib/generators/adspend.js +3 -3
  71. package/lib/generators/events.js +141 -14
  72. package/lib/generators/funnels.js +67 -7
  73. package/lib/generators/text.js +2 -2
  74. package/lib/orchestrators/user-loop.js +444 -22
  75. package/lib/templates/soup-presets.js +2 -2
  76. package/lib/utils/utils.js +4 -5
  77. package/package.json +4 -3
  78. package/scripts/dungeon-to-json.mjs +163 -0
  79. package/scripts/extract-dungeon-schema.mjs +343 -0
  80. package/scripts/json-to-dungeon.mjs +200 -0
  81. package/scripts/run-dungeon.mjs +76 -0
  82. package/scripts/run-many.mjs +118 -0
  83. package/scripts/verify-runner.mjs +42 -0
  84. package/types.d.ts +316 -1
  85. package/dungeons/array-of-object-lookup-schema.json +0 -327
  86. package/dungeons/ecommerce-schema.json +0 -462
  87. package/dungeons/education-schema.json +0 -2409
  88. package/dungeons/fintech-schema.json +0 -14034
  89. package/dungeons/foobar-schema.json +0 -403
  90. package/dungeons/food-delivery-schema.json +0 -192
  91. package/dungeons/food-delivery.js +0 -602
  92. package/dungeons/food-schema.json +0 -1152
  93. package/dungeons/gaming-schema.json +0 -1270
  94. package/dungeons/insurance-application-schema.json +0 -204
  95. package/dungeons/media-schema.json +0 -906
  96. package/dungeons/retention-cadence-schema.json +0 -78
  97. package/dungeons/rpg-schema.json +0 -4526
  98. package/dungeons/sanity-schema.json +0 -255
  99. package/dungeons/sass-schema.json +0 -1291
  100. package/dungeons/scd-schema.json +0 -919
  101. package/dungeons/simple-schema.json +0 -608
  102. package/dungeons/simplest-schema.json +0 -1418
  103. package/dungeons/social-schema.json +0 -1118
  104. package/dungeons/text-generation-schema.json +0 -3096
@@ -0,0 +1,438 @@
1
+ {
2
+ "events": [
3
+ {
4
+ "event": "app install",
5
+ "weight": 10,
6
+ "isFirstEvent": true
7
+ },
8
+ {
9
+ "event": "character creation",
10
+ "weight": 2,
11
+ "properties": {
12
+ "mode": [
13
+ "fast",
14
+ "slow",
15
+ "template"
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "event": "join party",
21
+ "weight": 8,
22
+ "properties": {
23
+ "party size": {
24
+ "$range": [
25
+ 2,
26
+ 5
27
+ ]
28
+ },
29
+ "party leader": [
30
+ "Bard",
31
+ "Cleric",
32
+ "Fighter",
33
+ "Rogue",
34
+ "Wizard",
35
+ "Paladin",
36
+ "Ranger",
37
+ "Sorcerer",
38
+ "Warlock"
39
+ ]
40
+ }
41
+ },
42
+ {
43
+ "event": "start quest",
44
+ "weight": 12,
45
+ "properties": {
46
+ "quest type": [
47
+ "Rescue",
48
+ "Retrieve",
49
+ "Explore",
50
+ "Destroy",
51
+ "Investigate"
52
+ ],
53
+ "quest difficulty": [
54
+ "Easy",
55
+ "Medium",
56
+ "Hard",
57
+ "Legendary"
58
+ ],
59
+ "quest location": [
60
+ "Forest",
61
+ "Dungeon",
62
+ "Mountain",
63
+ "City",
64
+ "Desert"
65
+ ],
66
+ "party size": {
67
+ "$range": [
68
+ 2,
69
+ 5
70
+ ]
71
+ },
72
+ "used hint": [
73
+ "no",
74
+ "yes"
75
+ ],
76
+ "used boost": [
77
+ "no",
78
+ "yes"
79
+ ],
80
+ "level at start": {
81
+ "$range": [
82
+ 2,
83
+ 17
84
+ ]
85
+ }
86
+ }
87
+ },
88
+ {
89
+ "event": "complete quest",
90
+ "weight": 12,
91
+ "properties": {
92
+ "completion time (mins)": {
93
+ "$range": [
94
+ 20,
95
+ 115
96
+ ]
97
+ },
98
+ "quest reward (gold)": {
99
+ "$range": [
100
+ 11,
101
+ 451
102
+ ]
103
+ },
104
+ "quest success": [
105
+ "yes",
106
+ "no"
107
+ ],
108
+ "used hint": [
109
+ "no",
110
+ "yes"
111
+ ],
112
+ "used boost": [
113
+ "no",
114
+ "yes"
115
+ ],
116
+ "number of deaths": [
117
+ 1,
118
+ 3
119
+ ],
120
+ "level at start": {
121
+ "$range": [
122
+ 2,
123
+ 19
124
+ ]
125
+ },
126
+ "level at end": {
127
+ "$range": [
128
+ 2,
129
+ 19
130
+ ]
131
+ }
132
+ }
133
+ },
134
+ {
135
+ "event": "gameplay summary",
136
+ "weight": 14,
137
+ "properties": {
138
+ "# enemies defeated": {
139
+ "$range": [
140
+ 7,
141
+ 93
142
+ ]
143
+ },
144
+ "# respawns": {
145
+ "$range": [
146
+ 0,
147
+ 10
148
+ ]
149
+ },
150
+ "# attacks": {
151
+ "$range": [
152
+ 14,
153
+ 52
154
+ ]
155
+ },
156
+ "# gold found": {
157
+ "$range": [
158
+ 49,
159
+ 886
160
+ ]
161
+ }
162
+ }
163
+ },
164
+ {
165
+ "event": "in-game purchase",
166
+ "weight": 2,
167
+ "properties": {
168
+ "purchase type": [
169
+ "Gold",
170
+ "Gems",
171
+ "Items: Weapons",
172
+ "Items: Armor",
173
+ "Items: Potions",
174
+ "Items: Scrolls",
175
+ "Boosts",
176
+ "Currency"
177
+ ],
178
+ "purchase amount": {
179
+ "$range": [
180
+ 3,
181
+ 36
182
+ ]
183
+ },
184
+ "is_whale": [
185
+ false
186
+ ]
187
+ }
188
+ },
189
+ {
190
+ "event": "fight boss",
191
+ "weight": 3,
192
+ "properties": {
193
+ "boss type": [
194
+ "Dragon",
195
+ "Demon",
196
+ "Lich",
197
+ "Vampire",
198
+ "Beholder"
199
+ ],
200
+ "boss level": {
201
+ "$range": [
202
+ 10,
203
+ 18
204
+ ]
205
+ },
206
+ "boss difficulty": [
207
+ "Hard",
208
+ "Legendary",
209
+ "Impossible"
210
+ ],
211
+ "fight duration (mins)": {
212
+ "$range": [
213
+ 6,
214
+ 59
215
+ ]
216
+ }
217
+ }
218
+ },
219
+ {
220
+ "event": "level up",
221
+ "properties": {
222
+ "new abilities": [
223
+ "Attack",
224
+ "Spell",
225
+ "Feat",
226
+ "Skill"
227
+ ]
228
+ }
229
+ },
230
+ {
231
+ "event": "attack",
232
+ "weight": 5,
233
+ "properties": {
234
+ "generic_prop": [
235
+ "foo",
236
+ "bar",
237
+ "baz",
238
+ "qux"
239
+ ]
240
+ }
241
+ },
242
+ {
243
+ "event": "defend",
244
+ "weight": 3,
245
+ "properties": {
246
+ "generic_prop": [
247
+ "foo",
248
+ "bar",
249
+ "baz",
250
+ "qux"
251
+ ]
252
+ }
253
+ }
254
+ ],
255
+ "funnels": [
256
+ {
257
+ "sequence": [
258
+ "app install",
259
+ "character creation",
260
+ "join party"
261
+ ],
262
+ "isFirstFunnel": true,
263
+ "conversionRate": 0.8,
264
+ "timeToConvert": 0.25
265
+ },
266
+ {
267
+ "sequence": [
268
+ "start quest",
269
+ "gameplay summary",
270
+ "complete quest"
271
+ ],
272
+ "conversionRate": 0.99,
273
+ "timeToConvert": 1,
274
+ "props": {
275
+ "quest type": [
276
+ "Rescue",
277
+ "Retrieve",
278
+ "Explore",
279
+ "Destroy",
280
+ "Investigate"
281
+ ],
282
+ "quest difficulty": [
283
+ "Easy",
284
+ "Medium",
285
+ "Hard",
286
+ "Legendary"
287
+ ],
288
+ "quest location": [
289
+ "Forest",
290
+ "Dungeon",
291
+ "Mountain",
292
+ "City",
293
+ "Desert"
294
+ ]
295
+ }
296
+ }
297
+ ],
298
+ "superProps": {
299
+ "platform": [
300
+ "Mobile",
301
+ "Xbox",
302
+ "Playstation",
303
+ "Switch",
304
+ "Web"
305
+ ],
306
+ "game mode": [
307
+ "Single Player",
308
+ "Multiplayer"
309
+ ],
310
+ "language": [
311
+ "English",
312
+ "Spanish",
313
+ "French",
314
+ "German",
315
+ "Japanese",
316
+ "Korean",
317
+ "Chinese"
318
+ ]
319
+ },
320
+ "userProps": {
321
+ "experiment": [
322
+ "fast leveling",
323
+ "tension economy",
324
+ "free trial"
325
+ ],
326
+ "variant": [
327
+ "A",
328
+ "B",
329
+ "C",
330
+ "Control"
331
+ ],
332
+ "race": [
333
+ "Human",
334
+ "Elf",
335
+ "Dwarf",
336
+ "Halfling",
337
+ "Dragonborn",
338
+ "Gnome",
339
+ "Half-Elf",
340
+ "Half-Orc",
341
+ "Tiefling"
342
+ ],
343
+ "class": [
344
+ "Barbarian",
345
+ "Bard",
346
+ "Cleric",
347
+ "Druid",
348
+ "Fighter",
349
+ "Monk",
350
+ "Paladin",
351
+ "Ranger",
352
+ "Rogue",
353
+ "Sorcerer",
354
+ "Warlock",
355
+ "Wizard"
356
+ ],
357
+ "alignment": [
358
+ "Lawful Good",
359
+ "Neutral Good",
360
+ "Chaotic Good",
361
+ "Lawful Neutral",
362
+ "True Neutral",
363
+ "Chaotic Neutral",
364
+ "Lawful Evil",
365
+ "Neutral Evil",
366
+ "Chaotic Evil"
367
+ ],
368
+ "level": {
369
+ "$range": [
370
+ 3,
371
+ 15
372
+ ]
373
+ },
374
+ "background": [
375
+ "Acolyte",
376
+ "Charlatan",
377
+ "Criminal",
378
+ "Entertainer",
379
+ "Folk Hero",
380
+ "Guild Artisan",
381
+ "Hermit",
382
+ "Noble",
383
+ "Outlander",
384
+ "Sage",
385
+ "Sailor",
386
+ "Soldier",
387
+ "Urchin"
388
+ ],
389
+ "subscription MRR": {
390
+ "$range": [
391
+ 0,
392
+ 244
393
+ ]
394
+ },
395
+ "archetype": [
396
+ "neutral"
397
+ ]
398
+ },
399
+ "scdProps": {
400
+ "subscription MRR": {
401
+ "type": "user",
402
+ "frequency": "week",
403
+ "timing": "fixed",
404
+ "max": 250,
405
+ "values": {
406
+ "$range": [
407
+ 1,
408
+ 221
409
+ ]
410
+ }
411
+ },
412
+ "player_rank": {
413
+ "type": "user",
414
+ "frequency": "week",
415
+ "timing": "fuzzy",
416
+ "max": 250,
417
+ "values": [
418
+ "bronze",
419
+ "silver",
420
+ "gold",
421
+ "diamond",
422
+ "legendary"
423
+ ]
424
+ },
425
+ "guild_rank": {
426
+ "type": "guild_id",
427
+ "frequency": "month",
428
+ "timing": "fixed",
429
+ "max": 6,
430
+ "values": [
431
+ "bronze",
432
+ "silver",
433
+ "gold",
434
+ "legendary"
435
+ ]
436
+ }
437
+ }
438
+ }
@@ -2,7 +2,7 @@
2
2
  import dayjs from "dayjs";
3
3
  import utc from "dayjs/plugin/utc.js";
4
4
  import "dotenv/config";
5
- import * as u from "../lib/utils/utils.js";
5
+ import * as u from "../../lib/utils/utils.js";
6
6
  import * as v from "ak-tools";
7
7
 
8
8
  const SEED = "my-seed";
@@ -11,7 +11,7 @@ const chance = u.initChance(SEED);
11
11
  const num_users = 12_000;
12
12
  const days = 180;
13
13
 
14
- /** @typedef {import("../types.d.ts").Dungeon} Config */
14
+ /** @typedef {import("../../types").Dungeon} Config */
15
15
 
16
16
  /*
17
17
  * ═══════════════════════════════════════════════════════════════════════════════
@@ -175,7 +175,6 @@ const config = {
175
175
 
176
176
  hasAvatar: true,
177
177
 
178
- batchSize: 2_500_000,
179
178
  concurrency: 1,
180
179
  writeToDisk: false,
181
180
  funnels: [
@@ -265,8 +264,8 @@ const config = {
265
264
  "Desert",
266
265
  ],
267
266
  "party size": u.weighNumRange(1, 6),
268
- "used hint": u.pickAWinner(["yes", "no"], 0.3),
269
- "used boost": u.pickAWinner(["yes", "no"], 0.2),
267
+ "used hint": ["no", "no", "yes"],
268
+ "used boost": ["no", "no", "no", "no", "yes"],
270
269
  "level at start": u.weighNumRange(1, 20),
271
270
  },
272
271
  },
@@ -276,9 +275,9 @@ const config = {
276
275
  properties: {
277
276
  "completion time (mins)": u.weighNumRange(5, 120, 1, 30),
278
277
  "quest reward (gold)": u.weighNumRange(10, 500, 1, 100),
279
- "quest success": u.pickAWinner(["yes", "no"], 0.9),
280
- "used hint": u.pickAWinner(["yes", "no"], 0.3),
281
- "used boost": u.pickAWinner(["yes", "no"], 0.2),
278
+ "quest success": ["yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", "yes", "no"],
279
+ "used hint": ["no", "no", "yes"],
280
+ "used boost": ["no", "no", "no", "no", "yes"],
282
281
  "number of deaths": u.weighNumRange(0, 5, 1, 2),
283
282
  "level at start": u.weighNumRange(1, 20),
284
283
  "level at end": u.weighNumRange(1, 20),
@@ -309,6 +308,7 @@ const config = {
309
308
  "Currency",
310
309
  ],
311
310
  "purchase amount": u.weighNumRange(1, 50, 1, 20),
311
+ is_whale: [false],
312
312
  }
313
313
  },
314
314
  {
@@ -383,13 +383,25 @@ const config = {
383
383
 
384
384
  },
385
385
  scdProps: {
386
- // "subscription MRR" : {
387
- // "frequency": "week",
388
- // "type": "number",
389
- // values: u.weighNumRange(0, 250, 1, 200),
390
- // timing: "fixed",
391
- // max: 250,
392
- // }
386
+ "subscription MRR" : {
387
+ frequency: "week",
388
+ values: u.weighNumRange(0, 250, 1, 200),
389
+ timing: "fixed",
390
+ max: 250,
391
+ },
392
+ player_rank: {
393
+ values: ["bronze", "silver", "gold", "diamond", "legendary"],
394
+ frequency: "week",
395
+ timing: "fuzzy",
396
+ max: 250
397
+ },
398
+ guild_rank: {
399
+ values: ["bronze", "silver", "gold", "legendary"],
400
+ frequency: "month",
401
+ timing: "fixed",
402
+ max: 6,
403
+ type: "guild_id"
404
+ }
393
405
  },
394
406
  userProps: {
395
407
  experiment: [
@@ -451,7 +463,8 @@ const config = {
451
463
  "Soldier",
452
464
  "Urchin",
453
465
  ],
454
- "subscription MRR": u.weighNumRange(0, 250, 1, 200)
466
+ "subscription MRR": u.weighNumRange(0, 250, 1, 200),
467
+ archetype: ["neutral"],
455
468
  },
456
469
  // HOOK: 3 patterns — gold scaling by level, whale purchases, alignment archetype
457
470
  hook: function (record, type, meta) {