Delnar_Ersike
Prince
Hey Delnar, I just wanted to check for sure, are you okay with people cherrypicking some of your changes? I'm working on integrating my own Hierarchical Task Network/A* planner implementation into the Civ 5 DLL and I'm trying to reuse code wherever I can, but I'd obviously like to reuse the better version of that code. It's likely this thing will never see the light of day as it's a huge undertaking and I'm largely doing it as a proof of concept, but you never know.
Sure, you can use my code, so long as you attribute me if you ever release your implementation.
Know though that the Experimental branch, and therefore version v10 and up, has A* classes structured differently than the current Master branch and the unmodified A* classes.
In the original code and all AuI code up to and including v9, A* classes worked with function pointers: the A* class had a bunch of function pointers for path validation, path cost calculation, path addition, etc. These function pointers were assigned to classless functions when the A* class' Initialize() function was called and were rarely (in some cases never) reassigned.
In all AuI code starting from v10, A* classes work with the FastDelegates implementation that Firaxis originally used as delegates for random number generators. The functions that previously used function pointers now use FastDelegates, and the original, classless functions that were originally loaded into the function pointers are now all members of the CvAStar class. Besides reducing namespace pollution and possible performance improvements, one of the biggest benefits of this restructure is that I can properly access functions and members of CvAStar from the path validation, path cost calculation, path addition, etc. functions without having to constantly refer to a pointer of the CvAStar instance calling the function.