Hey Tholal,
With my DuneWars AI work, I was having a time trying to get a handle on what kind of values the AI was returning when deciding techs to research. The BetterAI team, or it might have even been from vanilla, had added code to the plot help text while in debug mode holding 'ctrl+shift' showing all the possible techs a player can reach within 3 path steps and the AI_techValue() for it. Unfortunately... they failed to account for the fact that that function adds all kinds of random values (so the displayed values in the help text weren't even close to constant, e.i. constantly changing as the screen updated), it had no order, and the values returned have no absolute scale, so you could be looking at one tech with a value of 33,572 and another with 12,342. So even without the numbers all changing on you, it was nearly impossible to draw any useful information from it with a jumble of 20 or so techs all in random order with no rhyme or reason to the values.
So I added an argument to AI_techValue (called bAddRandom) and coded it to just add the average of any random ranges that would have been added (so it's constant) for use in the game text display. From there I used a vector to sort the tech values from highest to lowest, then scaled the returned values by the highest value so the highest value is always 100.0, where all the other techs display their respective % of the highest value. This gave me a sorted and readable list so I can actually get a much better idea of what kind of values AIs are getting from the function when making tech decisions.
Since techs are weighted by how many turns it'll take to reach them, the values are most accurate while the AI is about to choose one (as if they already have half of the current tech researched, it's value is shown artificially high compared to all others). You can see in the score board that the Artredies (who I'm looking at in the screen shot) are in between techs that turn, so it'll show all the possible techs on even footing in the plot help.
I thought this might be useful to you as well. It's been very handy for finding out what techs are consistently over or under valued (based on the AI's current situation) and what adjustments might need to be made. I'd be happy to merge this into your DLL if you think it will be helpful.
