AnotherPacifist
Deity
- Joined
- Sep 21, 2007
- Messages
- 4,878
Using the BG file from the pick a leader zip pack, I chose monarch difficulty. I haven't researched Faith yet, but I founded Shai-Hulud?
Spoiler :
Is the source from dunewars that is included in the download 1.7 up to date?
we've got out of sync in our multi game soon after this turn.
The installer does not delete the previous version; did you install on top of 1.6?
Do you see this result in a new game as I described above?
I was using the dll I compiled with the dune wars mod, so all python xml should be in place. When I use the dll included in the install, all works fine, but when use the one I compiled I get into trouble. I guess I have some wrong compiler options then.Yes, it is. Because DW is built on top of a ton of other mods, including RevDCM, there is no convenient way to run just the dll without having all the related python, xml, etc, etc files.
I wanted to try out a change to force the AI to unload transporters when in danger. The code is very basic but I hope it will most issues.What specifically are you trying to do? If you would like to extract some of the sdk changes, we can work with you on that. The AI changes were done by cephalo. The all-terrain transport changes were originally done by Maniac, with extensive changes later by myself and koma13.
/*************************************************************************************************/
/** BETTER AI (Unloading Transports in Danger at end of turn) Sephi **/
/** **/
/*************************************************************************************************/
if (!player.isHuman())
{
for(CvUnit* pLoopUnit = player.firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = player.nextUnit(&iLoop))
{
if(pLoopUnit->canUnloadAll() && (!pLoopUnit->plot()->isWater()))
{
bool bDanger=false;
// Are we in Danger?
int iOurDefense = player.AI_getOurPlotStrength(pLoopUnit->plot(), 0, true, false);
int iEnemyOffense = player.AI_getEnemyPlotStrength(pLoopUnit->plot(), 4, false, true);
if (iOurDefense < iEnemyOffense)
{
bDanger = true;
}
if (bDanger)
{
pLoopUnit->unloadAll();
}
}
}
}
/*************************************************************************************************/
/** END **/
/*************************************************************************************************/
I moved the old version outside the mods folder and installed the new one, maybe that shouldn't be done?
I was using the dll I compiled with the dune wars mod, so all python xml should be in place. When I use the dll included in the install, all works fine, but when use the one I compiled I get into trouble. I guess I have some wrong compiler options then.
I wanted to try out a change to force the AI to unload transporters when in danger. The code is very basic but I hope it will most issues.
I get no specific error, basically just a civ stopped working error. It seems to happen just before the screen pops up with the revolution components at gamestart. I doubt it has anything to do with dunewars. The dll I am compiling is also a bit bigger.Let me make sure I understand. You compile the sources from mods/dune wars/cvgamecoredll and produce a dll with no errors. Then you copy that on top of your existing mods/dune wars/assets/cvgamecoredll.dll and launch a game. Now you get some errors. What are the specific errors?
Say, that is clever. Brute force but it looks like it should work. Which file/line were you inserting this into? I am actively trying to solve the problem so this suggestion comes at a great time.
void CvGame::updateMoves()
{
[...]
if (!(player.hasBusyUnit()))
{
/*************************************************************************************************/
/** BETTER AI (Unloading Transports in Danger at end of turn) Sephi **/
/** **/
/*************************************************************************************************/
if (!player.isHuman())
{
for(CvUnit* pLoopUnit = player.firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = player.nextUnit(&iLoop))
{
if(pLoopUnit->canUnloadAll() && (!pLoopUnit->plot()->isWater()))
{
bool bDanger=false;
// Are we in Danger?
int iOurDefense = player.AI_getOurPlotStrength(pLoopUnit->plot(), 0, true, false);
int iEnemyOffense = player.AI_getEnemyPlotStrength(pLoopUnit->plot(), 4, false, true);
if (iOurDefense < iEnemyOffense)
{
bDanger = true;
}
if (bDanger)
{
pLoopUnit->unloadAll();
}
}
}
}
/*************************************************************************************************/
/** END **/
/*************************************************************************************************/
player.setAutoMoves(false);
}
}
}
}
}
}
in player.h
/*************************************************************************************************/
/** BETTER AI (Unloading Transports in Danger at end of turn) Sephi **/
/** Make sure we can call these functions in CvGame.cpp **/
/*************************************************************************************************/
virtual int AI_getOurPlotStrength(CvPlot* pPlot, int iRange, bool bDefensiveBonuses, bool bTestMoves) const = 0;
virtual int AI_getEnemyPlotStrength(CvPlot* pPlot, int iRange, bool bDefensiveBonuses, bool bTestMoves) const = 0;
/*************************************************************************************************/
/** END **/
/*************************************************************************************************/
here is all you need ... I don't know how well this works without testing, but the big advantage is that it is easy to remove in case it doesn't help

I'm might be a little obtuse, but what good are the Sayyadinas? I've stacked 2 of them in a city forever with a big stack and nothing happens to their XP.
Also, I was first to Technocracy but it wasn't founded by me.
I have a suggestion:
![]()
![]()
Reword the text and make clicking 'OK' continue with the installation anyway. I have the Steam version of Civ4 and BtS, it is most certainly updated to version 3.19. Installers that abort unnecessarily are a bit of a pet peeve of mine.
OK, I was first to mechanization, and unless the BG are forbidden to found Technocracy, there is a bug.
yeah, AI changes shouldn't be in CvGame, however the advantage of Cvgame is that it is run after ALL units have moved. So you prevent cases in which a transport unloads before other units move to escort the transport or destroy threathening units. So if your change makes the AI unload transporters too often you might want to try to move it to the game function.Thanks for the suggestion! I have put some code close to this into AI_unitUpdate. This way I don't have to expose the plot danger functions, and it seems more like an AI function than a game function.
while autoplaying returns falseOne question. I notice your code tests isHuman(). What happens if the human player is autoplaying? Does isHuman still return true?

I will test.If anybody is interested to try out this change, I hereby call it 1.7.0.2 and it is attached. Replace assets/cvgamecoredll.dll with the contents of the zip.
OK, I was first to mechanization, and unless the BG are forbidden to found Technocracy, there is a bug.
As you can see in the religion help, the only civ which cannot found Technocracy is Tleilaxu
Interesting. I've never tested them - never needed to use them.Inquisitors seem not to be able to do anything except move around.