I mentioned in another thread an external file containing game information that the AI would use to calculate the benefit of certain things, could it not figure it out itself. For example, it would record the exact effect of certain buildings.
This might be something id be happy to work on making. It could simply be a list of 'effects' or 'buildings' or 'items' in the game, each with an ID # to represent it, a short description of what it is so that anyone editing the list can find what they want, and then maybe two other fields, one for the factor (ie. *1.5 or +50%) and one for what its actually effecting (ie. science or tax/lux or production). The AI/code could then look up this information every time it wanted to calculate the benefit of certain things. Some things might be harder to classify.. but i do enjoy a good romp in the land of logic.
The other advantage would be that any user could freely edit the list, if it wanted the AI to value certain things higher, eg. raise the effect of librarys, effectively lying to the AI to force it to invest more in science.. although this could conflict with overall goals or "personalities" of the AI.
-->
Another and perhaps better way of doing it would be to add another field for Priority. This would NOT control the ai's personality per se, rather everything in the file would start on equal priority (0), and the personality would have its own preset priorities for things, eg. a militaristic AI would rate the priority of a barracks higher, say maybe 5 points vs everything else which is still 0, but then a user could change the "base" priority of the barracks, which started on 0, to say 5, bringing the overall priority up to 10, making the AI even MORE militaristic than it was to begin with. So effectively, even though the player might not know whether the AI is going to be militaristic or peaceful, they could raise base priorities of things if they definately always wanted the AI to use these things to some extent. However the full extent would be unknown to the user. This could make for much for dynamic and interesting games, because you never really know what the AI is going to do, but you could always have some kind of control over the "kind" of game you were playing, so if you wanted a definite military challenge or preferred a more laid back empire building game, you could set that up.
As for calculating effects and then taking priorities into account, it could be something as simple as having the priority as a 'modifier', so.. say an AI calculates that building a library would be a benefit of 4 science, where as building a marketplace would have a benefit of 6 tax and 6 luxury, 12 all up. It would probably rate the marketplace as a better benefit. But then if you take into account that the library has a priority of 5 attatched to it, you would then multiply that benefit of 4 science by the priority 5, and end up with a benefit of 20, which is more than the 12 of the marketplace, so the AI builds the library instead.
As far as benefits of things like barracks are concerned, this would have to be mainly preset, and slightly modified by things that the AI could figure out for itself, like current army size and number/frequency of enemy army units.
While were on the subject of external config files, Personalities of the AI is another thing that could be controlled in a similar way. There could be a bunch of preset personalities, and the user could easily specificy which one they wanted the AI to use, or even combinations of several personalities, or simply 'random' so that they didnt know what the AI was going to do. Also, the preset personalities could even be Another thing that could be setup in an external config file, allowing the user to actually create their own AI personalities, as opposed to just changing the base priorities of things to gear all the preset personalities (whichever one was being used at the time) in certain directions. Now that IS an interesting idea...
If anyone can think of any flaws with any of this, or if ive forgotten anything, feel free to point it out.
Posted 3-Nov-05 03:29 by Dragonfly <d_r_a_g_o_n_
hotmail.com>
