Since I have made so many improvements which I haven’t released yet, I decided to release a beta version, which basically is the full project, but it isn’t tested and I guarantee that there are bugs in there.
:arrow: Here’s a list of the major improvements:
:arrow: Quadtrees : This enables you to search for paths in wide open areas really fast.
:arrow: Path smoothing : I have three path smoothers, Bezier Curve smoother, Catmull Rom and Simple Smooth (subdivides the path and smoothes it).
:arrow: The editor gui has many improvements, e.g a quick button bar at the top which enables you to quickly switch on and off debug info.
:arrow: Up to 9+ times faster : I have found ways of caching data to make the script about 9 times faster, my average pathfinding calls are now calculated in milliseconds.
:arrow: Multithreading : If you enable this, the pathfinding will have almost no impact on framerate (if you run it on a 2+ core computer), which is great (Warning: This might cause crashes on windows of some reason).
:arrow: Correct paths, actually, in previous version paths have not been optimal in all cases, but they are now!
I’m on vacation from tomorrow, so I will not have a lot of time to answer questions and such (most of the time I will not even have internet connection).
Amazing! I’ve never been able to grasp how to program a*… XD Kind of problemsome with the fact I’m trying to program an RTS. May have to look at your code to get some ideas.
Very cool though.
(I’m one of those people that doesn’t like just using someone else’s code. I prefer to use my own, even if it’s not as efficient. Personal preference.)
Basically I want those to connect ingame - I plan to procedurally generate my structures when the game begins, and to have multiple floors.
Is it possible to connect those 2 ingame? It should be easy enough - look for nodes at a specific height, than match the X Y together.
Likewise a small bug, when using quad-trees it doesn’t work very well with ramps (trying to optimize it like it’s part of the flat terrain)
Workaround would be to place colliders on both sides of the ramp.
Besides that, I’m loving it. I need to give some love to the procedural scenes and make sure my question isn’t answered in it. Huge performance boost as well!
HUGE HUGE HUGE speed improvement on calculating the grid is the first thing I’ve noticed. Everything else is working just fine with no code changes. Took me a little while to find all the bits I needed to drop it in the project. Couldn’t find a 2.8 ‘just source’ download.
Excellent work as always and if my project ever sees the light of day - money dropping at ya.
Is there someone who don’t “scan map on startup” ?
I try to save my grid to not have to scan it (“big” grid) but when i run my project, Unity crash xD
I saw that some code is commented, i know that is a beta but maybe i’m bad
(Create new AstarData, uncheck “Scan map on Startup”, drag’n drop my AstarData object in the AstarData field, scan, save, run … crash )
Ok, i reimported all my scripts, it doesn’t crash anymore but i have this error at loading
NullReferenceException: Object reference not set to an instance of an object
AstarPath.FloodFillAll () (at Assets\Pathfinding\AstarPath.cs:2026)
AstarPath.LoadAstarData () (at Assets\Pathfinding\AstarPath.cs:3519)
AstarPath.Awake () (at Assets\Pathfinding\AstarPath.cs:587)
I know sturestone is in holiday, but if someone have an idea