View Full Version : Wiser Orcs (a FfH II mod)


xanaqui42
Dec 12, 2007, 11:59 AM
Wiser Orcs is a Fall From Heaven II mod that primarily deals in improvements to the Artificial Intelligence (AI). For the purposes of this mod (and the code), AI includes all complex decision-making done by the computer without direct human intervention. For example, automating a worker, allowing automatic determination of where your citizens will work, or giving a go to order all fall under this description. In other words, this mod should both improve the computer opponents' capabilities and reduce the advantages of micromanaging. It also should eventually reduce the need for cheating by the AI.

Wiser Orcs is not Smarter Orcs. Smarter Orcs was a merge between BetterAI and Vanilla-based FfH II with some added features. As BtS already has a large percentage of the changes from BetterAI, this is not the approach that was chosen for Wiser Orcs.

Unstable Release: Here (http://forums.civfanatics.com/downloads.php?do=file&id=7816)

Source Code: Sourceforge project link. Note that it's under the BtS Trunk.

License: This project is dual licensed. It is both licensed under the LGPL, and under the same terms as FfH II.

xanaqui42
Dec 12, 2007, 12:26 PM
Release 0.05 - based on FfH II 0.33d (Will break FfH II saved games; will not break Wiser Orcs 0.04 Saved games)

Files Changed

CvModEvents.py
CvRandomEventInterface.py
CvSpellInterface.py
CustomFunctions.py
CvGameCoreDLL.dll
GlobalDefinesAlt.xml
CIV4LEaderHeadInfos.xml

Known Defects:

Found an edge case where growth is limited (this is an imperfection in the new algorithm; it still behaves far better than the original code).

Features:

Fix City Plots
Fix City Radius
Speedup canMoveInto (minor optimization)
Speedup color acquisition (partial, through Player.cpp)
Fixes to food logic - defect from Wiser Orcs 0.04
Fixes to logic so that cities don't prevent themselves from growing.
Infinite loop removed (was previously broken out of, but may have been a time-waster).
Merge with FfH II 0.33d
Cities can not produce negative commerce.




Version 0.04 - based on FfH II 0.33c Will break saved games

Files Changed

CvModEvents.py
CvSpellInterface.py
CustomFunctions.py
CvGameCoreDLL.dll
GlobalDefinesAlt.xml
CIV4LEaderHeadInfos.xml

Known Defects:

foodConsumptionPerPopulation conflated with foodConsumption. This may cause problems for the food logic (although there are other problems in the main code).
infinite loops for immobile units (from main FfH II Mod)

Features

Merged to 0.33c
0-food (and a few 1-food) issues fixed.
Healing times should now display correctly under "fair combat"




Version 0.03 - based on FfH II 0.33c Wrong DLL - shouldn't break saved games, but most features are missing

Files Changed

CvModEvents.py
CvSpellInterface.py
CustomFunctions.py
CvGameCoreDLL.dll
GlobalDefinesAlt.xml
CIV4LEaderHeadInfos.xml

Known Defects:

If HIT_POINT_FACTOR is set to a non-default value, the displayed healing times are inaccurate. Healing occurs at the correct rate.
Hyborem no longer correctly ignores food.

Features

Merged to 0.33c




Version 0.02 - based on FfH II 0.25l breaks saved games

Files Changed

CvModEvents.py
CvSpellInterface.py
CustomFunctions.py
CvGameCoreDLL.dll
GlobalDefinesAlt.xml
CIV4LEaderHeadInfos.xml

Known Defects:

If HIT_POINT_FACTOR is set to a non-default value, the displayed healing times are inaccurate. Healing occurs at the correct rate.

Features

Increased base barbarian technology increase (modifiable via XML).
Barbarian technology increase modified by Game Speed, World Size, and Start Era.
Better AI response to Barbarian attacks (this breaks saved games)
The AI can create Great Works with military units, and will tend to disfavor doing this to highly experienced units.
Support for "Fair Combat" - HIT_POINT_FACTOR in GlobalDefinesAlt.xml acts as a multiplier to First Strikes, healing, Magic damage, damage limits, and maximum HP. The end result is that the higher the value, the more the more powerful unit will be favored in a 1 on 1 combat. However, the stronger unit is also more likely to be injured. Note that it is probable that this will break with sufficiently high values, however, it should work for values in the 1-20 range.
AI Exploration units no longer self-destruct once the map is complete.




Version 0.01 - based on FfH II 0.25l

Files Changed

CustomFunctions.py
CvGameCoreDLL.dll
GlobalDefinesAlt.xml
CIV4LEaderHeadInfos.xml

Known Defects:

None at this time.

Features

Arturus and Kandros can now trade up to 10% of their maximum gold. This is because some of the below changes make this less dangerous. Choosing not to trade Gold/Turn has not changed.
AI_BASE_MAXIMUM_KHAZAD_GOLD_PER_TURN and AI_PER_CITY_MAXIMUM_KHAZAD_GOLD_PER_TURN added to GlobalDefinesAlt.xml to allow a linear function for the Kahzad AI's gaining of gold (AI_BASE_MAXIMUM_KHAZAD_GOLD_PER_TURN + AI_PER_CITY_MAXIMUM_KHAZAD_GOLD_PER_TURN * the number of cities) is the maximum goal, until the player has vaults large enough to be overflowing with an additional city. If these are set correctly (I think the present values are pretty good), it should allow the Khazad AI to obtain overflowing vaults without too much effort.
Ignore food (Hyborem) is mostly supported. This both helps the AI and many decisions for the player; you no longer should need to override each citizen's choice of plot.
Food varying by Civic choice (Sacrifice the Weak) is mostly supported. Note that the effect here is much less significant than it is for the Ignore Food Logic.
Defect that caused a civilization to nearly always Gold rush under good population circumstances has been removed. This was preventing the Khazad from keeping any vault above Empty when it had an appropriate civic.
ExtraGoldTarget is used to track the amount of Gold the Khazad want for their vaults. It is also used in numerous spending calculations, from ones for trade deals through ones for rushing, and more. The end result is that the Khazad should actually attempt to maintain Overflowing vaults once they get them.
Civilizations will always try to get at least enough gold to survive Anarchy.

xanaqui42
Dec 12, 2007, 12:28 PM
Release 0.06

Merge with 0.33e
Expose some of the constants in AI_yieldValue to XML, and changed them slightly.
Added XML support for Strategy Framework.
Added Flavors from Smarter Orcs (by Bringa) & added ones for each religion.
Added strategy framework (does not yet have any functionality).



Work on Strategy Framework.
Work on AI_plotValue, AI_yieldValue - Improve avoid growth logic.
Work on Technology choices.
Workers shouldn't build non-mana improvements on mana nodes.
Work on adept mana node building. (This may be more general - any non-worker building)
Workers shouldn't destroy mana nodes.
AI protects its own heavily promoted units more.
AI targets enemy highly promoted units more.
Settlers are trying to settle with too few guards.
Look at CvPlot::changeVisibilityCount to determine if the visibility fix causes the same defect found in an early version of Smarter Orcs (with a similar fix).
Barbarian trait players are wasting troops preparing to attack Barbarian cities (?)
Look at chooseSpell

xanaqui42
Dec 12, 2007, 12:44 PM
New XML fields:


GlobalDefinesAlt.xml

AI_BASE_MAXIMUM_KHAZAD_GOLD_PER_TURN - the base maximum amount of gold the Khazad will attempt to obtain per turn.
AI_PER_CITY_MAXIMUM_KHAZAD_GOLD_PER_TURN - the additional maximum amount of gold per city the Khazad will attempt to obtain per turn.
BARBARIAN_FREE_TECH_PERCENT - the base research factor for the barbarians. Note that this is affected by world size, start era, game speed, and the number of civilizations which have this technology.
HIT_POINT_FACTOR - a factor for first strikes, hit points, healing, and direct damage. Note that very high values will not function (1-10 have been tested), and that 1 will give normal behavior. Changing this from 1 gives "Fair Combat" - essentially, less random combat.




Next Release:

YIELD_BASE_PRODUCTION_VALUE - the base yield value for a unit of production on a plot.
YIELD_BASE_COMMERCE_VALUE - the base yield value for a unit of commerce on a plot.
LOW_FOOD_DIVISOR_TENTHS - the divisor in tenths to the base yield value for low food (< than needed for 1 population) on a plot, assuming that growth is less than needed for 1 population. Note that 10 would give default behavior.
VERY_LOW_FOOD_DIVISOR_TENTHS - the divisor to the base yield value for low food (< than 1/2 of needed for 1 population) on a plot, assuming that growth is less than 1/2 needed for 1 population. Note that 10 would give default behavior, and that this does not trigger if LOW_FOOD_DIVISOR_TENTHS triggers.

xanaqui42
Dec 12, 2007, 01:31 PM
Note that this is a mod off of Fire, not Shadow.

I like the Khazad being more viable as an opponent, and I love the reduced micro-management when I play Hyborem. The Sacrifice the Weak changes are a bit disappointing; I may want to re-visit them to determine if further tweaking is needed, or if the optimal choices are that similar between 1 and 2 food/pop.

xienwolf
Dec 12, 2007, 02:23 PM
Request on the automation side for an early fix: Workers will never build on Mana resource or destroy any Mana Nodes.

MagisterCultuum
Dec 12, 2007, 04:36 PM
Frankly I don't see much of a point in releasing this for .25, especially less than a weak before Shadow is released. It is supposed to fix many of the AI problems anyway. I would say you shouldn't waste you efforts until you know exactly what the AI can and can't do well in .30. The last Fire version is really just a BtS Beta, not meant to be used for serious gaming/modmods.


Still, some of the changes (like ignoring food) look like they will be quite useful; if you already have them working, then why don't you see if you can get Kael to add them to Shadow? There is probably still enough time for him to do so without delaying the release.

(Even if this does delay it by a little, I won't mind; since I finished my finals today I'm going home tomorrow, and thus will be limited to dial-up for a while. I could probably ask to go to my dad's office to use his DSL to download it, but I think I'd better wait until Christmas to do that. I got BtS as a Christmas present from my sister, which she let me have early if I agreed to keep it a secret and to wrap it for her. Downloading a mod for a game that I "don't have yet" might be suspicious. )

Nikis-Knight
Dec 12, 2007, 06:10 PM
If you want suggestions for future implentation, AI protecting and targeting promoted units would help a lot, imo.

xanaqui42
Dec 12, 2007, 09:03 PM
Frankly I don't see much of a point in releasing this for .25, especially less than a weak before Shadow is released. It is supposed to fix many of the AI problems anyway. I would say you shouldn't waste you efforts until you know exactly what the AI can and can't do well in .30. The last Fire version is really just a BtS Beta, not meant to be used for serious gaming/modmods.

I'd started on this modmod prior to the announcement of the Shadow release date. I feel that since the initial version is going to be based off of late Fire anyway, a release prior to Shadow makes more sense than one after Shadow (the main mod group typically releases source code well after the release date). While this release is no where as dramatic as the earliest working version of Smarter Orcs, I feel that it's a significant improvement- and therefore worth releasing.

If Shadow fixes an AI problem, I'll be happy. At worst, I'll have to choose the better of their fix or mine for a particular issue - however, there are so many AI issues, that I doubt there will be much unintentional overlap, at least for the time being.

Still, some of the changes (like ignoring food) look like they will be quite useful; if you already have them working, then why don't you see if you can get Kael to add them to Shadow? There is probably still enough time for him to do so without delaying the release.
If his group does what it has previously, I'd guess that they'll seriously look at taking material from modmods in late Shadow, although I would have no objection to their choosing to do so at another time. For that matter, the combination of released sources and licensing under their own terms are specifically so that both the main modders and any other modmoders who are interested can use this work (or any portion thereof), even without contacting me.

3141592
Dec 12, 2007, 09:21 PM
Does it break save games?

xanaqui42
Dec 12, 2007, 10:55 PM
Does it break save games?

The present version shouldn't, no (caveat: I haven't tested this). Unless I find (and use) a good way around it, the next release is likely to.

