-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
1403 lines (1267 loc) · 69.7 KB
/
config.js
File metadata and controls
1403 lines (1267 loc) · 69.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ═══════════════════════════════════════════════════════════════
// GAME CONFIG - the dark heart of all settings
// ═══════════════════════════════════════════════════════════════
// Version: 0.92.00 | Unity AI Lab
// Creators: Hackall360, Sponge, GFourteen
// www.unityailab.com | github.com/Unity-Lab-AI/Medieval-Trading-Game
// unityailabcontact@gmail.com
// ═══════════════════════════════════════════════════════════════
const GameConfig = {
// ═══════════════════════════════════════════════════════════════
// 📋 VERSION INFO - tracking our descent into madness
// ═══════════════════════════════════════════════════════════════
version: {
game: '0.92.00', // Quest system audit, doom world fixes, weapon consistency
file: '0.92.00', // keeping pace with the darkness
build: '2026.02', // forged in the fires of 2026
releaseDate: '2026' // the year we conquered the void
},
// ═══════════════════════════════════════════════════════════════
// DEBOOGER CONFIG - for developers and chaos agents
// ═══════════════════════════════════════════════════════════════
// set enabled to false for production builds
// this locks out all debooger commands so players can't wreck the leaderboards
debooger: {
enabled: true, // true = debooger commands work, false = locked out
allowAchievementUnlock: false, // true = Super Hacker achievement can unlock debooger, false = no unlock ever
showConsoleWarnings: true, // show "debooger disabled" warnings in console
},
// ═══════════════════════════════════════════════════════════════
// GAME IDENTITY - who even are we anyway
// ═══════════════════════════════════════════════════════════════
game: {
name: 'Medieval Trading Game',
shortName: 'MTG', // not that MTG, cease and desist lawyers
tagline: 'where capitalism meets the dark ages... and thrives',
description: 'a browser-based descent into medieval capitalism. hoard gold, exploit markets, feel nothing. just like real life but with more plague.'
},
// ═══════════════════════════════════════════════════════════════
// CREDITS - the souls who sacrificed their sanity
// ═══════════════════════════════════════════════════════════════
credits: {
studio: 'Unity AI Lab',
developers: [
{ name: 'Hackall360', role: 'Lead Code Necromancer' },
{ name: 'Sponge', role: 'Chaos Engineer' },
{ name: 'GFourteen', role: 'Digital Alchemist' }
],
playtesters: [
{ name: 'TheREV', role: 'Debooger Cleaner' },
{ name: 'Dessimat0r', role: 'Void Hunter' }
],
year: '2025',
copyright: '© 2025 Unity AI Lab. Creators: Hackall360, Sponge, GFourteen. All rights reserved. Souls sold separately.'
},
// ═══════════════════════════════════════════════════════════════
// LINKS - escape routes from this madness
// ═══════════════════════════════════════════════════════════════
links: {
website: 'https://www.unityailab.com', // the shrine of darkness
github: 'https://github.com/Unity-Lab-AI/Medieval-Trading-Game.git', // where the bodies are buried
discord: 'https://discord.gg/D33Bk6Ay', // screaming into the void, together
support: 'unityailabcontact@gmail.com' // emotional or technical? yes.
},
// ═══════════════════════════════════════════════════════════════
// API CONFIG - summoning circles for external services
// ═══════════════════════════════════════════════════════════════
// all the endpoints live here now. one config to bind them all.
// change these and watch the whole damn thing dance to your tune.
// it's like having a universal remote for digital demons.
api: {
// 🦙 OLLAMA - local LLM, no cloud, no bullshit, no rate limits
// runs on localhost:11434, model: mistral (~4GB)
// if Ollama isn't running, we fall back to hardcoded responses
ollama: {
baseUrl: 'http://localhost:11434', // the local beast
generateEndpoint: 'http://localhost:11434/api/generate', // single-shot generation
chatEndpoint: 'http://localhost:11434/api/chat', // conversation endpoint
model: 'mistral', // our chosen model (~4GB)
timeout: 3000, // 3 seconds max - fall back if slow
useFallbackOnTimeout: true, // use hardcoded responses on timeout
// 🔧 generation settings
options: {
temperature: 0.7, // creativity dial
top_p: 0.9, // nucleus sampling
max_tokens: 150, // keep responses snappy
stop: ['\n\n', 'Player:', 'User:'] // stop sequences
},
// 🔍 status check - ping to see if Ollama is alive
async isRunning() {
try {
const response = await fetch('http://localhost:11434/api/tags', {
method: 'GET',
signal: AbortSignal.timeout(1000)
});
return response.ok;
} catch {
return false;
}
},
// 🎤 generate response from Ollama
async generate(prompt, systemPrompt = '') {
try {
const response = await fetch(GameConfig.api.ollama.generateEndpoint, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: GameConfig.api.ollama.model,
prompt: prompt,
system: systemPrompt,
stream: false,
options: GameConfig.api.ollama.options
}),
signal: AbortSignal.timeout(GameConfig.api.ollama.timeout)
});
if (!response.ok) return null;
const data = await response.json();
return data.response || null;
} catch {
return null; // timeout or error - caller should use fallback
}
}
},
// 🔧 request defaults - baseline for all API calls
defaults: {
timeout: 3000, // 3 seconds for Ollama
maxTokens: 150, // shorter responses for NPCs
temperature: 0.7, // balanced creativity
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
}
},
// ═══════════════════════════════════════════════════════════════
// 🎨 UI STRINGS - words that haunt the interface
// ═══════════════════════════════════════════════════════════════
ui: {
welcomeMessage: '🖤 welcome to Medieval Trading Game... your wallet will never recover',
loadingMessage: 'summoning Medieval Trading Game from the void...',
mainMenuTitle: 'Medieval Trading Game',
topBarTitle: 'Medieval Trading Game'
},
// ═══════════════════════════════════════════════════════════════
// 💾 STORAGE KEYS - where memories go to die (localStorage)
// ═══════════════════════════════════════════════════════════════
storage: {
prefix: 'medievalTradingGame',
highScores: 'medievalTradingGameHighScores', // hall of fallen merchants
saveSlots: 'medievalTradingGameSaveSlots', // parallel timelines of regret
autoSaveSlots: 'medievalTradingGameAutoSaveSlots', // paranoia saves lives
emergencySave: 'medievalTradingGameEmergencySave', // panic button data
settings: 'medievalTradingGameSettings', // your preferences, preserved
locationHistory: 'medieval-trading-game-location-history' // everywhere you've fled from
},
// ═══════════════════════════════════════════════════════════════
// 🏆 GLOBAL LEADERBOARD - eternal glory across all realms
// ═══════════════════════════════════════════════════════════════
// Set up at jsonbin.io (free tier: 10k requests/month):
// 1. Create account at jsonbin.io
// 2. Create new bin with content: {"leaderboard":[]}
// 3. Copy your Bin ID and Master Key below
// 4. Set enabled to true
// Your players' legacies will echo across all who play...
leaderboard: {
enabled: true, // set to true once configured
backend: 'local', // 'jsonbin', 'gist', or 'local' - default to LOCAL for security
jsonbin: {
// ⚠️ SECURITY FIX: API keys removed from client-side code
// To enable global leaderboards with JSONBin:
// 1. Create free account at jsonbin.io
// 2. Create a new bin and get your Bin ID
// 3. Copy your Master Key from API Keys section
// 4. Paste your credentials below (they're YOUR keys, YOUR risk)
// 5. Change backend to 'jsonbin' above
// WARNING: Any key you put here is visible to users inspecting the code!
// For production apps, use a backend proxy - this is a browser-only game.
binId: '', // YOUR JSONBin Bin ID here (or leave empty for local-only)
apiKey: '' // YOUR JSONBin API Key here (or leave empty for local-only)
},
gist: {
gistId: '', // GitHub Gist ID (if using gist backend)
// Note: Gist is read-only without auth token
},
settings: {
maxEntries: 100, // keep top 100 champions
displayEntries: 10, // show top 10 in UI
minScoreToSubmit: 100, // minimum score to submit (avoid spam)
cacheTimeout: 300000 // 5 minute cache between fetches
}
},
// ═══════════════════════════════════════════════════════════════
// ⚙️ DEFAULTS - factory settings for fresh souls
// ═══════════════════════════════════════════════════════════════
defaults: {
soundVolume: 0.7, // loud enough to drown out thoughts
musicVolume: 0.24, // 🖤💀 lowered 20% from 0.3 for quieter background ambiance 💀
autoSave: true, // because trust issues
autoSaveInterval: 300000, // 5 mins of anxiety between saves
maxSaveSlots: 10, // 10 alternate realities
maxAutoSaveSlots: 10 // 10 safety nets
},
// ═══════════════════════════════════════════════════════════════
// 🎛️ SETTINGS - the full spectrum of user preferences
// ═══════════════════════════════════════════════════════════════
// these are the default values for all settings panel options
// settings-panel.js reads from here - one source of truth
settings: {
// 🎵 audio settings - drown out the silence
audio: {
masterVolume: 0.7, // master volume slider (0-1)
musicVolume: 0.24, // 🖤💀 background music - lowered 20% from 0.3 for quieter ambiance 💀
sfxVolume: 0.7, // sound effects volume
isMuted: false, // global mute toggle
isMusicMuted: false, // music-only mute
isSfxMuted: false, // sfx-only mute
audioEnabled: true, // enable audio system at all
// 🎚️ Per-track volume multipliers for normalization
// Adjust these if individual tracks are too loud/quiet
// Lower = quieter, range 0.0 to 1.0
trackVolumeMultipliers: {
menu: 0.6, // menu music - moderate
normal: 0.7, // normal world - slightly louder for ambiance
dungeon: 0.6, // dungeon - atmospheric, not overpowering
doom: 0.5 // doom world - quietest, lets the dread sink in
},
// 🎵 Music system timing
gapBetweenTracks: 15000, // 15 seconds silence between tracks
fadeOutDuration: 1000, // 1 second fade out
fadeInDuration: 500 // 0.5 second fade in
},
// 👁️ visual settings - see the void in HD
visual: {
particlesEnabled: true, // particle effects (gold sparkles, etc)
screenShakeEnabled: true, // screen shake on impacts
animationsEnabled: true, // general animations
weatherEffectsEnabled: true, // rain, snow, etc in backgrounds
quality: 'medium', // 'low', 'medium', 'high'
reducedMotion: false, // respect prefers-reduced-motion
flashWarnings: true // warn before flashy effects
},
// ✨ animation settings - making pixels dance at 3am
animation: {
animationsEnabled: true, // master animation toggle
animationSpeed: 1.0, // animation speed multiplier
reducedMotion: false, // simplified animations
quality: 'medium' // animation quality level
},
// 🎨 ui settings - paint your nightmare pretty
ui: {
animationsEnabled: true, // UI transition animations
hoverEffectsEnabled: true, // hover state effects
transitionsEnabled: true, // smooth transitions
reducedMotion: false, // reduce motion sickness triggers
highContrast: false, // high contrast mode
fontSize: 'medium', // 'small', 'medium', 'large'
theme: 'default', // UI theme selection
uiScale: 1.0 // UI scale (0.75 - 1.5)
},
// 🌧️ environmental settings - weather for the soul
environmental: {
weatherEffectsEnabled: true, // weather visuals
lightingEnabled: true, // dynamic lighting
seasonalEffectsEnabled: true, // seasonal decorations
quality: 'medium', // effect quality level
reducedEffects: false // simplified effects
},
// ♿ accessibility settings - suffering should be inclusive
accessibility: {
reducedMotion: false, // reduce all motion
highContrast: false, // high contrast colors
screenReaderEnabled: false, // screen reader optimizations
flashWarnings: true, // warn about flashing content
colorBlindMode: 'none', // 'none', 'deuteranopia', 'protanopia', 'tritanopia'
fontSize: 'medium', // text size preference
keyboardNavigation: true // enable keyboard nav
},
// 🎮 gameplay settings - tweak the torture experience
gameplay: {
showTutorialOnStart: true // show tutorial yes/no popup on new game (default ON)
}
},
// ═══════════════════════════════════════════════════════════════
// 💰 PLAYER STARTING VALUES - your humble beginnings in this cruel world
// ═══════════════════════════════════════════════════════════════
// tweak these to make the early game merciful or merciless
// starting gold is the difference between hope and despair
player: {
// 🪙 starting wealth - how broke are you when you wake up?
startingGold: {
easy: 120, // baby mode - 20% bonus gold for soft souls
normal: 100, // the intended suffering
hard: 80 // masochist mode - 20% less, good luck
},
// 🎒 starting inventory - survival kit for the damned
startingItems: {
food: 2, // enough to not immediately starve
water: 2 // hydration is important even in medieval times
},
// 📊 starting stats - the vessel's condition at birth
startingStats: {
health: 100,
maxHealth: 100,
hunger: 50, // half full, half empty, very philosophical
maxHunger: 100,
thirst: 50, // same existential crisis as hunger
maxThirst: 100,
stamina: 100,
maxStamina: 100,
happiness: 50, // neutral - neither joy nor despair
maxHappiness: 100
},
// 🎯 starting attributes - base stats before you mess with them
baseAttributes: {
strength: 5,
charisma: 5,
intelligence: 5,
luck: 5,
endurance: 5
},
// 🎭 character creation constraints
characterCreation: {
availableAttributePoints: 5, // points to distribute like a true min-maxer
maxAttributeValue: 10, // cap per stat
maxTotalAttributes: 30, // total cap across all stats
maxPerks: 2 // pick your poison, but only twice
},
// 🚶 starting location - where your journey of suffering begins
defaultStartingLocation: 'greendale', // a village with a market, how quaint
// 🎒 starting transportation
startingTransportation: 'backpack' // you literally start with nothing but a bag
},
// ═══════════════════════════════════════════════════════════════
// 💀 SURVIVAL MECHANICS - the slow march toward death
// ═══════════════════════════════════════════════════════════════
// the body is a prison and these are its decay rates
// all calculations assume 5-minute game intervals (1440 min/day)
survival: {
// 🍖 HUNGER - the stomach is a demanding master
// 🦇 FIX: Changed from 4 days to 5 days per user requirement
hunger: {
decayDays: 5, // days from 100% to 0% - slow starvation
// calculated: 100 / (5 * 1440 / 5) = 0.0694 per 5-min update
decayPerUpdate: 0.0694, // the actual hunger drain per tick
criticalThreshold: 20, // below this, no health regen
warningThreshold: 30 // time to panic about food
},
// 💧 THIRST - dehydration hits different (and faster)
thirst: {
decayDays: 3, // days from 100% to 0% - faster than hunger
// calculated: 100 / (3 * 1440 / 5) = 0.1157 per 5-min update
decayPerUpdate: 0.1157, // the actual thirst drain per tick
criticalThreshold: 20, // below this, no health regen
warningThreshold: 30 // time to find water or perish
},
// 😴 STAMINA - energy recovers when idle, drains when working 🖤
stamina: {
// Regeneration: 0% to 100% in 5 game hours when idle
// 5 hours = 300 minutes, updates every 5 min = 60 updates
// calculated: 100 / 60 = 1.667 per update
regenPerUpdate: 1.667, // stamina gained per 5-min tick when idle
regenHours: 5, // hours to fully recover from 0 to 100
lowThreshold: 20 // below this, gathering slows down
},
// 💀 DEATH BY NEGLECT - the consequence of ignoring your needs
starvationDeath: {
hoursToKill: 24, // hours at 0% hunger/thirst until death (1 day)
// calculated: 100% / (24 * 60 / 5) = 0.347% of maxHealth per update
healthDrainPercent: 0.00347 // percentage of maxHealth lost per tick
// this ensures a 500hp player and 30hp player die in same time
},
// 💚 HEALTH REGENERATION - the body tries to heal itself
healthRegen: {
baseRegenPerUpdate: 0.5, // slow healing when fed and hydrated
wellFedBonus: 1.0, // double regen when hunger > 70 && thirst > 70
wellFedThreshold: 70, // what counts as "well fed"
enduranceBonusMultiplier: 0.05 // bonus per endurance point
}
},
// ═══════════════════════════════════════════════════════════════
// 💹 MARKET & TRADING - where dreams of wealth go to die
// ═══════════════════════════════════════════════════════════════
// the invisible hand of the market slaps everyone equally
market: {
// 📈 price fluctuation ranges
priceFluctuation: {
minMultiplier: 0.5, // minimum 50% of base price
maxMultiplier: 2.0, // maximum 200% of base price
dailyRandomRange: 0.1, // ±5% random daily fluctuation
morningPremium: 1.02, // 2% markup in morning
eveningDiscount: 0.98 // 2% discount in evening
},
// 🎪 event price modifiers
eventModifiers: {
festival: 0.9, // 10% lower prices - people are happy
war: 1.2, // 20% higher - scarcity and fear
drought: 1.5, // 50% higher for food/water - desperation
harvest: 0.8, // 20% lower - abundance is temporary
plague: 1.3, // 30% higher for medicine - profit from suffering
royalVisit: 1.2, // 20% higher luxury - gotta impress the nobles
construction: 1.15, // 15% higher materials - building boom
economicCrisis: 1.1 // 10% volatility - chaos is a ladder
},
// 💱 trading mechanics
trading: {
charismaModifierPerPoint: 0.02, // 2% price change per charisma above/below 5
baseCharisma: 5, // the neutral ground
negotiationSkillBonus: 0.01 // 1% bonus per negotiation skill level
}
},
// ═══════════════════════════════════════════════════════════════
// 🏨 SERVICES & COSTS - everything has a price in this world
// ═══════════════════════════════════════════════════════════════
// inn stays, house buying, all the ways to drain your gold
services: {
// 🛏️ inn costs and effects
inn: {
baseCost: 20, // gold per night
healthRestore: 100, // full health restore
hungerRestore: 100, // full belly
thirstRestore: 100, // fully hydrated
staminaRestore: 100, // well rested
happinessBoost: 20 // comfort bonus
},
// 🏠 property costs
property: {
smallHouseCost: 1000, // starter home for aspiring merchants
// other properties defined in property-system.js
},
// 🚗 transportation options base costs
transportation: {
backpackCapacity: 50, // lbs - just you and your dreams
cartCapacity: 200, // lbs - now we're talking
wagonCapacity: 500 // lbs - merchant king vibes
}
},
// ═══════════════════════════════════════════════════════════════
// ⚔️ COMBAT & DAMAGE - violence is always an option
// ═══════════════════════════════════════════════════════════════
// for when trading negotiations get... heated
combat: {
// 🗡️ base weapon damage values
weapons: {
sword: { damage: 10, weight: 5, basePrice: 50 },
spear: { damage: 8, weight: 4, basePrice: 30 },
bow: { damage: 7, weight: 3, basePrice: 40 }
},
// 💪 attribute bonuses
strengthDamageBonus: 0.1, // 10% damage per strength above 5
enduranceDefenseBonus: 0.05, // 5% damage reduction per endurance above 5
// 🎲 luck effects
luckCritChanceBonus: 0.02, // 2% crit chance per luck above 5
critDamageMultiplier: 1.5, // 50% bonus damage on crit
// 💀 Player death settings (added 2025-12-06)
playerDeath: {
enabled: true, // true = player can die, false = always 1 HP
showFinalStats: true, // Show 0 health at end of combat
deathDelayMs: 2000 // Delay before game over triggers
},
// 🎯 Combat UI
ui: {
showCombatLog: true,
maxLogEntries: 20,
showDamageNumbers: true
}
},
// ═══════════════════════════════════════════════════════════════
// 📦 ITEM BALANCE - the economy of stuff
// ═══════════════════════════════════════════════════════════════
// base prices and effects for common items
items: {
// 🍖 consumables - the fuel for survival
consumables: {
food: { basePrice: 5, hunger: 20, health: 5, weight: 1 },
water: { basePrice: 2, thirst: 25, health: 2, weight: 2 },
bread: { basePrice: 3, hunger: 15, health: 3, weight: 0.5 },
fish: { basePrice: 8, hunger: 12, health: 4, weight: 1 },
ale: { basePrice: 10, happiness: 10, health: 3, weight: 2 },
grain: { basePrice: 6, hunger: 8, weight: 2 }
},
// 🪨 resources - the building blocks
resources: {
wood: { basePrice: 8, weight: 5 },
stone: { basePrice: 5, weight: 10 },
iron_ore: { basePrice: 12, weight: 15 },
coal: { basePrice: 6, weight: 8 },
timber: { basePrice: 12, weight: 6 }
},
// 🔧 tools - the means of production
tools: {
hammer: { basePrice: 15, weight: 3, durability: 100 },
axe: { basePrice: 20, weight: 4, durability: 120 },
pickaxe: { basePrice: 25, weight: 6, durability: 100 }
},
// 💎 luxury goods - for the discerning hoarder
luxury: {
silk: { basePrice: 100, weight: 1, rarity: 'rare' },
livestock: { basePrice: 80, weight: 50, rarity: 'uncommon' }
}
},
// ═══════════════════════════════════════════════════════════════
// 🎭 PERK MODIFIERS - the balance of advantages and disadvantages
// ═══════════════════════════════════════════════════════════════
// all the ways perks can buff or nerf your existence
perkModifiers: {
// 💰 gold modifiers
goldBonus: { small: 0.1, medium: 0.25, large: 0.5 }, // +10/25/50%
goldPenalty: { small: 0.1, medium: 0.15, large: 0.2 }, // -10/15/20%
// 🏆 reputation modifiers
reputationBonus: { small: 1, medium: 2, large: 3 }, // +1/2/3 rep
reputationPenalty: { small: 1, medium: 2 }, // -1/2 rep
// 🎒 carry capacity modifiers
carryBonus: { small: 0.1, medium: 0.25, large: 0.5 }, // +10/25/50%
carryPenalty: { small: 0.1, medium: 0.2 }, // -10/20%
// 💬 negotiation modifiers
negotiationBonus: { small: 0.1, medium: 0.2 }, // +10/20%
negotiationPenalty: { small: 0.1, medium: 0.15 }, // -10/15%
// 🚶 travel modifiers
travelSpeedBonus: { small: 0.1, medium: 0.2 }, // +10/20%
travelCostReduction: { small: 0.1, medium: 0.2 } // -10/20%
},
// ═══════════════════════════════════════════════════════════════
// ⏰ TIME & GAME SPEED - the relentless march of time
// ═══════════════════════════════════════════════════════════════
// how fast does existence accelerate toward entropy?
time: {
// 📅 starting date - when every merchant's journey begins
// used for calculating days survived on leaderboards
startingDate: {
year: 1111, // the year of reckoning
month: 4, // April - spring awakening
day: 1, // first day of your suffering
hour: 8, // 8 AM - early bird catches the plague
minute: 0
},
// 🕐 game speed settings (ms between ticks)
speeds: {
PAUSED: 0, // frozen in time like your bank account
NORMAL: 1000, // 1 second = 1 game minute
FAST: 500, // 2x speed for the impatient
VERY_FAST: 100 // 10x speed for the truly reckless
},
// 📅 time events
dailyMarketResetHour: 6, // 6 AM - merchants wake up
weeklyEventDay: 1, // day 1 of each week
weeklyEventHour: 10, // 10 AM
monthlyCaravanDay: 15, // mid-month merchant caravan
monthlyCaravanHour: 14, // 2 PM
// 🌙 day/night cycle
dayStart: 6, // 6 AM - dawn breaks
dayEnd: 20, // 8 PM - darkness falls
morningEnd: 12, // noon - morning ends
eveningStart: 17 // 5 PM - evening begins
},
// ═══════════════════════════════════════════════════════════════
// 🏆 SCORING - how we measure your success (or failure)
// ═══════════════════════════════════════════════════════════════
// the formula for eternal glory or shame
scoring: {
survivalBonusPerDay: 10, // points per day survived
wealthDivisor: 100, // netWorth / 100 = wealth bonus
tradeBonusPerTrade: 5, // points per completed trade
achievementBonus: 50 // points per achievement unlocked
},
// ═══════════════════════════════════════════════════════════════
// 🏰 DUNGEON EXPLORATION - where fools go to find treasure or death
// ═══════════════════════════════════════════════════════════════
dungeon: {
// 💀 risk/reward scaling
healthCostRange: { min: 5, max: 45 },
staminaCostRange: { min: 5, max: 60 },
// 💎 loot tier multipliers
lootTierMultiplier: {
common: 1.0,
uncommon: 1.5,
rare: 2.0,
epic: 3.0,
legendary: 5.0
}
},
// ═══════════════════════════════════════════════════════════════
// 🚶 TRAVEL SYSTEM - journey across the realm
// ═══════════════════════════════════════════════════════════════
travel: {
enabled: true,
baseSpeedMinutesPerUnit: 5, // Game minutes per map distance unit
allowCancelTravel: true, // Can cancel mid-journey
allowRerouteTravel: true, // Can change destination mid-journey
// Map display settings
map: {
showUndiscoveredAsQuestionMarks: true, // Show ??? for unexplored
showGatehouseNamesWhenDiscovered: true, // Gates show real names even when discovered
labelFontSize: 12, // Normal location label size
areaLabelFontSize: 24, // Capital/region label size
revealGatesFromCapital: true // Gates visible when at Royal Capital
}
},
// ═══════════════════════════════════════════════════════════════
// 🏰 GATEHOUSE SYSTEM - controlling access to zones
// ═══════════════════════════════════════════════════════════════
gatehouses: {
enabled: true,
// Gate fees (gold required to unlock passage)
// Progression: east (1k) -> north (10k) -> west (50k)
fees: {
northern_outpost: 10000, // Northern zone gate - mid game
western_watch: 50000, // Western zone gate - late game
jade_harbor: 1000 // Eastern zone gate - early-mid game
},
// Which gate controls which zone
zones: {
northern: 'northern_outpost',
western: 'western_watch',
eastern: 'jade_harbor'
},
// Zone assignment for locations
locationZones: {
northern_outpost: 'starter', // Gate is in starter zone
ironforge_city: 'northern', // City is behind the gate
western_watch: 'starter',
stonebridge: 'western',
jade_harbor: 'starter',
jade_city: 'eastern'
}
},
// ═══════════════════════════════════════════════════════════════
// ⭐ REPUTATION SYSTEM - how the world sees you
// ═══════════════════════════════════════════════════════════════
reputation: {
// City-wide reputation
city: {
enabled: true,
saveToLocalStorage: true,
// Reputation level thresholds
levels: {
HOSTILE: { min: -100, max: -50, color: '#ff4444' },
UNTRUSTED: { min: -49, max: -20, color: '#ff8844' },
SUSPICIOUS: { min: -19, max: -1, color: '#ffaa44' },
NEUTRAL: { min: 0, max: 19, color: '#888888' },
FRIENDLY: { min: 20, max: 49, color: '#44aa44' },
TRUSTED: { min: 50, max: 79, color: '#44cc44' },
ELITE: { min: 80, max: 100, color: '#44ff44' }
},
// Price modifiers based on reputation
priceModifiers: {
HOSTILE: 1.2, // 20% higher prices
UNTRUSTED: 1.1, // 10% higher
SUSPICIOUS: 1.05, // 5% higher
NEUTRAL: 1.0, // Normal prices
FRIENDLY: 0.95, // 5% discount
TRUSTED: 0.9, // 10% discount
ELITE: 0.8 // 20% discount
}
},
// NPC-specific reputation and trade unlocks
npc: {
enabled: true,
startingReputation: 0,
maxReputation: 100,
minReputation: -100,
dynamicTradeUnlock: true, // Rep changes affect trade access in real-time
// Reputation thresholds for trading
tradeUnlockThresholds: {
alwaysTrade: 0, // merchant, innkeeper, farmer, etc.
lowRep: 10, // blacksmith, apothecary, tailor
mediumRep: 25, // jeweler, banker, guild_master
highRep: 50 // noble
},
// Which NPC types require which rep level
tradeRequirements: {
// Always trade (0 rep)
alwaysTrade: ['merchant', 'innkeeper', 'general_store', 'baker', 'farmer', 'fisherman', 'ferryman', 'traveler'],
// Low rep (10+)
lowRep: ['blacksmith', 'apothecary', 'tailor', 'herbalist', 'miner'],
// Medium rep (25+)
mediumRep: ['jeweler', 'banker', 'guild_master'],
// High rep (50+)
highRep: ['noble']
}
}
},
// ═══════════════════════════════════════════════════════════════
// 👥 NPC SYSTEM - the souls who populate the world
// ═══════════════════════════════════════════════════════════════
npc: {
// Relationship tracking
relationships: {
enabled: true,
startingReputation: 0,
maxReputation: 100,
minReputation: -100,
reputationDecayEnabled: false,
reputationDecayPerDay: 1
},
// NPC trading behavior
trading: {
enabled: true,
showTradePreview: true,
refreshInventoryOnVisit: true
},
// NPC death and respawn (added 2025-12-06)
death: {
enabled: true,
respawnTimeGameHours: 24, // 24 in-game hours
respawnTimeGameMinutes: 1440, // = 24 * 60 minutes
removeFromPanelWhenDead: true, // Hide from people panel when dead
// Reputation loss for killing NPCs
reputationLoss: {
outlaw: 5, // Minimal loss for outlaws/bandits
civilian: 20, // Moderate loss for regular NPCs
boss: 50, // Large loss for bosses
questTarget: 0 // No loss for quest targets
}
}
},
// ═══════════════════════════════════════════════════════════════
// 📜 QUEST SYSTEM - the narrative threads
// ═══════════════════════════════════════════════════════════════
quests: {
enabled: true,
maxActiveQuests: 5,
// Quest UI markers
markers: {
available: '!', // NPC has quest to give
inProgress: '?', // Quest in progress, talk to NPC
complete: '!' // Ready to turn in
},
// Quest tracking
tracking: {
showInJournal: true,
showOnMap: true,
showInPeoplePanel: true
}
},
// ═══════════════════════════════════════════════════════════════
// 🌍 WORLD SYSTEM - the realm itself
// ═══════════════════════════════════════════════════════════════
world: {
defaultStartingLocation: 'greendale',
randomStartEnabled: true,
// Starter zone locations (for random start)
starterZoneLocations: [
'greendale', 'riverside_hamlet', 'sunhaven',
'kings_inn', 'royal_capital'
],
// NPC respawn tracking
npcRespawnEnabled: true,
npcRespawnTimeMinutes: 1440, // 24 game hours
// Location visibility
visibility: {
revealOnVisit: true,
revealConnections: true,
revealGatehousesFromCapital: true
}
},
// ═══════════════════════════════════════════════════════════════
// 🤖 API COMMANDS - the dark arts of NPC control
// ═══════════════════════════════════════════════════════════════
// NPCs can embed commands in their responses like {openMarket}
// these get parsed out before display/TTS and executed by the game
// it's like giving NPCs a remote control for the game world
apiCommands: {
// 🔍 command pattern: {commandName} or {commandName:param1,param2}
pattern: /\{(\w+)(?::([^}]+))?\}/g,
// 📋 command definitions - what can NPCs do?
definitions: {
// ═══════════════════════════════════════════════════════════
// 🛒 BASIC COMMANDS - every NPC can use these
// ═══════════════════════════════════════════════════════════
openMarket: {
description: 'Open the market/shop UI',
handler: 'openMarket',
params: [],
permission: 'basic'
},
openTrade: {
description: 'Open direct trade window with NPC',
handler: 'openTradeWindow',
params: ['npcId'],
permission: 'basic'
},
closeChat: {
description: 'End conversation and close chat',
handler: 'closeNPCChat',
params: [],
permission: 'basic'
},
openInventory: {
description: 'Open player inventory',
handler: 'openInventory',
params: [],
permission: 'basic'
},
openTravel: {
description: 'Open travel panel',
handler: 'openTravel',
params: [],
permission: 'basic'
},
playEmote: {
description: 'NPC performs an emote/action',
handler: 'playNPCEmote',
params: ['emoteType'],
permission: 'basic'
},
// ═══════════════════════════════════════════════════════════
// 💰 MERCHANT COMMANDS - only merchants can use these
// ═══════════════════════════════════════════════════════════
giveItem: {
description: 'NPC gives player an item',
handler: 'givePlayerItem',
params: ['itemId', 'quantity'],
permission: 'merchant'
},
takeItem: {
description: 'NPC takes item from player',
handler: 'takePlayerItem',
params: ['itemId', 'quantity'],
permission: 'merchant'
},
setDiscount: {
description: 'Apply discount to market prices',
handler: 'applyMerchantDiscount',
params: ['percent'],
permission: 'merchant'
},
showWares: {
description: 'Display NPC inventory preview',
handler: 'showNPCWares',
params: [],
permission: 'merchant'
},
// ═══════════════════════════════════════════════════════════
// 💕 RELATIONSHIP COMMANDS - tracking player-NPC bonds
// ═══════════════════════════════════════════════════════════
addReputation: {
description: 'Increase reputation with NPC/faction',
handler: 'modifyReputation',
params: ['amount'],
permission: 'basic'
},
removeReputation: {
description: 'Decrease reputation with NPC/faction',
handler: 'modifyReputation',
params: ['amount', 'negative'],
permission: 'basic'
},
rememberPlayer: {
description: 'Store info about player for future conversations',
handler: 'storePlayerMemory',
params: ['key', 'value'],
permission: 'basic'
},
// ═══════════════════════════════════════════════════════════
// 📜 QUEST COMMANDS - the full quest lifecycle arsenal
// ═══════════════════════════════════════════════════════════
// quest assignment and management
assignQuest: {
description: 'Give player a quest (auto-checks prerequisites)',
handler: 'assignQuest',
params: ['questId'],
permission: 'questGiver'
},
checkQuest: {
description: 'Check quest progress with detailed breakdown',
handler: 'checkQuestProgress',
params: ['questId'],
permission: 'questGiver'
},
completeQuest: {
description: 'Complete quest and give rewards (validates objectives first)',
handler: 'completeQuest',
params: ['questId'],
permission: 'questGiver'
},
failQuest: {
description: 'Mark quest as failed',
handler: 'failQuest',
params: ['questId'],
permission: 'questGiver'
},
checkPrerequisites: {
description: 'Check if player meets all prerequisites for a quest',
handler: 'checkQuestPrerequisites',
params: ['questId'],
permission: 'questGiver'
},
getAvailableQuests: {
description: 'Get list of quests this NPC can offer',
handler: 'getAvailableQuests',
params: [],
permission: 'questGiver'
},
// quest item handling (weightless, can't drop)
giveQuestItem: {
description: 'Give player a quest item (for delivery quests)',
handler: 'giveQuestItem',
params: ['questItemId'],
permission: 'questGiver'
},
takeQuestItem: {
description: 'Take quest item from player (delivery received)',
handler: 'takeQuestItem',
params: ['questItemId'],
permission: 'questGiver'
},
checkQuestItem: {
description: 'Check if player has a quest item',