AnC-Flavors - for a better AI

New Flavor's for better AI gameplay (GnK/BNW/All DLC/CP/CBP/CSD/E&D) 10

CBP and its recommended mods, Cultural Diversity.
Throughout the game; a very big majority of the civs had Might and Aesthetics fully completed or near complete.
22 civs. Could this be a factor?

I can confirm it's due to AnC. Disabled it and tried again; the choices were much more diverse.

I'm experiencing the unanimous Might and Aesthetics as well.

2 tables for Aesthetics are calculated a little bit to high (will be adjusted in the next version) but is still the first and strongest policy for culture.

might (former honor) looks good. might is strong in offence/defence... i find this behaver ok
it's also 1 of my personal favourites...


how is the performance of the AI in choosing buildings and techs?
 
The entrys for Policies.OneShot and Policies.IncludesOneShotFreeUnits are just 0/1... where can i find how much the "OneShot" is?
 
The entrys for Policies.OneShot and Policies.IncludesOneShotFreeUnits are just 0/1... where can i find how much the "OneShot" is?

OneShot just means that if a Policy is to give out free units/policies/techs/whatever, it will be given out only once during a course of a game (for that policy entry). The column by itself will not do anything if nothing is given out from that social policy.

In practical terms, this is applicable mostly to ideologies as they count as 'policies' - if you are forced to de-select your current selection, but choose to re-select your former tenets, then any entries that have given you free units, but have the OneShot attribute ticked off will not give you units a second time.
 
Hi meRlinX_AT

I've been trying your mod for the first time - it looks fantastic! Problem is that I run a lot of mods (among other CBP+CP+CSD+CivIV DF) including three private mods.

The tree latter however cause problems and I was hoping you could help. I can see a lot of errors in Database.log and the mods cease to work. Without your mod they work fine. I included a reference to the mods in your modinfo file.

A preview from Database. log is seen below. I've also attached log-file, debug database and the files from the private mods that are mentioned in database.log.

Spoiler :
[2258.785] column File is not unique
[2258.785] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2258.785] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_GAULS_MURUS_GALLICUS, FLAVOR_ESPIONAGE, 10, ).
[2258.785] In XMLSerializer while updating table Building_Flavors from file Xml/Buildings/CivPack_Buildings.xml.
[2258.785] column File is not unique
[2258.941] column File is not unique
[2258.941] column File is not unique
[2258.972] column File is not unique
[2258.972] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2258.972] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_GOLDSMITH, FLAVOR_GOLD, 80, ).
[2258.972] In XMLSerializer while updating table Building_Flavors from file Additions/Goldsmith/Goldsmith.xml.
[2258.972] column File is not unique
[2258.972] column File is not unique
[2258.972] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2258.972] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_MARKETPLACE_BAKERY, FLAVOR_GROWTH, 15, ).
[2258.972] In XMLSerializer while updating table Building_Flavors from file Additions/Marketplace/Marketplace.xml.
[2258.972] column File is not unique
[2259.019] column File is not unique
[2259.019] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.019] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_ROMAN_BIBLIOTHECA, FLAVOR_SCIENCE, 45, ).
[2259.019] In XMLSerializer while updating table Building_Flavors from file Additions/Roman_Bibliotheca/Roman_Bibliotheca.xml.
[2259.019] column File is not unique
[2259.034] column File is not unique
[2259.034] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.034] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_ADD_PUBLIC_LIBRARY, FLAVOR_SCIENCE, 15, ).
[2259.034] In XMLSerializer while updating table Building_Flavors from file Additions/Science/Science.xml.
[2259.034] column File is not unique
[2259.081] column File is not unique
[2259.081] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.081] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_TEXTILEMILL, FLAVOR_PRODUCTION, 10, ).
[2259.081] In XMLSerializer while updating table Building_Flavors from file Additions/Textile_Mill/TextileMill.xml.
[2259.081] column File is not unique
[2259.112] column File is not unique
[2259.112] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.112] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_AMPHITHEATER, FLAVOR_CULTURE, 25, ).
[2259.112] In XMLSerializer while updating table Building_Flavors from file Tweaks/Buildings.xml.
[2259.112] column File is not unique
[2259.175] column File is not unique
[2259.175] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.175] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_CHURCH_OF_ENLIGHTMENT, FLAVOR_HAPPINESS, 4, ).
[2259.175] In XMLSerializer while updating table Building_Flavors from file Tweaks/Religion.xml.
[2259.175] column File is not unique
[2259.222] near "xxx": syntax error
[2259.237] column File is not unique
[2259.237] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.237] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_BABEL, FLAVOR_GROWTH, 30, ).
[2259.237] In XMLSerializer while updating table Building_Flavors from file Xml/WonderPack_Buildings.xml.
[2259.237] column File is not unique
[2263.028]


