1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[Religion and Revolution]: General Questions and Discussions

Discussion in 'Civ4Col - Religion and Revolution' started by raystuttgart, Sep 3, 2011.

  1. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,991
    Gender:
    Male
    Location:
    Stuttgart, Germany
    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.
     
  2. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    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.
     
  3. slackerpride

    slackerpride Chieftain

    Joined:
    Oct 25, 2008
    Messages:
    18
    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
     
  4. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,991
    Gender:
    Male
    Location:
    Stuttgart, Germany
    :)

    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 ?
     
  5. slackerpride

    slackerpride Chieftain

    Joined:
    Oct 25, 2008
    Messages:
    18
    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?
     
  6. lethiel

    lethiel Streaming Col at https://www.twitch.tv/lethiel01

    Joined:
    Jul 1, 2008
    Messages:
    143
    Location:
    Denmark
    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??!
     

    Attached Files:

  7. Edgecrusher

    Edgecrusher King

    Joined:
    Aug 7, 2006
    Messages:
    915
    Location:
    Massachusetts
    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.
     
  8. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    5,991
    Gender:
    Male
    Location:
    Stuttgart, Germany
    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.
     
  9. vetiarvind

    vetiarvind Prince

    Joined:
    Oct 20, 2013
    Messages:
    328
    Location:
    Chennai, South India
    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.
     
  10. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    Isn't it this one (CvInfos.cpp)
    Code:
    int CvUnitInfo::getCargoSpace() const
    {
    	return m_iCargoSpace;
    }
    
     
  11. vetiarvind

    vetiarvind Prince

    Joined:
    Oct 20, 2013
    Messages:
    328
    Location:
    Chennai, South India
    Is it? I think it's the total capacity. Say 6*100 for a galleon, 2*100 for wagon, etc.
     
  12. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    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". :(
     
  13. agnat86

    agnat86 Warlord

    Joined:
    Jun 30, 2011
    Messages:
    218
    This is programmed in XML, in Civ4GameSpeedInfo.xml, in the GameInfo folder.
     
  14. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    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?
     
  15. vetiarvind

    vetiarvind Prince

    Joined:
    Oct 20, 2013
    Messages:
    328
    Location:
    Chennai, South India
    Excellent^. Thanks guys!
     
  16. Schmiddie

    Schmiddie Emperor

    Joined:
    Feb 27, 2012
    Messages:
    1,452
    Location:
    Germany
    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?
     
  17. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    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.
     
  18. vetiarvind

    vetiarvind Prince

    Joined:
    Oct 20, 2013
    Messages:
    328
    Location:
    Chennai, South India
    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.
     
  19. agnat86

    agnat86 Warlord

    Joined:
    Jun 30, 2011
    Messages:
    218
    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.
     
  20. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,566
    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.
     

Share This Page