Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 14 additions & 15 deletions EngineOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,23 @@
-- Example EngineOptions.lua
--

local options =
{
local options = {
{
key="engineoptions",
name="Engine Options",
desc="Engine Options",
type="section",
key = "engineoptions",
name = "Engine Options",
desc = "Engine Options",
type = "section",
},
{
key = 'maxunits',
name = 'Max units',
desc = 'Maximum number of units (including buildings) for each team allowed at the same time',
type = 'number',
section= 'engineoptions',
def = 2000,
min = 1,
max = 10000, --- engine caps at lower limit if more than 3 team are ingame
step = 1,
key = "maxunits",
name = "Max units",
desc = "Maximum number of units (including buildings) for each team allowed at the same time",
type = "number",
section = "engineoptions",
def = 2000,
min = 1,
max = 10000, --- engine caps at lower limit if more than 3 team are ingame
step = 1,
},
}

Expand Down
68 changes: 38 additions & 30 deletions common/SetList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
-- A SetList is a data structure used for storing only keys, any key is valid (no values!)
-- It consists of a hash part for fast containment checks
-- And a list part for fast random generation
local function tstr(t,n)
if t==nil then return end
local res = tostring(n or "") .. ' {'
for k,v in pairs(t) do res = res .. tostring(k) .. "=" .. tostring(v) ..", " end
print( res .. '}')
local function tstr(t, n)
if t == nil then
return
end
local res = tostring(n or "") .. " {"
for k, v in pairs(t) do
res = res .. tostring(k) .. "=" .. tostring(v) .. ", "
end
print(res .. "}")
end

local mRandom = math.random
Expand All @@ -15,39 +19,39 @@ SetListMT.__index = SetListMT
function SetListMT:Add(key)
if self.hash[key] == nil then -- So that we dont add twice
self.count = self.count + 1
self.hash[key] = self.count
self.hash[key] = self.count
self.list[self.count] = key
end
end
function SetListMT:Remove(key)
local popindex = self.hash[key]
if popindex then
if popindex ~= self.count then
if popindex ~= self.count then
-- If not last element, then take the element at the very back, and emplace it at popindex
local popkey = self.list[self.count]
self.list[popindex] = popkey -- bring it back in list
self.list[popindex] = popkey -- bring it back in list
self.hash[popkey] = popindex
end
self.list[self.count] = nil
self.hash[key] = nil
self.hash[key] = nil
self.count = self.count - 1
end

end
function SetListMT:GetRandom()
if self.count > 0 then return self.list[mRandom(1, self.count)] end
if self.count > 0 then
return self.list[mRandom(1, self.count)]
end
end
local function NewSetList()
local t = {
hash = {}, -- Hash table map keys to positions in list
hash = {}, -- Hash table map keys to positions in list
list = {}, -- List table maps positions in list to keys
count = 0, -- Keeps a tally of how many elements
}
}
setmetatable(t, SetListMT)
return t
end


-- A SetListMin is a data structure used for storing only positive integer keys or strings (no values!)
-- It consists of only a hash part. Negative numbers are not allowed
local setListMinMT = {}
Expand All @@ -62,30 +66,31 @@ end
function setListMinMT:Remove(key)
local popindex = self.hash[key]
if popindex then
if popindex ~= self.count then
if popindex ~= self.count then
-- If not last element, then take the element at the very back, and emplace it at popindex
local popkey = self.hash[-1 * self.count]
self.hash[-1 * popindex] = popkey -- bring it back in list
self.hash[-1 * popindex] = popkey -- bring it back in list
self.hash[popkey] = popindex
end
self.hash[-1* self.count] = nil
self.hash[key] = nil
self.hash[-1 * self.count] = nil
self.hash[key] = nil
self.count = self.count - 1
end
end
function setListMinMT:GetRandom()
if self.count > 0 then return self.hash[-1 * mRandom(1, self.count)] end
if self.count > 0 then
return self.hash[-1 * mRandom(1, self.count)]
end
end
local function NewSetListMin()
local t = {
hash = {}, -- Hash table map keys to positions in list
hash = {}, -- Hash table map keys to positions in list
count = 0, -- Keeps a tally of how many elements
}
}
setmetatable(t, setListMinMT)
return t
end


-- A SetListNoTable is a data structure used for storing only positive integer keys, or string keys which arent called 'count'
-- It consists of only the table itself. Negative numbers are not allowed