Thanks in advance :)

\Skodkim
 

Attachments

Hi meRlinX_AT

I've been trying your mod for the first time - it looks fantastic! Problem is that I run a lot of mods (among other CBP+CP+CSD+CivIV DF) including three private mods.

The tree latter however cause problems and I was hoping you could help. I can see a lot of errors in Database.log and the mods cease to work. Without your mod they work fine. I included a reference to the mods in your modinfo file.

A preview from Database. log is seen below. I've also attached log-file, debug database and the files from the private mods that are mentioned in database.log.

Spoiler :
[2258.785] column File is not unique
[2258.785] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2258.785] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_GAULS_MURUS_GALLICUS, FLAVOR_ESPIONAGE, 10, ).
[2258.785] In XMLSerializer while updating table Building_Flavors from file Xml/Buildings/CivPack_Buildings.xml.
[2258.785] column File is not unique
[2258.941] column File is not unique
[2258.941] column File is not unique
[2258.972] column File is not unique
[2258.972] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2258.972] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_GOLDSMITH, FLAVOR_GOLD, 80, ).
[2258.972] In XMLSerializer while updating table Building_Flavors from file Additions/Goldsmith/Goldsmith.xml.
[2258.972] column File is not unique
[2258.972] column File is not unique
[2258.972] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2258.972] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_MARKETPLACE_BAKERY, FLAVOR_GROWTH, 15, ).
[2258.972] In XMLSerializer while updating table Building_Flavors from file Additions/Marketplace/Marketplace.xml.
[2258.972] column File is not unique
[2259.019] column File is not unique
[2259.019] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.019] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_ROMAN_BIBLIOTHECA, FLAVOR_SCIENCE, 45, ).
[2259.019] In XMLSerializer while updating table Building_Flavors from file Additions/Roman_Bibliotheca/Roman_Bibliotheca.xml.
[2259.019] column File is not unique
[2259.034] column File is not unique
[2259.034] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.034] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_ADD_PUBLIC_LIBRARY, FLAVOR_SCIENCE, 15, ).
[2259.034] In XMLSerializer while updating table Building_Flavors from file Additions/Science/Science.xml.
[2259.034] column File is not unique
[2259.081] column File is not unique
[2259.081] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.081] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_TEXTILEMILL, FLAVOR_PRODUCTION, 10, ).
[2259.081] In XMLSerializer while updating table Building_Flavors from file Additions/Textile_Mill/TextileMill.xml.
[2259.081] column File is not unique
[2259.112] column File is not unique
[2259.112] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.112] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_AMPHITHEATER, FLAVOR_CULTURE, 25, ).
[2259.112] In XMLSerializer while updating table Building_Flavors from file Tweaks/Buildings.xml.
[2259.112] column File is not unique
[2259.175] column File is not unique
[2259.175] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.175] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_CHURCH_OF_ENLIGHTMENT, FLAVOR_HAPPINESS, 4, ).
[2259.175] In XMLSerializer while updating table Building_Flavors from file Tweaks/Religion.xml.
[2259.175] column File is not unique
[2259.222] near "xxx": syntax error
[2259.237] column File is not unique
[2259.237] While executing - 'insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') values (?, ?, ?);'
[2259.237] In XMLSerializer while inserting row into table insert into Building_Flavors('BuildingType', 'FlavorType', 'Flavor') with values (BUILDING_BABEL, FLAVOR_GROWTH, 30, ).
[2259.237] In XMLSerializer while updating table Building_Flavors from file Xml/WonderPack_Buildings.xml.
[2259.237] column File is not unique
[2263.028]


