Quote:
Originally Posted by Lazy
The bot fires out 24 tracelines from the head, chest, knees and feet and will choose what distance to travel in based on which trace had the longest distance.
|
I don't know how costly traces are in HL, but in the Q3 engine, if 16 bots were in the game and you were doing 384 traces a frame (16 bots X 24 traces) - you would bring the server down to a crawl, even on the fastest computer.
Even if you spread it out over several frames, it can get very costly very quick, and its nearly impossible to design it for EVERY possible scenario of odd map geometry.
If you only had one bot in the map, and it traced around creating a path for all bots to use, it wouldn't be so bad, but you wouldn't be able to play as it learned - in fact it would be best to just let it run around on its own first, create the paths, THEN start the game normally with more bots
One thing though: you have the burden of giving the bot time to "learn" every map, and some maps it will never learn completely (if they have odd geometry or lots of jumps/traps/buttons/doors/etc), unless you use the human player as an unwitting "waypointer" - which would probably be the best best.
A lot of the old Q1 bots worked that way (the Reaper comes to mind): you were encouraged to run around the map at first, and then the bot would get a pretty good layout of where all the paths were for that map. The only hard thing to do there is intelligently lay down waypoints based on where the human moves, then pruning any unneeded waypoints when a complete model of the map was done. Then the burden is on the user.
However, today, most gamers don't want to be the waypointer or have to wait around to play the bots - they just want to fire it up and play, and that may hurt your bot in the eyes of some people if they have to jump thru hoops before they can play. Also, you may never get an optimal path - tho you can usually get one thats good enough, but it depends on how intelligent the human player moved around the map as they created the paths.
Tracelines have a part to play though - depending on your engine, they can help with the environmental sampling of the immediate area around a bot.