tModLoader Terraritone - Automated pathfinding and movement

saist

Terrarian
Terraritone
bot plays 2d block game for lazy people​

This mod uses a modified version of the A* pathfinding algorithm to find a path between 2 points and takes advantage of the tModLoader function hooks to move the player along the path. It doesn't mine or place blocks, there are several flaws with my implementation that have to do with movement, and the code is really messy (no class inheritance, inconsistent naming conventions, and class and variable scope is all over the place). I am releasing this here to share my work and if anyone is interested in this sort of thing and they could use what I've made (better ai for enemies or pathfinding projectiles?). I have only tested this on 1.3.5 running tModLoader v0.11.7.5

Unfortunately, I have completely burned out on this project (2-4 hours a day for 3 weeks straight) and college is starting for me soon so I've decided to stop development. Maybe I'll come back when I git gud but right now i'm kinda trash :(.

Also, tModLoader thinks there's a memory leak when you try to play with large worlds because of just how large the grid and TileType node arrays are soooooooooo no compability with large worlds?

Here's source code:
Gystre/Terraritone

Instructions:
1. set a goal with /goalmouse
2. click on the path button or type /path (movement will begin automatically)

Here are a few clips of where it works: ✔

terraritone-demo.gif


terraritone-demo2.gif


terraritone-demo3.gif



Here are a few clips of where it fails: ❌
terraritone-demo-fail.gif


terraritone-demo-fail2.gif


So yeah it kinda sucks... I just hope someone finds this code useful.
(-、-) - kale#0104
 
Back
Top Bottom