[Religion and Revolution]: General Questions and Discussions

We have an Overview which lists most of our changes.
(Some AI improvments are listed there specifically. But most of the time it only generally speaks of "AI Improvments".)

Even for me it would be very difficult to give you a complete list of useful AI improvments for other mods or tell the comments to look for in the code.

1. In TAC koma13 was the AI specialist.
2. In RaR I did many AI improvments as well, but most of them were quite specific to RaR and its features.
3. I never really tried to keep track of bugfixes or improvments like I tried to do with features.

Summary:

The AI improvments were simply too many over all those years.
(Just like we also had masses of other improvments and fixes.)

Creating an Overview over those AI improvments would take a lot of time, which I currently don't have.
Anybody looking for AI improvments will most likely need to start searching our code himself.

Sorry that I cannot give you better help.
 
Ok, thanks ray. I figured out what it was I remembered looking at and that was the TAC mod documentation. Like:

// TAC - AI Assault Sea
UNITAI_ASSAULT_SEA imported from Better BTS AI. It makes the AI loading military units on a transport ship and send it to an enemy target city. Technically it is working. Unfortunately ingame the AI makes rarely use of it, often failing to provide the prerequisites for a naval invasion.

I was wanting to implement some of those additions for M:C. Looks like this part could even use some more improvements to get the AI to actually use this feature.
 
Hey all,

Love the mod but I have a quick question. In my last game, I have completely beat the King (all of his sea and land forces are dead) and yet the game will not end. I can't win the War of Independence. The only victory condition was defeat the king. Am I missing something, did I screw up or is this something else altogether? Any help would be appreciated
 
Love the mod

:)

In my last game, I have completely beat the King (all of his sea and land forces are dead) and yet the game will not end. I can't win the War of Independence. The only victory condition was defeat the king. Am I missing something, did I screw up or is this something else altogether? Any help would be appreciated

The only explanation I have is that the King still has some Units somewhere on the map. :dunno:

Did you check the map with Worldbuilder ?
 
I did - which is how I found out that, before he attacked me, he attacked and conquered a bunch of English colonies. I sent a force up there and reconquered all of those colonies. I'll check with the world builder again. If he doesn't have any soldiers but some random citizen still on the map, will that cause the WOI to continue?
 
the game will not end.

