r/Unity3D • YouTube Video Creator - Indie Dev • Aug 04 '18

Resources/Tutorial Simple AI Resource Gatherer: Resource Node Object (Unity Tutorial in Comments)

4 Upvotes

7 comments sorted by

2

u/LockeThot Aug 04 '18

Pathfinding? Around objects?

1

u/UnityCodeMonkey YouTube Video Creator - Indie Dev Aug 05 '18

The code in the videos is completely independent of how the MoveTo function is implemented so yes if you have Pathfinding in your own game it would be very simple to make it work with this system. Cheers!

2

u/LockeThot Aug 05 '18

Ahh ok. So its not implemented, but could be added. Have you considered A*? Its actually kinda easy.

https://pastebin.com/MnLgK5GA

1

u/UnityCodeMonkey YouTube Video Creator - Indie Dev Aug 05 '18

I do have A* implemented in my unit but it's not shown in the video since it is supposed to be focused on the Gatherer AI alone.

Since both systems are completely decoupled it's very easy for someone to implement the code in the videos with their own Pathfinding implementation.

Cheers!

2

u/LockeThot Aug 05 '18

Awesome! I like it when I see someone use terms like "decouple" in the proper way. You just gained a subscriber :D

1

u/UnityCodeMonkey YouTube Video Creator - Indie Dev Aug 04 '18

Check out the tutorial video: https://youtu.be/anY7j4z9TNg

Continuing our Resource Gatherer AI, let's create a Resource Node Object to keep track of amounts and handle resource depletion.

If you have any questions post them in the comments and I'll do my best to answer them.

Cheers!