Autocuts diagonal walls, directional smoothing support, bumps cutter to v5.0.0 (#92471)

## About The Pull Request

See https://github.com/spacestation13/hypnagogic/releases/tag/v5.0.0 for
more details.

Some of this is just updating our existing .toml files to support the
changes to input vars (bools became enums). I'm also taking the
opportunity to implement autocutting for diagonal (read: shuttle mostly)
walls, which should be the LAST THING IN THE CODEBASE that wasn't
autocut. Hopefully this means none ever handcuts something ever again. I
hope.

Oh also [Removes /turf/closed/indestructible/syndicate/nodiagonal as it
does not do
anything](df735ab0e6)

The parent is also not diagonal so it doesn't like, do anything at all.

[cleans up redundant restoration
artifacts](552454fbf4)

Restoration step doesn't know about templates, so it just sort of puts
in everything that NEEDS to be in there (or tries to). This leads to
artifacts when a template is included, shouldn't have those in the
codebase they don't do anything.

## Why It's Good For The Game

No more handcut bullshit.

Wallem asked me for directional cutting support, now we have that so art
folk can use it for stuff.
This commit is contained in:
LemonInTheDark
2025-08-11 12:40:42 -07:00
committed by GitHub
parent c9e4360544
commit 3330cd9ae8
44 changed files with 366 additions and 486 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -307,7 +307,7 @@ xxx xxx xxx
SOUTH_JUNCTION|WEST_JUNCTION|SOUTHWEST_JUNCTION,
SOUTH_JUNCTION|EAST_JUNCTION|SOUTHEAST_JUNCTION,
)
icon_state = "[base_icon_state]-[smoothing_junction]-d"
icon_state = "[base_icon_state]-[smoothing_junction]-diagonal"
if(new_junction == old_junction || fixed_underlay) // Mutable underlays?
return

View File

