KISS -- What is the simplest way to pathfinding?
My first answer to this is behaviour -- don't make the object moving through space analyze a series of paths and choose one. To me, this is a simple matter of fact. It's also one of those "set in stone" boundaries I have to work around with in SL. Scripts just don't get much memory and nowhere to store information outside of their allotment.
For those of you who don't know, KISS is an acronym for, "Keep It Simple, Stupid." The common meaning of this acronym extends from the philosophy that often the best and most efficient way to accomplish something is to do it in the most simple way possible. Therefore, rather than teach a dumb box how to plot, graph, and map an optimal path given a specific set of rules, I'd rather give it a few rules and let it loose -- it doesn't have to analyze and "pre-think" anything; it's behaviours and complexities will emerge from the initial rules.
The first problem is with the way prims are constructed in SL. When detecting their position, one can only query their centre vector from the sensor event. Circumference is a bit of an issue since it would be extremely easy to just avoid a one-dimensional vector.
There are a few ways one might approach this issue --
- Create a larger invisible and phantom prim and set the pathfinder at its center. Then use a collision event to detect surfaces and transfer the information through a linked message.
- Use a circumference protocol for obstacles. Obstacles would store their size and shape information -- when the object then detects the object in its approach vector, it would query for the nearest point and the normal; allowing it to readust its course.
Personally, I perfer solution number two -- it would allow the object to move about an environment and avoid object regardless of thier shape and the size of the space the object is contained in. However, it means every prim the object is to avoid must have a script which leads to a couple of other problems:
- The pathfinders would only be able to exist within a controlled environment.
- More scripts means more server resources
- Communcation may not register fast enough for objects to avoid collisions
So I have a course set up in Gibson and am currently working on implementing the second solution to pathfinding. My ultimate goal will be to keep the code from this phase as elegant and stripped down as possible -- it has to be extremely thin and lightweight so as to not add too much baggage when I reach the later stages of the evolution of these creatures.
Any discussion and suggestions are duly welcome -- as are other virtual life experimentors! Remember: if you have a project you'd like to discuss or experiences/knowledge to share; you can write about it here. It is my hope that this blog will become a community hub for artifical life designers, developers, and enthusiasts. Just send me an email or message me in-world!