Skip to content

Commit

Permalink
Remove ship mass (unnecessary feature, doesn't improve anything)
Browse files Browse the repository at this point in the history
Initial idea (when the ship mass was first added) was for it to depend
on how much stuff was placed on the ship (blocks, buildings, etc.),
but this idea was abandoned, because there is no way to measure this
without heavy performance cost (full scan of the shipworld).

Currently ship mass is only increased by FTL Drives, which are mandatory
(player always has them), so increasing mass can't be avoided.

Player has methods to reduce the ship mass, but the mass only affects
fuel costs, so these methods can just reduce fuel cost instead.

In other words, ship mass is barely relevant to the player,
so we are removing this stat as unnecessary.

---

Note: fuel cost math (in [interface/cockpit/cockpit.lua]):
for most players, "shipMass" variable in fuelCost() function was approximately 2,
so these formulas will use the fixed number 2 instead.

There are no longer any ship mass reductions, so players who had them
will have slightly increased fuel costs.
  • Loading branch information
edwardspec committed Dec 5, 2024
1 parent ebf43ab commit ce6c0a1
Show file tree
Hide file tree
Showing 43 changed files with 57 additions and 162 deletions.
5 changes: 0 additions & 5 deletions frackinship/configs/shipupgrades.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
"max" : 384,
"totalMin" : 5
},
"shipMass" : {
"min" : -200,
"max" : 200,
"totalMin" : 0
},
"atmosphereSystem" : {
"maxPerimeter" : 1000,
"requireFilledBackground" : true
Expand Down
21 changes: 2 additions & 19 deletions frackinship/scripts/quest/shipupgrades.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ function update(dt)
end

--crewStats is set in /scripts/companions/player.lua
local crewStats=status.statusProperty("fu_shipUpgradeStatProperty") or {shipmass=10,fuelEfficiency=0,shipSpeed=15,maxFuel=10000}
local crewStats=status.statusProperty("fu_shipUpgradeStatProperty") or {fuelEfficiency=0,shipSpeed=15,maxFuel=10000}
--sb.logInfo("crewStats=%s",crewStats)
--[09:00:44.604] [Info] crewStats={shipMass: 10, fuelEfficiency: 0, shipSpeed: 15, maxFuel: 10000}
--[09:00:44.604] [Info] crewStats={fuelEfficiency: 0, shipSpeed: 15, maxFuel: 10000}

local crewSizeBYOS = world.getProperty("fu_byos.crewSize") or 0
local shipMaxFuel = world.getProperty("ship.maxFuel")
Expand All @@ -111,7 +111,6 @@ function update(dt)
local shipShipSpeed = shipUpgrades.shipSpeed
local shipSpeedStat = status.stat("shipSpeed")
local shipSpeedBYOS = world.getProperty("fu_byos.shipSpeed") or 0
local shipMassBYOS = world.getProperty("fu_byos.shipMass") or 0

if crewSizeBYOS then
crewSizeNew, crewSizeBYOSNew = calculateNew("crewSize", crewSizeBYOS, crewSizeBYOSOld, shipCrewSize)
Expand Down Expand Up @@ -176,22 +175,6 @@ function update(dt)
shipSpeedBYOSOld = shipSpeedBYOSNew
end]]
end
if shipMassBYOS then
--local newShipMass=clampStat("shipMass",((crewStats and crewStats.shipMass) or 0)+shipMassBYOS-status.stat("shipMass"))
--crew modifier for ship mass is basically unused, go figure.
status.clearPersistentEffects("byos")
local shipMassStat = status.stat("shipMass")
--shipMassStat = status.stat("shipMass")
--sb.logInfo("ship mass stat %s, shipMassBYOS %s",shipMassStat,shipMassBYOS)
shipMassTotal, shipMassModifier = calculateNew("shipMass", shipMassBYOS, 0, shipMassStat)
--sb.logInfo("ship mass total, ship mass modifier, pre calc %s %s",shipMassTotal, shipMassModifier)
if shipMassStat + shipMassModifier ~= shipMassTotal then
shipMassModifier = shipMassTotal - shipMassStat
end
--sb.logInfo("ship mass total, ship mass modifier, post calc %s %s",shipMassTotal, shipMassModifier)
status.addPersistentEffect("byos", {stat = "shipMass", amount = shipMassModifier})
--status.addPersistentEffect("byos", {stat = "shipMass", amount = newShipMass})
end
--[[if maxFuelNew and world.getProperty("ship.fuel") > maxFuelNew then
world.setProperty("ship.fuel", maxFuelNew)
end]]
Expand Down
15 changes: 5 additions & 10 deletions interface/cockpit/cockpit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,6 @@ end


-- For FU
function shipMassFind()
self.shipMass = status.stat("shipMass") /10
end

