make-mp-data 1.5.53 → 1.5.55
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/.vscode/launch.json +4 -2
- package/components/ai.js +30 -2
- package/components/cli.js +1 -2
- package/components/defaults.js +300 -0
- package/components/utils.js +29 -9
- package/dungeons/big.js +173 -109
- package/dungeons/gaming-experiments.js +323 -0
- package/dungeons/simple.js +1 -2
- package/index.js +164 -33
- package/log.json +1067 -0
- package/package.json +6 -4
- package/scratch.mjs +4 -2
- package/scripts/deploy.sh +5 -1
- package/types.d.ts +1 -0
package/dungeons/big.js
CHANGED
|
@@ -1,160 +1,224 @@
|
|
|
1
|
-
|
|
2
|
-
* This is the default configuration file for the data generator in SIMPLE mode
|
|
3
|
-
* notice how the config object is structured, and see it's type definition in ./types.d.ts
|
|
4
|
-
* feel free to modify this file to customize the data you generate
|
|
5
|
-
* see helper functions in utils.js for more ways to generate data
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/* cSpell:disable */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
const seed = "lets go big";
|
|
13
2
|
const Chance = require('chance');
|
|
14
3
|
const chance = new Chance();
|
|
15
4
|
const dayjs = require("dayjs");
|
|
16
5
|
const utc = require("dayjs/plugin/utc");
|
|
17
6
|
dayjs.extend(utc);
|
|
18
|
-
const { uid, comma } = require('ak-tools');
|
|
19
|
-
const { pickAWinner, weighNumRange, date,
|
|
7
|
+
const { uid, comma, makeName } = require('ak-tools');
|
|
8
|
+
const { pickAWinner, weighNumRange, integer, date, choose } = require('../components/utils');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const eventsPerQuarter = 5_000_000_000 // ~5 billion
|
|
12
|
+
const numQuarters = 8; // 24 months
|
|
13
|
+
const parallelism = 5000;
|
|
14
|
+
const totalEvents = Math.floor((eventsPerQuarter * numQuarters) / parallelism);
|
|
15
|
+
const eventPerUser = 500;
|
|
16
|
+
const totalUsers = Math.floor(totalEvents / eventPerUser);
|
|
17
|
+
const totalDays = (numQuarters * 90) + 10;
|
|
20
18
|
|
|
21
19
|
/** @type {import('../types').Dungeon} */
|
|
22
20
|
const config = {
|
|
23
21
|
token: "",
|
|
24
|
-
seed:
|
|
25
|
-
numDays:
|
|
26
|
-
numEvents:
|
|
27
|
-
numUsers:
|
|
28
|
-
format: '
|
|
22
|
+
seed: seed,
|
|
23
|
+
numDays: totalDays,
|
|
24
|
+
numEvents: totalEvents,
|
|
25
|
+
numUsers: totalUsers,
|
|
26
|
+
format: 'json', //csv or json
|
|
29
27
|
region: "US",
|
|
30
|
-
hasAnonIds:
|
|
28
|
+
hasAnonIds: false, //if true, anonymousIds are created for each user
|
|
31
29
|
hasSessionIds: false, //if true, hasSessionIds are created for each user
|
|
32
30
|
hasLocation: true,
|
|
33
|
-
|
|
31
|
+
hasAndroidDevices: false,
|
|
32
|
+
alsoInferFunnels: false,
|
|
33
|
+
batchSize: 2_000_000,
|
|
34
|
+
hasAvatar: false,
|
|
35
|
+
hasAdSpend: false,
|
|
36
|
+
hasBrowser: false,
|
|
37
|
+
hasCampaigns: false,
|
|
38
|
+
hasDesktopDevices: false,
|
|
39
|
+
hasIOSDevices: false,
|
|
40
|
+
writeToDisk: "gs://dungeon_master_4/big_data",
|
|
41
|
+
funnels: [
|
|
34
42
|
{
|
|
35
|
-
|
|
36
|
-
weight:
|
|
37
|
-
|
|
43
|
+
"sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny", "fonk", "crumn", "yak"],
|
|
44
|
+
weight: 1,
|
|
45
|
+
order: "sequential"
|
|
38
46
|
},
|
|
39
47
|
{
|
|
40
|
-
|
|
41
|
-
weight:
|
|
42
|
-
|
|
48
|
+
"sequence": ["foo", "bar"],
|
|
49
|
+
weight: 25,
|
|
50
|
+
order: "sequential"
|
|
43
51
|
},
|
|
44
52
|
{
|
|
45
|
-
|
|
46
|
-
weight:
|
|
47
|
-
|
|
53
|
+
"sequence": ["foo", "bar", "baz"],
|
|
54
|
+
weight: 20,
|
|
55
|
+
order: "sequential"
|
|
48
56
|
},
|
|
49
57
|
{
|
|
50
|
-
|
|
51
|
-
weight:
|
|
52
|
-
|
|
58
|
+
"sequence": ["foo", "bar", "baz", "qux"],
|
|
59
|
+
weight: 15,
|
|
60
|
+
order: "sequential"
|
|
53
61
|
},
|
|
54
62
|
{
|
|
55
|
-
|
|
56
|
-
weight:
|
|
57
|
-
|
|
63
|
+
"sequence": ["foo", "bar", "baz", "qux", "garply"],
|
|
64
|
+
weight: 10,
|
|
65
|
+
order: "sequential"
|
|
58
66
|
},
|
|
59
67
|
{
|
|
60
|
-
|
|
61
|
-
weight:
|
|
62
|
-
|
|
68
|
+
"sequence": ["foo", "bar", "baz", "qux", "garply", "durtle"],
|
|
69
|
+
weight: 8,
|
|
70
|
+
order: "sequential"
|
|
63
71
|
},
|
|
64
72
|
{
|
|
65
|
-
|
|
66
|
-
weight:
|
|
67
|
-
|
|
73
|
+
"sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny"],
|
|
74
|
+
weight: 6,
|
|
75
|
+
order: "sequential"
|
|
68
76
|
},
|
|
69
77
|
{
|
|
70
|
-
|
|
71
|
-
weight:
|
|
72
|
-
|
|
78
|
+
"sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny", "fonk"],
|
|
79
|
+
weight: 4,
|
|
80
|
+
order: "sequential"
|
|
73
81
|
},
|
|
74
82
|
{
|
|
75
|
-
|
|
83
|
+
"sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny", "fonk", "crumn"],
|
|
76
84
|
weight: 2,
|
|
77
|
-
|
|
85
|
+
order: "sequential"
|
|
78
86
|
},
|
|
79
87
|
{
|
|
80
|
-
|
|
88
|
+
"sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny", "fonk", "crumn", "yak"],
|
|
81
89
|
weight: 1,
|
|
82
|
-
|
|
90
|
+
order: "sequential"
|
|
83
91
|
}
|
|
84
|
-
],
|
|
85
|
-
superProps: {
|
|
86
|
-
color: ["red", "orange", "yellow", "green", "blue", "indigo", "violet"],
|
|
87
|
-
number: integer,
|
|
88
92
|
|
|
93
|
+
],
|
|
94
|
+
events: [
|
|
95
|
+
{ event: "foo" },
|
|
96
|
+
{ event: "bar" },
|
|
97
|
+
{ event: "baz" },
|
|
98
|
+
{ event: "qux" },
|
|
99
|
+
{ event: "garply" },
|
|
100
|
+
{ event: "durtle" },
|
|
101
|
+
{ event: "linny" },
|
|
102
|
+
{ event: "fonk" },
|
|
103
|
+
{ event: "crumn" },
|
|
104
|
+
{ event: "yak" }
|
|
105
|
+
],
|
|
106
|
+
//? https://docs.mixpanel.com/docs/data-structure/property-reference/data-type
|
|
107
|
+
superProps: {
|
|
108
|
+
"string": pickAWinner(["red", "orange", "yellow", "green", "blue", "indigo", "violet"]),
|
|
109
|
+
"number": integer,
|
|
110
|
+
"boolean": [true, true, false],
|
|
111
|
+
"date": () => date(90),
|
|
112
|
+
"string []": buildStringArray,
|
|
113
|
+
"number []": buildNumberArray,
|
|
114
|
+
"object {}": buildObjectProp,
|
|
115
|
+
"object [{}]": buildObjArrayProp
|
|
89
116
|
},
|
|
90
117
|
userProps: {
|
|
91
118
|
title: chance.profession.bind(chance),
|
|
92
119
|
luckyNumber: weighNumRange(42, 420),
|
|
93
|
-
spiritAnimal: ["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"]
|
|
120
|
+
spiritAnimal: pickAWinner(["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"]),
|
|
121
|
+
isHappyCustomer: pickAWinner([true, true, false]),
|
|
94
122
|
},
|
|
123
|
+
hook: function (record, type, meta) {
|
|
95
124
|
|
|
96
|
-
scdProps: {
|
|
97
|
-
"donk": ["dude", "man", "brok"],
|
|
98
|
-
"pronk": ["monk", "lonk", "aonk"],
|
|
99
|
-
},
|
|
100
|
-
mirrorProps: {},
|
|
101
|
-
groupKeys: [
|
|
102
|
-
["companies", 100_000],
|
|
103
|
-
["servers", 3_000_000],
|
|
104
|
-
["crews", 1000],
|
|
105
125
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
name: chance.company.bind(chance),
|
|
110
|
-
industry: ["tech", "finance", "healthcare", "education", "retail", "manufacturing", "entertainment", "government", "non-profit", "other"],
|
|
111
|
-
},
|
|
112
|
-
servers: {
|
|
113
|
-
name: chance.word.bind(chance),
|
|
114
|
-
ram: weighNumRange(4, 64, .25),
|
|
115
|
-
cpu: weighNumRange(1, 16, .25),
|
|
126
|
+
// if (type === "event") {
|
|
127
|
+
// debugger;
|
|
128
|
+
// }
|
|
116
129
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"reviews": weighNumRange(0, 35)
|
|
137
|
-
}
|
|
130
|
+
// if (type === "user") {
|
|
131
|
+
|
|
132
|
+
// }
|
|
133
|
+
|
|
134
|
+
// if (type === "funnel-post") {
|
|
135
|
+
|
|
136
|
+
// }
|
|
137
|
+
|
|
138
|
+
// if (type === "funnel-pre") {
|
|
139
|
+
|
|
140
|
+
// }
|
|
141
|
+
|
|
142
|
+
// if (type === "scd") {
|
|
143
|
+
|
|
144
|
+
// }
|
|
145
|
+
|
|
146
|
+
// if (type === "everything") {
|
|
147
|
+
// debugger;
|
|
148
|
+
// }
|
|
138
149
|
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
key: "video_id",
|
|
142
|
-
entries: 10_000_000,
|
|
143
|
-
attributes: {
|
|
144
|
-
isFlagged: [true, false, false, false, false],
|
|
145
|
-
copyright: ["all rights reserved", "creative commons", "creative commons", "public domain", "fair use"],
|
|
146
|
-
uploader_id: chance.guid.bind(chance),
|
|
147
|
-
"uploader influence": ["low", "low", "low", "medium", "medium", "high"],
|
|
148
|
-
thumbs: weighNumRange(0, 35),
|
|
149
|
-
rating: ["G", "PG", "PG-13", "R", "NC-17", "PG-13", "R", "NC-17", "R", "PG", "PG"]
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
}],
|
|
153
|
-
hook: function (record, type, meta) {
|
|
154
150
|
return record;
|
|
155
151
|
}
|
|
156
152
|
};
|
|
157
153
|
|
|
158
154
|
|
|
155
|
+
function buildObjectProp() {
|
|
156
|
+
return function () {
|
|
157
|
+
return {
|
|
158
|
+
"foo key": choose(pickAWinner(["red", "orange", "yellow", "green", "blue", "indigo", "violet"])()),
|
|
159
|
+
"bar key": integer(1, 100),
|
|
160
|
+
"baz key": choose(pickAWinner([true, true, false])()),
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
function buildNumberArray() {
|
|
167
|
+
return function () {
|
|
168
|
+
const arr = [];
|
|
169
|
+
const times = integer(1, 10);
|
|
170
|
+
for (let i = 0; i < times; i++) {
|
|
171
|
+
arr.push(integer(1, 100));
|
|
172
|
+
}
|
|
173
|
+
return [arr];
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function buildStringArray() {
|
|
178
|
+
return function () {
|
|
179
|
+
const arr = [];
|
|
180
|
+
const times = integer(1, 10);
|
|
181
|
+
for (let i = 0; i < times; i++) {
|
|
182
|
+
arr.push(makeName(integer(1, 3), " "));
|
|
183
|
+
}
|
|
184
|
+
return [arr];
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
function buildObjArrayProp(maxItems = 5) {
|
|
190
|
+
|
|
191
|
+
return function () {
|
|
192
|
+
const categories = ["Device Accessories", "eBooks", "Automotive", "Baby Products", "Beauty", "Books", "Camera & Photo", "Cell Phones & Accessories", "Collectible Coins", "Consumer Electronics", "Entertainment Collectibles", "Fine Art", "Grocery & Gourmet Food", "Health & Personal Care", "Home & Garden", "Independent Design", "Industrial & Scientific", "Accessories", "Major Appliances", "Music", "Musical Instruments", "Office Products", "Outdoors", "Personal Computers", "Pet Supplies", "Software", "Sports", "Sports Collectibles", "Tools & Home Improvement", "Toys & Games", "Video, DVD & Blu-ray", "Video Games", "Watches"];
|
|
193
|
+
const slugs = ['/sale/', '/featured/', '/home/', '/search/', '/wishlist/', '/'];
|
|
194
|
+
const assetExtension = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];
|
|
195
|
+
const data = [];
|
|
196
|
+
const numOfItems = integer(1, maxItems);
|
|
197
|
+
|
|
198
|
+
for (var i = 0; i < numOfItems; i++) {
|
|
199
|
+
const category = chance.pickone(categories);
|
|
200
|
+
const slug = chance.pickone(slugs);
|
|
201
|
+
const asset = chance.pickone(assetExtension);
|
|
202
|
+
const price = integer(1, 300);
|
|
203
|
+
const quantity = integer(1, 5);
|
|
204
|
+
|
|
205
|
+
const item = {
|
|
206
|
+
sku: integer(11111, 99999),
|
|
207
|
+
amount: price,
|
|
208
|
+
quantity: quantity,
|
|
209
|
+
total: price * quantity,
|
|
210
|
+
featured: chance.pickone([true, false]),
|
|
211
|
+
category: category,
|
|
212
|
+
urlSlug: slug + category,
|
|
213
|
+
asset: `${category}-${integer(1, 20)}${asset}`
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
data.push(item);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return () => [data];
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
|
|
159
223
|
|
|
160
224
|
module.exports = config;
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
|
|
2
|
+
const SEED = "my-seed";
|
|
3
|
+
const dayjs = require("dayjs");
|
|
4
|
+
const utc = require("dayjs/plugin/utc");
|
|
5
|
+
dayjs.extend(utc);
|
|
6
|
+
require("dotenv").config();
|
|
7
|
+
const u = require("../components/utils.js");
|
|
8
|
+
const v = require("ak-tools");
|
|
9
|
+
const chance = u.initChance(SEED);
|
|
10
|
+
const num_users = 10_000;
|
|
11
|
+
const days = 108;
|
|
12
|
+
|
|
13
|
+
/** @typedef {import("../types.js").Dungeon} Config */
|
|
14
|
+
|
|
15
|
+
/** @type {Config} */
|
|
16
|
+
const config = {
|
|
17
|
+
token: "",
|
|
18
|
+
seed: "twerk",
|
|
19
|
+
numDays: days,
|
|
20
|
+
numEvents: num_users * 100,
|
|
21
|
+
numUsers: num_users,
|
|
22
|
+
hasAnonIds: false,
|
|
23
|
+
hasSessionIds: false,
|
|
24
|
+
format: "json",
|
|
25
|
+
alsoInferFunnels: false,
|
|
26
|
+
hasLocation: true,
|
|
27
|
+
hasAndroidDevices: true,
|
|
28
|
+
hasIOSDevices: true,
|
|
29
|
+
hasDesktopDevices: true,
|
|
30
|
+
hasBrowser: false,
|
|
31
|
+
hasCampaigns: false,
|
|
32
|
+
isAnonymous: false,
|
|
33
|
+
hasAdSpend: false,
|
|
34
|
+
percentUsersBornInDataset: 35,
|
|
35
|
+
|
|
36
|
+
hasAvatar: true,
|
|
37
|
+
makeChart: false,
|
|
38
|
+
|
|
39
|
+
batchSize: 1_500_000,
|
|
40
|
+
concurrency: 1,
|
|
41
|
+
writeToDisk: false,
|
|
42
|
+
funnels: [
|
|
43
|
+
{
|
|
44
|
+
"sequence": ["app install", "character creation", "join party"],
|
|
45
|
+
"isFirstFunnel": true,
|
|
46
|
+
"conversionRate": 0.8,
|
|
47
|
+
"timeToConvert": .25,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"sequence": ["start quest", "gameplay summary", "complete quest"],
|
|
51
|
+
conversionRate: 0.99,
|
|
52
|
+
timeToConvert: 1,
|
|
53
|
+
props: {
|
|
54
|
+
"quest type": u.pickAWinner([
|
|
55
|
+
"Rescue",
|
|
56
|
+
"Retrieve",
|
|
57
|
+
"Explore",
|
|
58
|
+
"Destroy",
|
|
59
|
+
"Investigate",
|
|
60
|
+
]),
|
|
61
|
+
"quest difficulty": u.pickAWinner([
|
|
62
|
+
"Easy",
|
|
63
|
+
"Medium",
|
|
64
|
+
"Hard",
|
|
65
|
+
"Legendary",
|
|
66
|
+
]),
|
|
67
|
+
"quest location": u.pickAWinner([
|
|
68
|
+
"Forest",
|
|
69
|
+
"Dungeon",
|
|
70
|
+
"Mountain",
|
|
71
|
+
"City",
|
|
72
|
+
"Desert",
|
|
73
|
+
])
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
events: [
|
|
78
|
+
{ event: "app install", weight: 10, isFirstEvent: true },
|
|
79
|
+
{
|
|
80
|
+
event: "character creation",
|
|
81
|
+
weight: 2,
|
|
82
|
+
properties: {
|
|
83
|
+
mode: u.pickAWinner(["fast", "slow", "template"]),
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
event: "join party",
|
|
88
|
+
weight: 8,
|
|
89
|
+
properties: {
|
|
90
|
+
"party size": u.weighNumRange(1, 6),
|
|
91
|
+
"party leader": u.pickAWinner([
|
|
92
|
+
"Bard",
|
|
93
|
+
"Cleric",
|
|
94
|
+
"Fighter",
|
|
95
|
+
"Rogue",
|
|
96
|
+
"Wizard",
|
|
97
|
+
"Paladin",
|
|
98
|
+
"Ranger",
|
|
99
|
+
"Sorcerer",
|
|
100
|
+
"Warlock",
|
|
101
|
+
]),
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
event: "start quest",
|
|
106
|
+
weight: 12,
|
|
107
|
+
properties: {},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
event: "complete quest",
|
|
111
|
+
weight: 12,
|
|
112
|
+
properties: {},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"event": "gameplay summary",
|
|
116
|
+
"weight": 14,
|
|
117
|
+
"properties": {
|
|
118
|
+
"# enemies defeated": u.weighNumRange(0, 100),
|
|
119
|
+
"# respawns": u.weighNumRange(0, 10, 5),
|
|
120
|
+
"# attacks": u.weighNumRange(0, 100, 6, 12),
|
|
121
|
+
"# gold found": u.weighNumRange(0, 1000),
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"event": "in-game purchase",
|
|
126
|
+
"weight": 2,
|
|
127
|
+
"properties": {
|
|
128
|
+
"purchase type": u.pickAWinner([
|
|
129
|
+
"Gold",
|
|
130
|
+
"Gems",
|
|
131
|
+
"Items: Weapons",
|
|
132
|
+
"Items: Armor",
|
|
133
|
+
"Items: Potions",
|
|
134
|
+
"Items: Scrolls",
|
|
135
|
+
"Boosts",
|
|
136
|
+
"Currency",
|
|
137
|
+
]),
|
|
138
|
+
"purchase amount": u.weighNumRange(1, 50, 1, 20),
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
event: "fight boss",
|
|
143
|
+
weight: 3,
|
|
144
|
+
properties: {
|
|
145
|
+
"boss type": u.pickAWinner([
|
|
146
|
+
"Dragon",
|
|
147
|
+
"Demon",
|
|
148
|
+
"Lich",
|
|
149
|
+
"Vampire",
|
|
150
|
+
"Beholder",
|
|
151
|
+
]),
|
|
152
|
+
"boss level": u.weighNumRange(10, 20),
|
|
153
|
+
"boss difficulty": u.pickAWinner([
|
|
154
|
+
"Hard",
|
|
155
|
+
"Legendary",
|
|
156
|
+
"Impossible",
|
|
157
|
+
]),
|
|
158
|
+
"fight duration (mins)": u.weighNumRange(1, 60),
|
|
159
|
+
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
event: "level up",
|
|
164
|
+
weight: 1,
|
|
165
|
+
properties: {
|
|
166
|
+
"new abilities": u.pickAWinner([
|
|
167
|
+
"Attack",
|
|
168
|
+
"Spell",
|
|
169
|
+
"Feat",
|
|
170
|
+
"Skill",
|
|
171
|
+
]),
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
// {
|
|
175
|
+
// event: "generic event (common)",
|
|
176
|
+
// weight: 5,
|
|
177
|
+
// properties: {
|
|
178
|
+
// generic_prop: u.pickAWinner(["foo", "bar", "baz", "qux"]),
|
|
179
|
+
// }
|
|
180
|
+
// },
|
|
181
|
+
{
|
|
182
|
+
event: "$experiment_started",
|
|
183
|
+
weight: 3,
|
|
184
|
+
properties: {
|
|
185
|
+
"Experiment name": u.pickAWinner([
|
|
186
|
+
"fast leveling",
|
|
187
|
+
"tension economy",
|
|
188
|
+
"free trial",
|
|
189
|
+
]),
|
|
190
|
+
"Variant": ["A", "B", "C", "Control"],
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
superProps: {
|
|
195
|
+
platform: u.pickAWinner([
|
|
196
|
+
"Mobile",
|
|
197
|
+
"Xbox",
|
|
198
|
+
"Playstation",
|
|
199
|
+
"Switch",
|
|
200
|
+
"Web"
|
|
201
|
+
]),
|
|
202
|
+
"game mode": u.pickAWinner([
|
|
203
|
+
"Single Player",
|
|
204
|
+
"Multiplayer",
|
|
205
|
+
], 1),
|
|
206
|
+
language: u.pickAWinner([
|
|
207
|
+
"English",
|
|
208
|
+
"Spanish",
|
|
209
|
+
"French",
|
|
210
|
+
"German",
|
|
211
|
+
"Japanese",
|
|
212
|
+
"Korean",
|
|
213
|
+
"Chinese",
|
|
214
|
+
], 0),
|
|
215
|
+
|
|
216
|
+
},
|
|
217
|
+
scdProps: {
|
|
218
|
+
// "subscription MRR" : {
|
|
219
|
+
// "frequency": "week",
|
|
220
|
+
// "type": "number",
|
|
221
|
+
// values: u.weighNumRange(0, 250, 1, 200),
|
|
222
|
+
// timing: "fixed",
|
|
223
|
+
// max: 250,
|
|
224
|
+
// }
|
|
225
|
+
},
|
|
226
|
+
userProps: {
|
|
227
|
+
|
|
228
|
+
race: u.pickAWinner([
|
|
229
|
+
"Human",
|
|
230
|
+
"Elf",
|
|
231
|
+
"Dwarf",
|
|
232
|
+
"Halfling",
|
|
233
|
+
"Dragonborn",
|
|
234
|
+
"Gnome",
|
|
235
|
+
"Half-Elf",
|
|
236
|
+
"Half-Orc",
|
|
237
|
+
"Tiefling",
|
|
238
|
+
]),
|
|
239
|
+
class: u.pickAWinner([
|
|
240
|
+
"Barbarian",
|
|
241
|
+
"Bard",
|
|
242
|
+
"Cleric",
|
|
243
|
+
"Druid",
|
|
244
|
+
"Fighter",
|
|
245
|
+
"Monk",
|
|
246
|
+
"Paladin",
|
|
247
|
+
"Ranger",
|
|
248
|
+
"Rogue",
|
|
249
|
+
"Sorcerer",
|
|
250
|
+
"Warlock",
|
|
251
|
+
"Wizard",
|
|
252
|
+
]),
|
|
253
|
+
alignment: u.pickAWinner([
|
|
254
|
+
"Lawful Good",
|
|
255
|
+
"Neutral Good",
|
|
256
|
+
"Chaotic Good",
|
|
257
|
+
"Lawful Neutral",
|
|
258
|
+
"True Neutral",
|
|
259
|
+
"Chaotic Neutral",
|
|
260
|
+
"Lawful Evil",
|
|
261
|
+
"Neutral Evil",
|
|
262
|
+
"Chaotic Evil",
|
|
263
|
+
]),
|
|
264
|
+
level: u.weighNumRange(1, 20),
|
|
265
|
+
background: u.pickAWinner([
|
|
266
|
+
"Acolyte",
|
|
267
|
+
"Charlatan",
|
|
268
|
+
"Criminal",
|
|
269
|
+
"Entertainer",
|
|
270
|
+
"Folk Hero",
|
|
271
|
+
"Guild Artisan",
|
|
272
|
+
"Hermit",
|
|
273
|
+
"Noble",
|
|
274
|
+
"Outlander",
|
|
275
|
+
"Sage",
|
|
276
|
+
"Sailor",
|
|
277
|
+
"Soldier",
|
|
278
|
+
"Urchin",
|
|
279
|
+
]),
|
|
280
|
+
"subscription MRR": u.weighNumRange(0, 250, 1, 200)
|
|
281
|
+
},
|
|
282
|
+
hook: function (record, type, meta) {
|
|
283
|
+
// const NOW = dayjs();
|
|
284
|
+
|
|
285
|
+
if (type === "event") {
|
|
286
|
+
// const EVENT_TIME = dayjs(record.time);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (type === "user") {
|
|
290
|
+
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (type === "funnel-post") {
|
|
294
|
+
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (type === "funnel-pre") {
|
|
298
|
+
const sequence = v.clone(record.sequence);
|
|
299
|
+
if (sequence.includes("$experiment_started")) {
|
|
300
|
+
//ensure there's only one experiment per user flow
|
|
301
|
+
const newSequence = sequence.filter((event) => event !== "$experiment_started");
|
|
302
|
+
|
|
303
|
+
newSequence.unshift("$experiment_started");
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
record.sequence = newSequence;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (type === "scd") {
|
|
312
|
+
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (type === "everything") {
|
|
316
|
+
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return record;
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
module.exports = config;
|
package/dungeons/simple.js
CHANGED