- Home /
Pheremones and Texturemapping
I'm working on a simulated version of http://en.wikipedia.org/wiki/Ant_colony_optimization except with terrain instead of fixed paths.
I got off to a good start, but ran immediately into problems simulating the pheremone trails. my current thought is to do something with setting and reading the alpha on the terrain. trouble is, I'm not sure I understand the script functions that appear to do that. SetAlphamaps and GetAlphamaps respectively.
I'm also concerned that the Set function will be a simple all-or-nothing style function, and I can't set a value of strength (as the 'pheremones' need to reduce over time)
am I completely misunderstanding what these functions do? is there a better way to do it?
for the record, my original plan involved laying down a string of entities which would reduce in "strength" and eventually delete themselves. the problem was in identifying which was the 'next' in the line of them as each passing ant would reinforce the path by placing another entity. which would make following the intensity of the line rather difficult.
my current idea is that an alpha-channel on the terrain would continuously slide back towards the terrain's normal texture at a fixed rate across the whole map, and that the ants would override that to a new texture whenever they were carrying "food" back to the nest. essentially creating a slowly fading trail of texture which other ants could follow.
Answer by Eric5h5 · Jun 04, 2011 at 07:18 AM
You don't need to use the terrain; a basic 2D int array (you could use the same resolution as the terrain heightmap for simplicity) should do fine.