function fuelBonusFind()
self.fuelBonus = status.stat("maxFuel")
end
Expand Down Expand Up @@ -445,17 +441,16 @@ function fuelCost(travel)
self.one = celestial.currentSystem()
self.two = {location = travel or self.travel.system, planet = 0, satellite = 0, system = self.travel.target}
local distanceMath = math.sqrt( ( (self.one.location[1] - self.two.location[1]) ^ 2 ) + ( (self.one.location[2] - self.two.location[2]) ^ 2 ) )
shipMassFind()
local shipMass=self.shipMass or 0

local cost
if distanceMath < 30 then
cost = 50 + ((config.getParameter("jumpFuelCost") + distanceMath) * (shipMass + 2)) -- nearby systems are relatively cheap to travel to
cost = 50 + ((config.getParameter("jumpFuelCost") + distanceMath) * 4) -- nearby systems are relatively cheap to travel to
elseif distanceMath < 200 then
cost = 70 + ((config.getParameter("jumpFuelCost") + distanceMath) * (shipMass + 4)) -- a bit farther out
cost = 70 + ((config.getParameter("jumpFuelCost") + distanceMath) * 6) -- a bit farther out
elseif distanceMath < 400 then
cost = 140 + ((config.getParameter("jumpFuelCost") + distanceMath) * (shipMass + 6)) -- mid/long range
cost = 140 + ((config.getParameter("jumpFuelCost") + distanceMath) * 8) -- mid/long range
else
cost = 300 + ((config.getParameter("jumpFuelCost") + distanceMath) * (shipMass + 10)) -- long range value
cost = 300 + ((config.getParameter("jumpFuelCost") + distanceMath) * 12) -- long range value
end

if cost < 1000 and isConnected(self.one,self.two) then
Expand Down
9 changes: 0 additions & 9 deletions interface/scripted/statWindow/extraStatsWindow.config
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,6 @@
"value" : "---"
},

"shipMass" : {
"type" : "label",
"position" : [112, 33],
"hAnchor" : "mid",
"value" : "---"
},

////////////////////////////////////////// 7th row

"healingBonus" : {
Expand Down Expand Up @@ -231,7 +224,6 @@
// "shieldHealth" : "flat",
// "shieldRegen" : "flat",
// "shieldStaminaRegen" : "flat",
"shipMass" : "flat",
"healingBonus" : "percent",
"fuCharisma" : "charisma",
"mentalProtection" : "percent"
Expand Down Expand Up @@ -269,7 +261,6 @@
{"x1": 87, "y1": 74, "x2": 127, "y2": 86, "tooltip": "Crit Chance"},
{"x1": 87, "y1": 60, "x2": 127, "y2": 72, "tooltip": "Starvation (Minutes from Full)"},
{"x1": 87, "y1": 46, "x2": 127, "y2": 58, "tooltip": "Fall Damage Mult"},
{"x1": 87, "y1": 32, "x2": 127, "y2": 44, "tooltip": "Ship Mass"},
{"x1": 87, "y1": 18, "x2": 127, "y2": 30, "tooltip": "Madness Resistance"}
],

Expand Down
2 changes: 1 addition & 1 deletion items/active/crewcontracts/crewcontract_cyborg.activeitem
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"maxStack" : 1,
"rarity" : "Legendary",
"category" : "crewcontract",
"description" : "Hires a deadly cyborg. ^cyan;Reduces ship mass by 10%^reset;, increases ship speed by 1.25 and grants ^pink;Aether Immunity^reset;.",
"description" : "Hires a deadly cyborg. Increases ship speed by 1.25 and grants ^pink;Aether Immunity^reset;.",
"shortdescription" : "Cyborg Contract",
"twoHanded" : true,

Expand Down
2 changes: 1 addition & 1 deletion items/active/crewcontracts/crewcontract_janitor.activeitem
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"maxStack" : 1,
"rarity" : "Common",
"category" : "crewcontract",
"description" : "Has a mop. Sweeps. ^cyan;Reduces ship mass by 10%^reset;.",
"description" : "Has a mop. Sweeps.",
"shortdescription" : "Custodian Contract",
"twoHanded" : true,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"maxStack" : 1,
"rarity" : "Uncommon",
"category" : "crewcontract",
"description" : "Hires a mechanic to ^cyan;reduce ship mass by 20%^reset; and fuel costs by 10%. Also provides special coffee.",
"description" : "Hires a mechanic to ^cyan;reduce fuel costs by 10%^reset;. Also provides special coffee.",
"shortdescription" : "Mechanic Contract",
"twoHanded" : true,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"maxStack" : 1,
"rarity" : "Rare",
"category" : "crewcontract",
"description" : "Reduces fuel costs by 20% and ^cyan;decreases ship mass by 20%^reset;. Also provides extra special coffee.",
"description" : "Reduces fuel costs by 20%. Also provides extra special coffee.",
"shortdescription" : "Mechanic II Contract",
"twoHanded" : true,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"maxStack" : 1,
"rarity" : "Legendary",
"category" : "crewcontract",
"description" : "Hires a volcanologist to provide ^red;30% Fire resistance^reset; and ^cyan;reduce ship mass by 20%^reset;.",
"description" : "Hires a volcanologist to provide ^red;30% Fire resistance^reset;.",
"shortdescription" : "Volcanologist Contract",
"twoHanded" : true,

