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

Upstream sync #677

Merged
merged 8 commits into from
Nov 20, 2024
Binary file modified games/doom/fabs/stairs/gtd_stairs_glow_64.wad
Binary file not shown.
149 changes: 123 additions & 26 deletions modules/zdoom_otex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ OTEX_DIRECT_REMOVALS =
{
"OMRBLA90",
"OMRBLA91",
"OMBRLA92",
"OMBRLA93",
"OMBRLA94",
"OMRBLA92",
"OMRBLA93",
"OMRBLA94",

"OMBRLC90",
"OMRBLC90",

"OMBRLF29",
"OMBRLF38",
"OMBRLF90",
"OMRBLF29",
"OMRBLF38",
"OMRBLF90",

"OMBRLG90",
"OMRBLG90",

"OMRBLI92",
"OMRBLI93",
Expand All @@ -119,11 +119,11 @@ OTEX_DIRECT_REMOVALS =
"OMRBLO28",
"OMRBLO29",

"OMBRLP90",
"OMBRLP91",
"OMRBLP90",
"OMRBLP91",

"OMBRLR90",
"OMBRLR94"
"OMRBLR90",
"OMRBLR94"
}
},

Expand Down Expand Up @@ -435,18 +435,18 @@ OTEX_SPECIAL_RESOURCES =
liquid_defs =
{
otex_blood = { mat="OBLODA01", special=0},
otex_goop = { mat="OGOOPY01", special=0},
otex_ice = { mat="OICYWA01", special=0},
otex_goop = { mat="OGOOPY01", light_add=16, special=0},
otex_ice = { mat="OICYWA01", light_add=8, special=0},

otex_lavaA1 = { mat="OLAVAA01", light_add=24, special=5, damage=10},
otex_lavaA2 = { mat="OLAVAA02", light_add=24, special=5, damage=10},
otex_lavaB1 = { mat="OLAVAB01", light_add=24, special=5, damage=10},
otex_lavaC1 = { mat="OLAVAC01", light_add=24, special=5, damage=10},
otex_lavaD1 = { mat="OLAVAD01", light_add=24, special=5, damage=10},
otex_lavaE1 = { mat="OLAVAE01", light_add=24, special=5, damage=10},
otex_lavaF1 = { mat="OLAVAF01", light_add=24, special=5, damage=10},
otex_lavaA1 = { mat="OLAVAA01", light_add=56, special=5, damage=10},
otex_lavaA2 = { mat="OLAVAA02", light_add=56, special=5, damage=10},
otex_lavaB1 = { mat="OLAVAB01", light_add=56, special=5, damage=10},
otex_lavaC1 = { mat="OLAVAC01", light_add=56, special=5, damage=10},
otex_lavaD1 = { mat="OLAVAD01", light_add=56, special=5, damage=10},
otex_lavaE1 = { mat="OLAVAE01", light_add=56, special=5, damage=10},
otex_lavaF1 = { mat="OLAVAF01", light_add=56, special=5, damage=10},

otex_nukage = { mat="ONUKEA01", light_add=16, special=7, damage=5},
otex_nukage = { mat="ONUKEA01", light_add=24, special=7, damage=5},

otex_sludge = { mat="OSLUDG01", special=0},
otex_poop = { mat="OPOOPY01", special=0},
Expand Down Expand Up @@ -520,21 +520,119 @@ OTEX_SPECIAL_RESOURCES =

OTEX_GLOWING_FLATS =
[[
OBLODA01
OBLODA01
OBLODA02
OBLODA03
OBLODA04
OBLODA05
OBLODA06
OBLODA07
OBLODA08

OGOOPY01
OGOOPY02
OGOOPY03
OGOOPY04
OGOOPY05
OGOOPY06
OGOOPY07
OGOOPY08

OICYWA01
OICYWA02
OICYWA03
OICYWA04
OICYWA05
OICYWA06
OICYWA07
OICYWA08

OLAVAA01
OLAVAA02
OLAVAB01

OLAVAC01
OLAVAC02
OLAVAC03
OLAVAC04
OLAVAC05
OLAVAC06
OLAVAC07
OLAVAC08

OLAVAD01
OLAVAD02
OLAVAD03
OLAVAD04
OLAVAD05
OLAVAD06
OLAVAD07
OLAVAD08

OLAVAE01
OLAVAE02
OLAVAE03
OLAVAE04
OLAVAE05
OLAVAE06
OLAVAE07
OLAVAE08

OLAVAF01
OLAVAF02
OLAVAF03
OLAVAF04
OLAVAF05
OLAVAF06
OLAVAF07
OLAVAF08
OLAVAF09
OLAVAF10

ONUKEA01
ONUKEA02
ONUKEA03
ONUKEA04
ONUKEA05
ONUKEA06
ONUKEA07
ONUKEA08

OSLUDG01
OSLUDG02
OSLUDG03
OSLUDG04
OSLUDG05
OSLUDG06
OSLUDG07
OSLUDG08

OPOOPY01
OPOOPY02
OPOOPY03
OPOOPY04
OPOOPY05
OPOOPY06
OPOOPY07
OPOOPY08

OTAR__01
OTAR__02
OTAR__03
OTAR__04
OTAR__05
OTAR__06
OTAR__07
OTAR__08

OWATER01
OWATER02
OWATER03
OWATER04
OWATER05
OWATER06
OWATER07
OWATER08
]]

function OTEX_PROC_MODULE.setup(self)
Expand All @@ -546,7 +644,6 @@ end

function OTEX_PROC_MODULE.synthesize_procedural_themes()
local resource_tab = {}
local r

local function pick_unique_texture(table, tex_group, total_tries)
local tex
Expand Down Expand Up @@ -856,7 +953,7 @@ end


function OTEX_PROC_MODULE.all_done()
string.gsub(
GAME.RESOURCES.GLOWING_FLATS_GLDEFS = string.gsub(
GAME.RESOURCES.GLOWING_FLATS_GLDEFS,
"GLOWFLTS",
OTEX_GLOWING_FLATS
Expand Down Expand Up @@ -887,7 +984,7 @@ OB_MODULES["otex_proc_module"] =
},

tooltip = _("If enabled, generates room themes using OTEX based on a resource table. "..
"OTEX must be manually loaded in the sourceport. " ..
"OTEX WAD (not pk3 version) must be manually loaded in the sourceport. " ..
"Includes textures and flats only, no patches.\n\n" ..
"Currently does not make any kind of sensibly curated room themes."),

Expand Down
84 changes: 50 additions & 34 deletions scripts/grower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1184,14 +1184,10 @@ function Grower_decide_extents(LEVEL)
end

-- linear start code
if PARAM.linear_start then
if PARAM.linear_start ~= "default" then
if PARAM.linear_start == "all" then
LEVEL.has_linear_start = true
elseif rand.odds(math.floor(PARAM.linear_start)) then
LEVEL.has_linear_start = true
end
end
if PARAM.linear_start
and PARAM.linear_start ~= "default"
and PARAM.linear_start == "all" then
LEVEL.has_linear_start = true
end

if LEVEL.has_linear_start then
Expand Down Expand Up @@ -1523,9 +1519,6 @@ end


function Grower_kill_room(SEEDS, LEVEL, R)

local hallway_neighbor

gui.debugf("Killing " .. R.id .. "\n")

local function turn_joiner_into_closet(R2, chunk)
Expand Down Expand Up @@ -3626,7 +3619,7 @@ end

-- SUCCESS --

gui.debugf("APPLIED rule: " .. cur_rule.name .. " in ROOM_" .. R.id.. "\n")
gui.debugf("ROOM_" .. R.id .. " APPLIED rule: " .. cur_rule.name .. "\n")

if pass == "grow" then
if R.shapes_applied then
Expand Down Expand Up @@ -3989,14 +3982,17 @@ function Grower_grow_room(SEEDS, LEVEL, R)
Grower_grammatical_room(SEEDS, LEVEL, R, "grow")

if is_too_small(R) then

if R.grow_parent and R.grow_parent.is_start
and R.small_room then
return
end

if R.prelim_conn_num == 1 then
Grower_kill_room(SEEDS, LEVEL, R)
return
end

end
end

Expand Down Expand Up @@ -4418,17 +4414,17 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
end
end

--[[if R.prelim_conn_num(R, LEVEL) == 1 and R.areas[1].svolume <= 8
and #R.areas == 1 and not R.is_start then
gui.printf("Prelim conn num: " .. R.prelim_conn_num(R, LEVEL) .. "\n")
gui.printf(table.tostr(R, 2))
local hallway_parent
if R.parent_R and R.parent_R.is_hallway then
hallway_parent = R.parent_R
end
Grower_kill_room(SEEDS, LEVEL, R)
if hallway_parent then Grower_kill_room(SEEDS, LEVEL, hallway_parent) end
end]]
--[[if R.prelim_conn_num(R, LEVEL) == 1 and R.areas[1].svolume <= 8
and #R.areas == 1 and not R.is_start then
gui.printf("Prelim conn num: " .. R.prelim_conn_num(R, LEVEL) .. "\n")
gui.printf(table.tostr(R, 2))
local hallway_parent
if R.parent_R and R.parent_R.is_hallway then
hallway_parent = R.parent_R
end
Grower_kill_room(SEEDS, LEVEL, R)
if hallway_parent then Grower_kill_room(SEEDS, LEVEL, hallway_parent) end
end]]

end
end
Expand Down Expand Up @@ -4496,11 +4492,11 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",

gui.printf("Oh noes! Attempting emergency sprout in ROOM_" .. R.id .. "!!!\n")
Grower_grammatical_room(SEEDS, LEVEL, R, "sprout", "is_emergency")
Grower_grow_room(SEEDS, LEVEL, R)
end

if not R.emergency_sprout_attempts then
return "oof"
elseif R.emergency_sprout_attempts > 1 then
if not R.emergency_sprout_attempts
or (R.emergency_sprout_attempts and R.emergency_sprout_attempts > 1) then
return "oof"
end
return "yas queen"
Expand Down Expand Up @@ -4552,16 +4548,23 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
expand_limits()
emergency_sprouts()

if not LEVEL.is_procedural_gotcha
and (#LEVEL.rooms < ((LEVEL.min_rooms + LEVEL.max_rooms) / 2)) then
if emergency_linear_sprouts() == "oof" then
emergency_teleport_break(LEVEL)
if not LEVEL.is_procedural_gotcha then

-- levels that don't reach at least
-- half the amount of expected maximum rooms
if (#LEVEL.rooms < ((LEVEL.min_rooms + LEVEL.max_rooms) / 2)) then
if emergency_linear_sprouts() == "oof" then
emergency_teleport_break(LEVEL)
end
end
elseif #LEVEL.rooms <= 3 and not LEVEL.is_procedural_gotcha
and LEVEL.cur_coverage <= LEVEL.min_coverage then
if emergency_linear_sprouts() == "oof" then
emergency_teleport_break(LEVEL)

-- levels that don't reach the prefered coverage
if (LEVEL.cur_coverage <= LEVEL.min_coverage ) then
if emergency_linear_sprouts() == "oof" then
emergency_teleport_break(LEVEL)
end
end

end

--[[if LEVEL.cur_coverage <= LEVEL.min_coverage / 4
Expand All @@ -4575,6 +4578,7 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
end]]
end

-- force grow child rooms from start rooms
if #LEVEL.rooms == 2 then
gui.printf("BALLS! " .. MAX_LOOP .. "\n")
for _,R in pairs(LEVEL.rooms) do
Expand Down Expand Up @@ -4607,6 +4611,18 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
end
end

-- remove ungrown teleporter trunks
for _,R in pairs(LEVEL.rooms) do
if R.is_root and R.is_grown and #R.trunk.rooms == 1
and R:calc_walk_vol() <= 24 and not R.is_start then
gui.printf("Killed teleporter ROOM_" .. R.id .. "\n")
gui.printf(table.tostr(R.trunk.rooms,1) .. "\n")
gui.printf(table.tostr(R,2) .. "\n")
Grower_kill_room(SEEDS, LEVEL, R)
--Grower_kill_a_trunk(LEVEL, R.trunk)
end
end

end


Expand Down
2 changes: 2 additions & 0 deletions scripts/room.lua
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ function ROOM_CLASS.calc_walk_vol(R)
-- this should not happen
if vol < 1 then vol = 1 end

R.walk_vol = vol

return vol
end

Expand Down
2 changes: 1 addition & 1 deletion scripts/shapes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6599,7 +6599,7 @@ GROW_CAUSEWAY_WATERLOCKED_CROSSED_OUT =

GROW_CAUSEWAY_WATERLOCKED_CENTER_PILLAR =
{
prob = 35,
prob = 45,
skip_prob = 80,

structure =
Expand Down