Слияние с командой: экономика/рынок/зелья/Остров 2 + наш сад, площадь, Гильдия (карта соединена по объектам)

This commit is contained in:
heyshawtyy committed 2026-11-13 14:23:17 +05:00
commit a9bc4207cb
31 files changed
+239767 -638

No files matched your search

+722
View File
@@ -0,0 +1,722 @@
-- FishConfig (ModuleScript) -> ReplicatedStorage
-- Все настройки игры. Меняй цифры здесь, чтобы настроить баланс.
local Config = {}
Config.GameName = "Клёвое место"
---------------------------------------------------------------- миры
-- center = центр мира на карте; mult = множитель наград коллекции
Config.Worlds = {
{
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
clock = 16.2,
waterY = 0,
lakes = { { 0, -15, 62 }, { -42, 8, 34 }, { 44, 2, 36 }, { 0, 22, 30 }, { 48, -50, 22 } }, -- { x, z, радиус } от центра
-- внешний вид только этого мира (применяет клиент при входе, при выходе возвращает как было)
tint = Color3.fromRGB(255, 247, 236),
-- свет и эффекты: свойства Lighting и его эффектов; чего здесь нет, остаётся как в MapBuilder
look = {
lighting = {
-- днём солнце не выжигает светлый песок и траву: яркость и экспозиция ниже
Brightness = 2.0, ExposureCompensation = -0.35,
Ambient = Color3.fromRGB(62, 66, 84), OutdoorAmbient = Color3.fromRGB(105, 112, 132),
ColorShift_Top = Color3.fromRGB(255, 232, 196),
EnvironmentDiffuseScale = 0.5, EnvironmentSpecularScale = 0.6,
},
-- дымка вдали: Density — сколько тумана, Haze — насколько он плотный у горизонта
atmosphere = {
Density = 0.38, Offset = 0.1, Haze = 1.2, Glare = 0.15,
Color = Color3.fromRGB(188, 204, 224), Decay = Color3.fromRGB(196, 176, 160),
},
color = { Saturation = 0.16, Contrast = 0.12, Brightness = -0.04 },
-- свечение только у по-настоящему ярких мест (огни ночью), без ореолов вокруг светлого днём
bloom = { Intensity = 0.25, Size = 24, Threshold = 1.9 },
sunRays = { Intensity = 0.05, Spread = 0.6 },
-- мягкий тонмаппинг: светлое не выгорает в белое
grading = { TonemapperPreset = Enum.TonemapperPreset.Default },
-- лёгкое размытие дальнего плана
dof = { Enabled = true, FarIntensity = 0.2, FocusDistance = 60, InFocusRadius = 120, NearIntensity = 0 },
},
-- земля мира залита материалом Snow (ровный, без травинок), дорожки — Salt; здесь они перекрашиваются
terrainColors = {
Snow = Color3.fromRGB(127, 163, 63), Salt = Color3.fromRGB(191, 155, 105),
Rock = Color3.fromRGB(132, 139, 155), Slate = Color3.fromRGB(132, 139, 155),
Mud = Color3.fromRGB(78, 110, 92), Sand = Color3.fromRGB(205, 190, 140),
},
},
{
id = "World2", name = "Тропический остров", icon = "🏝", level = 8, mult = 4,
center = Vector3.new(1500, 0, 0), color = Color3.fromRGB(255, 190, 70),
desc = "Бирюзовое море, пальмы и яркая рифовая рыба.",
clock = 13,
waterY = 0,
sea = 74, -- всё дальше этого радиуса от центра — море (лагуна вокруг острова, пляж — кольцо ~r 64..79)
},
{
id = "World3", name = "Ледяной фьорд", icon = "❄", level = 18, mult = 12,
center = Vector3.new(-1500, 0, 0), color = Color3.fromRGB(150, 220, 255),
desc = "Рыбалка в лунках среди льдов и северного сияния.",
clock = 18.3,
waterY = 1,
lakes = { { 0, 0, 70 }, { -55, 30, 45 }, { 55, -25, 50 }, { 5, -70, 40 } }, -- подо льдом
holes = {
{ 0, 40 }, { -22, 18 }, { 22, 12 }, { 0, -12 }, { -30, -30 }, { 30, 40 }, { -60, 35 },
{ -45, 15 }, { 55, -25 }, { 75, -5 }, { 40, -50 }, { 5, -75 }, { -15, -60 }, { 25, -80 },
},
holeRadius = 6,
-- цвета террейна общие на весь плейс, а в нём сохранены цвета «Тихого озера» (зелёный Snow) —
-- поэтому снег фьорда задаём явно
terrainColors = { Snow = Color3.fromRGB(205, 212, 228) },
},
{
id = "World4", name = "Вулкан", icon = "🌋", level = 30, mult = 30, soon = true,
center = Vector3.new(0, 0, -1500), color = Color3.fromRGB(255, 90, 40),
desc = "Рыбалка в лаве. Скоро!",
},
}
Config.WorldRadius = 260
-- камера игрока: насколько близко и далеко можно отвести колесом (в studs);
-- maxZoom держит обзор внутри локаций — дальше видно край карты
Config.Camera = { minZoom = 0.5, maxZoom = 35 }
-- лента активности (слева внизу у всех игроков) и оповещения о редком улове
-- announceRank / announceMutations — крупный баннер со звуком у всех на сервере;
-- globalRank / globalMutations — улов уходит и на другие серверы игры (MessagingService);
-- lines — сколько строк в ленте, lineTime — сколько секунд строка остаётся видна
Config.Feed = {
announceRank = 4, announceMutations = { Golden = true, Rainbow = true },
globalRank = 5, globalMutations = { Rainbow = true },
lines = 6, lineTime = 30,
}
-- доски лидеров в лобби (глобальные, по всем серверам; обновляются раз в refresh секунд).
-- attr — атрибут игрока, который считает сервер; store — имя OrderedDataStore (смена имени = новый топ с нуля)
Config.Leaderboards = {
refresh = 60, size = 10,
boards = {
{ id = "Donate", title = "💎 Топ донатеров", attr = "RobuxSpent", store = "TopRobux_v1", unit = "R$", color = Color3.fromRGB(205, 140, 255) },
{ id = "Earn", title = "⚪ Топ по заработку", attr = "CoinsEarned", store = "TopEarned_v1", unit = "⚪", color = Color3.fromRGB(255, 214, 90) },
{ id = "Catch", title = "🎣 Топ рыболовов", attr = "TotalCaught", store = "TopCaught_v1", unit = "🐟", color = Color3.fromRGB(120, 210, 255) },
},
}
-- экран загрузки: при входе в игру и при каждом телепорте игрок уже стоит на месте, сцена прогружается
-- и свет локации ставится под ним; картинку видно только после этого (секунды — минимум показа)
Config.Loading = {
firstJoin = 3,
teleport = 2.5,
}
-- лобби: те же поля внешнего вида, что у миров (clock, tint, look, terrainColors); клиент применяет их вне миров
Config.Lobby = {
id = "Lobby",
clock = 16.3, -- предвечернее солнце: тени длиннее, свет теплее
tint = Color3.fromRGB(255, 242, 228),
look = {
lighting = {
Brightness = 2.0, ExposureCompensation = -0.3,
Ambient = Color3.fromRGB(64, 60, 72), OutdoorAmbient = Color3.fromRGB(120, 114, 124),
ColorShift_Top = Color3.fromRGB(255, 224, 186),
EnvironmentDiffuseScale = 0.5, EnvironmentSpecularScale = 0.5,
GlobalShadows = true,
},
-- тёплая дымка: дальние холмы за скалами тонут в ней
atmosphere = {
Density = 0.4, Offset = 0.18, Haze = 1.6, Glare = 0.25,
Color = Color3.fromRGB(222, 212, 204), Decay = Color3.fromRGB(186, 160, 150),
},
color = { Saturation = 0.18, Contrast = 0.14, Brightness = -0.04 },
bloom = { Intensity = 0.3, Size = 24, Threshold = 1.8 },
sunRays = { Intensity = 0.05, Spread = 0.7 },
dof = { Enabled = true, FarIntensity = 0.18, FocusDistance = 55, InFocusRadius = 95, NearIntensity = 0 },
-- мягкий тонмаппинг вместо Retro: светлая плитка и вывески не выгорают в белое
grading = { TonemapperPreset = Enum.TonemapperPreset.Default },
},
terrainColors = {
Grass = Color3.fromRGB(104, 150, 72), Ground = Color3.fromRGB(120, 98, 74), Rock = Color3.fromRGB(140, 126, 130),
},
}
function Config.WorldAt(pos)
for _, w in ipairs(Config.Worlds) do
if not w.soon then
local d = Vector3.new(pos.X - w.center.X, 0, pos.Z - w.center.Z).Magnitude
if d < Config.WorldRadius then
return w
end
end
end
return nil
end
-- куда бросать из этой точки (единичный вектор по горизонтали): к центру ближайшего озера или лунки,
-- а если ближе море — от центра острова к морю
function Config.CastDirection(world, pos)
if not world then
return nil
end
local x, z = pos.X - world.center.X, pos.Z - world.center.Z
local best, bestGap
local function consider(dir, gap)
if dir.Magnitude > 0.1 and (not bestGap or gap < bestGap) then
best, bestGap = dir.Unit, gap
end
end
if world.holes then
for _, h in ipairs(world.holes) do
consider(Vector3.new(h[1] - x, 0, h[2] - z), math.sqrt((h[1] - x) ^ 2 + (h[2] - z) ^ 2) - (world.holeRadius or 6))
end
end
for _, l in ipairs(world.lakes or {}) do
if not world.holes then -- в Мире 3 озёра подо льдом, бросаем только в лунки
consider(Vector3.new(l[1] - x, 0, l[2] - z), math.sqrt((l[1] - x) ^ 2 + (l[2] - z) ^ 2) - l[3])
end
end
if world.sea then
consider(Vector3.new(x, 0, z), world.sea - math.sqrt(x * x + z * z))
end
return best
end
-- расстояние по горизонтали от точки до ближайшей воды (0 — над водой: на причале или в воде)
function Config.WaterGap(world, pos)
if not world then
return math.huge
end
local x, z = pos.X - world.center.X, pos.Z - world.center.Z
local gap = math.huge
if world.holes then
for _, h in ipairs(world.holes) do
gap = math.min(gap, math.sqrt((h[1] - x) ^ 2 + (h[2] - z) ^ 2) - (world.holeRadius or 6))
end
else
for _, l in ipairs(world.lakes or {}) do
gap = math.min(gap, math.sqrt((l[1] - x) ^ 2 + (l[2] - z) ^ 2) - l[3])
end
end
if world.sea then
gap = math.min(gap, world.sea - math.sqrt(x * x + z * z))
end
return math.max(0, gap)
end
-- можно ли закидывать отсюда (pos — центр персонажа): стоим на берегу или платформе
-- и до воды не дальше Config.CastReach. Возвращает true или текст подсказки.
-- humanoid можно не передавать (на сервере его состояние ненадёжно) — тогда проверяем только по высоте.
function Config.CanCastFrom(world, pos, humanoid)
if not world then
return "🌍 Тут нет рыбы"
end
local inWater = pos.Y < (world.waterY or 0) + 2 -- у плывущего персонажа центр почти на уровне воды
if humanoid then
inWater = inWater or humanoid:GetState() == Enum.HumanoidStateType.Swimming or humanoid.FloorMaterial == Enum.Material.Water
end
if inWater then
return "🏊 Выйди из воды"
end
if humanoid and humanoid.FloorMaterial == Enum.Material.Air then
return "Встань на землю"
end
if Config.WaterGap(world, pos) > Config.CastReach then
return "🌊 Подойди к воде"
end
return true
end
-- есть ли вода в этой точке мира (озеро, море или лунка)
function Config.IsWater(world, pos)
if not world then
return false
end
local x, z = pos.X - world.center.X, pos.Z - world.center.Z
if world.holes then
local r = world.holeRadius or 6
for _, h in ipairs(world.holes) do
if (x - h[1]) ^ 2 + (z - h[2]) ^ 2 <= r * r then
return true
end
end
return false
end
if world.sea and math.sqrt(x * x + z * z) >= world.sea then
return true
end
for _, l in ipairs(world.lakes or {}) do
if (x - l[1]) ^ 2 + (z - l[2]) ^ 2 <= (l[3] - 1) ^ 2 then
return true
end
end
return false
end
---------------------------------------------------------------- редкости
Config.Rarities = {
Common = { name = "Обычная", rank = 1, weight = 55, color = Color3.fromRGB(215, 220, 225) },
Uncommon = { name = "Необычная", rank = 2, weight = 27, color = Color3.fromRGB(95, 225, 115) },
Rare = { name = "Редкая", rank = 3, weight = 11, color = Color3.fromRGB(70, 160, 255) },
Epic = { name = "Эпическая", rank = 4, weight = 4.5, color = Color3.fromRGB(185, 90, 255) },
Legendary = { name = "Легендарная", rank = 5, weight = 1.2, color = Color3.fromRGB(255, 185, 35) },
Mythic = { name = "Мифическая", rank = 6, weight = 0.25, color = Color3.fromRGB(255, 80, 150) },
}
Config.RarityOrder = { "Common", "Uncommon", "Rare", "Epic", "Legendary", "Mythic" }
---------------------------------------------------------------- мутации
Config.Mutations = {
{ id = "Rainbow", name = "Радужная", chance = 0.002, mult = 10, color = Color3.fromRGB(255, 120, 230) },
{ id = "Golden", name = "Золотая", chance = 0.010, mult = 5, color = Color3.fromRGB(255, 205, 60) },
{ id = "Shiny", name = "Блестящая", chance = 0.040, mult = 2, color = Color3.fromRGB(170, 240, 255) },
}
---------------------------------------------------------------- рыба
-- shape: classic, long, tall, flat, ray, puffer, shark, eel, sword, angler, jelly, sturgeon
-- color2 = второй цвет (плавники/узор); stripes/spots/whiskers/spikes/glow — украшения модели
local function F(t)
return t
end
Config.Zones = {
World1 = {
fish = {
F({ id = "Karas", name = "Карась", rarity = "Common", price = 5, xp = 8, minW = 0.2, maxW = 1.2, size = 1.0, shape = "tall", color = Color3.fromRGB(205, 170, 75), color2 = Color3.fromRGB(170, 120, 50) }),
F({ id = "Plotva", name = "Плотва", rarity = "Common", price = 6, xp = 8, minW = 0.1, maxW = 0.8, size = 0.9, shape = "classic", color = Color3.fromRGB(195, 200, 210), color2 = Color3.fromRGB(220, 80, 60) }),
F({ id = "Ersh", name = "Ёрш", rarity = "Common", price = 7, xp = 9, minW = 0.1, maxW = 0.4, size = 0.8, shape = "classic", color = Color3.fromRGB(135, 125, 75), color2 = Color3.fromRGB(95, 85, 50), spikes = true, spots = 6 }),
F({ id = "Okun", name = "Окунь", rarity = "Uncommon", price = 15, xp = 18, minW = 0.3, maxW = 1.5, size = 1.0, shape = "classic", color = Color3.fromRGB(150, 180, 70), color2 = Color3.fromRGB(230, 90, 40), stripes = 5, spikes = true }),
F({ id = "Lesh", name = "Лещ", rarity = "Uncommon", price = 18, xp = 20, minW = 0.5, maxW = 3.0, size = 1.2, shape = "tall", color = Color3.fromRGB(175, 145, 95), color2 = Color3.fromRGB(120, 95, 60) }),
F({ id = "Lin", name = "Линь", rarity = "Uncommon", price = 20, xp = 22, minW = 0.4, maxW = 2.5, size = 1.1, shape = "classic", color = Color3.fromRGB(95, 125, 55), color2 = Color3.fromRGB(60, 85, 35) }),
F({ id = "Shuka", name = "Щука", rarity = "Rare", price = 45, xp = 45, minW = 1.0, maxW = 8.0, size = 1.5, shape = "long", color = Color3.fromRGB(110, 140, 85), color2 = Color3.fromRGB(200, 210, 150), spots = 12 }),
F({ id = "Sudak", name = "Судак", rarity = "Rare", price = 50, xp = 48, minW = 1.0, maxW = 6.0, size = 1.4, shape = "long", color = Color3.fromRGB(165, 165, 135), color2 = Color3.fromRGB(80, 80, 70), stripes = 6, spikes = true }),
F({ id = "Som", name = "Сом", rarity = "Epic", price = 130, xp = 110, minW = 5.0, maxW = 40, size = 2.0, shape = "long", color = Color3.fromRGB(75, 75, 90), color2 = Color3.fromRGB(180, 175, 160), whiskers = true }),
F({ id = "Koi", name = "Карп кои", rarity = "Epic", price = 150, xp = 120, minW = 2.0, maxW = 9.0, size = 1.4, shape = "classic", color = Color3.fromRGB(250, 245, 240), color2 = Color3.fromRGB(240, 110, 40), spots = 7, whiskers = true }),
F({ id = "Gold", name = "Золотая рыбка", rarity = "Legendary", price = 500, xp = 350, minW = 0.1, maxW = 0.5, size = 0.9, shape = "classic", color = Color3.fromRGB(255, 195, 40), color2 = Color3.fromRGB(255, 120, 30), glow = true, bigTail = true }),
F({ id = "Crystal", name = "Хрустальный осётр", rarity = "Mythic", price = 2000, xp = 900, minW = 10, maxW = 60, size = 2.0, shape = "sturgeon", color = Color3.fromRGB(150, 230, 255), color2 = Color3.fromRGB(230, 250, 255), glow = true, glass = true }),
},
},
World2 = {
fish = {
F({ id = "Clown", name = "Рыба-клоун", rarity = "Common", price = 18, xp = 18, minW = 0.1, maxW = 0.4, size = 0.8, shape = "classic", color = Color3.fromRGB(255, 120, 30), color2 = Color3.fromRGB(255, 255, 255), stripes = 3 }),
F({ id = "Sergeant", name = "Рыба-сержант", rarity = "Common", price = 20, xp = 18, minW = 0.2, maxW = 0.9, size = 0.9, shape = "tall", color = Color3.fromRGB(240, 230, 110), color2 = Color3.fromRGB(40, 40, 45), stripes = 5 }),
F({ id = "Mullet", name = "Барабулька", rarity = "Common", price = 22, xp = 20, minW = 0.1, maxW = 0.6, size = 0.9, shape = "classic", color = Color3.fromRGB(235, 110, 100), color2 = Color3.fromRGB(255, 220, 120), whiskers = true }),
F({ id = "Angel", name = "Рыба-ангел", rarity = "Uncommon", price = 45, xp = 40, minW = 0.3, maxW = 1.5, size = 1.0, shape = "tall", color = Color3.fromRGB(60, 120, 230), color2 = Color3.fromRGB(255, 220, 40), stripes = 4, bigFins = true }),
F({ id = "Puffer", name = "Иглобрюх", rarity = "Uncommon", price = 50, xp = 42, minW = 0.3, maxW = 2.0, size = 1.0, shape = "puffer", color = Color3.fromRGB(230, 205, 140), color2 = Color3.fromRGB(110, 90, 60), spots = 10 }),
F({ id = "Parrot", name = "Рыба-попугай", rarity = "Uncommon", price = 55, xp = 45, minW = 1.0, maxW = 5.0, size = 1.2, shape = "classic", color = Color3.fromRGB(60, 210, 190), color2 = Color3.fromRGB(240, 90, 180), spots = 5 }),
F({ id = "Ray", name = "Скат", rarity = "Rare", price = 120, xp = 90, minW = 3.0, maxW = 25, size = 1.6, shape = "ray", color = Color3.fromRGB(110, 115, 140), color2 = Color3.fromRGB(230, 230, 240), spots = 14 }),
F({ id = "Barracuda", name = "Барракуда", rarity = "Rare", price = 130, xp = 95, minW = 2.0, maxW = 20, size = 1.7, shape = "long", color = Color3.fromRGB(175, 185, 200), color2 = Color3.fromRGB(60, 70, 85), stripes = 8 }),
F({ id = "Swordfish", name = "Рыба-меч", rarity = "Epic", price = 350, xp = 220, minW = 30, maxW = 200, size = 2.0, shape = "sword", color = Color3.fromRGB(55, 75, 130), color2 = Color3.fromRGB(200, 210, 230) }),
F({ id = "Moray", name = "Мурена", rarity = "Epic", price = 320, xp = 210, minW = 2.0, maxW = 15, size = 1.8, shape = "eel", color = Color3.fromRGB(80, 140, 60), color2 = Color3.fromRGB(230, 220, 90), spots = 12 }),
F({ id = "Shark", name = "Рифовая акула", rarity = "Legendary", price = 1200, xp = 700, minW = 40, maxW = 180, size = 2.4, shape = "shark", color = Color3.fromRGB(110, 125, 145), color2 = Color3.fromRGB(235, 235, 240) }),
F({ id = "SunJelly", name = "Солнечная медуза", rarity = "Mythic", price = 5000, xp = 2000, minW = 1.0, maxW = 8.0, size = 1.8, shape = "jelly", color = Color3.fromRGB(255, 200, 80), color2 = Color3.fromRGB(255, 120, 200), glow = true, glass = true }),
},
},
World3 = {
fish = {
F({ id = "Cod", name = "Треска", rarity = "Common", price = 55, xp = 40, minW = 1.0, maxW = 10, size = 1.2, shape = "classic", color = Color3.fromRGB(150, 150, 110), color2 = Color3.fromRGB(230, 225, 200), spots = 14, whiskers = true }),
F({ id = "Herring", name = "Сельдь", rarity = "Common", price = 50, xp = 38, minW = 0.2, maxW = 0.8, size = 0.9, shape = "long", color = Color3.fromRGB(150, 175, 205), color2 = Color3.fromRGB(70, 100, 140) }),
F({ id = "Capelin", name = "Мойва", rarity = "Common", price = 48, xp = 36, minW = 0.05, maxW = 0.2, size = 0.7, shape = "classic", color = Color3.fromRGB(170, 200, 190), color2 = Color3.fromRGB(80, 120, 110) }),
F({ id = "Flounder", name = "Камбала", rarity = "Uncommon", price = 140, xp = 90, minW = 0.5, maxW = 4.0, size = 1.2, shape = "flat", color = Color3.fromRGB(150, 125, 90), color2 = Color3.fromRGB(230, 120, 60), spots = 10 }),
F({ id = "Redfish", name = "Морской окунь", rarity = "Uncommon", price = 150, xp = 92, minW = 0.5, maxW = 5.0, size = 1.1, shape = "classic", color = Color3.fromRGB(225, 70, 60), color2 = Color3.fromRGB(255, 160, 120), spikes = true }),
F({ id = "Char", name = "Арктический голец", rarity = "Uncommon", price = 160, xp = 95, minW = 0.5, maxW = 6.0, size = 1.2, shape = "long", color = Color3.fromRGB(120, 130, 150), color2 = Color3.fromRGB(255, 130, 150), spots = 12 }),
F({ id = "Halibut", name = "Палтус", rarity = "Rare", price = 380, xp = 200, minW = 5.0, maxW = 90, size = 1.9, shape = "flat", color = Color3.fromRGB(90, 95, 80), color2 = Color3.fromRGB(150, 150, 130), spots = 16 }),
F({ id = "Wolffish", name = "Морской волк", rarity = "Rare", price = 400, xp = 210, minW = 3.0, maxW = 20, size = 1.7, shape = "long", color = Color3.fromRGB(110, 120, 140), color2 = Color3.fromRGB(60, 65, 80), stripes = 7, teeth = true }),
F({ id = "Angler", name = "Удильщик", rarity = "Epic", price = 1100, xp = 500, minW = 5.0, maxW = 50, size = 1.6, shape = "angler", color = Color3.fromRGB(60, 50, 70), color2 = Color3.fromRGB(120, 255, 230), glow = true }),
F({ id = "IceEel", name = "Ледяная мурена", rarity = "Epic", price = 1000, xp = 480, minW = 3.0, maxW = 25, size = 1.9, shape = "eel", color = Color3.fromRGB(150, 210, 245), color2 = Color3.fromRGB(240, 250, 255), glass = true }),
F({ id = "Greenland", name = "Полярная акула", rarity = "Legendary", price = 3500, xp = 1500, minW = 200, maxW = 900, size = 2.6, shape = "shark", color = Color3.fromRGB(80, 90, 100), color2 = Color3.fromRGB(160, 170, 180) }),
F({ id = "Leviathan", name = "Ледяной левиафан", rarity = "Mythic", price = 15000, xp = 4000, minW = 500, maxW = 3000, size = 2.4, shape = "eel", color = Color3.fromRGB(110, 230, 255), color2 = Color3.fromRGB(200, 120, 255), glow = true, spikes = true }),
},
},
}
---------------------------------------------------------------- удочки
-- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны,
-- icon = картинка удочки в хотбаре (Tool.TextureId)
Config.Rods = {
{ id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood", icon = "rbxassetid://83350883185349" },
{ id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo", icon = "rbxassetid://98615001898640" },
{ id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass", icon = "rbxassetid://100031752289540" },
{ id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon", icon = "rbxassetid://71788597596034" },
{ id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral", icon = "rbxassetid://139114393074237" },
{ id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold", icon = "rbxassetid://83212298735071" },
{ id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost", icon = "rbxassetid://134579643216329" },
{ id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend", icon = "rbxassetid://84863811378769" },
}
Config.RodUpgrade = { maxLevel = 5, luckPerLevel = 0.08, zonePerLevel = 0.012, speedPerLevel = 0.96 }
function Config.UpgradeCost(rod, currentLevel)
return math.floor(rod.upgradeCost * (currentLevel + 1) ^ 1.5)
end
---------------------------------------------------------------- сумки
Config.Bags = {
{ id = "Pouch", name = "Холщовая сумка", price = 0, level = 1, capacity = 12, color = Color3.fromRGB(170, 140, 95) },
{ id = "Satchel", name = "Сумка рыбака", price = 150, level = 2, capacity = 25, color = Color3.fromRGB(110, 140, 80) },
{ id = "Backpack", name = "Туристический рюкзак", price = 700, level = 4, capacity = 45, color = Color3.fromRGB(60, 110, 180) },
{ id = "BigNet", name = "Огромный садок", price = 2500, level = 7, capacity = 80, color = Color3.fromRGB(200, 80, 50) },
{ id = "Chest", name = "Сундук за спиной", price = 9000, level = 12, capacity = 140, color = Color3.fromRGB(140, 90, 50) },
{ id = "Magic", name = "Магический мешок", price = 30000, level = 20, capacity = 250, color = Color3.fromRGB(120, 60, 200) },
}
---------------------------------------------------------------- удача
Config.LuckPerPlayerLevel = 0.02 -- +2% за уровень игрока
Config.MasteryLuck = 0.10 -- +10% навсегда за полностью собранный мир
Config.Potions = {
{ id = "Luck1", name = "Зелье удачи", price = 120, bonus = 0.5, duration = 300, color = Color3.fromRGB(90, 230, 120) },
{ id = "Luck2", name = "Большое зелье удачи", price = 450, bonus = 1.0, duration = 600, color = Color3.fromRGB(255, 200, 60), level = 5 },
{ id = "Luck3", name = "Эликсир фортуны", price = 2500, bonus = 2.0, duration = 600, color = Color3.fromRGB(200, 120, 255), level = 12 },
}
---------------------------------------------------------------- коллекция
-- награда за то, что поймал ВСЕ виды одной редкости в мире (умножается на mult мира)
Config.CollectionRewards = {
Common = { coins = 50, xp = 40 },
Uncommon = { coins = 120, xp = 100 },
Rare = { coins = 300, xp = 250 },
Epic = { coins = 800, xp = 600 },
Legendary = { coins = 2000, xp = 1500 },
Mythic = { coins = 6000, xp = 4000 },
}
Config.MasteryCoins = 5000 -- за весь мир (тоже умножается на mult)
---------------------------------------------------------------- цепочки заданий
-- короткие задания идут по очереди: награда сразу, следующее появляется мгновенно.
-- после последнего шага — бонус цепочки и следующая цепочка; каждый новый круг цели растут
-- coins/xp = награда за 1 единицу цели (умножается на цель и уровень игрока);
-- max — потолок цели, byLevel — цель растёт с уровнем игрока;
-- forms — слово после числа для 1 / 2–4 / 5+ (подставляется вместо второго %s)
local FISH, TIMES = { "рыбу", "рыбы", "рыб" }, { "раз", "раза", "раз" }
Config.QuestKinds = {
catch = { text = "Поймай %d %s", forms = FISH, coins = 5, xp = 4 },
uncommon = { text = "Поймай %d %s «Необычная» или реже", forms = FISH, coins = 18, xp = 14 },
rare = { text = "Поймай %d %s «Редкая» или реже", forms = FISH, coins = 60, xp = 50 },
perfect = { text = "Подсеки %d %s без промаха", forms = TIMES, coins = 10, xp = 8 },
perfectCast = { text = "Забрось в зелёную зону %d %s", forms = TIMES, coins = 8, xp = 6 },
combo = { text = "Набери серию из %d рыб", coins = 12, xp = 10, max = 15 },
sell = { text = "Продай %d %s", forms = FISH, coins = 3, xp = 3 },
earn = { text = "Заработай %d ⚪ на продаже", coins = 0.25, xp = 0.2, byLevel = true },
buy = { text = "Купи что-нибудь в магазине", coins = 40, xp = 30, max = 1 },
boss = { text = "Нанеси боссу %d урона", coins = 15, xp = 12 },
}
Config.QuestChains = {
{ name = "🎣 Утренний клёв", steps = { { "catch", 3 }, { "perfectCast", 2 }, { "sell", 3 }, { "catch", 5 }, { "uncommon", 1 } } },
{ name = "🔥 Без промаха", steps = { { "perfect", 3 }, { "combo", 3 }, { "catch", 6 }, { "earn", 80 }, { "combo", 5 } } },
{ name = "💎 Охота за редкостью", steps = { { "uncommon", 3 }, { "perfectCast", 3 }, { "rare", 1 }, { "sell", 8 }, { "buy", 1 } } },
{ name = "🏆 Мастер озера", steps = { { "combo", 6 }, { "catch", 10 }, { "perfect", 6 }, { "rare", 2 }, { "earn", 300 } } },
}
Config.QuestTierGrowth = 0.5 -- каждый следующий круг цепочек: цели ×(1 + 0.5 · номер круга)
Config.ChainBonus = { coins = 120, xp = 100, potion = "Luck1" } -- за всю цепочку (растёт с уровнем и кругом)
---------------------------------------------------------------- серия улова
-- каждая рыба подряд без срыва: +10% к цене и опыту следующей, до ×2;
-- срыв, ушедшая рыба или timeout секунд без улова — серия сгорает
Config.Combo = { step = 0.1, max = 2.0, timeout = 90 }
---------------------------------------------------------------- босс озера
-- раз в interval секунд в мир, где больше всего игроков, приплывает босс. Его ловят всем сервером:
-- каждая пойманная там рыба наносит урон = ранг редкости (+1 за подсечку без промаха).
-- Если за duration секунд урона хватило — награда всем, кто помог (× mult мира, минимум 40% за малый вклад)
Config.Boss = {
firstDelay = 240, interval = 600, duration = 180,
hpPerPlayer = 12,
reward = { coins = 300, xp = 250, potion = "Luck1" },
worlds = {
World1 = { name = "Сом-великан", fish = "Som", mutation = "Golden", scale = 5 },
World2 = { name = "Королевская акула", fish = "Shark", mutation = "Golden", scale = 3 },
World3 = { name = "Ледяной левиафан", fish = "Leviathan", mutation = "Rainbow", scale = 2.5 },
},
}
-- ежедневная награда (7 дней по кругу), серебро растёт с уровнем
Config.DailyRewards = {
{ coins = 100 },
{ coins = 200 },
{ coins = 300, potion = "Luck1" },
{ coins = 450 },
{ coins = 600, potion = "Luck1" },
{ coins = 800 },
{ coins = 1500, potion = "Luck2" },
}
---------------------------------------------------------------- события на сервере
Config.Events = {
{ id = "Bite", name = "⚡ Клёвый час", desc = "Рыба клюёт в 2 раза быстрее", duration = 180, speed = 0.5 },
{ id = "Luck", name = "🍀 Удачный ветер", desc = "Удача +50% для всех", duration = 180, luck = 0.5 },
{ id = "Stars", name = "🌟 Звездопад", desc = "Мутации в 3 раза чаще", duration = 180, mutation = 3 },
{ id = "Fair", name = "🐟 Рыбная ярмарка", desc = "Рыба продаётся на 50% дороже", duration = 180, sell = 1.5 },
}
Config.EventFirstDelay = 120
Config.EventGapMin = 420
Config.EventGapMax = 720
---------------------------------------------------------------- время суток
-- одни сутки длятся length секунд реального времени; время общее для всего сервера
Config.DayNight = {
enabled = true,
length = 1200, -- 20 минут на сутки
startClock = 9, -- во сколько начинается день при запуске сервера
nightLuck = 0.10, -- ночью удача +10%
}
-- время на часах в момент serverTime (workspace:GetServerTimeNow()), dayStart — атрибут workspace "DayStart"
function Config.ClockAt(serverTime, dayStart)
local d = Config.DayNight
return (d.startClock + (serverTime - (dayStart or serverTime)) / d.length * 24) % 24
end
-- 0 днём, 1 глубокой ночью, плавно на рассвете и закате
function Config.Nightness(clock)
if clock >= 7 and clock <= 17.5 then
return 0
elseif clock > 17.5 and clock < 20 then
return (clock - 17.5) / 2.5
elseif clock >= 5 and clock < 7 then
return 1 - (clock - 5) / 2
end
return 1
end
function Config.IsNight(clock)
return Config.Nightness(clock) >= 0.5
end
---------------------------------------------------------------- погода
-- меняется на всём сервере; weight — как часто выпадает, duration — сколько длится (секунды)
-- luck / speed / mutation — бонусы к рыбалке, пока погода держится
-- names — как погода называется в отдельных мирах (во фьорде вместо дождя снег)
Config.Weathers = {
{ id = "Clear", name = "Ясно", icon = "☀", weight = 40, duration = { 240, 420 } },
{ id = "Cloudy", name = "Пасмурно", icon = "☁", weight = 25, duration = { 180, 360 }, luck = 0.05, desc = "Удача +5%" },
{ id = "Rain", name = "Дождь", icon = "🌧", weight = 20, duration = { 150, 300 }, speed = 0.85, desc = "Клюёт на 15% быстрее",
names = { World3 = "Снегопад" } },
{ id = "Storm", name = "Гроза", icon = "⛈", weight = 8, duration = { 120, 240 }, luck = 0.25, speed = 0.9, desc = "Удача +25%",
names = { World3 = "Метель" } },
{ id = "Fog", name = "Туман", icon = "🌫", weight = 7, duration = { 150, 300 }, mutation = 1.5, desc = "Мутации ×1.5" },
}
function Config.WeatherById(id)
for _, w in ipairs(Config.Weathers) do
if w.id == id then
return w
end
end
return Config.Weathers[1]
end
---------------------------------------------------------------- звуки
-- ID из Creator Store: эффекты — Pro Sound Effects (официальная библиотека Roblox),
-- музыка — APM и DistroKid (лицензированы для Roblox). volume — громкость, pitch — разброс высоты
local function S(id, volume, extra)
local t = extra or {}
t.id = "rbxassetid://" .. id
t.volume = volume
return t
end
Config.Sounds = {
-- музыка
musicLobby = S(137023744071437, 0.35), -- The Ancient Lutes | Medieval Tavern Music
musicLobby2 = S(116079409060113, 0.35), -- The Lute Lament | Medieval Tavern Music
musicLake = S(1838853377, 0.3), -- Harp Fantasy
musicLake2 = S(86472274853159, 0.3), -- Calm Fantasy Atmosphere
musicNight = S(140195397978848, 0.3), -- Moonlit Meadow Whisper
-- окружение (петли)
birdsLake = S(9112877174, 0.35), -- Squam Lake 1
birdsPark = S(9113444360, 0.25), -- Birds Park 2
birdsJungle = S(9114892930, 0.3), -- Jungle Birds Ambience 3
crickets = S(9112764573, 0.3), -- Crickets Night 3
lakeWater = S(9116203162, 0.25), -- Lake Lap Water Movement 2
wind = S(9113286782, 0.18), -- Barstow Wind Light Blustery Low Howl 1
rainLight = S(9112852668, 0.45), -- Rain Continuous Drizzle 1
rainHeavy = S(9112853287, 0.55), -- Rain Heavy 1
fire = S(9112780193, 0.6, { roll = 30 }), -- Fireplace Constant Burning Flame 1 (слышно у костра)
thunder = { "rbxassetid://9116282875", "rbxassetid://9116282646", "rbxassetid://9116282791", "rbxassetid://9116282544" },
-- рыбалка
cast = S(9120718279, 0.5, { pitch = { 0.9, 1.1 } }), -- Whoosh Fast Swish By 1
bite = S(9112751536, 0.7, { pitch = { 0.9, 1.15 } }), -- Bubble Bloop High Pitched Cute 1
reel = S(9114454019, 0.4), -- Fishing Reel 4 (петля, пока тянешь)
catchSplash = S(9119293555, 0.6), -- Small Splash Shallow Water
catch = S(9126073001, 0.5), -- Bell Tone Ding
fanfare = S(1836473422, 0.45), -- Victory Fanfare Sting (редкая рыба)
sparkle = S(9114369623, 0.5), -- Fairy Dust 1 (мутация)
escape = S(9117944976, 0.5), -- Puddle Splash 2 (сорвалась)
-- интерфейс
click = S(15675032796, 0.5), -- Roblox_UI_Small_Click
open = S(9117231552, 0.45), -- Paper Scroll Unroll Handle 4
coins = S(9113849306, 0.6), -- Coins Or Keys Jingle 1
chestHop = S(9120718279, 0.35, { pitch = { 0.7, 0.8 } }), -- Whoosh Fast Swish By 1 (сундук награды подпрыгивает)
chestLand = S(9113769181, 0.7, { pitch = { 0.95, 1.05 } }), -- Chair Drop 2: тяжёлый деревянный удар о землю
levelUp = S(1840525342, 0.5), -- Harp Glissando (A)
quest = S(9126073318, 0.5), -- Bell Tone Ding 2
}
Config.DefaultVolume = { music = 0.6, sfx = 0.8 }
---------------------------------------------------------------- донат (Robux)
-- Все товары — Developer Products игры (create.roblox.com → Monetization → Developer Products);
-- id — Product ID оттуда, robux — цена для кнопки (должна совпадать с ценой в Roblox).
-- Пропуска тоже Developer Products: покупаются один раз, сервер запоминает их в данных игрока навсегда.
-- Пока id = 0, кнопка покупки покажет подсказку, что товар не настроен.
Config.GamePasses = {
{ key = "VIP", id = 3728143641, robux = 199, icon = "👑", name = "VIP", desc = "+25% удачи и серебра, корона над головой" },
{ key = "DoubleCoins", id = 3728143692, robux = 299, icon = "⚪", name = "x2 Серебро", desc = "Вся рыба продаётся в 2 раза дороже" },
{ key = "LuckyCharm", id = 3728143735, robux = 349, icon = "🍀", name = "Талисман удачи", desc = "+50% удачи навсегда" },
{ key = "BigBag", id = 3728143773, robux = 149, icon = "🎒", name = "Бездонная сумка", desc = "+100 мест в любой сумке" },
}
Config.Products = {
{ key = "Coins1", id = 3728142264, robux = 49, icon = "👝", name = "Кошель серебра", desc = "+1 000 серебра (больше с уровнем)", coins = 1000 },
{ key = "Coins2", id = 3728142848, robux = 199, icon = "⚪", name = "Сундук серебра", desc = "+5 000 серебра (больше с уровнем)", coins = 5000 },
{ key = "Coins3", id = 3728142885, robux = 599, icon = "🏆", name = "Гора золота", desc = "+20 000 серебра (больше с уровнем)", coins = 20000 },
{ key = "Luck", id = 3728142916, robux = 99, icon = "🧪", name = "Супер-зелье удачи", desc = "+200% удачи на 15 минут", boost = 2.0, duration = 900 },
}
---------------------------------------------------------------- рыбалка
Config.BiteTimeMin = 3
Config.BiteTimeMax = 7
Config.BiteTimeout = 12
Config.MaxMisses = 2
-- заброс: держишь ЛКМ — сила ездит 0 → 1 → 0 → …; от силы в момент отпускания зависит дальность
Config.CastChargeTime = 1.3 -- секунд на проход шкалы в одну сторону
Config.CastMinDist, Config.CastMaxDist = 6, 28
Config.CastReach = 7 -- закидывать можно не дальше ~2 м (7 studs) от воды
Config.CastPerfect = { 0.72, 0.86 } -- зелёная зона шкалы
Config.CastPerfectLuck = 1.2 -- множитель удачи за попадание в зелёную зону
-- обучение: линия-подсказка ведёт по шагам 0 → 1 → 2 → 3, на 4 обучение пройдено
-- 0 — табличка «Как играть», 1 — портал в Мир 1, 2 — причал (поймать рыбу), 3 — скупка (продать)
Config.TutorialDone = 4
function Config.HitsNeeded(rank)
return math.ceil(rank / 2)
end
-- опыт до следующего уровня: до 8-го ≈ 3 600 (1,5–2 часа вместе с заказами гильдии);
-- у старых сохранений уровень не понижается — копится только опыт внутри уровня
function Config.XPForLevel(level)
return math.floor(50 * level ^ 1.6)
end
---------------------------------------------------------------- гильдия рыбаков
-- три валюты: серебро (coins в данных), жемчуг (pearls), печати гильдии (seals — копятся для ранга)
Config.Pearls = {
mutation = { Shiny = 1, Golden = 3, Rainbow = 10 }, -- за пойманную рыбу с мутацией
boss = 5, -- за победу над боссом
daily7 = 5, -- 7-й день ежедневной награды
rankUp = 10, -- за новый ранг
}
-- ранги: seals — сколько печатей нужно накопить, trial — испытание у Старейшины,
-- orders — заказов на доске, traps — ловушек, discount — скидка у торговцев
-- trial.kind: deliver (сдать рыбу из сумки), catch (поймать с условием), bossWin (участие в победе над боссом),
-- dex (собрать коллекцию мира)
Config.Guild = {
elder = "Старейшина Ворон",
ranks = {
{ id = "F", name = "Ученик", seals = 0, orders = 3, color = Color3.fromRGB(150, 150, 150),
unlocks = "Мир 1, доска заказов" },
{ id = "E", name = "Подмастерье", seals = 30, orders = 4, color = Color3.fromRGB(90, 190, 90), auto = true,
trial = { kind = "deliver", fish = "Okun", count = 5, text = "Сдать 5 окуней" },
unlocks = "🎣 Автоловля, 4-й заказ на доске" },
{ id = "D", name = "Рыбак", seals = 120, orders = 4, color = Color3.fromRGB(70, 130, 230), auto = true, traps = 1,
trial = { kind = "catch", minRank = 3, weathers = { Rain = true, Storm = true }, count = 1, text = "Поймать «Редкую» рыбу в дождь или грозу" },
unlocks = "🏝 Мир 2 (и ур. 8), 🧺 ловушка" },
{ id = "C", name = "Опытный рыбак", seals = 350, orders = 4, color = Color3.fromRGB(150, 80, 200), auto = true, traps = 2, discount = 0.05,
trial = { kind = "bossWin", count = 1, text = "Помочь одолеть босса озера" },
unlocks = "🧺 2 ловушки, скидка у торговцев 5%" },
{ id = "B", name = "Мастер", seals = 900, orders = 4, color = Color3.fromRGB(200, 50, 45), auto = true, traps = 3, discount = 0.05,
trial = { kind = "dex", world = "World1", text = "Собрать всю коллекцию «Тихого озера»" },
unlocks = "❄ Мир 3 (и ур. 18), 🧺 3 ловушки" },
{ id = "A", name = "Магистр", seals = 2000, orders = 4, color = Color3.fromRGB(230, 180, 60), auto = true, traps = 3, discount = 0.10,
trial = { kind = "catch", minRank = 4, night = true, count = 1, text = "Поймать «Эпическую» рыбу ночью" },
unlocks = "Титул «Магистр», скидка 10%" },
{ id = "S", name = "Легенда", seals = 4500, orders = 4, color = Color3.fromRGB(255, 120, 200), auto = true, traps = 3, discount = 0.10, autoNoCap = true,
trial = { kind = "catch", minRank = 6, count = 1, text = "Поймать «Мифическую» рыбу" },
unlocks = "Золотой жетон, автоловля без ограничения редкости" },
},
-- миры требуют и уровень, и ранг (номер в списке ranks)
worldRank = { World2 = 3, World3 = 5 },
elderDistance = 22, -- взять испытание / сдать рыбу — рядом со Старейшиной или доской
}
-- заказы гильдии: личные, обновляются каждые period секунд (окно floor(os.time()/period)),
-- один заказ можно перебросить за rerollPearls жемчуга. Награда растёт с рангом
Config.Orders = {
period = 10800,
rerollPearls = 2,
pearlChance = 0.2, pearlsMin = 1, pearlsMax = 3,
coinsPerSeal = 12, -- серебро за заказ = печати × это × (1 + 0.5 · (ранг − 1))
-- weight — как часто выпадает; seals — печати {мин, макс}
kinds = {
deliver = { weight = 3, seals = { 5, 12 } },
heavy = { weight = 2, seals = { 8, 16 } },
weather = { weight = 1, seals = { 10, 20 } },
night = { weight = 1, seals = { 10, 22 } },
combo = { weight = 2, seals = { 8, 18 } },
perfect = { weight = 2, seals = { 6, 14 } },
},
}
-- наживка: 1 слот, 1 штука тратится на заброс. price — за пачку из pack штук; currency = "pearls" — за жемчуг
Config.Baits = {
{ id = "Worm", name = "Червь", icon = "🐛", price = 40, pack = 10, speed = 0.9, desc = "Клюёт на 10% быстрее" },
{ id = "Larva", name = "Мотыль", icon = "🦐", price = 90, pack = 10, luck = 0.15, desc = "Удача +15%" },
{ id = "Firefly", name = "Светлячок", icon = "✨", price = 120, pack = 10, nightLuck = 0.30, desc = "Ночью удача +30% (вместо +10%)" },
{ id = "Blood", name = "Кровавая приманка", icon = "🩸", price = 400, pack = 10, rareWeight = 1.5, rank = 3, desc = "Редкие и выше попадаются в 1,5 раза чаще" },
{ id = "Pearl", name = "Жемчужная блесна", icon = "🦪", price = 5, pack = 5, mutation = 2, currency = "pearls", desc = "Шанс мутаций ×2" },
}
-- автоловля (с ранга E): сервер сам забрасывает и вытаскивает, но со штрафами
Config.AutoFish = {
luck = 0.6, -- удача ×0.6
maxRarity = 3, -- не выше «Редкой» (ранг S снимает)
slower = 1.5, -- каждая поимка на 50% дольше
reel = 2.5, -- секунд «вываживания» вместо мини-игры
}
-- ловушки-вентери (с ранга D): 1 рыба Мира 1 каждые every секунд, не больше max, копятся и офлайн
Config.Traps = {
every = 900, max = 16,
world = "World1", rarities = { Common = 3, Uncommon = 1 }, -- вес редкостей
}
-- отдых: пока игрока нет, копится двойной опыт — 1 минута за каждые perOffline минут офлайн, не больше max
Config.Rest = { perOffline = 4, max = 3600, mult = 2 }
function Config.RankById(id)
for i, r in ipairs(Config.Guild.ranks) do
if r.id == id then
return r, i
end
end
return nil
end
---------------------------------------------------------------- помощники
function Config.Find(list, id)
for _, item in ipairs(list) do
if item.id == id or item.key == id then
return item
end
end
return nil
end
function Config.FindFish(fishId)
for zoneId, zone in pairs(Config.Zones) do
for _, f in ipairs(zone.fish) do
if f.id == fishId then
return f, zoneId
end
end
end
return nil
end
function Config.RodStats(rodId, upgradeLevel)
local rod = Config.Find(Config.Rods, rodId) or Config.Rods[1]
local u = Config.RodUpgrade
upgradeLevel = upgradeLevel or 0
return {
luck = rod.luck + u.luckPerLevel * upgradeLevel,
speed = rod.speed * (u.speedPerLevel ^ upgradeLevel),
zone = rod.zone + u.zonePerLevel * upgradeLevel,
}
end
return Config
+463
View File
@@ -0,0 +1,463 @@
"""Модель баланса экономики v2 (только чтение конфига, игру не меняет). Стандартная библиотека Python.
Запуск из любой папки: py -3 tools/economy_model.py
Читает src/ReplicatedStorage/FishConfig.lua (текущий баланс) и tools/baseline/FishConfig_v1.lua (баланс
до v2), пишет docs/economy-balance.md (таблицы) и docs/economy-model-results.json (все числа).
Это МАТЕМАТИЧЕСКАЯ модель ожиданий, а не замер игроков:
* темп — «успешных ручных поимок за минуту эффективной игры» (с продажей и переходами, без AFK);
его нужно измерить телеметрией (CareerXP / LevelUp / economy events) и подставить сюда;
* доход рыбы — точное ожидание по формулам сервера (rollFish), без случайных хвостов;
* задания, босс, заказы, ежедневка — средние оценки по допущениям ниже (ASSUMPTIONS);
* покупки — жадный маршрут: следующая удочка, когда позволяет уровень и серебро; сумки и улучшения —
когда на них хватает без задержки ближайшей удочки.
"""
import json
import math
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
CUR = (ROOT / 'src/ReplicatedStorage/FishConfig.lua').read_text(encoding='utf-8-sig')
OLD = (ROOT / 'tools/baseline/FishConfig_v1.lua').read_text(encoding='utf-8-sig')
RAR = ['Common', 'Uncommon', 'Rare', 'Epic', 'Legendary', 'Mythic']
WORLDS = ['World1', 'World2', 'World3']
ASSUMPTIONS = {
'fail_rate': 0.12, # доля сорвавшихся поклёвок (серия сгорает)
'perfect_cast_share': 0.45, # доля забросов в зелёную зону (удача x1.2)
'night_share': 0.35, # доля ночи (удача +10%)
'weather_luck': 0.05 * 0.25 + 0.25 * 0.08, # пасмурно 25% времени +5%, гроза 8% +25%
'event_share_each': 180 / (180 + 570) / 4, # каждое из 4 событий ~6% времени
'boss_win_rate': 0.7, 'boss_share': 0.8, # победа над боссом и доля участия
'orders_per_hour': 1.5, # заказов гильдии за час игры (3-4 заказа в окне 3 ч)
'order_seals_avg': 13,
'daily_session_min': 90, # ежедневка делится на столько минут игры в день
'consumables_per_min': {'World1': 2, 'World2': 6, 'World3': 12}, # обычные траты: наживка, иногда зелье
'quest_rates': {'perfect': 0.6, 'perfectCast': 0.45, 'buy_min': 2.0, 'boss_min': 6.0},
}
def num(pattern, text, cast=float, default=None):
m = re.search(pattern, text, re.S)
return cast(m.group(1)) if m else default
def block(text, head):
i = text.index(head)
depth, j = 0, text.index('{', i)
for k in range(j, len(text)):
if text[k] == '{':
depth += 1
elif text[k] == '}':
depth -= 1
if depth == 0:
return text[j:k + 1]
raise ValueError(head)
def parse(text, legacy=False):
c = {}
zones = block(text, 'Config.Zones = {')
if legacy:
rows = re.findall(r'id = "(\w+)",\s*name = "[^"]*",\s*rarity = "(\w+)",\s*price = (\d+),\s*xp = (\d+)', zones)
c['fish'] = [dict(id=a, rarity=b, price=int(p), xp=int(x)) for a, b, p, x in rows]
else:
rows = re.findall(r'id = "(\w+)",\s*name = "[^"]*",\s*rarity = "(\w+)",\s*price = (\d+)', zones)
c['fish'] = [dict(id=a, rarity=b, price=int(p)) for a, b, p in rows]
assert len(c['fish']) == 36, len(c['fish'])
rods = re.findall(r'\{ id = "(\w+)",\s*name = "[^"]*",\s*price = (\d+),\s*level = (\d+),\s*luck = ([\d.]+),\s*speed = ([\d.]+),\s*zone = ([\d.]+),\s*upgradeCost = (\d+)', block(text, 'Config.Rods = {'))
c['rods'] = [dict(id=a, price=int(p), level=int(l), luck=float(lu), speed=float(s), upgradeCost=int(u)) for a, p, l, lu, s, z, u in rods]
bags = re.findall(r'\{ id = "(\w+)",\s*name = "[^"]*",\s*price = (\d+),\s*level = (\d+),\s*capacity = (\d+)', block(text, 'Config.Bags = {'))
c['bags'] = [dict(id=a, price=int(p), level=int(l), capacity=int(cap)) for a, p, l, cap in bags]
up = block(text, 'Config.RodUpgrade = {')
c['up'] = dict(max=num(r'maxLevel = (\d+)', up, int), luck=num(r'luckPerLevel = ([\d.]+)', up), speed=num(r'speedPerLevel = ([\d.]+)', up))
c['luck_per_level'] = num(r'Config.LuckPerPlayerLevel = ([\d.]+)', text)
rr = block(text, 'Config.Rarities = {')
c['weights'] = {r: float(re.search(r + r'\s*= \{[^}]*weight = ([\d.]+)', rr).group(1)) for r in RAR}
c['mutations'] = [(float(ch), int(m)) for ch, m in re.findall(r'chance = ([\d.]+), mult = (\d+)', block(text, 'Config.Mutations = {'))]
cb = re.search(r'Config.Combo = \{ step = ([\d.]+), max = ([\d.]+)', text)
c['combo'] = (float(cb.group(1)), float(cb.group(2)))
qk = block(text, 'Config.QuestKinds = {')
c['quest_kinds'] = {}
for name, body in re.findall(r'(\w+)\s*= \{ (text = [^}]*)\}', qk):
c['quest_kinds'][name] = dict(coins=float(re.search(r'coins = ([\d.]+)', body).group(1)),
xp=float(num(r'xp = ([\d.]+)', body, float, 0)),
max=num(r'max = (\d+)', body, int), byLevel='byLevel' in body)
c['chains'] = [re.findall(r'\{ "(\w+)", (\d+) \}', line) for line in re.findall(r'steps = \{(.*?)\} \}', block(text, 'Config.QuestChains = {'))]
c['tier_growth'] = num(r'Config.QuestTierGrowth = ([\d.]+)', text)
c['chain_coins'] = num(r'Config.ChainBonus = \{ coins = (\d+)', text)
c['chain_xp'] = num(r'Config.ChainBonus = \{[^}]*xp = (\d+)', text, float, 0)
c['quest_min'] = num(r'Config.QuestMinCoins = (\d+)', text, float, 10)
boss = block(text, 'Config.Boss = {')
c['boss'] = dict(coins=num(r'reward = \{ coins = (\d+)', boss), xp=num(r'reward = \{[^}]*xp = (\d+)', boss, float, 0),
cycle=num(r'interval = (\d+)', boss) + num(r'duration = (\d+)', boss))
c['daily'] = [int(x) for x in re.findall(r'coins = (\d+)', block(text, 'Config.DailyRewards = {'))]
c['coins_per_seal'] = num(r'coinsPerSeal = (\d+)', text)
c['bite'] = (num(r'Config.BiteTimeMin = ([\d.]+)', text), num(r'Config.BiteTimeMax = ([\d.]+)', text))
events = block(text, 'Config.Events = {')
c['fair'] = num(r'id = "Fair".*?sell = ([\d.]+)', events)
if not legacy:
e = block(text, 'Config.Economy = {')
c['career'] = {w: int(x) for w, x in re.findall(r'(World\d) = (\d+)', block(e, 'careerXP = {'))}
c['rarity_luck'] = {r: float(x) for r, x in re.findall(r'(\w+) = ([\d.]+)', block(e, 'rarityLuck = {'))}
for key in ['luckCap', 'mutationLuck', 'mutationCap', 'waitFloor', 'minBite', 'reelPerHit', 'valueBonusCap', 'restSilver', 'autoValue', 'autoMinCycle']:
c[key] = num(key + r' = ([\d.]+)', e)
c['level_xp'] = [int(x) for x in re.findall(r'\d+', re.sub(r'--[^\n]*', '', block(text, 'Config.LevelXP = {')))]
after = block(text, 'Config.LevelXPAfter = {')
c['level_after'] = dict(per=num(r'perMinute = (\d+)', after), minutes=num(r'minutes = (\d+)', after), step=num(r'step = (\d+)', after))
c['potions'] = re.findall(r'id = "(\w+)",\s*name = "[^"]*",\s*icon = "[^"]*",\s*price = (\d+), level = (\d+), charges = (\d+)', block(text, 'Config.Potions = {'))
c['tier'] = {w: int(x) for w, x in re.findall(r'id = "(World\d)",[^\n]*tier = (\d+)', text)}
m = block(text, 'Config.Market = {')
c['market'] = dict(fee=num(r'fee = ([\d.]+)', m), minLevel=num(r'minLevel = (\d+)', m, int), minPrice=num(r'minPriceMult = ([\d.]+)', m))
return c
NEW, BASE = parse(CUR), parse(OLD, legacy=True)
# ---------------------------------------------------------------- улов: ожидания (как rollFish на сервере)
def eff_luck(c, luck):
b = luck - 1
if b <= 0:
return max(-0.8, b)
return c['luckCap'] * (1 - math.exp(-b / c['luckCap']))
def fish_dist(c, world, luck, legacy=False, max_rank=None):
rows = c['fish'][WORLDS.index(world) * 12:(WORLDS.index(world) + 1) * 12]
ws = []
for f in rows:
rank = RAR.index(f['rarity']) + 1
base = c['weights'][f['rarity']]
if legacy:
w = base / max(1, luck) if rank == 1 else base * max(0.2, 1 + (luck - 1) * (rank - 1))
else:
be = eff_luck(c, luck)
k = c['rarity_luck'][f['rarity']]
w = base / max(0.2, 1 + be * k) if rank == 1 else base * max(0.2, 1 + be * k)
if max_rank and rank > max_rank:
w = 0
ws.append(w)
t = sum(ws)
return [(f, w / t) for f, w in zip(rows, ws)]
def mutation_value(c, luck, legacy=False, other=1.0):
if legacy:
mm = luck * other
else:
be = eff_luck(c, luck)
mm = min(c['mutationCap'], max(0.2, 1 + be * c['mutationLuck']) * other)
rem, vm, p_any = 1.0, 0.0, 0.0
for ch, mult in c['mutations']:
p = rem * min(1, ch * mm)
vm += p * mult
p_any += p
rem -= p
return vm + rem, p_any
WEIGHT_FACTOR = 0.75 + 0.9 / 3.2 # E[0.75 + 0.9 u^2.2]
def fish_ev(c, world, luck, legacy=False, max_rank=None):
d = fish_dist(c, world, luck, legacy, max_rank)
vm, p_mut = mutation_value(c, luck, legacy)
value = sum(p * f['price'] for f, p in d) * WEIGHT_FACTOR * vm
xp = sum(p * f.get('xp', 0) for f, p in d) * (1 + p_mut) if legacy else 0
p_rank = {r: sum(p for f, p in d if RAR.index(f['rarity']) >= RAR.index(r)) for r in RAR}
return value, xp, p_rank
def blended_ev(c, world, luck, legacy=False):
s = ASSUMPTIONS['perfect_cast_share']
a = fish_ev(c, world, luck, legacy)
b = fish_ev(c, world, luck * 1.2, legacy)
return a[0] * (1 - s) + b[0] * s, a[1] * (1 - s) + b[1] * s, {k: a[2][k] * (1 - s) + b[2][k] * s for k in a[2]}
def combo_bonus(c, legacy=False):
"""E[надбавка серии]: серия до поимки ~ геометрическая (срыв с вероятностью fail_rate)"""
p = ASSUMPTIONS['fail_rate']
step, cap = c['combo']
e = 0.0
for k in range(0, 200):
pk = (1 - p) ** k * p
e += pk * (min(cap, 1 + step * k) - 1 if legacy else min(cap, step * k))
return e
# ---------------------------------------------------------------- прочие источники серебра
def quest_income(c, world, catches, ev, p_rank, tier, legacy=False, level=1):
"""серебро (и опыт для старой версии) в минуту от цепочек заданий: шаги идут по очереди"""
q = ASSUMPTIONS['quest_rates']
coins_total = xp_total = minutes = 0.0
for tier_round in range(2):
for chain in c['chains']:
for kind, base in chain:
k = c['quest_kinds'][kind]
goal = int(base) * (1 + c['tier_growth'] * tier_round)
if k['byLevel']:
goal *= (1 + (level - 1) * 0.25) if legacy else tier
goal = math.ceil(goal)
if k['max']:
goal = min(goal, k['max'])
rate = {'catch': catches, 'sell': catches, 'uncommon': catches * p_rank['Uncommon'], 'rare': catches * p_rank['Rare'],
'perfect': catches * q['perfect'], 'perfectCast': catches * q['perfectCast'], 'earn': catches * ev}.get(kind)
if kind == 'combo':
t = goal / catches / ((1 - ASSUMPTIONS['fail_rate']) ** goal)
elif kind == 'buy':
t = q['buy_min']
elif kind == 'boss':
t = q['boss_min']
else:
t = goal / rate
m = (1 + (level - 1) * 0.25) if legacy else tier
minimum = 10 if legacy else c['quest_min'] * tier
coins_total += max(minimum, math.floor(k['coins'] * goal * m))
xp_total += max(10, math.floor(k['xp'] * goal * m)) if legacy else 0
minutes += t
bm = ((1 + (level - 1) * 0.25) if legacy else tier) * (1 + c['tier_growth'] * tier_round)
coins_total += c['chain_coins'] * bm
xp_total += c['chain_xp'] * bm if legacy else 0
return coins_total / minutes, xp_total / minutes
def other_income(c, world, tier, legacy=False, level=1, world_mult=1):
a = ASSUMPTIONS
if legacy:
boss = c['boss']['coins'] * world_mult * a['boss_share'] * (1 + (level - 1) * 0.25) * a['boss_win_rate'] / (c['boss']['cycle'] / 60)
order = a['order_seals_avg'] * c['coins_per_seal'] * (1 + 0.5 * min(6, level // 4)) * a['orders_per_hour'] / 60
daily = sum(c['daily']) / len(c['daily']) * (1 + (level - 1) * 0.2) / a['daily_session_min']
boss_xp = c['boss']['xp'] * world_mult * a['boss_share'] * a['boss_win_rate'] / (c['boss']['cycle'] / 60)
return dict(boss=boss, orders=order, daily=daily), boss_xp
boss = c['boss']['coins'] * tier * a['boss_share'] * a['boss_win_rate'] / (c['boss']['cycle'] / 60)
order = a['order_seals_avg'] * c['coins_per_seal'] * tier * a['orders_per_hour'] / 60
daily = sum(c['daily']) / len(c['daily']) * tier / a['daily_session_min']
return dict(boss=boss, orders=order, daily=daily), 0
def ambient_luck():
return ASSUMPTIONS['night_share'] * 0.10 + ASSUMPTIONS['weather_luck'] + ASSUMPTIONS['event_share_each'] * 0.5
# ---------------------------------------------------------------- уровни
def xp_for(c, level, legacy=False):
if legacy:
return math.floor(50 * level ** 1.6)
if level <= len(c['level_xp']):
return c['level_xp'][level - 1]
a = c['level_after']
return a['per'] * (a['minutes'] + a['step'] * (level - len(c['level_xp'])))
def world_for(level):
return 'World3' if level >= 18 else 'World2' if level >= 8 else 'World1'
def level_minutes(c, catches, upto):
t = 0.0
out = {}
for lvl in range(1, upto):
t += xp_for(c, lvl) / (catches * c['career'][world_for(lvl)])
out[lvl + 1] = round(t, 1)
return out
# ---------------------------------------------------------------- поминутная симуляция покупок
def simulate(c, catches, minutes=1500, paid=False, legacy=False):
st = dict(level=1, xp=0.0, coins=0.0, rod=0, rodlv={}, bag=0, t=0)
events, income_by_world = [], {w: [] for w in WORLDS}
rods, bags = c['rods'], c['bags']
combo = combo_bonus(c, legacy)
fair = 1 + ASSUMPTIONS['event_share_each'] * (c['fair'] - 1)
for minute in range(1, minutes + 1):
world = world_for(st['level'])
tier = c['tier'][world] if not legacy else 1
rod = rods[st['rod']]
up = st['rodlv'].get(st['rod'], 0)
luck = 1 + rod['luck'] + up * c['up']['luck'] + (st['level'] - 1) * c['luck_per_level'] + ambient_luck() + (0.75 if paid else 0)
ev, xp_catch, p_rank = blended_ev(c, world, luck, legacy)
sale = fair * ((1.25 * 2) if paid else 1)
if legacy:
fish = catches * ev * (1 + combo) * sale
else:
fish = catches * ev * (1 + min(c['valueBonusCap'], combo)) * sale
q_coins, q_xp = quest_income(c, world, catches, ev, p_rank, tier, legacy, st['level'])
other, boss_xp = other_income(c, world, tier, legacy, st['level'], {'World1': 1, 'World2': 4, 'World3': 12}[world])
cons = 0 if legacy else ASSUMPTIONS['consumables_per_min'][world]
gain = fish + q_coins + sum(other.values()) - cons
income_by_world[world].append(dict(fish=fish, quests=q_coins, cons=cons, **other))
st['coins'] += gain
if legacy:
st['xp'] += catches * xp_catch * (1 + combo) + q_xp + boss_xp
else:
st['xp'] += catches * c['career'][world]
while st['xp'] >= xp_for(c, st['level'], legacy):
st['xp'] -= xp_for(c, st['level'], legacy)
st['level'] += 1
events.append((minute, 'level', st['level']))
# покупки: следующая удочка → сумка → улучшение
bought = True
while bought:
bought = False
nxt = st['rod'] + 1
if nxt < len(rods) and st['level'] >= rods[nxt]['level'] and st['coins'] >= rods[nxt]['price']:
st['coins'] -= rods[nxt]['price']
st['rod'] = nxt
events.append((minute, 'rod', rods[nxt]['id']))
bought = True
continue
reserve = rods[nxt]['price'] if nxt < len(rods) and st['level'] >= rods[nxt]['level'] - 1 else 0
nb = st['bag'] + 1
if nb < len(bags) and st['level'] >= bags[nb]['level'] and st['coins'] - reserve >= bags[nb]['price']:
st['coins'] -= bags[nb]['price']
st['bag'] = nb
events.append((minute, 'bag', bags[nb]['id']))
bought = True
continue
lv = st['rodlv'].get(st['rod'], 0)
cost = math.floor(rods[st['rod']]['upgradeCost'] * (lv + 1) ** 1.5)
if lv < c['up']['max'] and st['coins'] - reserve >= cost * 2:
st['coins'] -= cost
st['rodlv'][st['rod']] = lv + 1
events.append((minute, 'upgrade', f"{rods[st['rod']]['id']}+{lv + 1}"))
bought = True
avg = {}
for w, rows in income_by_world.items():
if rows:
keys = rows[0].keys()
avg[w] = {k: round(sum(r[k] for r in rows) / len(rows), 1) for k in keys}
avg[w]['net'] = round(sum(sum(v for k, v in r.items() if k != 'cons') - r['cons'] for r in rows) / len(rows), 1)
avg[w]['minutes'] = len(rows)
return events, avg, st
def first(events, kind, value=None):
for m, k, v in events:
if k == kind and (value is None or v == value):
return m
return None
# ---------------------------------------------------------------- отчёт
def main():
res = {'assumptions': ASSUMPTIONS}
scen = {'Новичок / телефон': 3, 'Обычный активный': 4, 'Опытный': 5, 'Оптимизированный (снасти + зелья)': 6, 'Предел механики': 7.5}
res['levels'] = {name: {k: v for k, v in level_minutes(NEW, cpm, 26).items() if k in (3, 5, 8, 10, 13, 18, 25)} for name, cpm in scen.items()}
# до v2: опыт за поимку с серией, первой поимкой и мутациями; плюс задания и босс
old = {}
for cpm in (3, 4, 5):
ev_old, _, st = simulate(BASE, cpm, minutes=1300, legacy=True)
old[cpm] = {k: first(ev_old, 'level', k) for k in (3, 5, 8, 10, 13, 18, 25)}
res['levels_before'] = old
sims = {}
for name, cpm, paid in [('Новичок 3/мин', 3, False), ('Обычный 4/мин', 4, False), ('Опытный 5/мин', 5, False), ('Платные пропуска 4/мин', 4, True)]:
evs, avg, st = simulate(NEW, cpm, minutes=1400, paid=paid)
sims[name] = dict(
purchases=[(m, k, v) for m, k, v in evs if k != 'level'],
first_purchase=min([m for m, k, v in evs if k in ('rod', 'bag')] or [None]),
rods={r['id']: first(evs, 'rod', r['id']) for r in NEW['rods'][1:]},
income=avg, coins_left=round(st['coins']))
res['simulations'] = sims
evs_old, avg_old, _ = simulate(BASE, 4, minutes=1300, legacy=True)
res['income_before_4cpm'] = avg_old
res['rods_before_4cpm'] = {r['id']: first(evs_old, 'rod', r['id']) for r in BASE['rods'][1:]}
# ожидания одной поимки по снаряжению
gear = []
for world, rod_ids in [('World1', ['Basic', 'Bamboo', 'Fiberglass']), ('World2', ['Carbon', 'Coral', 'Golden']), ('World3', ['Frost', 'Legend'])]:
for rid in rod_ids:
rod = next(r for r in NEW['rods'] if r['id'] == rid)
lvl = {'World1': 4, 'World2': 12, 'World3': 22}[world]
luck = 1 + rod['luck'] + (lvl - 1) * NEW['luck_per_level'] + ambient_luck()
v, _, pr = blended_ev(NEW, world, luck)
gear.append(dict(world=world, rod=rid, luck=round(luck, 2), silver_per_catch=round(v, 1), epic_plus=round(pr['Epic'] * 100, 2), mythic=round((pr['Mythic']) * 100, 3)))
res['per_catch'] = gear
# скорость клёва: множитель ожидания лучшей снасти до/после
old_best = BASE['rods'][-1]['speed'] * BASE['up']['speed'] ** BASE['up']['max'] * 0.5 * 0.85 * 0.9
new_best = max(NEW['waitFloor'], NEW['rods'][-1]['speed'] * NEW['up']['speed'] ** NEW['up']['max'] * 0.85 * 0.92 * 0.93 * 0.9)
res['wait_mult'] = dict(before=round(old_best, 3), after=round(new_best, 3))
# автоловля против ручной (мир, снаряжение середины)
autos = []
for world, rid, lvl in [('World1', 'Fiberglass', 6), ('World2', 'Golden', 15), ('World3', 'Legend', 25)]:
rod = next(r for r in NEW['rods'] if r['id'] == rid)
luck = 1 + rod['luck'] + (lvl - 1) * NEW['luck_per_level'] + ambient_luck()
manual = blended_ev(NEW, world, luck)[0] * 4
auto_rate = 60 / NEW['autoMinCycle']
auto = fish_ev(NEW, world, luck * 0.6, max_rank=3)[0] * NEW['autoValue'] * auto_rate
autos.append(dict(world=world, manual_fish_silver_min=round(manual, 1), auto_silver_min=round(auto, 1), auto_catches_min=round(auto_rate, 2), auto_xp_min=0,
manual_xp_min=4 * NEW['career'][world]))
res['auto'] = autos
out = ROOT / 'docs' / 'economy-model-results.json'
out.write_text(json.dumps(res, ensure_ascii=False, indent=1) + '\n', encoding='utf-8')
write_md(res)
print(json.dumps({k: res[k] for k in ('levels', 'levels_before', 'wait_mult')}, ensure_ascii=False, indent=1))
for name, s in sims.items():
print(name, 'first purchase', s['first_purchase'], 'rods', s['rods'])
for w, a in s['income'].items():
print(' ', w, a)
print('before income', avg_old)
print('per catch', gear)
print('auto', autos)
def hm(m):
if m is None:
return '—'
return f"{int(m // 60)} ч {int(m % 60):02d} мин" if m >= 60 else f"{int(round(m))} мин"
def write_md(res):
L = ['# Экономика v2 — расчёт баланса', '',
'Сгенерировано `py -3 tools/economy_model.py`. Это математическая модель ожиданий по формулам сервера '
'и допущениям ниже, **не замер игроков**. Цели по времени считаются подтверждёнными только после '
'телеметрии (события CareerXP, LevelUp, economy events) и плейтестов.', '',
'## Время до уровней (эффективная игра, без AFK)', '',
'| Сценарий | ур. 3 | ур. 5 | ур. 8 (Мир 2) | ур. 10 | ур. 13 | ур. 18 (Мир 3) | ур. 25 |', '|---|---:|---:|---:|---:|---:|---:|---:|']
scen_cpm = {'Новичок / телефон': 3, 'Обычный активный': 4, 'Опытный': 5, 'Оптимизированный (снасти + зелья)': 6, 'Предел механики': 7.5}
for name, lv in res['levels'].items():
L.append(f"| {name} — {scen_cpm[name]} рыб/мин | " + ' | '.join(hm(lv[k]) for k in (3, 5, 8, 10, 13, 18, 25)) + ' |')
L += ['', 'До v2 (та же модель, опыт с серией ×2, первой поимкой, мутациями, заданиями и боссом):', '',
'| Темп | ур. 3 | ур. 5 | ур. 8 | ур. 10 | ур. 13 | ур. 18 | ур. 25 |', '|---|---:|---:|---:|---:|---:|---:|---:|']
for cpm, lv in res['levels_before'].items():
L.append(f"| {cpm} рыб/мин | " + ' | '.join(hm(lv[k]) for k in (3, 5, 8, 10, 13, 18, 25)) + ' |')
L += ['', 'Опыт карьеры зависит только от темпа ручной ловли: снасти, удача, редкость, зелья и пропуска его не ускоряют. '
'Разброс между игроками — это разброс темпа (3–6 рыб/мин), а не случайные скачки.', '',
f"Ускорение клёва: лучшая снасть со всеми бонусами раньше давала множитель ожидания ×{res['wait_mult']['before']}, теперь не меньше ×{res['wait_mult']['after']}.", '',
'## Доход серебра, ⚪ в минуту (обычный игрок, 4 рыбы/мин)', '',
'| Мир | рыба | задания | босс | заказы | ежедневка | расходники | итого | цель |', '|---|---:|---:|---:|---:|---:|---:|---:|---:|']
target = {'World1': 60, 'World2': 120, 'World3': 240}
for w, a in res['simulations']['Обычный 4/мин']['income'].items():
L.append(f"| {w} | {a['fish']} | {a['quests']} | {a['boss']} | {a['orders']} | {a['daily']} | −{a['cons']} | **{a['net']}** | {target[w]} |")
L += ['', 'До v2, та же модель (4 рыбы/мин): ' + ', '.join(f"{w}: {a['net']} ⚪/мин" for w, a in res['income_before_4cpm'].items()), '',
'## Серебро за одну поимку по снаряжению', '', '| Мир | Удочка | Удача | ⚪ за рыбу | Эпическая+ % | Мифическая % |', '|---|---|---:|---:|---:|---:|']
for g in res['per_catch']:
L.append(f"| {g['world']} | {g['rod']} | {g['luck']} | {g['silver_per_catch']} | {g['epic_plus']} | {g['mythic']} |")
L += ['', '## Маршрут покупок (жадный, модель)', '', '| Сценарий | первая покупка | ' + ' | '.join(r['id'] for r in NEW['rods'][1:]) + ' |',
'|---|---:|' + '---:|' * (len(NEW['rods']) - 1)]
for name, s in res['simulations'].items():
L.append(f"| {name} | {hm(s['first_purchase'])} | " + ' | '.join(hm(s['rods'][r['id']]) for r in NEW['rods'][1:]) + ' |')
L.append('| До v2, 4/мин | — | ' + ' | '.join(hm(res['rods_before_4cpm'].get(r['id'])) for r in BASE['rods'][1:]) + ' |')
L += ['', 'Удочку можно купить не раньше её уровня; задержка после уровня — время накопить. '
'Платные пропуска (VIP + x2 серебро + талисман) ускоряют покупки, но не уровни.', '',
'## Автоловля против ручной ловли', '', '| Мир | ручная: ⚪/мин (рыба) | авто: ⚪/мин | авто: рыб/мин | опыт/мин ручная | опыт/мин авто |', '|---|---:|---:|---:|---:|---:|']
for a in res['auto']:
L.append(f"| {a['world']} | {a['manual_fish_silver_min']} | {a['auto_silver_min']} | {a['auto_catches_min']} | {a['manual_xp_min']} | {a['auto_xp_min']} |")
L += ['', '## Допущения', '']
for k, v in ASSUMPTIONS.items():
L.append(f"- `{k}` = {v}")
L += ['', 'Ограничения: модель не воспроизводит случайные хвосты (мифическая рыба, серия удачных мутаций), '
'поведение реальных игроков, очереди к скупщику, рынок игроков и пропуски заданий. '
'Темп в рыбах/мин — главная неизвестная: замерить его до выводов о времени прохождения.', '']
(ROOT / 'docs' / 'economy-balance.md').write_text('\n'.join(L), encoding='utf-8')
if __name__ == '__main__':
main()
+76
View File
@@ -0,0 +1,76 @@
"""Read-only balance analysis; no game files modified. Python standard library only.
Expected-value budgets, NOT a full gameplay simulation. Run from any directory.
"""
import json
import math
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
# баланс ДО экономики v2 (снимок); текущий баланс считает tools/economy_model.py
source = (ROOT / 'tools/baseline/FishConfig_v1.lua').read_text(encoding='utf-8-sig')
fish_section = source.split('Config.Zones = {', 1)[1].split('Config.Rods = {', 1)[0]
fish = re.findall(r'rarity = "(\w+)",\s+price = (\d+),\s+xp = (\d+)', fish_section)
assert len(fish) == 36
rarities = ['Common', 'Uncommon', 'Rare', 'Epic', 'Legendary', 'Mythic']
base_weights = [55, 27, 11, 4.5, 1.2, .25]
def old_expectation(world, luck):
rows = fish[(world-1)*12:world*12]
weights = []
for rarity, _, _ in rows:
rank = rarities.index(rarity)
weights.append(base_weights[rank] / max(1, luck) if rank == 0
else base_weights[rank] * max(.2, 1 + (luck-1)*rank))
ps = [w / sum(weights) for w in weights]
# Sequential independent mutation rolls, no weather/event/bait mutation multipliers.
remaining, mutation_p, value_mult = 1., 0., 0.
for chance, mult in [(.002, 10), (.01, 5), (.04, 2)]:
p = remaining * min(1, chance*luck)
mutation_p += p
value_mult += p * mult
remaining -= p
value_mult += remaining
xp = sum(p*int(row[2]) for p, row in zip(ps, rows)) * (1 + mutation_p)
value = sum(p*int(row[1]) for p, row in zip(ps, rows)) * (0.75 + .9/3.2) * value_mult
return dict(world=world, luck=luck, xp_per_catch=round(xp, 3),
silver_per_catch_before_combo_sale=round(value, 3),
xp_per_min_4_catches_combo2=round(xp*8, 2))
minutes = [5,8,12,15,20,25,35,35,40,45,45,50,55,60,65,70,75,75,80,85,90,95,100,115]
rows, elapsed = [], 0
for level, target in enumerate(minutes, 1):
world = 1 if level < 8 else 2 if level < 18 else 3
rate = {1:20, 2:28, 3:36}[world]
elapsed += target
rows.append(dict(from_level=level, to_level=level+1, world=world,
xp_required=target*rate, target_minutes=target,
cumulative_minutes=elapsed))
milestones = [r for r in rows if r['to_level'] in [3,5,8,10,13,18,25]]
# Proposed career XP = fixed 5/7/9 per successful manual catch by world.
# Other rewards move to silver/materials/research, not career XP.
scenarios = []
for catches in [3,4,5]:
rates = {w:catches*base for w,base in [(1,5),(2,7),(3,9)]}
for milestone in [8,18,25]:
t = sum(r['xp_required']/rates[r['world']] for r in rows if r['to_level'] <= milestone)
scenarios.append(dict(catches_per_effective_minute=catches,to_level=milestone,minutes=round(t,1)))
result = dict(
assumptions='Current: stationary catch expectations, excludes quests, first discoveries, collection rewards and catch timing. Proposed: budget model, 4 successful manual catches/effective minute, fixed career XP 5/7/9 per world; no other career XP sources or multipliers. Proposed world access exactly at levels 8/18; guild must not add delays. Effective minutes include normal travel/selling, exclude AFK.',
current_xp_to_level={str(l):sum(math.floor(50*k**1.6) for k in range(1,l)) for l in [3,5,8,18,25]},
current_expectations=[old_expectation(w,luck) for w,luck in [(1,1),(1,1.8),(2,2.5),(3,4)]],
proposed_levels=rows, milestones=milestones, sensitivity=scenarios)
out = ROOT/'docs'/'progression-budget-results.json'
out.write_text(json.dumps(result,ensure_ascii=False,indent=2)+'\n',encoding='utf-8')
table = ['| Переход | Мир | XP на переход | Минут на переход | Минут всего |',
'|---|---:|---:|---:|---:|']
for r in rows:
table.append(f"| {r['from_level']} → {r['to_level']} | {r['world']} | {r['xp_required']} | {r['target_minutes']} | {r['cumulative_minutes']} |")
(ROOT/'docs'/'progression-level-table.md').write_text(
'# Предлагаемая кривая уровней\n\n'
'Расчёт бюджета, не замер живых игроков и не симуляция клиента. '
'4 успешные ручные поимки за минуту эффективной игры, включая обычные перемещения и продажу, без AFK. '
'Опыт карьеры: 5/7/9 за рыбу миров 1/2/3. Других источников и множителей XP карьеры нет. '
'Доступ к мирам на уровнях 8/18; ранг не добавляет ожидания. '
'Таблица не применена к игре.\n\n'+'\n'.join(table)+'\n',encoding='utf-8')
print(json.dumps({k:v for k,v in result.items() if k not in ['proposed_levels','assumptions']}, ensure_ascii=False,indent=2))
+28
View File
@@ -0,0 +1,28 @@
// Тесты экономики в открытом Studio (Rojo подключён): node tools/run-tests.js [имя]
// Каждый tests/*.spec.lua выполняется в Edit-режиме через Studio MCP вместе с tests/lib.lua.
// Код плейса не меняется: модули клонируются во временную папку ServerStorage и удаляются после прогона.
const { execFileSync } = require('child_process');
const fs = require('fs');
const path = require('path');
const root = path.resolve(__dirname, '..');
const tests = path.join(root, 'tests');
const only = process.argv[2];
const lib = fs.readFileSync(path.join(tests, 'lib.lua'), 'utf8').replace(/^/, '');
const specs = fs.readdirSync(tests).filter(f => f.endsWith('.spec.lua') && (!only || f.includes(only)));
const outDir = path.join(tests, '.out');
fs.mkdirSync(outDir, { recursive: true });
const steps = specs.map(f => ({
tool: 'execute_luau',
args: {
datamodel_type: 'Edit',
code: 'local T = (function()\n' + lib + '\nend)()\n' + fs.readFileSync(path.join(tests, f), 'utf8').replace(/^/, ''),
},
}));
const stepsFile = path.join(outDir, 'steps.json');
fs.writeFileSync(stepsFile, JSON.stringify(steps));
const out = execFileSync('node', [path.join(__dirname, 'mcp', 'run.js'), stepsFile], { maxBuffer: 1 << 26 }).toString('utf8');
process.stdout.write(out + '\n');
const failed = [...out.matchAll(/(\d+) passed, (\d+) failed/g)];
const bad = failed.length < specs.length || failed.some(m => m[2] !== '0') || /\(ERROR\)/.test(out);
console.log(bad ? 'TESTS FAILED' : `ALL ${specs.length} SUITES PASSED`);
process.exit(bad ? 1 : 0);
+85
View File
@@ -0,0 +1,85 @@
// Writes script sources from src/ into a .rbxlx place without touching the map.
// Only scripts that sit directly in their service (ReplicatedFirst, ReplicatedStorage,
// ServerScriptService, StarterPlayer.StarterPlayerScripts) are updated; copies in
// ServerStorage.Backup etc. are left alone. Missing scripts are reported, not added.
// usage: node tools/sync-scripts-into-place.js in.rbxlx out.rbxlx
'use strict';
const fs = require('fs');
const path = require('path');
const [,, inP, outP] = process.argv;
const root = path.join(__dirname, '..');
const dirs = {
ReplicatedFirst: 'src/ReplicatedFirst',
ReplicatedStorage: 'src/ReplicatedStorage',
ServerScriptService: 'src/ServerScriptService',
StarterPlayerScripts: 'src/StarterPlayer/StarterPlayerScripts',
};
const wanted = new Map(); // "Service/Name/Class" -> source
for (const [svc, rel] of Object.entries(dirs)) {
const d = path.join(root, rel);
if (!fs.existsSync(d)) continue;
for (const f of fs.readdirSync(d)) {
if (!f.endsWith('.lua')) continue;
let cls = 'ModuleScript', name = f.slice(0, -4);
if (f.endsWith('.server.lua')) { cls = 'Script'; name = f.slice(0, -11); }
else if (f.endsWith('.client.lua')) { cls = 'LocalScript'; name = f.slice(0, -11); }
const src = fs.readFileSync(path.join(d, f), 'utf8');
if (src.includes(']]>')) throw new Error('"]]>" not allowed in ' + f);
wanted.set(svc + '/' + name + '/' + cls, { src, file: rel + '/' + f, done: false });
}
}
const text = fs.readFileSync(inP, 'latin1'); // byte-preserving
const toBytes = (s) => Buffer.from(s, 'utf8').toString('latin1');
const ITEM_RE = /<Item class="([^"]+)" referent="[^"]+">\s*<Properties>/g;
const NAME_RE = /<string name="Name">([^<]*)<\/string>/;
// Track nesting to know each script's parent service.
const out = [];
let last = 0;
const stack = []; // {cls, name}
const TOKEN_RE = /<Item class="([^"]+)" referent="[^"]+">|<\/Item>/g;
let m;
const edits = []; // {start, end, replacement}
while ((m = TOKEN_RE.exec(text))) {
if (m[0] === '</Item>') { stack.pop(); continue; }
const cls = m[1];
const propsStart = text.indexOf('<Properties>', m.index);
const propsEnd = text.indexOf('</Properties>', propsStart);
// Name may come after a long Source block, so search the whole Properties block
// with the Source CDATA cut out.
const seg = text.slice(propsStart, propsEnd).replace(/<!\[CDATA\[[\s\S]*?\]\]>/g, '');
const nm = NAME_RE.exec(seg);
const name = nm ? Buffer.from(nm[1], 'latin1').toString('utf8') : '';
const parent = stack.length ? stack[stack.length - 1] : null;
stack.push({ cls, name });
if ((cls === 'Script' || cls === 'LocalScript' || cls === 'ModuleScript') && parent) {
const svc = parent.cls === 'StarterPlayerScripts' ? 'StarterPlayerScripts' : parent.cls;
const key = svc + '/' + name + '/' + cls;
const w = wanted.get(key);
if (w) {
if (w.done) console.log('WARNING: duplicate script in place, updating both:', key);
const full = text.slice(propsStart, propsEnd);
const sm = /<ProtectedString name="Source">[\s\S]*?<\/ProtectedString>/.exec(full);
const tag = '<ProtectedString name="Source"><![CDATA[' + toBytes(w.src) + ']]></ProtectedString>';
if (sm) edits.push({ start: propsStart + sm.index, end: propsStart + sm.index + sm[0].length, rep: tag });
else edits.push({ start: propsEnd, end: propsEnd, rep: tag });
w.done = true;
}
}
// skip over the Properties block so nested strings are not scanned as items
TOKEN_RE.lastIndex = propsEnd;
}
edits.sort((a, b) => a.start - b.start);
const fd = fs.openSync(outP, 'w');
let pos = 0;
for (const e of edits) {
fs.writeSync(fd, Buffer.from(text.slice(pos, e.start), 'latin1'));
fs.writeSync(fd, Buffer.from(e.rep, 'latin1'));
pos = e.end;
}
fs.writeSync(fd, Buffer.from(text.slice(pos), 'latin1'));
fs.closeSync(fd);
let missing = 0;
for (const [k, w] of wanted) if (!w.done) { missing++; console.log('MISSING in place:', k, '(' + w.file + ')'); }
console.log('updated', edits.length, 'scripts, missing', missing);