@@ -137,12 +137,6 @@ INITIALIZE_IMMEDIATE(/turf/closed/indestructible/splashscreen)
smoothing_groups = SMOOTH_GROUP_WALLS + SMOOTH_GROUP_CLOSED_TURFS + SMOOTH_GROUP_SYNDICATE_WALLS
canSmoothWith = SMOOTH_GROUP_SHUTTLE_PARTS + SMOOTH_GROUP_AIRLOCK + SMOOTH_GROUP_PLASTITANIUM_WALLS + SMOOTH_GROUP_SYNDICATE_WALLS
/turf/closed/indestructible/syndicate/nodiagonal
icon = 'icons/turf/walls/plastitanium_wall.dmi'
icon_state = "map-shuttle_nd"
base_icon_state = "plastitanium_wall"
smoothing_flags = SMOOTH_BITMASK
/turf/closed/indestructible/riveted/uranium
icon = 'icons/turf/walls/uranium_wall.dmi'
icon_state = "uranium_wall-0"
@@ -160,7 +154,8 @@ INITIALIZE_IMMEDIATE(/turf/closed/indestructible/splashscreen)
canSmoothWith = SMOOTH_GROUP_PLASTINUM_WALLS
/turf/closed/indestructible/riveted/plastinum/nodiagonal
icon_state = "map-shuttle_nd"
icon = MAP_SWITCH('icons/turf/walls/plastinum_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("plastinum_wall-0", "plastinum_nd")
smoothing_flags = SMOOTH_BITMASK
/turf/closed/indestructible/wood

View File

@@ -281,14 +281,13 @@
return ..()
/turf/closed/wall/mineral/titanium/nodiagonal
icon = 'icons/turf/walls/shuttle_wall.dmi'
icon_state = "map-shuttle_nd"
base_icon_state = "shuttle_wall"
icon = MAP_SWITCH('icons/turf/walls/shuttle_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("shuttle_wall-0", "shuttle_nd")
smoothing_flags = SMOOTH_BITMASK
/turf/closed/wall/mineral/titanium/overspace
icon_state = "map-overspace"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
icon = MAP_SWITCH('icons/turf/walls/shuttle_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("shuttle_wall-0", "shuttle_overspace")
fixed_underlay = list("space" = TRUE)
/turf/closed/wall/mineral/titanium/interior/copyTurf(turf/copy_to_turf, copy_air = FALSE, flags = null)
@@ -352,17 +351,14 @@
/turf/closed/wall/mineral/plastitanium/nodiagonal
icon = 'icons/turf/walls/plastitanium_wall.dmi'
icon_state = "map-shuttle_nd"
base_icon_state = "plastitanium_wall"
icon = MAP_SWITCH('icons/turf/walls/plastitanium_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("plastitanium_wall-0", "plastitanium_nd")
smoothing_flags = SMOOTH_BITMASK
rust_resistance = RUST_RESISTANCE_TITANIUM
/turf/closed/wall/mineral/plastitanium/overspace
icon_state = "map-overspace"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
icon = MAP_SWITCH('icons/turf/walls/plastitanium_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("plastitanium_wall-0", "plastitanium_overspace")
fixed_underlay = list("space" = TRUE)
rust_resistance = RUST_RESISTANCE_TITANIUM
/turf/closed/wall/mineral/plastitanium/rust_turf()
if(HAS_TRAIT(src, TRAIT_RUSTY))

View File

@@ -248,14 +248,13 @@
rust_resistance = RUST_RESISTANCE_TITANIUM
/turf/closed/wall/r_wall/plastitanium/nodiagonal
icon = 'icons/turf/walls/plastitanium_wall.dmi'
icon_state = "map-shuttle_nd"
base_icon_state = "plastitanium_wall"
icon = MAP_SWITCH('icons/turf/walls/plastitanium_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("plastitanium_wall-0", "plastitanium_nd")
smoothing_flags = SMOOTH_BITMASK
/turf/closed/wall/r_wall/plastitanium/overspace
icon_state = "map-overspace"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
icon = MAP_SWITCH('icons/turf/walls/plastitanium_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("plastitanium_wall-0", "plastitanium_overspace")
fixed_underlay = list("space" = TRUE)
/turf/closed/wall/r_wall/plastitanium/syndicate
@@ -267,12 +266,11 @@
return FALSE
/turf/closed/wall/r_wall/plastitanium/syndicate/nodiagonal
icon = 'icons/turf/walls/plastitanium_wall.dmi'
icon_state = "map-shuttle_nd"
base_icon_state = "plastitanium_wall"
icon = MAP_SWITCH('icons/turf/walls/plastitanium_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("plastitanium_wall-0", "plastitanium_nd")
smoothing_flags = SMOOTH_BITMASK
/turf/closed/wall/r_wall/plastitanium/syndicate/overspace
icon_state = "map-overspace"
smoothing_flags = SMOOTH_BITMASK | SMOOTH_DIAGONAL_CORNERS
icon = MAP_SWITCH('icons/turf/walls/plastitanium_wall.dmi', 'icons/turf/walls/misc_wall.dmi')
icon_state = MAP_SWITCH("plastitanium_wall-0", "plastitanium_overspace")
fixed_underlay = list("space" = TRUE)

View File

@@ -1,9 +1,18 @@
mode = "BitmaskSlice"
# Don't try and put directions in our icon states
produce_dirs = false
# Dictates what sort of directions this dmi will have.
# There are currently 4 possible values:
# Standard (Default, used if none is specified) -> only 1 direction per frame
# Cardinals -> 4 directions per frame, arranged as duplicates of the full input set out to the right
# ... in order SOUTH, NORTH, EAST, WEST
# All -> 8 directions per frame, arranged in the same pattern as cardinals
# ... in order SOUTH, NORTH, EAST, WEST, SOUTHEAST, SOUTHWEST, NORTHEAST, NORTHWEST
# CardinalsRotated -> 1 direction per frame, will be expanded in the dmi to be Cardinals, with each
# ... direction being that base junction, rotated in whatever way. Exists mostly so client.dir supporting states
# ... can be created. Creates a lot of duplicate blocks otherwise.
directional_strategy = "Standard"
# We smooth only with our cardinal neighbors, not the ones on the diagonal
smooth_diagonally = false
output_type = "Cardinal"
# Take as input a set of 32x32 blocks
[icon_size]

View File

@@ -1,7 +1,7 @@
template = "bitmask/cardinal_32x32"
# We're diagonal
smooth_diagonally = true
output_type = "StandardDiagonal"
# And because of that we need a state for all directions
[positions]

View File

@@ -0,0 +1,20 @@
template = "bitmask/diagonal_32x32"
# We're a corner diagonal
output_type = "CornerDiagonal"
# And because of that we need a state for all directions and all our asshole corner bits
[positions]
convex = 0
vertical = 1
horizontal = 2
concave = 3
flat = 4
bottom_right_inner = 5
bottom_left_inner = 6
top_right_inner = 7
top_left_inner = 8
bottom_right_outer = 9
bottom_left_outer = 10
top_right_outer = 11
top_left_outer = 12

View File

@@ -0,0 +1,25 @@
# Bitmask restoration! (Corners)
# Allows for easy mass extraction of template pngs and their configs from a dmi
# Use this if you have a dmi and you want a cutter config you can edit easily
# Of note, while it tries its best it is nowhere near perfect. We don't parity check against the existing dmi
# And we also do not account for overrided states very well
# Always double check (and be aware that dmi is weird so you may get diffs of 1 rgb value when doin this)
mode = "BitmaskSliceReconstruct"
# List of icon states to pull out, expanded to get the standard ordering for diagonals
extract = [
"0", "3", "12", "15", "255",
"6-diagonal", "10-diagonal", "5-diagonal", "9-diagonal",
"38-diagonal", "74-diagonal", "21-diagonal", "137-diagonal"
]
# Map of name -> state that will be encoded into a positions list later
# Lets you extract particular states and use them to fill in for states later
# Useful to carry over odd snowflake states
#[bespoke]
# Map of key -> value to set on the created config
# Lets you set arbitrary values on the created config, mostly useful for batch processing
# IMPORTANT NOTE: We sort of assume you'll setup a default template here (since this is for batch processing),
# so if things work odd that's likely why
#[set]
#template = "\"bitmask/diagonal_corner_32x32\""

View File

@@ -32,5 +32,5 @@ export DREAMLUAU_VERSION=0.1.2
export CUTTER_REPO=spacestation13/hypnagogic
#hypnagogic git tag
export CUTTER_VERSION=v4.0.0
export CUTTER_VERSION=v5.0.0

View File

@@ -8,7 +8,3 @@ y = 33
[output_icon_size]
x = 32
y = 33
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_bronze"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_cult"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_gold"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_iron"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_material"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_normal"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_paperframe"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_paperframe"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_plastitanium"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_rusty"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_rusty"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_shuttle"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_silver"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

View File

@@ -1,14 +1,2 @@
output_name = "window_frame_uranium"
template = "bitmask/diagonal_32x32.toml"
[icon_size]
x = 32
y = 32
[output_icon_size]
x = 32
y = 32
[cut_pos]
x = 16
y = 16

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
icons/turf/smooth_wall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,2 @@
output_name = "smooth_wall"
template = "bitmask/diagonal_corner_32x32"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,2 @@
output_name = "abductor_wall"
template = "bitmask/diagonal_corner_32x32"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,2 @@
output_name = "plastinum_wall"
template = "bitmask/diagonal_corner_32x32"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,2 @@
output_name = "plastitanium_wall"
template = "bitmask/diagonal_corner_32x32"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,2 @@
output_name = "shuttle_wall"
template = "bitmask/diagonal_corner_32x32.toml"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,2 @@
output_name = "survival_pod_walls"
template = "bitmask/diagonal_corner_32x32"