Bringa
Dec 13, 2007, 07:48 PM
Hey xanaqui, how could I make myself useful right now?

xanaqui42
Dec 14, 2007, 04:17 AM
Hey xanaqui, how could I make myself useful right now?
I'm answering via private message. :)

it-ogo
Dec 14, 2007, 04:37 AM
And what about magic system for AI? Is it a problem of Artificial Intellect or Artificial Wisdom?

xanaqui42
Dec 15, 2007, 07:53 AM
And what about magic system for AI? Is it a problem of Artificial Intellect or Artificial Wisdom?

Really, it's mostly a problem of specification. While there are a couple large groups of spells, many spells or special abilities have their own optimal use, which means that it needs to be specified separately and coded separately. While I suspect that few individual spells are hard, there are a lot of them.

Would I like to address them? Yes. However, we're going to consider most spells individually simply because that's how we're going to have to code most of them.

xanaqui42
Dec 16, 2007, 05:15 AM
Note that this is a mod off of Fire, not Shadow.

This will break saved games

The big addition in my mind is the resilience against the Barbarians. For fans of Fair Combat, the re-addition of this code will be significant (note, however,that the default, 1, essentially turns this off). However, note that the XML interface is different from the Smarter Orcs version - it's a single multiplier.

Also, there's a change a few people may not like - the base teching of the barbarians is set to be higher. This is in response to the wider tech tree - presently, it can take an inordinately long time for barbarians to even gain LV 2 units. Note that this can be turned back to its original value via XML.

