@jdog5000: Thanks for that information!
The deterministic nature of the formula certainly accords with my earlier point re: being repeatedly dis-satisfied with the choice of hex gained from a border pop. Indeed, if anything, your findings mean that I’m now really struggling to understand how the existing border pop logic can be defended by many in this thread. Of course, I’m sure that other gamers will be thinking the same thing re: my (and joyous gard’s) claims too. Perhaps people might care to run through a few more examples in their own mind to understand precisely which hex a city will expand onto, to help the debate.
All that said, I’d suggest that two additional features need to be highlighted in addition to the three conclusions you drew:
(i) The cost of expanding into an additional ring (mentioned as 100) – this looks to be the reason why borders aren’t popping to access non-resource tiles in an inner (eg. second) ring of the BFH, so as to prioritise securing access to resources in an outer (eg. third) ring. By the looks of it, no consideration is given to the value of the tile that can subsequently be gained in the next ring, assuming borders pop onto a particular tile in the current ring. As it stands, it looks as if these non-resource tiles need to be purchased to encourage the code to then consider popping borders into the next ring to secure an early resource.
(ii) Absolutely no consideration in the calculation appears to be given to whether or not the empire already has a particular resource available to it.
IMHO, both of these issues need addressing, although I can imagine that many will suggest they are happy with the purchase / no purchase decision raised by (i). FWIW, I believe (ii) to be a significant oversight and, subject to due consideration of the role played by city states (which can provide resources), ripe for adjustment by Firaxis and / or the modding community.
Thanks once again for your willingness to examine the code in pursuit of the facts.
@TMIT: I read the first iteration of your last post in which you mentioned that this wasn’t the biggest issue in the game, with which I completely agree. If anything, I’d describe it being one of those small issues that has pretty far reaching gameplay implications. IMHO, the most obvious of these is that the current border pop code clearly discourages gamers from optimally settling large cities containing resources in the third ring. Instead, as many have mentioned, it can become necessary to (sub-optimally IMHO) settle more cities closer together (or spend precious early gold) to access resources earlier. In short, the inability of the border pop logic to prioritise securing resources in all three rings of a city’s BFH represents a clear bias in favour of pursuing a (very much reduced admittedly) form of ICS.
As you rightly mention, correcting this requires tweaking the existing code - to prioritise securing resources in all three rings of the BFH, so that the gamer is working their best tiles earlier. As it stands, the delicious irony of the current code is that, on the one hand, this strategy game is meant to reward you for settling well placed city sites...but its very own code punishes you for doing this by delaying access to resources located in the outer rings of a city’s BFH.

What’s worse, remedying this by settling more cities (as some have suggested) works against some of the core mechanics newly introduced in Civ 5, by (i) increasing the cost of, and therefore limiting access to, social policies and (ii) limiting the number of hexes that closely packed cities can work (which has interesting implications for production given that Civ 5 also saw mines lose a hammer). If you continue to have any contact with the guys at Firaxis (since I recall you mentioning that you were a beta tester for Civ 5), perhaps you might care to impress upon them the need to avoid making game design choices (like the current state of border pop logic) that work against showcasing newly introduced features of their game.
@Lyoncet, TMIT and joyous gard: If anyone’s to blame for the confusion that’s arisen re: the role of randomness in this thread, it’s probably me – for which I apologize. You see, I used “randomness” in an attempt to explain the variation in border pop experiences reported by TPQ and I in this sentence here:
Your experience meanwhile TPQ also illustrates precisely how much false difficulty the randomness of border popping introduces into gameplay...because it completely contradicts my Civ 5 experience.
because, having not seen the border pop code at that time, I could only explain the different experiences that TPQ and I reported, by referring to an event I’ve seen over and over when playing Civ 5: the simultaneous highlighting of hexes to be gained on the next border pop in the city management screen. The only way I could rationalise our very different experiences was to assume that, in such cases, Civ 5 had chosen to expand borders in one direction in my games and another in TPQ’s.
Now following jdog5000’s excellent post, it appears that this may not have been an entirely groundless assumption on my part. After all, in the event of a tie-break, it seems that Civ 5 does indeed use an RNG roll to determine which tile to expand onto. However, my post could well be construed as having overstated the importance of randomness in border popping, leading to some subsequent confusion - for which I apologise to all. FWIW, I strongly suspected that there was a fundamental / deterministic fault in the code, because, as I mentioned in earlier posts, the game seemed in my experience to repeatedly ignore the value of resources it could secure in the outer ring of a BFH, if only it expanded borders onto a particular tile in the inner ring.
This behaviour is of course completely borne out by jdog5000's excellent post, which all too clearly illustrates that the current border pop logic isn’t prepared to prioritise securing resources in all three rings of the BFH. Instead, the inclusion of the ring cost = 100 term actively discourages it, with the result that the game will quite happily continue to expand borders onto largely useless inner ring tiles – instead of popping borders in the inner ring, only after giving due consideration to what resources could be accessed in the outer rings of the BFH from a more judicious inner ring border pop. As it stands, the gamer is quite clearly being forced to guide the border pop logic to grab outer ring resources in these instances, to compensate for a flaw in the border pop code.