View Full Version : Resource Prediction
RichardMNixon Jul 17, 2008, 12:18 PM I've seen a lot of threads where people discussing the opening will say something like "oh, that specific plains tile probably has horses." Are there any rules you judge this sort of thing by? Does it only work with your starting capital or throughout the game? I tried searching for a strategy guide but didn't find any, if this has already been written about a link would be great. If not, could someone explain how these types of calls are made?
PaulusIII Jul 17, 2008, 12:25 PM I've seen that 'forested' starts, ie a city surrounded entirely by forest, will often have hidden resources in non-forested tiles. Other than that I don't know any tricks yet.
oyzar Jul 17, 2008, 12:27 PM Starting positions often have alot of resources and if there are very few resources people tend to guess about unrevealed strategic resources. I think that civs with their uu recquiring a specific resource have greater chance to start close to that resource, but not sure... Often alot of titles are covered in forests, and it is then easy to guess at the other titles for having strategic resources...
DaveMcW Jul 17, 2008, 12:40 PM If your capital isn't "good enough", the map generator covers all non-resource tiles with forests.
lilnev Jul 17, 2008, 12:41 PM In BtS, there's a bug in the code that improves most starting sites. It reads: If this starting location is not "good enough", add a forest to every non-resource tile that can support a forest (i.e. not water or desert). Then try to add resources until the location is either "good enough" or 2*sea resources + 3*land resources is at least 11. ("Good enough" is a threshold based on the best site, I think 80% as good as the best, but I might be misremembering the exact number.)
So, if you have only one or two unforested tiles that could support a forest, it's overwhelmingly likely that your start location was run through this bit of code, and therefore each of those unforested tiles will be a hidden resource. Generate a huge map and jump into Worldbuilder on turn one sometime, and look -- two thirds or more of the start sites will follow this rule.
Incidentally, I pointed this out to Bhruic, and now Solver, but it hasn't been changed. Seven Spirits, who also found it, seems to believe that it's not a bug, it's a feature -- forests are good, so more forests are better, and the point of this bit of code is to improve start sites that need it. The form it takes is that a random number test that would limit forestation to a fraction of tiles has been commented out.
oyzar Jul 17, 2008, 01:07 PM It does have the unfortunate implication that it makes a huge amount of starts in ffh totaly unplayable as it haven't been changed for that mod...
VoiceOfUnreason Jul 17, 2008, 01:32 PM I've seen a lot of threads where people discussing the opening will say something like "oh, that specific plains tile probably has horses." Are there any rules you judge this sort of thing by? Does it only work with your starting capital or throughout the game? I tried searching for a strategy guide but didn't find any, if this has already been written about a link would be great. If not, could someone explain how these types of calls are made?
I don't believe that there's a strategy guide anywhere, but there are a few hints I can offer...
First, the placement of resources depends on the resource allocator used by the particular map type you are playing. Most maps use a common allocator - these maps will share rules for where resources get placed. When you have an understanding of those rules, you can start making reasonable guesses. (Those guesses may not be any good on other map types).
Second, the XML files define several rules for where resources can appear - these define terrain, shape, and also whether or not a resource can appear next to a river (which in practice means they aren't next to the straight segment of a river - corners are OK).
Third, the generator won't drop a forest onto a hidden resource.
So the basic drill is that you look at the tiles without a feature (no trees, no other resource, no huts? -- not absolutely certain about this last bit), and start trying to figure out what goes where.
You can get some feel for this by using the "balanced" resources option. The resource allocator adds each resource in turn, scanning the tiles in a predetermined order, placing the resource on the first eligible tile. Roll a new map, figure out where everything should appear, drop into world builder to check your results.
The one tricky bit is normalized rivers, which get placed after the first pass of strategic resources. So occasionally you'll run into twisted cases where first the resource gets placed, and subsequently a river is added to the start, passing the copper in a way that isn't "legal". Which is why "desert no floodplains" is important - it tells you that the river is artificial - so the riverside restrictions don't apply.
kazapp Jul 17, 2008, 03:18 PM In BtS, there's a bug in the code that improves most starting sites. It reads: If this starting location is not "good enough", add a forest to every non-resource tile that can support a forest (i.e. not water or desert). Then try to add resources until the location is either "good enough" or 2*sea resources + 3*land resources is at least 11. ("Good enough" is a threshold based on the best site, I think 80% as good as the best, but I might be misremembering the exact number.)
So, if you have only one or two unforested tiles that could support a forest, it's overwhelmingly likely that your start location was run through this bit of code, and therefore each of those unforested tiles will be a hidden resource. Generate a huge map and jump into Worldbuilder on turn one sometime, and look -- two thirds or more of the start sites will follow this rule.
Incidentally, I pointed this out to Bhruic, and now Solver, but it hasn't been changed. Seven Spirits, who also found it, seems to believe that it's not a bug, it's a feature -- forests are good, so more forests are better, and the point of this bit of code is to improve start sites that need it. The form it takes is that a random number test that would limit forestation to a fraction of tiles has been commented out.
Where's the bug in this?
Unless you mean that it makes hidden resources kind-of spottable? (Which I agree isn't severe)
Perhaps the code could be changed to make the forest cover 80% instead of 100%? Then there would be a probability of one or two non-forested squares that did not also have a resource. (But already when I write this I understand why noone would bother with this tweak)
Polobo Jul 17, 2008, 04:39 PM Where's the bug in this?
Unless you mean that it makes hidden resources kind-of spottable? (Which I agree isn't severe)
Perhaps the code could be changed to make the forest cover 80% instead of 100%? Then there would be a probability of one or two non-forested squares that did not also have a resource. (But already when I write this I understand why noone would bother with this tweak)
Since a bug is behavior contrary to the designer's intentions it is unfair to classify it as such. However, the argument in favor of disabling this feature is that an all-forest start requires bronze working in order to perform any improvements. Having a couple of flatland and a hill or two left unforested would allow for more starts with alternate opening technology paths while still having improved tiles in the BFC. I like forests as much as the hippie next door but being able to improve 3-4 tiles while I have a small happy cap and focus on the religious path after picking up archery would be a nice option for those "forest improved" starts.
oyzar Jul 17, 2008, 04:39 PM Where's the bug in this?
Unless you mean that it makes hidden resources kind-of spottable? (Which I agree isn't severe)
Perhaps the code could be changed to make the forest cover 80% instead of 100%? Then there would be a probability of one or two non-forested squares that did not also have a resource. (But already when I write this I understand why noone would bother with this tweak)
It should put in resources before the forests... As it is it will be impossible to place the resources due to forests all over the place...
Polobo Jul 17, 2008, 04:41 PM Also, why do they not allow resources such as iron and copper to appear under forested tiles? Its not like you won't be able to chop and build a mine by the time you discover them.
tycoonist Jul 17, 2008, 04:46 PM Also, why do they not allow resources such as iron and copper to appear under forested tiles? Its not like you won't be able to chop and build a mine by the time you discover them.
why don't they allow floodplains to appear on plains? :p
r_rolo1 Jul 17, 2008, 04:47 PM The problem is a little bit worse. The native code for the start location beutification on BtS, due to the way that it places forests, makes that most of the starts never get to the desired level of ( IIRC ) 80% of the quality of the best start ( as defined in the code ), because it will not put more resources where forests already are. This makes a lot of the BtS starts clearly more subpar compared with the others on the same map than it was intended.
lilnev Jul 17, 2008, 05:16 PM Since a bug is behavior contrary to the designer's intentions it is unfair to classify it as such.
OK, I would say that the designers' intent is at best unclear: The line that has been made into a comment is an "if" clause that checks a random number, based on how many forests have already been added. The line wasn't removed, just made into a comment. The brackets surrounding the block of statements that (I argue) belong within the "if" structure remain (this creates a compound statement, which is perfectly legal in C, but it's never used outside of "if" statements and "while" loops and the like). The variable which counts added forests remains, and is dutifully incremented ... and then is never used for anything.
So it could be intentional, and just a case of very poor programming style. Or it could be inadvertent, someone was testing something and forgot to de-comment it. But then there's the interaction oyzar and r_rolo1 point out, that universal forestation prevents the later addition of resources (except seafood, which is why you sometimes get five Clams in BtS).
kazapp Jul 17, 2008, 06:07 PM why don't they allow floodplains to appear on plains? :p
Because it is called flooddeserts. Everybody calls them that, why don't you? :twitch:
(Thanks for explaining the bug - that is, how the woods stop the resources from being added in)
kazapp Jul 17, 2008, 06:11 PM Since a bug is behavior contrary to the designer's intentions it is unfair to classify it as such.
Generally, bugs mean undesired behavior, such as "not working".
Just being "contrary to the designer's intentions" or "unexpected" doesn't necessarily mean it's a bug, or at least not always a severe one.
In fact, sometimes being "contrary to the designer's intentions" isn't a bug at all. It's art! :)
RichardMNixon Jul 17, 2008, 09:35 PM Thanks for your help. You would have expected the iron here because almost everything is full of forests except for it? http://i34.photobucket.com/albums/d109/RichardMNixon/Iron.jpg
One city had Uranium nearby, would that count in the same way or does the quality measurement only pay attention to early resources?
VoiceOfUnreason Jul 18, 2008, 12:21 AM You would have expected the iron here because almost everything is full of forests except for it?
ish - to some degree you end up trying to guess whether the river is real or not. This one certainly looks faked (that is to say, added in as part of the balancing process), so a no-riverside resource is possible. If you were in the middle of the river, rather than at the head of it, iron would be less likely.
Scoottr Jul 18, 2008, 12:29 PM Why does silver only occur in the North South poles? Gold drops about anywhere, Silver is sooo reclusive!
vicawoo Jul 18, 2008, 02:13 PM Why does silver only occur in the North South poles? Gold drops about anywhere, Silver is sooo reclusive!
Poor word choice on reclusive.
|
|