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 #672

Merged
merged 4 commits into from
Sep 26, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion games/doom/fabs/item/dem_secret_closets_urban.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ PREFABS.Item_secret_yard_closet1 =
deep = 16,
over = -16,

prob = 350,
prob = 90,

key = "secret",

Expand Down
2 changes: 1 addition & 1 deletion games/doom/fabs/joiner/scionox_secret_lift.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREFABS.Joiner_scionox_secret_lift =
file = "joiner/scionox_secret_lift.wad",
map = "MAP01",

prob = 50,
prob = 25,
theme = "tech",
key = "secret",
style = "steepness",
Expand Down
Binary file modified games/doom/fabs/window/gtd_window_bay.wad
Binary file not shown.
Binary file modified games/doom/fabs/window/gtd_window_cage.wad
Binary file not shown.
Binary file modified games/doom/fabs/window/gtd_window_slump_tall.wad
Binary file not shown.
Binary file modified games/doom/fabs/window/gtd_windows_low_gap_closed.wad
Binary file not shown.
Binary file modified games/doom/fabs/window/gtd_windows_tall_octagon.wad
Binary file not shown.
250 changes: 201 additions & 49 deletions modules/zdoom_otex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ OTEX_EXCLUSIONS =
-- just plain weird
CRPT = "textures",
TRAK = "all",
KEYS = "all"
KEYS = "all",
EFCT = "all",

-- too colorful
TECH = "textures",
FADE = "all"
}

-- some textures that must be removed manually from the DB
Expand Down Expand Up @@ -205,6 +210,8 @@ OTEX_DIRECT_REMOVALS =
{
textures =
{
"OVENTE01",
"OVENTE02",
"OVENTE03",
"OVENTE04",
"OVENTE13",
Expand All @@ -231,19 +238,27 @@ OTEX_DIRECT_REMOVALS =

OTEX_THEME_RESTRICTIONS =
{
MRBL = {"hell"},
BONE = {"hell"},
FLSH = {"hell"},
HELL = {"hell"},

BRCK = {"hell", "urban"},
BOOK = {"hell", "urban"},
WOOD = {"hell", "urban"},
MRBL = {"tech"},
BONE = {"tech", "urban"},
FLSH = {"tech", "urban"},
HELL = {"tech", "urban"},
SKIN = {"tech"},
CMBD = {"tech"},

FNCY = {"tech"},
PALC = {"tech"},
STCC = {"tech"},

BRCK = {"tech"},
BOOK = {"tech"},
WOOD = {"tech"},
TUDR = {"tech"},

SOIL = {"hell", "urban"},
ROCK = {"hell"},
SAND = {"hell"},
DIRT = {"hell"}
STON = {"tech"},
SOIL = {"tech"},
ROCK = {"tech", "urban"},
SAND = {"tech", "urban"},
DIRT = {"tech", "urban"}
}

OTEX_SPECIAL_RESOURCES =
Expand All @@ -252,7 +267,7 @@ OTEX_SPECIAL_RESOURCES =
{
OFENCA01 = {t="OFENCA01", rail_h=128},
OFENCA02 = {t="OFENCA02", rail_h=128},
OFENCB01 = {t="OFENCB01", rail_h=48},
OFENCB01 = {t="OFENCB01", rail_h=56},
OFENCB02 = {t="OFENCB02", rail_h=64},
OFENCC01 = {t="OFENCC01", rail_h=128},
OFENCC64 = {t="OFENCC64", rail_h=64},
Expand All @@ -267,7 +282,7 @@ OTEX_SPECIAL_RESOURCES =
OFENCF05 = {t="OFENCF05", rail_h=128},
OFENCF06 = {t="OFENCF06", rail_h=96},
OFENCF07 = {t="OFENCF07", rail_h=32},
OFENCF08 = {t="OFENCF08", rail_h=128},
OFENCF08 = {t="OFENCF08", rail_h=32},
OFENCF09 = {t="OFENCF09", rail_h=128},
OFENCF10 = {t="OFENCF10", rail_h=96},
OFENCF11 = {t="OFENCF11", rail_h=64},
Expand All @@ -280,8 +295,8 @@ OTEX_SPECIAL_RESOURCES =

OFENCG01 = {t="OFENCG01", rail_h=128},
OFENCG02 = {t="OFENCG02", rail_h=64},
OFENCH01 = {t="OFENCH01", rail_h=128},
OFENCH02 = {t="OFENCH02", rail_h=128},
OFENCH01 = {t="OFENCH01", rail_h=96},
OFENCH02 = {t="OFENCH02", rail_h=96},

OFENCJ11 = {t="OFENCJ11", rail_h=128},

Expand All @@ -298,10 +313,10 @@ OTEX_SPECIAL_RESOURCES =
OFENCN11 = {t="OFENCN11", rail_h=128},
OFENCN12 = {t="OFENCN12", rail_h=128},

ORAILA01 = {t="ORAILA01", rail_h=48},
ORAILA02 = {t="ORAILA02", rail_h=48},
ORAILA03 = {t="ORAILA03", rail_h=48},
ORAILB01 = {t="ORAILB01", rail_h=48},
ORAILA01 = {t="ORAILA01", rail_h=32},
ORAILA02 = {t="ORAILA02", rail_h=32},
ORAILA03 = {t="ORAILA03", rail_h=32},
ORAILB01 = {t="ORAILB01", rail_h=32},

OBKMTA92 = {t="OBKMTA92", rail_h=128},
OBKMTA93 = {t="OBKMTA93", rail_h=128},
Expand Down Expand Up @@ -376,6 +391,112 @@ OTEX_SPECIAL_RESOURCES =
OBKMTD38 = 30,
OBKMTD39 = 30
}
},

liquid_materials =
{
OBLODA01 = { t="OFALLB01", f="0BLODA01"},
OGOOPY01 = { t="OFALLG01", f="0POOPY01"},
OICYWA01 = { t="OFALLW11", f="0ICYWA01"},

OLAVAA01 = { t="OFALLL01", f="0LAVAA01"},
OLAVAA02 = { t="OFALLM01", f="0LAVAA02"},
OLAVAB01 = { t="OFALLL01", f="0LAVAB01"},
OLAVAC01 = { t="OFALLL01", f="0LAVAC01"},
OLAVAD01 = { t="OFALLM01", f="0LAVAD01"},
OLAVAE01 = { t="OFALLL11", f="0LAVAE01"},
OLAVAF01 = { t="OFALLL11", f="0LAVAF01"},

ONUKEA01 = { t="OFALLN01", f="0NUKEA01"},
OSLUDG01 = { t="OFALLS01", f="0SLUDG01"},
OPOOPY01 = { t="OFALLP01", f="0POOPY01"},
OTAR__01 = { t="OFALLT01", f="0TAR__01"},
OWATER01 = { t="OFALLW01", f="0WATER01"}
},

liquid_defs =
{
otex_blood = { mat="OBLODA01", special=0},
otex_goop = { mat="OGOOPY01", special=0},
otex_ice = { mat="OICYWA01", special=0},

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=56, special=7, damage=5},

otex_sludge = { mat="OSLUDG01", special=0},
otex_poop = { mat="OPOOPY01", special=0},
otex_tar = { mat="OTAR__01", special=0},
otex_water = { mat="OWATER01", special=0}
},