Thanks in advance :)

\Skodkim


hi
thanks for the detailed informations.

after a first look:
- your mods will not be loaded before my mod --> did you cleared the cache? / did you load the saved game directly?
- there is an error, which i cant check: [2259.222] near "xxx": syntax error --> xxx is not in the provided files
- my triggers which should handle inserts of buildingflavor's after my mod is loaded, did not work as expected --> will check

Spoiler :
V9
-- Trigger! Just in case a Mod inserts/updates/deletes Flavor's after AnC
CREATE TABLE IF NOT EXISTS 'Building_Flavors_OLD' ('BuildingType' TEXT, 'FlavorType' TEXT, 'Flavor' DECIMAL);
DELETE FROM Building_Flavors_OLD;

-- Insert new Flavor's, if not exists
CREATE TRIGGER IF NOT EXISTS 'AnC_Building_Flavors_INSERT' INSTEAD OF INSERT ON 'Building_Flavors'
BEGIN
INSERT INTO 'Building_Flavors_OLD' (BuildingType, FlavorType, Flavor)
SELECT new.BuildingType, new.FlavorType, new.Flavor;

INSERT INTO 'AnC_Flavor2BuildingType' (FT, BT, Flavor, FromTable)
SELECT FlavorType AS FT, BuildingType as BT, Flavor, 'INSERT_afterAnC' AS FromTable
FROM Building_Flavors_OLD
WHERE Building_Flavors_OLD.BuildingType NOT IN (SELECT BT FROM AnC_Flavor2BuildingType);

DELETE FROM Building_Flavors_OLD;

INSERT INTO 'AnC_DebugCheck' (File, Executed, Mod)
VALUES ('Building_Flavors_INSERT', 1, 'afterAnC');
END;

-- drop update of existing Flavor's
CREATE TRIGGER IF NOT EXISTS 'AnC_Building_Flavors_UPDATE' INSTEAD OF UPDATE ON 'Building_Flavors'
BEGIN
UPDATE 'Building_Flavors_OLD'
SET BuildingType = new.BuildingType, FlavorType = new.FlavorType, Flavor = new.Flavor
WHERE BuildingType = old.BuildingType;

DELETE FROM Building_Flavors_OLD;

INSERT INTO 'AnC_DebugCheck' (File, Executed, Mod)
VALUES ('Building_Flavors_UPDATE', 1, 'afterAnC');
END;

-- drop delete of existing Flavor's
CREATE TRIGGER IF NOT EXISTS 'AnC_Building_Flavors_DELETE' INSTEAD OF DELETE ON 'Building_Flavors'
BEGIN
DELETE FROM 'Building_Flavors_OLD'
WHERE BuildingType = old.BuildingType;

INSERT INTO 'AnC_DebugCheck' (File, Executed, Mod)
VALUES ('Building_Flavors_DELETE', 1, 'afterAnC');
END;


please replace the AnC_QueryViews1C_STOCK with the attached. not sure if it works now.
i will look further in it.


sry
 

Attachments

Thanks for the help. I'll give the file a try as soon as I have time.

A bit puzzled why the references didn't work though. I've used references with success before and as far as I can tell they are correct in the file I uploaded.

Edit: Just tried - Have yet to find out if everything is okbut there was only one error in database.log:

[733.547] no such column: Buildings.DPToVotes