Tiarilir
Dec 20, 2007, 02:08 AM
Can't wait to try this once it's released for shadow ;)

Sandro
Feb 10, 2008, 12:24 PM
Any news on this project?

Cheers,

Sandro

xanaqui42
Feb 21, 2008, 07:48 PM
The short version is that I haven't spent enough time on it recently.

The long version is that hours after my last release, my compiler was attacked by a virus, then after that my computer was attacked by a pack of new trojan horses - the later were new/unique versions, as far as I could tell, so it took a while to root them out. Although I do hope to release during Shadow, I wouldn't expect a release in the immediate future.

Sandro
Feb 22, 2008, 07:55 AM
Darn, could really use an option for blocking the AI access to magic for more challenging games...

xanaqui42
Aug 21, 2008, 07:59 PM
Version 0.03 is out. I hadn't looked at the code in a while, so all I did was a merge with Shadow.

Vehem
Aug 22, 2008, 07:51 AM
Release 0.04 - tenative

Work on AI_plotValue, AI_yieldValue (make worked tile choices make more sense)
fix healing display. (defect from 0.02)



Look more at the Hyborem food logic.
Work on Technology choices.
Workers shouldn't build non-mana improvements on mana nodes.
Work on adept mana node building. (This may be more general - any non-worker building)
Workers shouldn't destroy mana nodes.
AI protects its own heavily promoted units more.
AI targets enemy highly promoted units more.
Choice of what tiles to work should be re-examined. It seems that the present algorithm can easily get into holes where a city won't grow. It seems that this can cripple entire AI civilizations.


