Download

Animal tracking system

Hey everyone,

I am looking to make a hunting game prototype. I have most of the things I need to create it but I am wondering what would be the best approach to tracking traces of animals such as footprints, foraging sites, etc.
I love the way that hunter: Call of the Wild does it and would love to try to implement a similar idea. So far mostly what I’ve tried is just having the animals drop an invisible actor that you can only see when you get close. But I feel that is a very unoptimized way, not to mention having to have the game run for a while before tracks start to generate. This whole idea is very early so its still mostly in planning to see what features I can work in. I was also thinking of almost like a scent trail system, then it would make clouds or lines of scent leading to the animal.

Guide showing the tracking:
https://youtube.com/watch?v=3MMO6FFw050

Thank you for the help!

You can try to create a vector array and add current location to array every 3 or 5 seconds when animal is moving. Create a function that will save the last 50 (or more) locations in array by replacing the oldest with new locations.
The way you show the trails depends on your game mechanics.
For example, you can display all trails that are close to a character within a certain radius via particle effect or similiar.
Or you can find the nearest animal and show trails/footprints from that animal only.

Or maybe better solution to save locations:

  • create locations vector array and create last_location vector. Every few seconds check distance from the last location and current animal location. If distance > 1000 (or less/more) units add current location to array and set last_location as current location. This will add a location to the array when the animal travels a certain distance. Always keep a limited number of locations in array per animal.

That is a super good idea! I will have to give it a go for sure!