Civics Dependency Mod

I edited CvPlayerAI.cpp and now it compiles.
I had to comment out Fuyu's code in CvPlayerAI::AI_doCivics(). Hope it doesn't cause any problems.
If civic values are static within one turn and player, then there is no problem. It's just that all of the code I changed/added for the civic AI is based on the thought that this isn't the case, the value of a single civic can also depend on what other civics are active at the same time.

@LunarMongoose:I hope you don't really need this.
If you do, I think I can add this, my civic AI is still missing that final step to absolutely ensure the selection of the most potent combination anyway and that dependancy checking would fit in there rather nicely I believe.
 
@LunarMongoose:I hope you don't really need this.
If you do, I think I can add this, my civic AI is still missing that final step to absolutely ensure the selection of the most potent combination anyway and that dependancy checking would fit in there rather nicely I believe.

Ooh, thanks for offering! No I don't "really" need it... It's in the "intriguing" category where I'd have to add it and think about it for a while to know for sure if I wanted it or not, and I could live without it in any case, but yeah it could potentially be nice... that sort of category. ;)
 
If civic values are static within one turn and player, then there is no problem. It's just that all of the code I changed/added for the civic AI is based on the thought that this isn't the case, the value of a single civic can also depend on what other civics are active at the same time.

@LunarMongoose:I hope you don't really need this.
If you do, I think I can add this, my civic AI is still missing that final step to absolutely ensure the selection of the most potent combination anyway and that dependancy checking would fit in there rather nicely I believe.

In my algorithm, the value given to a group of civics is just the sum of each of the civics value. I thought of making the value of each civic dependent on the other civics, but didn't really know how to do it.

It would fit in rather nicely with your code :)

I didn't want to rewrite the AI civic selection when I merged the code for keldath, but it might be a good idea to do it anyway.
I wouldn't mind adding it if you happen to merge it ;)

But it's just a thought. I don't really need it.
 
hi there,

ive finally i gave the fixed playerai.cpp file you uploaded for me a chance, but it didnt work im afraid :(

ive tried to change stuff, look for error, but i cant tell whats wrong, i get the following error:
Spoiler :
Code:
CvPlayer.cpp(10440) : warning C4101: 'iLoop' : unreferenced local variable
CvPlayer.cpp(10439) : warning C4101: 'pLoopCity' : unreferenced local variable
 "C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe" /nologo /MD /O2 /Oy /Oi /G7 /DNDEBUG /DFINAL_RELEASE /Fp"Release\CvGameCoreDLL.pch" /GR /Gy /W3 /EHsc /Gd /Gm- /DWIN32 /D_WINDOWS /D_USRDLL /DCVGAMECOREDLL_EXPORTS /Yu"CvGameCoreDLL.h"  /D_MOD_SENTRY /D_MOD_FRACTRADE /D_MOD_GOVWORKERS  /D_MOD_GWARM /D_MOD_SHAM_SPOILER /IBoost-1.32.0/include /IPython24/include /I"C:\Program Files\Microsoft Visual C++ Toolkit 2003/include" /I"C:\Program Files\Microsoft Platform SDK/Include" /I"C:\Program Files\Microsoft Platform SDK/Include/mfc" /FoRelease\CvPlayerAI.obj /c CvPlayerAI.cpp
CvPlayerAI.cpp
CvPlayerAI.cpp(12233) : error C2660: 'CvPlayer::canDoCivics' : function does not take 2 arguments
CvPlayerAI.cpp(12236) : error C2039: 'getCivicPrereq' : is not a member of 'CvCivicInfo'
        c:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\CvGameCoreDLL\CvInfos.h(1723) : see declaration of 'CvCivicInfo'
CvPlayerAI.cpp(12238) : error C2660: 'CvPlayer::canDoCivics' : function does not take 2 arguments
CvPlayerAI.cpp(16013) : error C2660: 'CvPlayer::canDoCivics' : function does not take 2 arguments
CvPlayerAI.cpp(16016) : error C2039: 'getCivicPrereq' : is not a member of 'CvCivicInfo'
        c:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\CvGameCoreDLL\CvInfos.h(1723) : see declaration of 'CvCivicInfo'
CvPlayerAI.cpp(16018) : error C2660: 'CvPlayer::canDoCivics' : function does not take 2 arguments
CvPlayerAI.cpp(16304) : error C2664: 'CvPlayer::canRevolution' : cannot convert parameter 1 from 'const CivicTypes *' to 'CivicTypes *'
        Conversion loses qualifiers
CvPlayerAI.cpp(16324) : error C3861: 'isMissingCivicDependency': identifier not found, even with argument-dependent lookup
CvPlayerAI.cpp(16353) : error C2039: 'getCivicPrereq' : is not a member of 'CvCivicInfo'
        c:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\CvGameCoreDLL\CvInfos.h(1723) : see declaration of 'CvCivicInfo'
CvPlayerAI.cpp(16368) : error C3861: 'isMissingCivicDependency': identifier not found, even with argument-dependent lookup
CvPlayerAI.cpp(16384) : error C2664: 'CvPlayer::revolution' : cannot convert parameter 1 from 'const CivicTypes *' to 'CivicTypes *'
        Conversion loses qualifiers
CvPlayerAI.cpp(17168) : error C2660: 'CvPlayer::canDoCivics' : function does not take 2 arguments
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\cl.exe"' : return code '0x2'
Stop.
Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
Build log was saved at "file://c:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods\CvGameCoreDLL\Release\BuildLog.htm"
CvGameCoreDLL - 14 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

im also adding the cvgamecoredll source files, maybe someone will help me.

thanks,
kel.
 

Attachments

  • cvgamecoredll.zip
    3.6 MB · Views: 69
I compiled your files - and only got some of the errors you got (the "'const CivicTypes *' to 'CivicTypes *'" ones).
I fixed the relevant files and attached them (just added 'const' in a few places).

Regarding the other errors - it seems that you have some bad headers there. Make sure you did not mix in any files from before the Civics Dependency changes.
Also try to rebuild, though I'm not sure it'll help here.
 

Attachments

  • ChangedFiles.zip
    11.4 KB · Views: 78
Top Bottom