The Hyborem food logic is very interesting - as of version 043 of Fall Further, we'll have two Fallow civs, one of which is available at game start. Having the AI for that handled correctly would be very useful to them.

I've had a brief look at it and I think Xienwolf also planned to poke at it at some later point, but if you've already got some progress in that area, I'd love to discuss it...

xanaqui42
Aug 22, 2008, 04:46 PM
Wiser Orcs 0.04 released. The big change is that I actually uploaded the correct dll. I also went through and fixed a number of 0-food issues.

The Hyborem food logic is very interesting - as of version 043 of Fall Further, we'll have two Fallow civs, one of which is available at game start. Having the AI for that handled correctly would be very useful to them.

I've had a brief look at it and I think Xienwolf also planned to poke at it at some later point, but if you've already got some progress in that area, I'd love to discuss it...

Yeah, as of 0.04, it pretty much works. I've even gotten the display fixed so that it no longer shows "Starving" all the time.

If you use Wiser Orcs, all you have to do for a new Fallow mechanism is to make certain that it gets through to:

void CvPlayer::setIgnoreFood(bool bNewValue)

Which a trait using the present mechanism should.

Note that a grep on Wiser Orcs.*Food should catch all the code associated with 0 food and 1 food logic.

Note also that technically since the city material uses CvCity::isIgnoreFood (which presently is just a pass-through for the above function), it should be possible to have variable amounts of food per population (varying on the city). I have no idea if this would be of use to you.

