I didn't really know in which thread this would belong best, so here goes:
I'm writing the code needed to allow the ai to decide what to build. Now I finally found how to do it, it all seems clear, and I think the player can benefit from it too, in terms of user interface.
Currently, ai and players say which kind of unit they want and how much production they want to put in each. This is fine, but maybe what they want is to have that proportion of armies, and when you get your legions killed but not the archers, you have to micromanage to get more legions produced than archers to keep the good proportions. Additionally, there's the fact that archers are listed before legions, so they get produced before.
Now, the player can change production orders when they like. The ai can too, but you must script it in the scenario file, which makes it not very responsive in general, unless you want to code all the ai in xml.
So what I am doing is writing an object that maps to a certain distribution of units. For the player, that would be pretty simple, he says I want 40% legion, 60% dreadnoughts, and how much globally the econ should spend on units, and voilá.
This, however, would require some econ changes, as I'd add an econ order like 'overall military spendings', whose production/kapital/food ratios vary depending on the player's input. I can always bypass this in a first coding attempt as there will be some waste (the same problem exists for walls, which share a single wall-building category).
And then there is the ai. I can also tell the ai to build units in proportion, so it will always have combined arms TFs rather than having mostly archers in an archer/legion case.
I'm writing the code needed to allow the ai to decide what to build. Now I finally found how to do it, it all seems clear, and I think the player can benefit from it too, in terms of user interface.
Currently, ai and players say which kind of unit they want and how much production they want to put in each. This is fine, but maybe what they want is to have that proportion of armies, and when you get your legions killed but not the archers, you have to micromanage to get more legions produced than archers to keep the good proportions. Additionally, there's the fact that archers are listed before legions, so they get produced before.
Now, the player can change production orders when they like. The ai can too, but you must script it in the scenario file, which makes it not very responsive in general, unless you want to code all the ai in xml.
So what I am doing is writing an object that maps to a certain distribution of units. For the player, that would be pretty simple, he says I want 40% legion, 60% dreadnoughts, and how much globally the econ should spend on units, and voilá.
This, however, would require some econ changes, as I'd add an econ order like 'overall military spendings', whose production/kapital/food ratios vary depending on the player's input. I can always bypass this in a first coding attempt as there will be some waste (the same problem exists for walls, which share a single wall-building category).
And then there is the ai. I can also tell the ai to build units in proportion, so it will always have combined arms TFs rather than having mostly archers in an archer/legion case.
Comment