AlgoLib
О материале
«AlgoLib» — материал мастерской tModLoader. Моды Terraria для tModLoader: новый контент, удобство игры и библиотеки. Для установки откройте оригинал в Steam Workshop, проверьте требования автора и подпишитесь. Совместимость с версией игры редакцией не проверена.
Описание автора
A library that contains useful algorithms and helper functions for gathering information in 2D space.
I ended up using a lot of the same algorithms across all of my mods and thought that re-implementing them every time was annoying, so I made this library.
This mod doesn't do anything on its own, it exists solely to expose useful tools for myself and other modders.
Highlights include:
-
Graph search iterators that traverse grid coordinates:
-
Breadth-first search for radial searches that expand from a specific point
-
Bresenham's Line Algorithm for raycasting
-
-
Utilities for pathfinding:
-
A* pathfinding algorithm with optional stagnation limits
-
Path smoothing/node pruning tools
-
-
A nice way to get tiles safely without having to remember to check WorldGen.InWorld every time
-
A dozen different functions for getting information about two points, such as distance, angle, direction, etc
The implementation of the point iterator algorithms in particular is quite optimized, and run comfortably in hot loops.
I highly recommend it for cutting down on boilerplate in mods that are heavy on analyzing tiles.
GitHub: https://github.com/km-clay/AlgoLib
Developed By pagedMov
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.