The main issue you may have with the code is that when food is being ignored, the Food Emphasize button no longer functions. That's only a few lines of code, which I can point out if you want to emphasize food for some reason when you're ignoring it.

Warning: Wiser Orcs through 0.04 has a defect in the variable food logic. It will be fixed on the next release.

xanaqui42
Aug 26, 2008, 07:22 AM
One of the things which almost immediately drove me towards working on Wiser Orcs ASAP was that in my first game in 0.25, I had a city with Dragon Bones in its radius.

That city never grew until I realized the problem, and manually over-rid the worked plot selection - note that I had Emphasize food turned on, which was plenty in Smarter Orcs to ensure growth.

I've had to do this frequently ever since the BtS merge in 0.25 - even using the buttons to focus on food can get you caught in a trap where your city won't grow until you manually override its plot selection.

When you realize that the AI can't manually override (after all, the automatic algorithm, with very tiny changes, is its algorithm), you realize pretty fast why occasionally an entire AI civilization will have its growth paralyzed without war or barbarians; they're just choosing bad plots to work.

This release attempts to fix that, and it appears to succeed (frankly, it seems to do better than I'd thought possible with this small of a change). While it may not always use an optimal growth algorithm, cities put a much higher emphasis on growth, at least up to their happy cap. Note that you can override this feature by focusing on Production, Commerce, or Avoiding Growth - all these buttons will return to the use of the older algorithm, among their other functions.

Question: In cases where a civilization can rush via population (ex: Slavery), how large should cities attempt to grow?

The other features are more minor - fixes to city radius and size (mostly a Kuriotates fix), fixes to the food logic from a defect injected in the last release, a bunch of minor speedups, and a few minor fixes. This also has a merge to d.

[to_xp]Gekko
Aug 26, 2008, 09:55 AM
so this doesn't work only for the AI, but even for the human player whenever he chooses to automate city plot selection? good stuff, that selection is seriously messed up in BTS. the worst part of it is when you tell it to stop growth to avoid unhappiness, and it just seems to ignore the avoid growth command and happily continue to grow >.<

xienwolf
Aug 26, 2008, 10:05 AM
Sweetness :) And the previous fix for Fallow Civilizations keeps them making good plot decisions as well?


I personally don't rush population, but I would assume that growing 2 Angry Citizens is about as far as a Slave Whipper would want to push things, unless they planned to rush a wonder.

[to_xp]Gekko
Aug 26, 2008, 10:16 AM
I personally don't rush population, but I would assume that growing 2 Angry Citizens is about as far as a Slave Whipper would want to push things, unless they planned to rush a wonder.

you should definitely give it a try, it's very effective :D I as well was very uninclined to sacrifice population before trying it, but now I'm addicted XD
when you got tons of food and little hammers ( which tends to happen a lot to me as I love farms and despise cottages/workshops ) , it's invaluable.

OT I know, I'm sorry :(

xanaqui42
Aug 27, 2008, 05:54 AM
Gekko;7178711']so this doesn't work only for the AI, but even for the human player whenever he chooses to automate city plot selection? good stuff, that selection is seriously messed up in BTS. the worst part of it is when you tell it to stop growth to avoid unhappiness, and it just seems to ignore the avoid growth command and happily continue to grow >.<

I should note that I've yet to directly address the proper stopping of growth (merely the starting of growth). While I seem to be getting this effect anyway, I think that's just chance.

