Skip to content

Commit

Permalink
Lava: includable in mapconfig, new config options, some refactor (#3964)
Browse files Browse the repository at this point in the history
Refactor lavaConfig.lua module into Spring.Lava so it can be easier to access (only available to LuaUI and LuaRules for now).
Make lava config includable in mapconfig/lava.lua inside mapfiles.
* Also now game provided config goes into common/configs/LavaMaps/

Add more lava config options:
* The options were already inside map_lava.lua as TODO notes and comments.
* See at the bottom of this PR for more details.
* damageFeatures: enable damage to features and control damage speed to features.
* effectDamage: set custom ceg effect for damage.
* effectBurst: set custom ceg effect for bursts (or disable).
* effectBurstSounds: set custom sounds for bursts.
* ambientSounds: set custom ambient sounds (or disable).

Slight cleanup of the lava code.
* Extracted shaders to shaders/GLSL/lava/.
* No more lava globals from the lavaConfig.lua (now lava.lua) module.
* Optimized most critical parts from map_lava.lua a bit (tried not to overdo it).
  • Loading branch information
saurtron authored Jan 2, 2025
1 parent 0af661e commit c40fae4
Show file tree
Hide file tree
Showing 27 changed files with 1,122 additions and 1,000 deletions.
26 changes: 26 additions & 0 deletions common/configs/LavaMaps/AcidicQuarry.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
local conf = {
grow = 0,
effectBurst = false,
level = 5,
colorCorrection = "vec3(0.26, 1.0, 0.03)",
--coastColor = "vec3(0.6, 0.7, 0.03)",
coastLightBoost = 1.2,
coastWidth = 10.0,
fogColor = "vec3(1.60, 0.8, 0.3)",
--coastWidth = 30.0,
lavaParallaxDepth = 32.0,
lavaParallaxOffset = 0.2,
swirlFreq = 0.008,
swirlAmp = 0.017,
uvScale = 2.2,
specularExp = 12.0,
tideAmplitude = 3,
tidePeriod = 40,
fogFactor = 0.13,
fogHeight = 36,
fogAbove = 0.1,
fogDistortion = 2.0,
tideRhym = { { 4, 0.05, 5*6000 } },
}

return conf
18 changes: 18 additions & 0 deletions common/configs/LavaMaps/Claymore.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local conf = {
grow = 0,
effectBurst = false,
diffuseEmitTex = "LuaUI/images/lava/lava2_diffuseemitblue.dds",
colorCorrection = "vec3(0.4, 0.5, 0.4)",
coastColor = "vec3(0.24, 0.46, 0.5)",
coastLightBoost = 0.3,
fogColor = "vec3(0.24, 0.46, 0.5)",
fogFactor = 0.01,
fogHeight = 15,
fogAbove = 4.0,
fogDistortion = 2.0,
tideAmplitude = 0.3,
tidePeriod = 1000,
tideRhym = { { -1, 0.05, 5*6000 } },
}

return conf
22 changes: 22 additions & 0 deletions common/configs/LavaMaps/Forge.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local conf = {
level = 0,
damage = 150,
tideAmplitude = 3,
tidePeriod = 95,
diffuseEmitTex = "LuaUI/images/lava/lava7_diffuseemit.dds",
normalHeightTex = "LuaUI/images/lava/lava7_normalheight.dds",
losDarkness = 0.7,
colorCorrection = "vec3(1.1, 1.0, 0.88)",
shadowStrength = 1.0,
coastColor = "vec3(2.2, 0.4, 0.0)",
coastLightBoost = 0.7,
coastWidth = 36.0,
fogFactor = 0.02,
fogColor = "vec3(2.0, 0.31, 0.0)",
fogHeight = 35,
fogAbove = 0.18,

tideRhym = { { -1, 0.25, 5*6000 } },
}

return conf
21 changes: 21 additions & 0 deletions common/configs/LavaMaps/Ghenna Rising.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local conf = {
level = 251,
damage = 750,
colorCorrection = "vec3(0.7, 0.7, 0.7)",
swirlFreq = 0.017,
swirlAmp = 0.0024,
tideAmplitude = 3,
specularExp = 4.0,
shadowStrength = 0.9,
coastLightBoost = 0.8,
uvScale = 1.5,
tideRhym = { { 250, 0.10, 15 },
{ 415, 0.05, 30 },
{ 250, 0.10, 5*60 },
{ 415, 0.05, 30 },
{ 250, 0.10, 5*60 },
{ 415, 0.05, 3*30 },
{ 250, 0.10, 10*60 } },
}

return conf
16 changes: 16 additions & 0 deletions common/configs/LavaMaps/Hotstepper 5.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local conf = {
level = 100,
damage = 130,
tideRhym = { { 90, 0.25, 5*60 },
{ 215, 0.10, 5 },
{ 90, 0.25, 5*60 },
{ 290, 0.15, 5 },
{ 90, 0.25, 4*60 },
{ 355, 0.20, 5 },
{ 90, 0.25, 4*60 },
{ 390, 0.20, 5 },
{ 90, 0.25, 2*60 },
{ 440, 0.04, 2*60 } },
}

return conf
18 changes: 18 additions & 0 deletions common/configs/LavaMaps/Hyperion Shale.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local conf = {
grow = 0,
effectBurst = false,
diffuseEmitTex = "LuaUI/images/lava/lava2_diffuseemitblue.dds",
colorCorrection = "vec3(1.0, 1.0, 1.0)",
coastColor = "vec3(0.0, 0.35, 0.9)",
coastLightBoost = 0.3,
fogColor = "vec3(0.0, 0.3, 1.0)",
fogFactor = 0.01,
fogHeight = 15,
fogAbove = 4.0,
fogDistortion = 2.0,
tideAmplitude = 0.3,
tidePeriod = 1000,
tideRhym = { { -1, 0.05, 5*6000 } },
}

return conf
22 changes: 22 additions & 0 deletions common/configs/LavaMaps/Incandescence Remake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local conf = {
level = 207,
damage = 150,
tideAmplitude = 3,
tidePeriod = 95,
diffuseEmitTex = "LuaUI/images/lava/lava7_diffuseemit.dds",
normalHeightTex = "LuaUI/images/lava/lava7_normalheight.dds",
losDarkness = 0.7,
colorCorrection = "vec3(1.1, 1.0, 0.88)",
shadowStrength = 1.0,
coastColor = "vec3(2.2, 0.4, 0.0)",
coastLightBoost = 0.7,
coastWidth = 36.0,
fogFactor = 0.08,
fogColor = "vec3(2.0, 0.31, 0.0)",
fogHeight = 85,
fogAbove = 0.18,

tideRhym = { { 206, 0.25, 5*6000 } },
}

return conf
16 changes: 16 additions & 0 deletions common/configs/LavaMaps/Kings Assault.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local conf = {
grow = 0,
colorCorrection = "vec3(1.0, 1.0, 1.0)",
coastColor = "vec3(1.0, 0.25, 0.0)",
coastLightBoost = 0.3,
fogColor = "vec3(1.5, 0.1, 0.0)",
fogFactor = 0.01,
fogHeight = 15,
fogAbove = 4.0,
fogDistortion = 2.0,
tideAmplitude = 0.3,
tidePeriod = 1000,
tideRhym = { { -1, 0.05, 5*6000 } },
}

return conf
23 changes: 23 additions & 0 deletions common/configs/LavaMaps/Pit of Azar.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local conf = {
level = 0,
damage = 150,
tideAmplitude = 3,
tidePeriod = 95,
diffuseEmitTex = "LuaUI/images/lava/lava7_diffuseemit.dds",
normalHeightTex = "LuaUI/images/lava/lava7_normalheight.dds",
losDarkness = 0.7,
colorCorrection = "vec3(1.1, 1.0, 0.88)",
shadowStrength = 1.0,
coastColor = "vec3(2.2, 0.4, 0.0)",
coastLightBoost = 0.7,
coastWidth = 36.0,
fogFactor = 0.02,
fogColor = "vec3(2.0, 0.31, 0.0)",
fogHeight = 35,
fogAbove = 0.18,
fogDistortion = 2.0,
uvScale = 10.0,
tideRhym = { { -1, 0.25, 5*6000 } },
}

return conf
14 changes: 14 additions & 0 deletions common/configs/LavaMaps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Lava Map Configuration Directory

Place map specific lava configuration files here.

Note the lava configuration can also be included inside the map pack in mapconfig/lava.lua (recommmended).

The mapconfig has precedence over game provided configuration, but overrideMap can be set to true inside the file here to make it have priority.

The game will try to find the full name with version, like "Ghenna Rising 4.0.1.lua", if not found then it will search for a configuration without the version "Ghenna Rising.lua".

### Note for map makers

You can just take a file from here and place it inside mapconfig/lava.lua for your map to have lava.

28 changes: 28 additions & 0 deletions common/configs/LavaMaps/Sector 318C.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local conf = {
grow = 0,
effectBurst = false,
level = 5,
diffuseEmitTex = "LuaUI/images/lava/lava7_diffuseemit.dds",
normalHeightTex = "LuaUI/images/lava/lava7_normalheight.dds",
colorCorrection = "vec3(0.2, 0.65, 0.03)",
--coastColor = "vec3(0.6, 0.7, 0.03)",
coastLightBoost = 0.6,
coastWidth = 60.0,
fogColor = "vec3(1.60, 0.8, 0.3)",
--coastWidth = 30.0,
lavaParallaxDepth = 8.0,
lavaParallaxOffset = 0.2,
swirlFreq = 0.008,
swirlAmp = 0.017,
uvScale = 2.2,
specularExp = 12.0,
tideAmplitude = 3,
tidePeriod = 40,
fogFactor = 0.13,
fogHeight = 36,
fogAbove = 0.1,
fogDistortion = 2.0,
tideRhym = { { 4, 0.05, 5*6000 } },
}

return conf
16 changes: 16 additions & 0 deletions common/configs/LavaMaps/SpeedMetal BAR.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local conf = {
grow = 0,
effectBurst = false,
level = 1,
colorCorrection = "vec3(0.3, 0.1, 1.5)",
--coastWidth = 40.0,
--coastColor = "vec3(1.7, 0.02, 1.4)",
fogColor = "vec3(0.60, 0.02, 1)",
swirlFreq = 0.025,
swirlAmp = 0.003,
tideAmplitude = 3,
tidePeriod = 50,
tideRhym = { { 1, 0.05, 5*6000 } },
}

return conf
28 changes: 28 additions & 0 deletions common/configs/LavaMaps/Stronghold.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local config = {
grow = 0,
effectBurst = false,
level = 5,
diffuseEmitTex = "LuaUI/images/lava/lava7_diffuseemit.dds",
normalHeightTex = "LuaUI/images/lava/lava7_normalheight.dds",
colorCorrection = "vec3(0.2, 0.65, 0.03)",
--coastColor = "vec3(0.6, 0.7, 0.03)",
coastLightBoost = 0.6,
coastWidth = 60.0,
fogColor = "vec3(1.60, 0.8, 0.3)",
--coastWidth = 30.0,
lavaParallaxDepth = 8.0,
lavaParallaxOffset = 0.2,
swirlFreq = 0.008,
swirlAmp = 0.017,
uvScale = 2.2,
specularExp = 12.0,
tideAmplitude = 3,
tidePeriod = 40,
fogFactor = 0.13,
fogHeight = 36,
fogAbove = 0.1,
fogDistortion = 2.0,
tideRhym = { { 4, 0.05, 5*6000 } },
}

return config
16 changes: 16 additions & 0 deletions common/configs/LavaMaps/Thermal Shock.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local conf = {
grow = 0,
colorCorrection = "vec3(1.0, 1.0, 1.0)",
coastColor = "vec3(1.0, 0.25, 0.0)",
coastLightBoost = 0.3,
fogColor = "vec3(1.5, 0.1, 0.0)",
fogFactor = 0.01,
fogHeight = 15,
fogAbove = 4.0,
fogDistortion = 2.0,
tideAmplitude = 0.3,
tidePeriod = 1000,
tideRhym = { { -1, 0.05, 5*6000 } },
}

return conf
22 changes: 22 additions & 0 deletions common/configs/LavaMaps/To Kill The Middle.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
local conf = {
level = 0,
damage = 150,
tideAmplitude = 3,
tidePeriod = 95,
diffuseEmitTex = "LuaUI/images/lava/lava7_diffuseemit.dds",
normalHeightTex = "LuaUI/images/lava/lava7_normalheight.dds",
losDarkness = 0.7,
colorCorrection = "vec3(1.1, 1.0, 0.88)",
shadowStrength = 1.0,
coastColor = "vec3(2.2, 0.4, 0.0)",
coastLightBoost = 0.7,
coastWidth = 36.0,
fogFactor = 0.08,
fogColor = "vec3(2.0, 0.31, 0.0)",
fogHeight = 85,
fogAbove = 0.18,

tideRhym = { { -1, 0.25, 5*6000 } },
}

return conf
16 changes: 16 additions & 0 deletions common/configs/LavaMaps/Zed Remake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local conf = {
grow = 0,
level = 1,
damage = 75,
uvScale = 1.5,
colorCorrection = "vec3(0.4, 0.09, 1.2)",
losDarkness = 0.8,
coastColor = "vec3(0.8, 0.03, 1.1)",
fogColor = "vec3(0.60, 0.10, 1.1)",
coastLightBoost = 1.3,
tideAmplitude = 1.5,
tidePeriod = 150,
tideRhym = { { 0, 0.3, 5*6000 } },
}

return conf
10 changes: 10 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ local commonFunctions = {
LuaIntro = true,
LuaUI = true,
},

map = {
LuaRules = true,
LuaUI = true,
},
}

if commonFunctions.spring[environment] then
Expand All @@ -40,6 +45,11 @@ if commonFunctions.i18n[environment] then
Spring.I18N = Spring.I18N or VFS.Include("modules/i18n/i18n.lua")
end


if commonFunctions.map[environment] then
Spring.Lava = VFS.Include("modules/lava.lua")
end

-- we don't want them to run these tests for end users
-- uncomment this only when working on functions in `common/tablefunctions.lua`
-- VFS.Include('common/tableFunctionsTests.lua')
Loading

0 comments on commit c40fae4

Please sign in to comment.