I like to make game on TGF, but one thing that has bothered me for many years is the fact that I can't seem to get pathfinding to work. I've tried everything but I can't seem to get it right. Im not too bothered if its not perfect, its just that I want my games to have enemies that don't walk into walls and bounce off them like idiots. Im hopeless with any programming so please don't shower me with stuff ive never heard of.
It's certainly possible, just real hard, and kinda depends on the specifics of your game. I half-finished an example once that used invisible node objects scattered over the playfield. It determined which node the player was closest to, then which the enemy was closest to, then moved the enemy to the next node along that path. Within a certain distance from the player, the enemy goes into normal seek and destroy ball movement. I'm sure there's plenty of other ways to do it, all equally cumbersome.
A* (pathfinding system) is technically possible in TGF but it's a bastard to get working, so I wouldn't waste my time with it
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
You can kind of fake pathfinding pretty well in both MMF and TGF easily. All you really need is two detector actives, one sticking out left and one right, both 45 degrees, from each object. If the left detector hits an obstacle steer the object right, and vice versa. Of course this method is not going to work out the shortest/best method to get anywhere, but it certainly looks more intelligent than slamming your face in to a wall repeatedly.
In TGF this method is more limiting because each object now requires an additional 2 objects, so you'll hit that 256 object limit faster.
Assault Andy Administrator
I make other people create vaporware
26th January, 2005 at 11:31:44 PM -
Funny, I've just been reading about A* pathfinding. I really wish I could find a good article written in click.