I'll consider looking into it in detail for the next release.

Comment: One major difference between AI growth and Human Player growth is that Human player growth limits are one higher (i.e. they will create an unhappy population by default). I think that the idea is to use this as an indicator to a human that they need more happiness in that city.

Question: Barring the ability to sacrifice population for production, should human players' growth be capped at the happiness cap?

xanaqui42
Aug 27, 2008, 05:57 AM
Gekko;7178765']you should definitely give it a try, it's very effective :D I as well was very uninclined to sacrifice population before trying it, but now I'm addicted XD
when you got tons of food and little hammers ( which tends to happen a lot to me as I love farms and despise cottages/workshops ) , it's invaluable.

OT I know, I'm sorry :(
Since you are an addict, how many unhappy people would you prefer your cities to grow when you can sacrifice population?
Does it change how you view the value of food vs. production when you can sacrifice population (do you consider food more valuable, and/or production less valuable?
Do you only find it valuable when you have a high Food:Production ratio?

xanaqui42
Aug 27, 2008, 06:02 AM
Sweetness :) And the previous fix for Fallow Civilizations keeps them making good plot decisions as well?


It should. I'll have to admit that I didn't re-test Fallow this release; it's possible that I injected a defect.

[to_xp]Gekko
Aug 27, 2008, 07:28 AM
Question: Barring the ability to sacrifice population for production, should human players' growth be capped at the happiness cap?

you're talking about city automation right?

if you are, then my answer is 100% YES. no unhappyness and no unhealth should be the default situation the automation aims too. then if somebody wants to increas pop even more, he can choose to do so himself. maybe change it a little if the city has pillar of chains if it's possible?

[to_xp]Gekko
Aug 27, 2008, 07:52 AM
1)Since you are an addict, how many unhappy people would you prefer your cities to grow when you can sacrifice population?

2)Does it change how you view the value of food vs. production when you can sacrifice population (do you consider food more valuable, and/or production less valuable?

3)Do you only find it valuable when you have a high Food:Production ratio?

well, I'm not really an addict, I just meant I really like how it works, not that I use it all the time, but I'll answer anyway ok? :D

1)I still hate unhappy faces and try to avoid them as much as I can. I always rush pop ASAP if it allows me to get rid of them, so that I can keep my cities happy all the time. I will rush military units if under attack and caught flat-footed, but I usually use it to rush invaluable buildings like courthouses, AND buildings that raise happyness so that I can then rush more :D

I don't take food vs production much in consideration actually. if a city has a lot of food, I will rush pop, if it has lots of hammer it will usually not need it anyway. I'm not a good enough player or micromanager to think "ok let's run slavery as long as possible and build as many food-giving improvements as possible. no, I will usually build farms everywhere I can, mines on hills and cottages if I can not build a farm ( which happens rarely cuz I usually try to get irrigation-spreading farms ASAP ) . later in the game, I will reshuffle and usually substitute some farms with watermills and build lumbermills if I still have forests ( I tend to avoid cutting them until it is really needed or my workers have already improved every other tile available ) . substitute some mines with windmills if the city has very little food, and I simply never build a workshop.

so, simply said, it won't change how I view food and hammers, I'll just use it whenever it feels useful in a city ( rule of thumb for me is: if the population it deletes is at least 1/2 the # of turns it would have taken to finish that building, I will use it. 1/3 is better though. i.e. granary in 6 turns, would take 2 pop to finish? rush it! granary in 7 turns, 4 turns to finish? not worth rushing imho. I'm actually not sure if this is a good way of using it at all, if someone has a better plan please share :D

also, it should be noted that I like to rush with money way more than I like rushing with pops, cuz it's much easier to manage, so I'll switch to caste system or something that lets me rush with gold ASAP.

3) definitely yes. It's not useful if you can build stuff quickly already but it takes ages to grow back to max size.