Expand All @@ -101,30 +106,32 @@ end
function SetListNoTableMT:Remove(key)
local popindex = self[key]
if popindex then
if popindex ~= self.count then
if popindex ~= self.count then
-- If not last element, then take the element at the very back, and emplace it at popindex
local popkey = self[-1 * self.count]
self[-1 * popindex] = popkey -- bring it back in list
self[-1 * popindex] = popkey -- bring it back in list
self[popkey] = popindex
end
self[-1 * self.count] = nil
self[key] = nil
self[key] = nil
self.count = self.count - 1
end
end
function SetListNoTableMT:GetRandom()
if self.count > 0 then return self[-1 * mRandom(1, self.count)] end
if self.count > 0 then
return self[-1 * mRandom(1, self.count)]
end
end
local function NewSetListNoTable()
local t = {count = 0} -- Keeps a tally of how many elements
local t = { count = 0 } -- Keeps a tally of how many elements
setmetatable(t, SetListNoTableMT)
return t
end

local SetListUtilities = {
NewSetListNoTable = NewSetListNoTable,
NewSetListMin = NewSetListMin,
NewSetList = NewSetList
NewSetListMin = NewSetListMin,
NewSetList = NewSetList,
}
return SetListUtilities

Expand Down Expand Up @@ -205,4 +212,5 @@ end
local deltat = os.clock()-t0
print ("Time taken to test", "good old vanilla", deltat,"s")

]]--
]]
--
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/AcidicQuarry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local conf = {
fogHeight = 36,
fogAbove = 0.1,
fogDistortion = 2.0,
tideRhythm = { { 4, 1.5, 5*6000 } },
tideRhythm = { { 4, 1.5, 5 * 6000 } },
}

return conf
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/Claymore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local conf = {
fogDistortion = 2.0,
tideAmplitude = 0.3,
tidePeriod = 1000,
tideRhythm = { { -1, 1.5, 5*6000 } },
tideRhythm = { { -1, 1.5, 5 * 6000 } },
}

return conf
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/Forge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local conf = {
fogHeight = 35,
fogAbove = 0.18,

tideRhythm = { { -1, 7.5, 5*6000 } },
tideRhythm = { { -1, 7.5, 5 * 6000 } },
}

return conf
8 changes: 1 addition & 7 deletions common/configs/LavaMaps/Ghenna Rising.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ local conf = {
shadowStrength = 0.9,
coastLightBoost = 0.8,
uvScale = 1.5,
tideRhythm = { { 250, 3, 15 },
{ 415, 1.5, 30 },
{ 250, 3, 5*60 },
{ 415, 1.5, 30 },
{ 250, 3, 5*60 },
{ 415, 1.5, 3*30 },
{ 250, 3, 10*60 } },
tideRhythm = { { 250, 3, 15 }, { 415, 1.5, 30 }, { 250, 3, 5 * 60 }, { 415, 1.5, 30 }, { 250, 3, 5 * 60 }, { 415, 1.5, 3 * 30 }, { 250, 3, 10 * 60 } },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tables should still be formatted with entries on separate lines

}

return conf
11 changes: 1 addition & 10 deletions common/configs/LavaMaps/Hotstepper 5.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
local conf = {
level = 100,
damage = 130,
tideRhythm = { { 90, 7.5, 5*60 },
{ 215, 3, 5 },
{ 90, 7.5, 5*60 },
{ 290, 4.5, 5 },
{ 90, 7.5, 4*60 },
{ 355, 6, 5 },
{ 90, 7.5, 4*60 },
{ 390, 6, 5 },
{ 90, 7.5, 2*60 },
{ 440, 1.2, 2*60 } },
tideRhythm = { { 90, 7.5, 5 * 60 }, { 215, 3, 5 }, { 90, 7.5, 5 * 60 }, { 290, 4.5, 5 }, { 90, 7.5, 4 * 60 }, { 355, 6, 5 }, { 90, 7.5, 4 * 60 }, { 390, 6, 5 }, { 90, 7.5, 2 * 60 }, { 440, 1.2, 2 * 60 } },
}

return conf
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/Hyperion Shale.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local conf = {
fogDistortion = 2.0,
tideAmplitude = 0.3,
tidePeriod = 1000,
tideRhythm = { { -1, 1.5, 5*6000 } },
tideRhythm = { { -1, 1.5, 5 * 6000 } },
}

return conf
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/Incandescence Remake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local conf = {
fogHeight = 85,
fogAbove = 0.18,

tideRhythm = { { 206, 7.5, 5*6000 } },
tideRhythm = { { 206, 7.5, 5 * 6000 } },
}

