Flintlock
Emperor
- Joined
- Sep 25, 2004
- Messages
- 1,222
That's right. There's an element of randomness in what the AI chooses to build and it works by adding a random number of points to the AI's valuations of its options. IIRC, the random number is chosen between -5 and +5. Perfume is added at the very end of the valuation logic so it's not affected by the randomness or any other factors in the AI logic.During testing I observed that when you investigate an AI city and repeatedly press P and close the window, you will get different numbers every time. Is this the result of a RNG element being recalculated every time? A "useless" building in AI eyes that gets its entire rating via perfume (a resource producing building in this case) does not have such variance and sticks to the perfume-set score.
This is surprisingly tricky because each city's total maintenance cost is cached inside the city object, instead of being recalculated every time it's needed like most things. So when an improvement is built, its maintenance cost is added to the total, and when it's lost, the cost is removed. Nothing special is done when it's obsoleted of course. The game must recalculate the cost from scratch sometimes because it's affected by wonders granting free improvements being gained, lost, or obsoleted. I found a method that does that, although I don't know exactly when it's run. Oddly, that method does not charge maintenance for obsolete buildings, so I don't know what's going on there, maybe a bug. Anyway, this sort of thing is doable but would have to be done carefully.I have one thing to chime in on the earlier obsoleting of improvements discussion: What if an obsolete building would simply cease incurring maintenance costs?
This is surely possible, again the hardest part would be reading in the exclusion lists from the text file and organizing them.Would it be possible to have a "simple" exclusion list for buildings that prevent others from being constructed when they already exist?
I haven't looked at the AI logic regarding rushing, but I don't expect it would be difficult to influence its decisions.Do you think it is possible to make the AI's behaviour a little more reasonable in terms of rushing and gold-management?
No worriesFlintlock, I am very sorry for wasting your time with such a stupid mistake I have done.I couldn´t find the CCM testfile among my many dozens of config files, where I set the two worded resources in quotation marks (and some more such two worded resources in it), but after having done a new test file with a special focus, that even all two worded resources are set in quotation marks, all was working well (as you posted).
May be it could a good idea to add to the examples in the c3x_config file an example with a two worded building producing a two worded resource, like:
"Hydro Plant": local no-tech-req "Electric Power".

Like Alekseyev_ suggested, it might help to think of quotation marks as standard and only leave them off in special circumstances. Fun fact, that was actually what I had in mind when I originally programmed the mod's INI reader. Originally all strings were going to require quotation marks but then I decided to add the option to read single words as strings without quotes. That's why you don't need quotes around things like the names of the config options, but you can optionally include them. For example, instead of retreat_rules = standard you can write "retreat_rules" = "standard" and it will work the same.