xanaqui42
Aug 29, 2008, 01:23 PM
One intrinsic problem with FfH II's AI is that the AI lack any strategy that's distinguishable from the standard BtS strategies; that is, they take little or no advantage of FfH II's unique features. For example, nearly every strategy on the strategy forum is presently impossible for the AI to execute.

The question (since sometime in Smarter Orcs) was how to implement this; ideally, we want something that is:
1) effective at emulating virtually any strategy imaginable.
2) fast
3) easy to modify for non-C++ coders (ideally XML, otherwise python hooks)

So here's the idea:

Basically, I plan to create a framework. Much like Spells or Events, Strategies will have its own XML file, with entries for each strategy, each with sub-headings allowing each strategy feature to be turned off or on with some independence (for example, there might be a list of flavors with weights, which would indicate the flavor changes under that strategy (flavors control Tech choices)).

The transition points between various strategies would hook into (new) python code.

Furthermore, LeaderHeadInfo would gain a new hook into new Python code which would save the present strategy.

The idea would be to eventually allow a modmodmodder or scenario builder who works off of this code the ability to create their own strategies (within the parameters that are coded) and to transition between strategies with just XML and python knowledge.

Obviously, to start with, this feature would have a fraction of its eventual expressive power (I'd likely start with 1-2 strategies, possibly ones that are already coded in the C++ code). However, I think I now have a good enough grasp of what I want to do that I can start on looking into it.

Let me know if you have any comments/suggestions.

xienwolf
Aug 29, 2008, 01:37 PM
First thing I would allow each Strategy Type to contain is a flavor Array. The current Strategy Type Flavor would add to the Leader Flavors. This will be very versatile as you can create new flavortypes to directly control the AI in various methods (ie - Flavor_Runes would be placed on each Tech required to found RoK, with the numbers set to force "Smart Order" of Mysticism first)

Next I'd add Arrays of Unit/Building Infos with AI weight values which will add to the basic AI Weight Values.



Do you plan to have only 1 Strat active per player at a time?

xanaqui42
Aug 29, 2008, 01:53 PM
First thing I would allow each Strategy Type to contain is a flavor Array. The current Strategy Type Flavor would add to the Leader Flavors. This will be very versatile as you can create new flavortypes to directly control the AI in various methods (ie - Flavor_Runes would be placed on each Tech required to found RoK, with the numbers set to force "Smart Order" of Mysticism first)

Next I'd add Arrays of Unit/Building Infos with AI weight values which will add to the basic AI Weight Values.



Do you plan to have only 1 Strat active per player at a time?

Yes; I think both would be useful.

I was just thinking about that. I think that ideally, I'd have multiple strategy classes, so, for example, one strategy class could be worried about the value of melee units with Bronze vs. melee units without Bronze, whereas another strategy class could vary on the player, whereas another could vary on if the player's at war.

So the idea is that each AI could have 1 strategy instance from each strategy class. If the definition of both is done in XML, that would make this potentially extremely generic.

Of course, this is another layer of complexity on something I've never done before. So I'll have to think about it.

I'll have to think about it further.

xienwolf
Aug 29, 2008, 02:22 PM
The Strategy Classs having a file to themselves would work well. Some fields for there:

bAtWar - Strategy Category valid if at war
bPeaceTime - Strategy Category valid if not at war
iDogpiledBy - Strategy Category valid if at war against multiple factions
iDogpiling - Strategy Category valid if at war with support
i__UnderFirst, i__OverSecond - One pair per power graph, making the Category valid if far enough behind/ahead
iDebtRatio - Category made valid when bleeding :gold: to maintenance


Though on review maybe these are more fitting on the Strat Types. Oops

Bringa
Sep 03, 2008, 08:47 AM
Glad to see you're back, xanaqui :) The strategy classes idea sounds really good. I played a game with an unmodded ffh033e last night and I steamrolled a number of civs with iron-upgraded champions vs non-upgraded warriors. Tech prioritization still seems really bad: they did build lots of stuff like adepts and priests but didn't use them, so since the last time I played with the FFH ai, not much seems to have changed.

Will you have a version of Wiser Orcs for f soon or should I use the one that's up now? (0.05 I think)