Open ronaldosvieira opened 7 years ago
Idea 1: on each entity's iteration, it "registers" a sound or smell they made. Then, maybe store those on the same quadtree used for collision detection as an object as big as the sound/smell range, so that the entities "colliding" with it would be the entities that were able to hear/smell it.
Issue: the sounds/smells won't be able to be "detected" in the same iteration they were "registered".
A rabbit running to its lair makes sound. Fresh deer meat can be smelled from quite a distance. A sudden explosion that appeared out of nowhere (but definitely wasn't work of some random god) also makes a very loud sound.
How can we model the process of sound and smell going all the way from its source to the ears/noses of nearby creatures, fading with distance?