liquid_themes =
{
tech =
{
otex_goop = 10,
otex_ice = 20,

otex_lavaA1 = 3,
otex_lavaA2 = 3,
otex_lavaB1 = 3,
otex_lavaC1 = 3,
otex_lavaD1 = 3,
otex_lavaE1 = 3,
otex_lavaF1 = 3,

otex_nukage = 50,
otex_sludge = 30,
otex_poop = 10,
otex_tar = 40,
otex_water = 20
},

urban =
{
otex_blood = 20,
otex_goop = 10,
otex_ice = 20,

otex_lavaA1 = 2,
otex_lavaA2 = 2,
otex_lavaB1 = 2,
otex_lavaC1 = 2,
otex_lavaD1 = 2,
otex_lavaE1 = 2,
otex_lavaF1 = 2,

otex_nukage = 10,
otex_sludge = 20,
otex_poop = 50,
otex_tar = 40,
otex_water = 20
},

hell =
{
otex_blood = 70,
otex_goop = 10,
otex_ice = 20,

otex_lavaA1 = 12,
otex_lavaA2 = 12,
otex_lavaB1 = 12,
otex_lavaC1 = 12,
otex_lavaD1 = 12,
otex_lavaE1 = 12,
otex_lavaF1 = 12,

otex_sludge = 30,
otex_tar = 40,
otex_poop = 40
}
}
}

Expand Down Expand Up @@ -432,22 +553,24 @@ function OTEX_PROC_MODULE.synthesize_procedural_themes()
if OTEX_EXCLUSIONS[group] and OTEX_EXCLUSIONS[group] == "all" then
-- do nothing
else
if OTEX_THEME_RESTRICTIONS[group]
and check_elem(OTEX_THEME_RESTRICTIONS[group], theme) then
if resource_tab[group].has_textures == true
and not OTEX_EXCLUSIONS[group] then
local prob = table.size(resource_tab[group].textures)
group_pick_list[theme].textures[group] = prob
if OTEX_THEME_RESTRICTIONS then
if OTEX_THEME_RESTRICTIONS[group]
and check_elem(OTEX_THEME_RESTRICTIONS[group], theme) then
-- do nothing
else
if resource_tab[group].has_textures == true
and not OTEX_EXCLUSIONS[group] then
local prob = table.size(resource_tab[group].textures)
group_pick_list[theme].textures[group] = prob
end

if resource_tab[group].has_flats == true
and not OTEX_EXCLUSIONS[group] then
local prob = table.size(resource_tab[group].flats)
group_pick_list[theme].flats[group] = prob
end
end