return conf
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/Kings Assault.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local conf = {
fogDistortion = 2.0,
tideAmplitude = 0.3,
tidePeriod = 1000,
tideRhythm = { { -1, 1.5, 5*6000 } },
tideRhythm = { { -1, 1.5, 5 * 6000 } },
}

return conf
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/Pit of Azar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local conf = {
fogAbove = 0.18,
fogDistortion = 2.0,
uvScale = 10.0,
tideRhythm = { { -1, 7.5, 5*6000 } },
tideRhythm = { { -1, 7.5, 5 * 6000 } },
}

return conf
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/Sector 318C.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local conf = {
fogHeight = 36,
fogAbove = 0.1,
fogDistortion = 2.0,
tideRhythm = { { 4, 1.5, 5*6000 } },
tideRhythm = { { 4, 1.5, 5 * 6000 } },
}

return conf
52 changes: 26 additions & 26 deletions common/configs/LavaMaps/Special Hotstepper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,32 @@ local conf = {
level = 35,
damage = 120,
tideRhythm = {
{ 0, 4.5, 4*60}, -- ~ 0:00- 4:00
{ 120, 3.0, 10 }, -- ~ 4:30- 4:40
{ 50, 4.5, 4*60}, -- ~ 4:55- 8:55
{ 250, 3.0, 10 }, -- ~10:00-10:10
{ 50, 4.5, 4*60}, -- ~10:55-14:55
{ 400, 3.0, 10 }, -- ~16:50-17:00
{ 250, 4.5, 150 }, -- ~17:35-20:05
{ 600, 4.5, 10 }, -- ~21:25-21:35
{ 400, 6.0, 4*60}, -- ~22:05-26:05
{ 700, 4.5, 10 }, -- ~27:15-27:25
{ 400, 6.0, 4*60}, -- ~28:15-32:15
{ 780, 4.5, 10 }, -- ~33:40-33:50
{ 400, 6.0, 4*60}, -- ~34:50-38:50
{ 880, 4.5, 10}, -- ~40:40-40:50
{ 0, 15, 2*60}, -- ~41:45-43:45
{ 980, 30, 1 }, -- ~44:19-44:20
{ 880, 7.5, 2*60},
{ 1050, 30, 1 },
{ 880, 7.5, 2*60},
{ 1100, 30, 1 },
{ 880, 7.5, 2*60},
{ 1180, 30, 5 },
{ 880, 7.5, 2*60},
{ 1210, 1.5, 20 }, -- ~58:15-58:35
{ 4000, 15, 10*60}
},
{ 0, 4.5, 4 * 60 }, -- ~ 0:00- 4:00
{ 120, 3.0, 10 }, -- ~ 4:30- 4:40
{ 50, 4.5, 4 * 60 }, -- ~ 4:55- 8:55
{ 250, 3.0, 10 }, -- ~10:00-10:10
{ 50, 4.5, 4 * 60 }, -- ~10:55-14:55
{ 400, 3.0, 10 }, -- ~16:50-17:00
{ 250, 4.5, 150 }, -- ~17:35-20:05
{ 600, 4.5, 10 }, -- ~21:25-21:35
{ 400, 6.0, 4 * 60 }, -- ~22:05-26:05
{ 700, 4.5, 10 }, -- ~27:15-27:25
{ 400, 6.0, 4 * 60 }, -- ~28:15-32:15
{ 780, 4.5, 10 }, -- ~33:40-33:50
{ 400, 6.0, 4 * 60 }, -- ~34:50-38:50
{ 880, 4.5, 10 }, -- ~40:40-40:50
{ 0, 15, 2 * 60 }, -- ~41:45-43:45
{ 980, 30, 1 }, -- ~44:19-44:20
{ 880, 7.5, 2 * 60 },
{ 1050, 30, 1 },
{ 880, 7.5, 2 * 60 },
{ 1100, 30, 1 },
{ 880, 7.5, 2 * 60 },
{ 1180, 30, 5 },
{ 880, 7.5, 2 * 60 },
{ 1210, 1.5, 20 }, -- ~58:15-58:35
{ 4000, 15, 10 * 60 },
},
}

return conf
2 changes: 1 addition & 1 deletion common/configs/LavaMaps/SpeedMetal BAR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local conf = {
swirlAmp = 0.003,
tideAmplitude = 3,
tidePeriod = 50,
tideRhythm = { { 1, 1.5, 5*6000 } },
tideRhythm = { { 1, 1.5, 5 * 6000 } },
}

return conf
Loading
Loading