Expand Down
1 change: 0 additions & 1 deletion items/armors/tier2/lunariarmor/lunari.chest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"maxStack": 1,
"rarity": "Common",
"description": "^orange;Set Bonuses^reset;:
^yellow;^reset; -^green;10^reset;% Ship Fuel Cost^reset;
^yellow;^reset; +^green;12^reset;% Energy Regen
^yellow;^reset; Lunari weapons: Damage x^green;1.15^reset;, +^green;4^reset;% Crit Chance",

Expand Down
1 change: 0 additions & 1 deletion items/armors/tier2/lunariarmor/lunari.head
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"maxStack": 1,
"rarity": "Common",
"description": "^orange;Set Bonuses^reset;:
^yellow;^reset; -^green;10^reset;% Ship Fuel Cost^reset;
^yellow;^reset; +^green;12^reset;% Energy Regen
^yellow;^reset; Lunari weapons: Damage x^green;1.15^reset;, +^green;4^reset;% Crit Chance",

Expand Down
1 change: 0 additions & 1 deletion items/armors/tier2/lunariarmor/lunari.legs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"maxStack": 1,
"rarity": "Common",
"description": "^orange;Set Bonuses^reset;:
^yellow;^reset; -^green;10^reset;% Ship Fuel Cost^reset;
^yellow;^reset; +^green;12^reset;% Energy Regen
^yellow;^reset; Lunari weapons: Damage x^green;1.15^reset;, +^green;4^reset;% Crit Chance",

