does anybody understand AI_foundValue?

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
The current worst problem in Dune Wars is poor city placement by the AI. The map and values are so different from vanilla that the existing AI_foundValue function (which computes a value for each plot for founding a new city) gives very poor results. A human can easily expand faster and have larger populations than the AI today.

I have written a new weighting function which seems to give good results for initial city site selection in a mapscript. It is highly customized and hardcoded for the mod. See this post for details. (The thread may be interesting to others considering modifications to AI_foundValue.) I hope to completely replace the existing AI_foundValue with this function, but I have failed several times to understand the existing function. In particular, I am confused about how it handles two good sites which are right next to each other. It seems that there should be some way to make sure to pick the best local site, and then discard the nearby losers. But, I cannot quite locate / understand how this is handled in AI_foundValue today. Can anybody give me a pointer?
 
You probably know it already, but you can see the foundvalue in Debug modus, I think it is control and then mouseover a plot.

One thing that might be a problem for you is that the AI will give all non coastal plots a value of zero if it doesn't already have a city on the area.
 
Thanks. The actual sdk code for AI_foundValue is over 1,000 lines long and contains virtually no documentation. I was looking for pointers on how the code itself operates.
 
Back
Top Bottom