by date
Pathfinding on the RTS-SK!!
Pathfinding on the RTS-SK!!
| Name: | RTS Kit Account | |
|---|---|---|
| Date Posted: | Feb 08, 2008 | |
| Rating: | 5.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for RTS Kit Account |
Blog post
I had this idea since a long time, but just recently -with a more concrete need-, is that I finally got avocated to work on pathfinding, more clearly on the port of the pathfinding part of the Tom Romanos and Gavin Bunney's immersive AI Engine (iAI) to the RTS-SK.
iAI is an excelent resource, and besides thank Gavin and Tom for such incredible work, I highly recommend it to anyone woking on AI and Torque. I also recommend the reading of the thread on the iAI engine. I have to thank everyone on that thread, involved on documentation and fixes for the proper use of Gavin's code. Some of the guys there, Thomas Huehn, opened my eyes about how easy it could be to use just the pathfinding part of the iAI engine. Thomas also did a fantastic mechanism to add a node using a grey scale bitmap to set the weight.

An image is better...
Now without more intruduction, lets talk about the port.
The core of the iAI pathfinding mechanism remains untouched. I also maintained the original filter/folder structure so would be easy to anyone intrested on continue the iAI integration to the RTS-SK.
The changes are on files where just little parts of the code where needed, or a lightwieght version of it would do a better job. Also some general modifications to the eninge are needed.
So, as the majority of the code on iAIAgent.cc/.h were not needed for the cause, I just lefted it out, integrating some of the fields and functions from that class to the RTSUnit.
Also I've included all the needed script functionality on the pathManager.cs file, forever defeating the historically hated comment:
// Clever pathfinding algorithms here! -- BJG
Sorry BJG, whoever you are! (Ben?) ;)
Plus some minor modifications on game.cs and player.cs
And thats all the porting work!

Doesnt look great?
I have writen an artcle on TDN with the description, some documentation, the download, and a step-by-step guide for a proper integration.
The pathfinding engine has some drawbacks, like a huge framerate drop when the node net is displayed (design/debug time anyway), also by default make no distinctions on the weight of each node (which isnt really a flaw), and the 45 degrees turning could result a little clumsy (the path smoothing maybe need some love for the RTS needs).
However, all in all the pathfinding is great, and the good design of the iAI engine, perfectly allows further improvements. The system is designed to work with diferent grids (node sub-networks). Also working on iAIPathNode::updateMoveModifier() would be easy to customize the node weight settings. And is really easy to test changes on the fly, ie. node grid size, paths, etc. To finish, the system has a good work on the engine console messages, so the feedback to the developer its great.
As a disclaimer, I have to say that I have little or no experience on AI, so any comments of mine on the subject, should be taked, at least, with care.

