Sections

Saturday, May 2, 2015

Curves!

Yesterday, I met a friend.

He told me about using animation curves in the inspector. I always thought animations curves are great, giving you amassing control, but I never thought about using it to control values directly in the inspector for things other than the animations.

Provably not exactly what he had in mind when he told me, but I create a quick script to control the offset of those moving object with a curve. 




The possibilities...!




[j]

Tuesday, March 3, 2015

Path Finding

It's been a while!

Today I want to share something I've been working on. As you might know from my previous posts, I've learned programming on my own mostly and I take programming challenges to learn more about different algorithms and such. This time I want to show you my first approach to path finding.
A little heads up: This isn't A* nor any other, or at least I believe it isn't since I made this without learning the current existent ones.

What my algorithm does is that it looks for a tile's neighbor and evaluates which is close to where I want to go. While doing this it discards tiles that are part of the current path and those that are 'closed'. If the code isn't able to find a way to the destination it tries again ignoring the path that was already tried. Also, after the path has been found (if it is) it optimizes it by removing unnecessary steps, rearranges the steps to make smoother lines and curves and at the end removes overlapped steps.

As you can tell by now, this won't give me the shortest route to a destination, but as a first attempt I am very happy with the result.




Now that I've managed to create a path finding script on my own, I plan on comparing it to what the big path finding algorithms look like. Now that I know how it should be approached, learning how the great ones work will be easier to do.


Hope you liked it!

Now I wonder... where next?



[j]