tModLoader

tModLoader

评价数不足
AlgoLib
   
奖励
收藏
已收藏
取消收藏
模组功能: 模组类库
tModLoader版本: 1.4.4
文件大小
发表于
更新日期
30.996 KB
11 月 4 日 上午 12:11
11 月 8 日 下午 12:09
8 项改动说明 ( 查看 )

订阅以下载
AlgoLib

在 pagedMov 的 2 个合集中
Stuff I am using
34 件物品
pagedMov's mods
18 件物品
描述
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
引用自 tModLoader AlgoLib
Developed By pagedMov
1 条留言
professional clown 11 月 6 日 下午 11:19 
o algo lib