ID:154205
 
I'm now working on pathfinding inside the ant colony. I've got a simple system for letting ants find their way out no matter how complicated it is (they backtrack the path the digger took) but I'm having problems with allowing ants to find their way to places and objects inside the colony.

The problem is that something two spaces away may take 5 steps in the opposite direction just to get started on the path to it (depending on how drunk the player was when digging the nest :p).

I'm really at a loss...
Unless you really wanted to implement something yourself, you might take a look at Deadron's PathFinding library. http://www.byond.com/hub/Deadron/PathFinding
In response to Air Mapster
Nothing like a few hundred ants running a pathfinding program to eat up your CPU :o)
In response to Foomer
That's partially why I decided not to use Deadron's library because a few of his comments talked about cutting down on massive CPU usage. Ants aren't that smart so my pathfinding doesn't need to be that smart either, I just need them to have some basic navigation skills so they can find their way arround in a reasonable amount of time.

I'm thinking of "cheating" and just creating a room for the queen and her eggs and just not letting the nurses leave it. The gatherers just walk in and dump their food so they just need to be able to exit (which isn't a problem).

Right now nests reach an equilibrium population of arround 100-110 ants without human intervention. When you guide them they can get up to a max of about 200 (You could probably get more if you really tried and were good at management). Although I'd like to keep numbers this high I think I'm going to end up lowering them because many users could cause some problems :p
Make path nodes. A good example of this thats visual and you can see in action is the BYOND game Sheep.

How the node gets placed there I'll leave up to you, but the ants and navigate through complex areas with path nodes setup and just jump from node to node.

LJR