Expand Down
1 change: 0 additions & 1 deletion items/armors/tier4/intersec/kirhostier4.chest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"maxStack" : 1,
"rarity" : "rare",
"description" : "^orange;Set Bonuses^reset;:
^yellow;^reset; -^green;15^reset;% Ship Mass^reset;^reset;
^yellow;^reset; Assault Rifle, Pistol: +^green;2^reset;% Crit Chance, +^green;25^reset;% Crit Damage",
"shortdescription" : "Intersec Breastplate",
"category" : "chestarmour",
Expand Down
1 change: 0 additions & 1 deletion items/armors/tier4/intersec/kirhostier4.head
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"maxStack" : 1,
"rarity" : "rare",
"description" : "^orange;Set Bonuses^reset;:
^yellow;^reset; -^green;15^reset;% Ship Mass^reset;^reset;
^yellow;^reset; Assault Rifle, Pistol: +^green;2^reset;% Crit Chance, +^green;25^reset;% Crit Damage",
"shortdescription" : "Intersec Helmet",
"category" : "headarmour",
Expand Down
1 change: 0 additions & 1 deletion items/armors/tier4/intersec/kirhostier4.legs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"maxStack" : 1,
"rarity" : "rare",
"description" : "^orange;Set Bonuses^reset;:
^yellow;^reset; -^green;15^reset;% Ship Mass^reset;^reset;
^yellow;^reset; Assault Rifle, Pistol: +^green;2^reset;% Crit Chance, +^green;25^reset;% Crit Damage",
"shortdescription" : "Intersec Greaves",
"category" : "legarmour",
Expand Down
4 changes: 0 additions & 4 deletions npcs/crew/crewmembercyborg.npctype
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
"type" : "EphemeralEffect",
"effect" : "aetherimmunity",
"duration" : 300
},
{
"type" : "PersistentEffect",
"effect" : "shipMassSmall"
}
]
}
Expand Down
4 changes: 0 additions & 4 deletions npcs/crew/crewmembergreg.npctype
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
"defenseAmount" : 6,
"duration" : 300
},
{
"type" : "PersistentEffect",
"effect" : "shipMassLarge"
},
{
"type": "ShipUpgradeBenefit",
"property": "maxFuel",
Expand Down
4 changes: 0 additions & 4 deletions npcs/crew/crewmemberjanitor.npctype
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"uniformColorIndex" : 11,

"benefits" : [
{
"type": "PersistentEffect",
"effect": "shipMassSmall"
}
]
}
},
Expand Down
8 changes: 0 additions & 8 deletions npcs/crew/crewmembermechanic.npctype.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
[
[{
"op": "add",
"path": "/scriptConfig/crew/role/benefits/0",
"value": {
"type": "PersistentEffect",
"effect": "shipMassMed"
}
}],
[{
"op": "replace",
"path": "/scriptConfig/dialog/crewmember/roleDescription/default/default/0",
Expand Down
7 changes: 2 additions & 5 deletions npcs/crew/crewmembermechanic2.npctype
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
"field": "Technical",
"uniformColorIndex": 8,

"benefits": [{
"type": "PersistentEffect",
"effect": "shipMassMed"
},
"benefits": [
{
"type": "ShipUpgradeBenefit",
"property": "fuelEfficiency",
Expand All @@ -36,7 +33,7 @@
"roleDescription": {
"default": {
"default": [
"I'll keep clearing out the carborator while I'm here. Fuel costs are down by 20% and ^cyan;Ship Mass has decreased by 20%^reset;."
"I'll keep clearing out the carborator while I'm here. Fuel costs are down by 20%."
]
}
},
Expand Down
4 changes: 0 additions & 4 deletions npcs/crew/crewmembervolcanologist.npctype
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
"type" : "EphemeralEffect",
"effect" : "fireblock3",
"duration" : 900
},
{
"type" : "PersistentEffect",
"effect" : "shipMassMed"
}
]
}
Expand Down
10 changes: 3 additions & 7 deletions objects/ship/fu_ftlBooster_large/fu_ftlBooster_large.object
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"colonyTags": ["byos"],
"scannable": false,
"rarity": "uncommon",
"description": "A thruster used for FTL travel.\n^yellow;Ship Mass: -10\n^cyan;BYOS Only^reset;",
"description": "A thruster used for FTL travel.\n^cyan;BYOS Only^reset;",
"shortdescription": "Large FTL Booster",
"race": "generic",
"apexDescription": "A booster. These have been known to malfunction and explode.",
Expand Down Expand Up @@ -33,13 +33,9 @@
"animation": "/objects/ship/boosters/boosterflame.animation",
"soundEffect": "/sfx/objects/boosterflame.ogg",
"scripts": [
"/objects/ship/boosters/boosterflame.lua",
"/objects/ship/fu_shipstatmodifier.lua"
"/objects/ship/boosters/boosterflame.lua"
],
"scriptDelta": 60,
"stats": {
"shipMass": -10
},
"flyingBoosterStates": {
"none": "off",
"disembarking": "off",
Expand All @@ -59,4 +55,4 @@
"damageSourceKind": "plasma"
},
"byosOnly": true
}
}
10 changes: 3 additions & 7 deletions objects/ship/fu_ftlBooster_medium/fu_ftlBooster_medium.object
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"colonyTags": ["byos"],
"scannable": false,
"rarity": "common",
"description": "A thruster used for FTL travel.\n^yellow;Ship Mass: -6\n^cyan;BYOS Only^reset;",
"description": "A thruster used for FTL travel.\n^cyan;BYOS Only^reset;",
"shortdescription": "Medium FTL Booster",
"race": "generic",
"apexDescription": "A booster. These have been known to malfunction and explode.",
Expand Down Expand Up @@ -33,13 +33,9 @@
"animation": "/objects/ship/boosters/boosterflame.animation",
"soundEffect": "/sfx/objects/boosterflame.ogg",
"scripts": [
"/objects/ship/boosters/boosterflame.lua",
"/objects/ship/fu_shipstatmodifier.lua"
"/objects/ship/boosters/boosterflame.lua"
],
"scriptDelta": 60,
"stats": {
"shipMass": -6
},
"flyingBoosterStates": {
"none": "off",
"disembarking": "off",
Expand All @@ -59,4 +55,4 @@
"damageSourceKind": "plasma"
},
"byosOnly": true
}
}
10 changes: 3 additions & 7 deletions objects/ship/fu_ftlBooster_small/fu_ftlBooster_small.object
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"colonyTags": ["byos"],
"scannable": false,
"rarity": "common",
"description": "A thruster used for FTL travel.\n^yellow;Ship Mass: -4\n^cyan;BYOS Only^reset;",
"description": "A thruster used for FTL travel.\n^cyan;BYOS Only^reset;",
"shortdescription": "Small FTL Booster",
"race": "generic",
"apexDescription": "A booster. These have been known to malfunction and explode.",
Expand Down Expand Up @@ -33,13 +33,9 @@
"animation": "/objects/ship/boosters/boosterflame.animation",
"soundEffect": "/sfx/objects/boosterflame.ogg",
"scripts": [
"/objects/ship/boosters/boosterflame.lua",
"/objects/ship/fu_shipstatmodifier.lua"
"/objects/ship/boosters/boosterflame.lua"
],
"scriptDelta": 60,
"stats": {
"shipMass": -4
},
"flyingBoosterStates": {
"none": "off",
"disembarking": "off",
Expand All @@ -59,4 +55,4 @@
"damageSourceKind": "plasma"
},
"byosOnly": true
}
}
Loading

0 comments on commit ce6c0a1

Please sign in to comment.