if resource_tab[group].has_flats == true
and not OTEX_EXCLUSIONS[group] then
local prob = table.size(resource_tab[group].flats)
group_pick_list[theme].flats[group] = prob
end
end

if not OTEX_THEME_RESTRICTIONS[group] then
else
if resource_tab[group].has_textures == true
and not OTEX_EXCLUSIONS[group] then
local prob = table.size(resource_tab[group].textures)
Expand All @@ -459,7 +582,8 @@ function OTEX_PROC_MODULE.synthesize_procedural_themes()
local prob = table.size(resource_tab[group].flats)
group_pick_list[theme].flats[group] = prob
end
end
end

end

end
Expand Down Expand Up @@ -520,8 +644,15 @@ function OTEX_PROC_MODULE.synthesize_procedural_themes()
for _,F in pairs(resource_group.flats) do
local side_tex, group_pick
-- hack fix to assign DMD flats a side texture rather than just a default
if string.find(group_name, "DMD") then
group_pick = rand.key_by_probs(group_pick_list["urban"].textures)
if string.find(group_name, "DMD")
or string.find(group_name, "PAVE")
or string.find(group_name, "TL16")
or string.find(group_name, "TL32")
or string.find(group_name, "TLMX")
or string.find(group_name, "TRHX")
or string.find(group_name, "BSKT")
or string.find(group_name, "LLLL") then
group_pick = rand.key_by_probs(group_pick_list["urban"].textures)
side_tex = rand.pick(resource_tab[group_pick].textures)
else
side_tex = "BROWNHUG"
Expand Down Expand Up @@ -573,22 +704,28 @@ function OTEX_PROC_MODULE.synthesize_procedural_themes()
room_theme.ceilings = {}

tab_pick = rand.key_by_probs(group_pick_list[T].textures)
tex_pick = rand.pick(resource_tab[tab_pick].textures)
room_theme.walls[tex_pick] = 5
for j = 1, 3 do
tex_pick = rand.pick(resource_tab[tab_pick].textures)
room_theme.walls[tex_pick] = 5
end
RT_name = RT_name .. tex_pick .. "_"

if rand.odds(25) or resource_tab[tab_pick].has_flats == false then
tab_pick = rand.key_by_probs(group_pick_list[T].flats)
end
tex_pick = rand.pick(resource_tab[tab_pick].flats)
room_theme.floors[tex_pick] = 5
for j = 1, 3 do
tex_pick = rand.pick(resource_tab[tab_pick].flats)
room_theme.floors[tex_pick] = 5
end
RT_name = RT_name .. tex_pick .. "_"

if rand.odds(25) or resource_tab[tab_pick].has_flats == false then
tab_pick = rand.key_by_probs(group_pick_list[T].flats)
end
tex_pick = rand.pick(resource_tab[tab_pick].flats)
room_theme.ceilings[tex_pick] = 5
for j = 1, 3 do
tex_pick = rand.pick(resource_tab[tab_pick].flats)
room_theme.ceilings[tex_pick] = 5
end
RT_name = RT_name .. tex_pick

room_theme.name = RT_name
Expand Down Expand Up @@ -658,14 +795,29 @@ function OTEX_PROC_MODULE.synthesize_procedural_themes()
end
local scenic_fence_tab = table.copy(OTEX_SPECIAL_RESOURCES.rail_scenic_fences)
for fence,prob in pairs(scenic_fence_tab.tech) do
GAME.THEMES.tech.scenic_fences[fence] = prob
GAME.THEMES.urban.scenic_fences[fence] = prob
GAME.THEMES.tech.scenic_fences[fence] = int(prob * 0.75)
GAME.THEMES.urban.scenic_fences[fence] = int(prob * 0.75)
end
for fence,prob in pairs(scenic_fence_tab.gothic) do
GAME.THEMES.hell.scenic_fences[fence] = prob
GAME.THEMES.urban.scenic_fences[fence] = prob
GAME.THEMES.hell.scenic_fences[fence] = int(prob * 0.75)
GAME.THEMES.urban.scenic_fences[fence] = int(prob * 0.75)
end

-- create liquid attachments
local liquid_tab = table.copy(OTEX_SPECIAL_RESOURCES.liquid_materials)
for liquid_mat,_ in pairs(liquid_tab) do
GAME.MATERIALS[liquid_mat]={t=_.t, f=_.f}
end
local liquid_defs = table.copy(OTEX_SPECIAL_RESOURCES.liquid_defs)
for liquid,_ in pairs(liquid_defs) do
GAME.LIQUIDS[liquid]=liquid_defs[liquid]
end
local liquid_themes = table.copy(OTEX_SPECIAL_RESOURCES.liquid_themes)
for theme,l_tab in pairs(liquid_themes) do
for liquid,prob in pairs(l_tab) do
GAME.THEMES[theme].liquids[liquid] = prob
end
end
end


Expand Down