Some gridsize fun...
Ok, Ok, I'll shutup now, here is the TDN link: http://tdn.garagegames.com/wiki/RTS/iAIpathfinding
And here is the forum thread to discuss any issue: Pathfinding on the kit
iAI is an excelent resource, and besides thank Gavin and Tom for such incredible work, I highly recommend it to anyone woking on AI and Torque. I also recommend the reading of the thread on the iAI engine. I have to thank everyone on that thread, involved on documentation and fixes for the proper use of Gavin's code. Some of the guys there, Thomas Huehn, opened my eyes about how easy it could be to use just the pathfinding part of the iAI engine. Thomas also did a fantastic mechanism to add a node using a grey scale bitmap to set the weight.
An image is better...
Now without more intruduction, lets talk about the port.
The core of the iAI pathfinding mechanism remains untouched. I also maintained the original filter/folder structure so would be easy to anyone intrested on continue the iAI integration to the RTS-SK.
The changes are on files where just little parts of the code where needed, or a lightwieght version of it would do a better job. Also some general modifications to the eninge are needed.
So, as the majority of the code on iAIAgent.cc/.h were not needed for the cause, I just lefted it out, integrating some of the fields and functions from that class to the RTSUnit.
Also I've included all the needed script functionality on the pathManager.cs file, forever defeating the historically hated comment:
// Clever pathfinding algorithms here! -- BJG
Sorry BJG, whoever you are! (Ben?) ;)
Plus some minor modifications on game.cs and player.cs
And thats all the porting work!
Doesnt look great?
I have writen an artcle on TDN with the description, some documentation, the download, and a step-by-step guide for a proper integration.
The pathfinding engine has some drawbacks, like a huge framerate drop when the node net is displayed (design/debug time anyway), also by default make no distinctions on the weight of each node (which isnt really a flaw), and the 45 degrees turning could result a little clumsy (the path smoothing maybe need some love for the RTS needs).
However, all in all the pathfinding is great, and the good design of the iAI engine, perfectly allows further improvements. The system is designed to work with diferent grids (node sub-networks). Also working on iAIPathNode::updateMoveModifier() would be easy to customize the node weight settings. And is really easy to test changes on the fly, ie. node grid size, paths, etc. To finish, the system has a good work on the engine console messages, so the feedback to the developer its great.
As a disclaimer, I have to say that I have little or no experience on AI, so any comments of mine on the subject, should be taked, at least, with care.
Some gridsize fun...
Ok, Ok, I'll shutup now, here is the TDN link: http://tdn.garagegames.com/wiki/RTS/iAIpathfinding
And here is the forum thread to discuss any issue: Pathfinding on the kit
Recent Blog Posts
| List: | 04/27/08 - Official upgrade: RTS-SK 1.5.2 02/08/08 - Pathfinding on the RTS-SK!! 01/14/08 - RTS-SK Mission Shortcut Button 11/17/07 - World Domination Mod RTS-SK 1.5 compat 10/19/07 - RTSKit Objects Exposed to script 10/06/07 - New List of RTS Console Functions/Methods 10/06/07 - RTSKit port to last TGE - 2nd Revision 09/21/07 - New clean how-to for porting RTS-SK to TGE 1.5.2 |
|---|
Submit your own resources!| James (Feb 08, 2008 at 03:10 GMT) |
| John McGlamory (Feb 08, 2008 at 06:44 GMT) Resource Rating: 5 |
| Novack (Feb 08, 2008 at 22:26 GMT) |
As always, any corrections to the TDN article are welcome (specially on my clumsy english :D )
| Tijs (Mar 08, 2008 at 15:11 GMT) |
Good work, but im not really sure this is quite fast enough, at least not in this form; when you for example tweak this a bit, so that units cant scale too steep slopes (which is probably one of the things you want to use this for) in such a way, that some areas (for example mountain tops) cant be reached, it seems to be very slow at calculating such a path does not exist. and this will affect the entire game i suppose as these will be calculated on the server. (or arent they)
you probably want to devide this into regions or do more of the calculations in the map reneration phase rather than ingame.
maybe its also an idea not to calculate a path for every unit in a selection, when it is proven not to be reachable at all.
| Novack (Mar 08, 2008 at 19:36 GMT) |
Afaik, the design also has a way to stop the process from start if the place is not reacheable, take a closer look, beacuse it sounds like its not working for you?
On the other matter, the system has the capability by design to use multiple regions, so you should have no problems there.
Its important to note. that this is not designed by me, its just a -rogue- port to the RTS-SK of an stablished resource. You are very welcome to implement and share any changes that you found usefull to rts needs!
| Tijs (Mar 08, 2008 at 20:34 GMT) |
i know the kit has the capability to stop when a point is not reachable; but before it states the point is unreachable, it tries a lot of routes (or all? im not sure). I made a simple change so that all the connected nodes get the same value in a memberfield i called mArea in the iAIPathGrid::createTerrainGrid method. which means it only has to check that variable in runtime to know wether we can skip the actual pathFinding. (im not sure you noticed; but if you would have a lot of units trying to reach an unreachable point the game freezes for a bit; and since this is serverside [i think] this could get pretty bad in multiplayer)
again, i didnt mean to get personal; great resource
| Novack (Mar 08, 2008 at 21:23 GMT) |
Really usefull info, however, as I didnt extensively tested this on the kit (didnt have time). What I was talking about on the "stop the process from start if the place is not reacheable" was just that, skip PF in case of unreachable place: I thought what you just did, was implemented by default, beacuse Gavin mentioned it on one of its .plans (in fact I'll check it out sometime soon [I hope], as maybe its there, but not working?).
Again Tjis,good job, and really useful info, any news on this dont doubt on post it :)
| Deozaan (Apr 07, 2008 at 19:08 GMT) Resource Rating: 5 |
You must be a member and be logged in to either append comments or rate this resource.


5.0 out of 5