Apparently Buildings.DPToVotes is from CBP.

\Skodkim
 
Great work, Merlin. We'll test this out a bit and fold it in a few versions down the road.
G

to make it fit for the new v88 - i need info to changed/new tables.
is there an overview available... or at least a description to the tables?

thanks
 
to make it fit for the new v88 - i need info to changed/new tables.
is there an overview available... or at least a description to the tables?

thanks

Every table is described in some amount of detail in the CP - look at the xml/sql in the CoreFiles/CoreTables folder.
 
Every table is described in some amount of detail in the CP - look at the xml/sql in the CoreFiles/CoreTables folder.

just the problem that your CoreTableEntries.sql has ~1080 Lines. i can find a few easily but i can not compare all
... did you have an list, which tables/columns are new compared to the last version?

i have to figure out, which col are not longer used and which new col are added.
i just know, that some buildings/policies use only a new col/table - because the have no calculated flavors. (see picture)
but also (more) important are buildings/pol/... which use now a old and new col/tab (they have flavors but just less) - i can not figure this easy out and in adequate time.

maybe you can help?
- a table with the full clean db schema would be nice... just the sql-vodoo select

like ...
tab col
Achievements Type
Achievements Description
Achievements Broken
Achievements ...
AICityStrategies Type
AICityStrategies CheckTriggerTurnCount
AICityStrategies MinimumNumTurnsExecuted
AICityStrategies ...


i log all my selects like this

SELECT Technologies.Type AS TT, AnC_Flavor2Yields.FT AS FT, Technologies.InternationalTradeRoutesChange *AnC_Flavor2Yields.Flavor *0.25 AS Flavor,
'Technologies.InternationalTradeRoutesChange' AS FromTable, 'BNW' AS Mod
FROM Technologies, AnC_Flavor2Yields
WHERE Technologies.InternationalTradeRoutesChange <> 0 AND AnC_Flavor2Yields.YT = 'NumTradeRouteBonus'

or this

SELECT AnC_Flavor2Yields.FT AS FT, Building_YieldFromDeath.BuildingType AS BT, sum(Building_YieldFromDeath.Yield *AnC_Flavor2Yields.Flavor) *0.1 AS Flavor,
'Building_YieldFromDeath' AS FromTable, 'CP' AS Mod
FROM AnC_Flavor2Yields, Building_YieldFromDeath
WHERE /* we can also have negative Yields */ Building_YieldFromDeath.Yield <> 0
AND AnC_Flavor2Yields.YT = Building_YieldFromDeath.YieldType
GROUP BY FT, BT

i will then make the other sql-vodoo and figure out the rest :)

future updates and adaptation would then also possible with much less pia.

thanks!




AnC-CP.JPG
 
Last edited:
Every table is described in some amount of detail in the CP - look at the xml/sql in the CoreFiles/CoreTables folder.

lol - someone likes me... with SQLite version 3.16.0 (2017-01-02) its now possible to archive this

pragma.JPG



i now make the other sql-vodoo and figure out the rest :D
 
just the problem that your CoreTableEntries.sql has ~1080 Lines. i can find a few easily but i can not compare all
... did you have an list, which tables/columns are new compared to the last version?

Just look at the git commit history for files in that folder. Pretty easy.

maybe you can help?
- a table with the full clean db schema would be nice... just the sql-vodoo select

Now you're asking me to do your project for you. :)

G
 
Now you're asking me to do your project for you. :)

G

no no - please understand me right :) (sry - i am not a native english speaker)
i was thinking about, maybe you have some "working-papers"

anyway - not relevant/needed anymore - see

greetz
m
 
no no - please understand me right :) (sry - i am not a native english speaker)
i was thinking about, maybe you have some "working-papers"

anyway - not relevant/needed anymore - see

greetz
m
You did it yourself, you are amazing :^)
 
Sorry for the noob question, but in lay terms, how does this mod improve the AI?
 
Back
Top Bottom