sirjuddington / SLADE

It's a Doom editor
https://slade.mancubus.net
GNU General Public License v2.0
709 stars 109 forks source link

Tutti-Frutti and Medusa Effect Fixer #1679

Open OpenRift412 opened 7 months ago

OpenRift412 commented 7 months ago

Editor

Resource editor

Description of your feature request

There are methods of fixing the tutti-frutti and medusa effects in WADs using SLADE, but the problem is that this would require checking every nook and cranny of each level to see where these texture bugs are present. Given the existing functionality within SLADE, it seems to me like this could be made into an automated process.

The main appeal of having a maintenance script that fixes these problems would be for playing WADs on legacy executables, such as the vanilla DOS EXE and executable hacks like Doom-plus and its derivatives (which allows for playing more limit-removing WADs, where these issues become a lot more apparent).

These scripts could use roughly the following processes, more or less.

Medusa Fix When this script is run, check the middle textures for all maps. If a middle texture is made up of multiple patches, merge all the patches into a single texture under a new name (akin to the Export to Archive function, plus), add the new texture to TEXTUREx and PNAMES, then replace any middle texture using the old texture with the new one in each map's SIDEDEFS lump.

Tutti-frutti fix When this script is run, it will check for any textures less than 128 pixels tall that have a height shorter than the linedef they are placed on. If the texture height is equal to the linedef height, then check if the vertical alignment on the linedef is a multiple of the texture height. Lastly, check if the texture height can be cleanly multiplied to 128.

If a texture is found to be shorter than the linedef it's mapped to AND has a height that can be cleanly multiplied to 128, do the following*:

  1. make a copy of the texture,
  2. tile it vertically to be 128 pixels tall
  3. export it as a new patch under a new name (using a different naming scheme than the medusa fix as to avoid conflicts)
  4. add the patch to TEXTUREx and PNAMES
  5. replace any instance of the old texture found as upper and lower textures in all SIDEDEFS lumps.

*This process should also apply to textures that have an alignment height that isn't a multiple of the texture height AND can be multiplied to 128.

If a texture is found to NOT be multipliable to 128 BUT meets the other requirements, display a list of linedefs, their respective map, and the name of the texture after the script is finished. These textures cannot be tiled to above 128 because they will not tile correctly in-game.

Would such features be something that works within the scope of SLADE's development?

OpenRift412 commented 2 months ago

Giving this a bump, just remembered that this python script exists as well, which may help in making a script for SLADE: https://github.com/sponge/rutti-tutti-find-a-frutti (edited with correct link)

eevee commented 2 months ago

(that's a python library for general wad operations, which SLADE can already do)

OpenRift412 commented 2 months ago

(that's a python library for general wad operations, which SLADE can already do)

Oh whoops, wrong link. here's the correct one: https://github.com/sponge/rutti-tutti-find-a-frutti