{"id":44857039,"url":"https://github.com/trk20/aps-optimizer","last_synced_at":"2026-02-17T08:00:12.193Z","repository":{"id":291326480,"uuid":"972320307","full_name":"trk20/APS-Optimizer","owner":"trk20","description":"APS Tetris Optimizer for From The Depths","archived":false,"fork":false,"pushed_at":"2025-09-07T20:59:15.000Z","size":2059,"stargazers_count":10,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T22:22:18.185Z","etag":null,"topics":["csharp","fromthedepths","uno-platform"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trk20.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-24T22:12:52.000Z","updated_at":"2025-09-07T18:55:04.000Z","dependencies_parsed_at":"2025-09-07T22:14:11.953Z","dependency_job_id":"9ae34854-404b-4d45-b2d4-67fdda74e8f8","html_url":"https://github.com/trk20/APS-Optimizer","commit_stats":null,"previous_names":["trk20/aps-optimizer"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/trk20/APS-Optimizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trk20%2FAPS-Optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trk20%2FAPS-Optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trk20%2FAPS-Optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trk20%2FAPS-Optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trk20","download_url":"https://codeload.github.com/trk20/APS-Optimizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trk20%2FAPS-Optimizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29537226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T05:00:25.817Z","status":"ssl_error","status_checked_at":"2026-02-17T04:57:16.126Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","fromthedepths","uno-platform"],"created_at":"2026-02-17T08:00:11.234Z","updated_at":"2026-02-17T08:00:12.169Z","avatar_url":"https://github.com/trk20.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# APS Optimizer tool for From The Depths\n\nThis tool provides a simple, user-friendly method to easily generate density-optimized APS layouts for From The Depths.\n\n---\n\n## Features\n\n- Support for 3, 4, and 5-clip tetris.\n- Automatic turret layout templates, with the option to customize them for armour or extra space.\n- Hard and soft symmetry enforcement options, including both rotational and reflexive symmetry.\n- Export generated layouts directly to _From The Depths_ prefab file (`.blueprint`) for immediate use in-game.\n- Choose the resulting prefab height, mapped automatically to the respective blocks (loader/clip length variants).\n- Optionally include bottom layer of ejectors and ammo loaders in exported blueprint.\n\n---\n\n## Installation\n\n#### Windows\n\n1. Download `APS-Optimizer-{version}-windows-x64.zip` from the [latest release](https://github.com/trk20/APS-Optimizer/releases).\n2. Extract the contents to a folder.\n3. Run the contained `APS_Optimizer_V3.exe` executable\n4. When Windows gives the \"Windows protected your PC\" popup click on \"More Info\" then \"Run Anyways\"\n\n| _More Info_                                                 | _Run Anyways_                                               |\n| ----------------------------------------------------------- | ----------------------------------------------------------- |\n| ![run-confirmation-1](readme-images/run-confirmation-1.png) | ![run-confirmation-2](readme-images/run-confirmation-2.png) |\n\nThis will prompt for the .NET 8.0 runtime if needed.\n\n5. All done - you can move the folder (and all its contents) anywhere you feel and/or create a shortcut to the exe.\n\n**Q:** Why does windows block the program?\n\n**A:** The executable is \"unsigned\" - it doesn't have a special signature/certificate saying who made it, when, etc so windows can't tell whether or not it's safe. Reason it isn't signed is that that signing an exe is a pain - if you know better and think it's easy, feel free to create a PR for the workflow changes and I'll get it merged.\n\n#### Linux\n\n1. Download the relevant zip file from the [latest release](https://github.com/trk20/APS-Optimizer/releases) - `linux-x64` or `linux-arm64` depending on your cpu (if you don't know, you probably want the `linux-x64` version).\n2. Extract the contents to a folder.\n3. In terminal, navigate to the folder and run\n   `chmod +x APS_Optimizer_V3_Linux \u0026\u0026 ./APS_Optimizer_V3_Linux`\n4. All done - the program should open.\n\n---\n\n# Usage\n\n### Solver Parameters\n\n![interface-solve-parameters](readme-images/interface-solve-parameters.png)\n\n#### Grid Editor (1)\n\nAllows for toggling of individual cells between blocked and clear for fully custom templates.\n![custom-template](readme-images/custom-template.png)\n\n#### Symmetry Selector (2)\n\nTells the solver to enforce the selected symmetry.\n\n![symmetry-dropdown](readme-images/symmetry-dropdown.png)\n\nChosen symmetry will be displayed on editor and result displays.\n\n**Rotational (90/180 degrees)**\n\n| Symmetry (Blank)                            | Example Solution                                          |\n| ------------------------------------------- | --------------------------------------------------------- |\n| ![rotational](readme-images/rotational.png) | ![rotational-result](readme-images/rotational-result.png) |\n\n**Reflexive (Vertical/Horizontal/Quadrants)**\n\n| Symmetry (Blank)                          | Example Solution                                        |\n| ----------------------------------------- | ------------------------------------------------------- |\n| ![reflexive](readme-images/reflexive.png) | ![reflexive-result](readme-images/reflexive-result.png) |\n\n#### Soft vs Hard Symmetry (3)\n\nTells the solver whether or not to discard non-symmetric placements where the rotated or reflected shape would intersect itself.\n\n| **Soft Symmetry**                                       | **Hard Symmetry**                                 |\n| ------------------------------------------------------- | ------------------------------------------------- |\n| ![reflexive-result](readme-images/reflexive-result.png) | ![hard-symmetry](readme-images/hard-symmetry.png) |\n\n#### Template Preset Selector (4)\n\nAutomatically applies the selected template pattern on selection and resize.\n\n![template-preset](readme-images/template-preset.png)\n\n| **Circle (Center Hole)**                      | **Circle (No Hole)**                  | **None**                        |\n| --------------------------------------------- | ------------------------------------- | ------------------------------- |\n| ![center-hole](readme-images/center-hole.png) | ![no-hole](readme-images/no-hole.png) | ![none](readme-images/none.png) |\n\n#### Grid Dimensions (5)\n\nChanges the width and height of the grids.\n\n![width-height](readme-images/width-height.png)\n\n**Note:**\n\n- Larger sizes will take longer to solve, especially above 21x21 for 4-clip.\n\n#### Shape Selection (6)\n\nIndicates which shape(s) the solver is allowed to use to generate a solution.\n\n![shape-selection](readme-images/shape-selection.png)\n\n**Notes:**\n\n- The cooler in 5-clip allows self-intersection to ensure optimal solutions.\n- Mixing clip types is pretty much never optimal in FTD, so enable multiple at your own digression.\n\n## Solving\n\nWhile the solver is finding a solution, you'll be presented with an updating display of how long it's taking and the current iteration attempt number.\n\n![progress](readme-images/progress.png)\n\n**Note:**\n\n- Iterations in this case mean that the solver is allowing progressively less dense solutions. This will happen a fair number of times in certain situations, especially with hard reflexive symmetry, 4-clip, and 5-clip.\n\n**Q:** Why can't there be a progress bar?\n\n**A:** The time taken is _very_ unpredictable - a single solver setting can be the difference between 0.2s and 40s. If you figure out how to accurately estimate how long it will take, please consider making an issue with the exact details or submit a pull request.\n\n## Exporting to FTD\n\nWhen a solution is ready, you'll be able to use the export menu by pressing the Export Result button directly under the result display.\n\n![export-button](readme-images/export-button.png)\n\nThis will give you a pop-up menu displaying the number of each shape placed, the total material cost, and the block count for the generated prefab. You can select the result height using the target height (between 1 and 8 for 3-clip and 4-clip). If exporting 3 or 4 clip tetris, there will be an option to include the bottom ejector and ammo intake layer.\nPressing \"Save\" will allow you to navigate and save the prefab to your From The Depths prefab folder or a subfolder to allow placement in-game - located at `...\\From The Depths\\Player Profiles\\{username}\\PrefabsVersion2\\`.\n\n![save-blueprint](readme-images/save-blueprint.png)\n\nNow you can open it up in-game!\n\n![load-prefab](readme-images/load-prefab.png)\n\n![loaded-prefab](readme-images/loaded-prefab.png)\n\nVoila!\n\n**Note:**\n\n- If From The Depths was already open, you might have to refresh the prefabs folder.\n\n---\n\n## Tips and extra info\n\n- Enforcing symmetry will usually reduce the compute time, at the risk of missing better asymmetric solutions.\n- 3-clip solutions are almost always faster to solve than 4-clip and 5-clip.\n- Hard reflexive symmetry (Horizontal or Vertical) is recommended for 5-clip - the solution is almost always still optimal, it usually solves quite a bit faster, and the result looks nice :\\)\n- If you need more space for coolers/recoil absorbers/rail chargers, but don't care where, try using the different symmetries.\n- If you want to leave room at the front of the turret for armour, or want a specific shape of center hole, just use the editor grid to toggle the cells before solving.\n- 3-clip almost always finds optimal solutions with rotational symmetry, and at larger sizes reflexive symmetry is often still optimal.\n\n---\n\n## Contributing\n\nContributions are welcome! If you'd like to help improve this tool, please feel free to:\n\n- **Report Issues:** If you find a bug _or_ you have a suggestion, please open an issue using the [GitHub Issues tab](https://github.com/trk20/APS-Optimizer/issues). Provide as much detail as possible, including steps to reproduce the bug if applicable.\n- **Submit Pull Requests:** If you've fixed a bug or added a feature:\n  1.  Fork the repository.\n  2.  Create a new branch for your changes.\n  3.  Make your changes and commit them.\n  4.  Push to your branch.\n  5.  Open a Pull Request against the main branch of this repository. Please provide a clear description of your changes.\n  6.  Request a review.\n\nNote: for making and testing changes to the codebase, you'll need to be able to run and debug Uno Platform apps - refer to their documentation [here](https://platform.uno/docs/articles/get-started.html) for setting that up.\n\n## Acknowledgements\n\n- Thanks to the developers of `cryptominisat5` for their [powerful SAT solver](https://github.com/msoos/cryptominisat) - this tool uses it directly to do the brunt of the optimization. Suffice it to say this tool would not be nearly as good without this fantastic SAT solver.\n- Thanks to **sascha** on stackoverflow for their fantastic [answer on a polynomio grid-packing question](https://stackoverflow.com/a/47934736) that served as the basis for this tool's core logic.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrk20%2Faps-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrk20%2Faps-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrk20%2Faps-optimizer/lists"}