Along the same lines though less critical; In my current game [attached] (and I believe I've seen it before) another European refuses to give up. In this case it's France. I haven't seen at unit of his for I'd say 70 turns now and also confirmed it in world builder (no ships or missions either). Is it possible that units could be stuck in Europe and that would cause it? Could a diplomatic agreement (e.g open borders) be enough??!
 

Attachments

  • rmk.ColonizationSave
    1.3 MB · Views: 146
I had a question regarding the natives ability to cause damage, steal gold or goods, etc... when performing raids. Specifically if the ability to do it was hardcoded in the sdk or if it was given in the xml.
I ask because i thought about playing around with a unit that i would call "raiding party" or so specifically with that ability and to be basically a land privateer.
 
Specifically if the ability to do it was hardcoded in the sdk or if it was given in the xml.

It is coded in DLL and only works for Native Units with a special UnitAI.

So you cannot simply change a single XML tag at a Unit to make it use that feature.
You would need to do DLL coding.

The changes necessary are beyond beginners level though. The feature is far more complex than it seems.
Actually it caused lots of small problems for quite a long time.
 
Hi modders, does anyone know of a way to get the "max capacity of a particular cargo unit in a transport"?
For eg. it is 100 in normal games, 300 in marathon games. However, any idea where to get this using code in c++?

Edit: I guess i could just use 100 * GC.getGameSpeedInfo(getGameSpeedType()).getStoragePercent()/100 but I don't like to hardcode the "100" value.
 
Hi modders, does anyone know of a way to get the "max capacity of a particular cargo unit in a transport"?
For eg. it is 100 in normal games, 300 in marathon games. However, any idea where to get this using code in c++?

Edit: I guess i could just use 100 * GC.getGameSpeedInfo(getGameSpeedType()).getStoragePercent()/100 but I don't like to hardcode the "100" value.

Isn't it this one (CvInfos.cpp)
Code:
int CvUnitInfo::getCargoSpace() const
{
	return m_iCargoSpace;
}
 
Is it? I think it's the total capacity. Say 6*100 for a galleon, 2*100 for wagon, etc.

I don't think so as in the CIV4UnitInfos.xml the cargo capacity is defined by
<iCargo>6</iCargo> (in this case, for the Galleon, obviously)

On second thought, maybe you're right. Seems to be the number of "cargo bays per transport unit". :(
 
Hi modders, does anyone know of a way to get the "max capacity of a particular cargo unit in a transport"?
For eg. it is 100 in normal games, 300 in marathon games. However, any idea where to get this using code in c++?

Edit: I guess i could just use 100 * GC.getGameSpeedInfo(getGameSpeedType()).getStoragePercent()/100 but I don't like to hardcode the "100" value.

This is programmed in XML, in Civ4GameSpeedInfo.xml, in the GameInfo folder.
 
Well, that is the gamespeed-specific change to what originally seems to be defined in GlobalDefines.xml
Code:
	<Define>
		<DefineName>CITY_YIELD_CAPACITY</DefineName>
		<iDefineIntVal>100</iDefineIntVal>
	</Define>

And the respective entry in the dll seems to be (CvGame.cpp):
Code:
int CvGame::getCargoYieldCapacity() const
{
	return (GC.getDefineINT("CITY_YIELD_CAPACITY") * GC.getGameSpeedInfo(getGameSpeedType()).getStoragePercent() / 100);
}
Is it only me, or have the Firaxis guys done some things overly complicated?
 
Hi Folks,

I'm currently thinking about implementing a new Founding Father, who will increase the percentage of capturing enemy ships. Since there is no tag in the traitinfos for that, I think this would require a new tag (= changing the DLL).

Since this should be a well known pirate I would like to decrease the relationship to the king when getting the FF, but I have no idea if this would be possible.

Any ideas how to do this?
 
Why should the relationship to the king suffer from this? Either you are still his governor, then he should be pleased instead, since you are catching the ships of other colonial powers.
Or you are in revolution, then you don't have to care about the relationship anymore.

It just doesn't make any sense to me.
 
Why should the relationship to the king suffer from this?

He means that when a pirate joins as a FF, your king will be displeased. He doesn't like his viceroys mixing with the "wrong" sort. Unless you're queen Elizabeth and just knighted Drake.
 
Hi Folks,

I'm currently thinking about implementing a new Founding Father, who will increase the percentage of capturing enemy ships. Since there is no tag in the traitinfos for that, I think this would require a new tag (= changing the DLL).

Since this should be a well known pirate I would like to decrease the relationship to the king when getting the FF, but I have no idea if this would be possible.

Any ideas how to do this?

Coding this in DLL is, as far as I'm aware, relatively simple.

Decreasing the attitude of the king can simply be done by entering a negative value in the right XML tags, but I don't really like the idea.:dunno:
It would currently be the only FF to give the player a penalty for accepting him. IMHO, a FF should be a bonus, and the only reason to refuse one is because you don't want to lose another FF. Forcing the player to make tough decisions is fine, but we already have random events for that purpose.
 
I'm currently thinking about implementing a new Founding Father, who will increase the percentage of capturing enemy ships. Since there is no tag in the traitinfos for that, I think this would require a new tag (= changing the DLL).
Adding an int value to any XML file is fairly easy and any DLL modder should be able to do that fairly quickly.

CvTeam should then have an int telling the combined bonus from all FF. That is a cache, which is the sum of all owned FF's value in this field. That shouldn't be that tricky to do either and there is code to copy paste for this in vanilla.
(FFs exist in CvTeam, not CvPlayer. That can make a difference in multiplayer)

Depending on implementation, that cache in CvTeam is either recalculated on load or saved. Personally I prefer recalculating because it allows editing XML with less risk of breaking savegames, but saving it like vanilla does works too.

At the place where the capture percentage is calculated: add the bonus from CvTeam of the ship's owner. (I think this is somewhere in CvUnit.cpp)

I think that is what needs to be done to implement this feature in the DLL. I think the coding difficulty is fairly easy, which mean the real question is who will do it? It makes little sense if multiple people start on this one feature.

Lost relationship with the king
I think that's a bad idea. It could be interesting to have positive and negative bonuses, but then it should be from something like civics where you can turn them on and off. Placing negative features in FF is dangerous as they can't be turned off. Imagine an FF giving negative relation to natives and right after you get him, you encounter a tribe with 30 settlements and you are stuck on a hostile policy towards natives. The logical choice in such a case is to sacrifice your bonus in favor of not getting beaten in such a case.

Colonization has the civ4 civic system, complete with network code to change civic and all that. This mean adding civics will be a matter of XML changes and setting up a screen for it. If nothing else, the civ4 python file for the screen will likely work. Just saying in case somebody comes up with interesting ideas.
 
Top Bottom