Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lava: includable in mapconfig, new config options, some refactor #3964

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d6e9da
Move luarules/configs/lavaConfig.lua to modules/lava.lua.
saurtron Nov 23, 2024
f3f5291
Make modules/lava.lua (previously lavaConfig.lua) into Spring.Lava mo…
saurtron Nov 23, 2024
005a317
Extract map_lava.lua shaders into shaders/GLSL/lava/.
saurtron Nov 23, 2024
6bf0747
Optimize lavaDeathCheck.
saurtron Nov 23, 2024
11ecd32
Lava damage modes through damageMode (direct, proportional, dontdie, …
saurtron Nov 23, 2024
3746e41
Allow maps to declare lava configuration inside mapinfo.lua.
saurtron Nov 23, 2024
f46384d
Allow lava to damage features.
saurtron Nov 23, 2024
d10a889
Missing function declaration.
saurtron Nov 23, 2024
4b2a35e
New lava options: effectDamage, effectBurst, effectBurstSounds and ef…
saurtron Nov 23, 2024
6fb581d
Remove dontdie damageMode, and add damageMinHealth instead, this way …
saurtron Nov 23, 2024
f7c5b2f
Increase map_lava version to 2.5.
saurtron Nov 23, 2024
81f1942
Make damageFeatures also control damage per second to features.
saurtron Nov 23, 2024
54adef1
Destroy feature as soon as it's going to be below 0 remaining resources.
saurtron Nov 23, 2024
4d52f62
Set damageFeatures to 0.1 if not a number and not falsy.
saurtron Nov 23, 2024
c8a2604
Fix variable name.
saurtron Nov 23, 2024
f9d2eaf
Use SetFeatureResources instead of SetFeatureReclaim so gui will
saurtron Nov 23, 2024
998c0d9
Improve comment for damageFeatures.
saurtron Nov 23, 2024
bcb5a71
lava.effectAmbientSounds -> lava.ambientSounds.
saurtron Nov 23, 2024
f468203
Fix ambientSounds comment.
saurtron Nov 23, 2024
05a9bb4
Load mappack lava config from mapconfig/lava.lua instead of mapinfo,
saurtron Nov 24, 2024
f7e8c68
MIT license the shaders
Beherith Nov 24, 2024
c293f1f
Switch over to autoreload compatible shader compilation, smoothen dis…
Beherith Nov 24, 2024
b07edd9
Merge branch 'master' into lava-refactor
Beherith Dec 15, 2024
c8f25aa
Remove damageMode and damageMinHealth options as decided by GDT.
saurtron Dec 16, 2024
13f2a95
Remove some magic constants and add DAMAGE_RATE.
saurtron Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = {
Beherith marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -38,6 +43,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