Skip to content

Commit 8c7cdcc

Browse files
author
Sorra
authored
Merge pull request #417 from TheWizardsCode/wl-CG-0MMKBVXJK09CESA8-balance-business-costs
CG-0MMKBVXJK09CESA8: Balance business costs
2 parents 808560f + f6e46ae commit 8c7cdcc

3 files changed

Lines changed: 51 additions & 51 deletions

File tree

example-games/main-street/MainStreetCards.ts

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
181181
{
182182
id: 'biz-bakery',
183183
name: 'Bakery',
184-
cost: 3,
185-
baseIncome: 2,
184+
cost: 6,
185+
baseIncome: 1,
186186
synergyTypes: ['Food'],
187187
upgradePath: 'Bakery',
188188
maxLevel: 2,
@@ -191,8 +191,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
191191
{
192192
id: 'biz-diner',
193193
name: 'Diner',
194-
cost: 4,
195-
baseIncome: 3,
194+
cost: 8,
195+
baseIncome: 1,
196196
synergyTypes: ['Food'],
197197
upgradePath: 'Diner',
198198
maxLevel: 2,
@@ -201,8 +201,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
201201
{
202202
id: 'biz-bookshop',
203203
name: 'Bookshop',
204-
cost: 4,
205-
baseIncome: 2,
204+
cost: 8,
205+
baseIncome: 1,
206206
synergyTypes: ['Culture'],
207207
upgradePath: 'Bookshop',
208208
maxLevel: 1,
@@ -211,8 +211,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
211211
{
212212
id: 'biz-park',
213213
name: 'Park',
214-
cost: 2,
215-
baseIncome: 1,
214+
cost: 4,
215+
baseIncome: 0,
216216
synergyTypes: ['Culture'],
217217
upgradePath: 'Park',
218218
maxLevel: 1,
@@ -221,8 +221,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
221221
{
222222
id: 'biz-hardware',
223223
name: 'Hardware Store',
224-
cost: 5,
225-
baseIncome: 3,
224+
cost: 10,
225+
baseIncome: 1,
226226
synergyTypes: ['Commerce'],
227227
upgradePath: 'Hardware Store',
228228
maxLevel: 1,
@@ -233,8 +233,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
233233
{
234234
id: 'biz-pawnshop',
235235
name: 'Pawn Shop',
236-
cost: 3,
237-
baseIncome: 2,
236+
cost: 6,
237+
baseIncome: 1,
238238
synergyTypes: ['Commerce'],
239239
upgradePath: 'Pawn Shop',
240240
maxLevel: 1,
@@ -243,8 +243,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
243243
{
244244
id: 'biz-boutique',
245245
name: 'Boutique',
246-
cost: 4,
247-
baseIncome: 2,
246+
cost: 8,
247+
baseIncome: 1,
248248
synergyTypes: ['Commerce'],
249249
upgradePath: 'Boutique',
250250
maxLevel: 1,
@@ -254,8 +254,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
254254
{
255255
id: 'biz-laundromat',
256256
name: 'Laundromat',
257-
cost: 3,
258-
baseIncome: 2,
257+
cost: 6,
258+
baseIncome: 1,
259259
synergyTypes: ['Service'],
260260
upgradePath: 'Laundromat',
261261
maxLevel: 1,
@@ -264,8 +264,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
264264
{
265265
id: 'biz-barbershop',
266266
name: 'Barbershop',
267-
cost: 3,
268-
baseIncome: 2,
267+
cost: 6,
268+
baseIncome: 1,
269269
synergyTypes: ['Service'],
270270
upgradePath: 'Barbershop',
271271
maxLevel: 1,
@@ -275,8 +275,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
275275
{
276276
id: 'biz-arcade',
277277
name: 'Arcade',
278-
cost: 4,
279-
baseIncome: 2,
278+
cost: 8,
279+
baseIncome: 1,
280280
synergyTypes: ['Entertainment'],
281281
upgradePath: 'Arcade',
282282
maxLevel: 1,
@@ -285,8 +285,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
285285
{
286286
id: 'biz-cinema',
287287
name: 'Cinema',
288-
cost: 5,
289-
baseIncome: 3,
288+
cost: 10,
289+
baseIncome: 1,
290290
synergyTypes: ['Entertainment'],
291291
upgradePath: 'Cinema',
292292
maxLevel: 2,
@@ -296,8 +296,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
296296
{
297297
id: 'biz-cafe',
298298
name: 'Cafe',
299-
cost: 3,
300-
baseIncome: 2,
299+
cost: 6,
300+
baseIncome: 1,
301301
synergyTypes: ['Food', 'Culture'],
302302
upgradePath: 'Cafe',
303303
maxLevel: 1,
@@ -306,8 +306,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
306306
{
307307
id: 'biz-food-truck',
308308
name: 'Food Truck',
309-
cost: 2,
310-
baseIncome: 1,
309+
cost: 4,
310+
baseIncome: 0,
311311
synergyTypes: ['Food', 'Entertainment'],
312312
upgradePath: 'Food Truck',
313313
maxLevel: 1,
@@ -316,8 +316,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
316316
{
317317
id: 'biz-gallery',
318318
name: 'Art Gallery',
319-
cost: 4,
320-
baseIncome: 2,
319+
cost: 8,
320+
baseIncome: 1,
321321
synergyTypes: ['Culture', 'Entertainment'],
322322
upgradePath: 'Art Gallery',
323323
maxLevel: 1,
@@ -326,8 +326,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
326326
{
327327
id: 'biz-spa',
328328
name: 'Day Spa',
329-
cost: 5,
330-
baseIncome: 3,
329+
cost: 10,
330+
baseIncome: 1,
331331
synergyTypes: ['Service', 'Entertainment'],
332332
upgradePath: 'Day Spa',
333333
maxLevel: 2,
@@ -337,8 +337,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
337337
{
338338
id: 'biz-florist',
339339
name: 'Florist',
340-
cost: 2,
341-
baseIncome: 1,
340+
cost: 4,
341+
baseIncome: 0,
342342
synergyTypes: ['Commerce', 'Culture'],
343343
upgradePath: 'Florist',
344344
maxLevel: 1,
@@ -347,8 +347,8 @@ const BUSINESS_TEMPLATES: Omit<BusinessCard, 'family' | 'level' | 'incomeBonus'
347347
{
348348
id: 'biz-clinic',
349349
name: 'Clinic',
350-
cost: 5,
351-
baseIncome: 3,
350+
cost: 10,
351+
baseIncome: 1,
352352
synergyTypes: ['Service'],
353353
upgradePath: 'Clinic',
354354
maxLevel: 1,

tests/main-street/expanded-card-pool.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ describe('Expanded Card Pool: Business Card Fields', () => {
9595
}
9696
});
9797

98-
it('all business cards should have positive baseIncome', () => {
98+
it('all business cards should have non-negative baseIncome', () => {
9999
for (const card of businessDeck) {
100-
expect(card.baseIncome).toBeGreaterThan(0);
100+
expect(card.baseIncome).toBeGreaterThanOrEqual(0);
101101
}
102102
});
103103

@@ -436,8 +436,8 @@ describe('Expanded Card Pool: Deck Building', () => {
436436
const bakeries = deck.filter(c => c.name === 'Bakery');
437437
expect(bakeries).toHaveLength(2);
438438
for (const b of bakeries) {
439-
expect(b.cost).toBe(3);
440-
expect(b.baseIncome).toBe(2);
439+
expect(b.cost).toBe(6);
440+
expect(b.baseIncome).toBe(1);
441441
expect(b.synergyTypes).toEqual(['Food']);
442442
}
443443
});
@@ -536,9 +536,9 @@ describe('Expanded Card Pool: Synergy Coverage', () => {
536536
}
537537
});
538538

539-
it('cost distribution should span at least 2-5 range', () => {
539+
it('cost distribution should span at least 4-10 range', () => {
540540
const costs = businessDeck.map(c => c.cost);
541-
expect(Math.min(...costs)).toBeLessThanOrEqual(2);
542-
expect(Math.max(...costs)).toBeGreaterThanOrEqual(5);
541+
expect(Math.min(...costs)).toBeLessThanOrEqual(4);
542+
expect(Math.max(...costs)).toBeGreaterThanOrEqual(10);
543543
});
544544
});

tests/main-street/monte-carlo-balance.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ describe('Main Street Monte Carlo balance heuristics', () => {
88
const { metrics } = runMonteCarlo({ seeds, maxTurns: 25, strategy: 'market-greedy' });
99

1010
expect(metrics.runs).toBe(100);
11-
expect(metrics.winRate).toBeGreaterThanOrEqual(0.85);
12-
expect(metrics.winRate).toBeLessThanOrEqual(0.97);
11+
expect(metrics.winRate).toBeGreaterThanOrEqual(0.3);
12+
expect(metrics.winRate).toBeLessThanOrEqual(0.5);
1313

14-
expect(metrics.medianScore).toBeGreaterThanOrEqual(150);
15-
expect(metrics.medianScore).toBeLessThanOrEqual(170);
14+
expect(metrics.medianScore).toBeGreaterThanOrEqual(20);
15+
expect(metrics.medianScore).toBeLessThanOrEqual(40);
1616

1717
const dominantLossRate = Math.max(0, ...Object.values(metrics.lossReasonRates));
18-
expect(dominantLossRate).toBeGreaterThanOrEqual(0.5);
18+
expect(dominantLossRate).toBeGreaterThanOrEqual(0.75);
1919

20-
expect(metrics.averageNoActionTurns).toBeGreaterThanOrEqual(0.75);
20+
expect(metrics.averageNoActionTurns).toBeGreaterThanOrEqual(6);
2121

2222
expect(metrics.averageTurnWhenGridHalf).not.toBeNull();
23-
expect(metrics.averageTurnWhenGridHalf!).toBeGreaterThanOrEqual(4.5);
24-
expect(metrics.averageTurnWhenGridHalf!).toBeLessThanOrEqual(7.5);
23+
expect(metrics.averageTurnWhenGridHalf!).toBeGreaterThanOrEqual(11);
24+
expect(metrics.averageTurnWhenGridHalf!).toBeLessThanOrEqual(15);
2525

2626
expect(metrics.averageTurnWhenGridFull).not.toBeNull();
27-
expect(metrics.averageTurnWhenGridFull!).toBeGreaterThanOrEqual(9);
28-
expect(metrics.averageTurnWhenGridFull!).toBeLessThanOrEqual(12);
27+
expect(metrics.averageTurnWhenGridFull!).toBeGreaterThanOrEqual(15);
28+
expect(metrics.averageTurnWhenGridFull!).toBeLessThanOrEqual(19);
2929
});
3030
});

0 commit comments

Comments
 (0)