AI changes, and problems now: 2022.11
Posted: Thu Nov 03, 2022 8:35 am
I opened this topic as i have not found a "AI is dumb" topic here, please help me if there are any and i will merge it.
No i changed these, and i will post here my further findings as i am testing the changes:
1. Shallow water problem: we introduced the "shallow water" some time ago, and ALL "best against me" logic checked if the target can walk on water or not, and if so only the ships were checked to be built (as every unit was able to walk on shallow water)... so LITERALLY only ship production worked earlier - so ALL land units were working bad...
now i did a quick fix: now i first check the possible trainable land units and if no units to train than then the water units too, regardless of the target unit walkability
but i am afraid if there are land units set against ships than ONLY land units will be produced agaisnt ships in TC-s (eg. archers agaisnt ships not anti-ship ships)
(as probably in a TC-s there are land units are trainable too that are also in the bestagainstme list)
and the land i checked first as in code i dont know which unit is ship or not anymore
(since we have a land tile "shallow water" i can not check their walkability anymore.)
2. "Healthy army ratio": (this logic is limiting the unit types to build egarless of task needs, it will not build 150 workers as it is set only about max. 10% can be workers) in this logic was hardcoded that >20 power units are considered "siege" - so no attackers were created in AOF as in (the hardcoded) "healthy army ratio" said only a few siege units is permitted - so since AOF got upscaled (meaning many units have more then 20 power) this started not working.
3. Enemy units walking ranges: the TC occupier units were wrongly calculated - instead of their speed their ID was used that is in AOF a big value, so AI always made TC protecting units instead of anything else because it though all enemy units can walk about 200 tiles a turn.
4. Neutrals should have less importance for productions: i set on "spell task" productions too that neutral buildings not that important to kill than any other (same for "attacking task" productions)
5. "Defend TC" tasks have less importance for productions: I set that while for units the top prior is the "Defend TC" task (when an enemy is close to a TC of the AI) for factories it will not be the top importance, now goes behind the "attack enemy" tasks -> this way not only cheap tc defending units will be created but (as on normal attack tasks) good "anti" units agaisnt the enemy army.
6. productions "consume" tasks: i dont know why but prodcutions were not consuming the tasks, as a result on a case if a task to eg. "heal" a unit that was in most importance, than in ALL factories healers were created, as the first factory did not get a sign on the task that is was "taken" so next factory also used that task.
and maybe several smaller other changes.
also ALL of these changes will be in ALL ALTERNATIVES!
(bad news for me i will need to make the same changes in unity version too - as all AI is already ported to unity.)
No i changed these, and i will post here my further findings as i am testing the changes:
1. Shallow water problem: we introduced the "shallow water" some time ago, and ALL "best against me" logic checked if the target can walk on water or not, and if so only the ships were checked to be built (as every unit was able to walk on shallow water)... so LITERALLY only ship production worked earlier - so ALL land units were working bad...
now i did a quick fix: now i first check the possible trainable land units and if no units to train than then the water units too, regardless of the target unit walkability
but i am afraid if there are land units set against ships than ONLY land units will be produced agaisnt ships in TC-s (eg. archers agaisnt ships not anti-ship ships)
(as probably in a TC-s there are land units are trainable too that are also in the bestagainstme list)
and the land i checked first as in code i dont know which unit is ship or not anymore
(since we have a land tile "shallow water" i can not check their walkability anymore.)
2. "Healthy army ratio": (this logic is limiting the unit types to build egarless of task needs, it will not build 150 workers as it is set only about max. 10% can be workers) in this logic was hardcoded that >20 power units are considered "siege" - so no attackers were created in AOF as in (the hardcoded) "healthy army ratio" said only a few siege units is permitted - so since AOF got upscaled (meaning many units have more then 20 power) this started not working.
3. Enemy units walking ranges: the TC occupier units were wrongly calculated - instead of their speed their ID was used that is in AOF a big value, so AI always made TC protecting units instead of anything else because it though all enemy units can walk about 200 tiles a turn.
4. Neutrals should have less importance for productions: i set on "spell task" productions too that neutral buildings not that important to kill than any other (same for "attacking task" productions)
5. "Defend TC" tasks have less importance for productions: I set that while for units the top prior is the "Defend TC" task (when an enemy is close to a TC of the AI) for factories it will not be the top importance, now goes behind the "attack enemy" tasks -> this way not only cheap tc defending units will be created but (as on normal attack tasks) good "anti" units agaisnt the enemy army.
6. productions "consume" tasks: i dont know why but prodcutions were not consuming the tasks, as a result on a case if a task to eg. "heal" a unit that was in most importance, than in ALL factories healers were created, as the first factory did not get a sign on the task that is was "taken" so next factory also used that task.
and maybe several smaller other changes.
also ALL of these changes will be in ALL ALTERNATIVES!
(bad news for me i will need to make the same changes in unity version too - as all AI is already ported to unity.)