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

Caveman 2 Cosmos (ideas/discussions thread)

Discussion in 'Civ4 - Caveman 2 Cosmos' started by strategyonly, Sep 3, 2010.

  1. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    7,204
    Location:
    Norway
    So, I looked into why pedia links sometimes goes to the wrong game object if there are two objects with the same exact description. Like the Building "Lighthouse" and the Improvement "Lighthouse".
    I identified the problem.

    Here's an example, let's say there is a Bonus called "Earthenware" and a Tech called "Earthenware" (Which there is in the "my take on stuff" modmod ^^):
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    This XML entry is an example of an in-game text that would contain a flawed link:
    <TEXT>
    <Tag>TXT_KEY_BUILDING_PROVIDES</Tag>
    <English>[ICON_BULLET]Provides %d1_Num [COLOR_HIGHLIGHT_TEXT][LINK=literal]%s2_BonusName[\LINK][COLOR_REVERT] (%F3_BonusIcon)</English>​
    </TEXT>

    This is the code that fills in the blank in that TXT_KEY:
    Code:
    szBuffer.append(gDLL->getText("TXT_KEY_BUILDING_PROVIDES", GC.getGameINLINE().getNumFreeBonuses(eBuilding), GC.getBonusInfo((BonusTypes) kBuilding.getFreeBonus()).getTextKeyWide(), GC.getBonusInfo((BonusTypes) kBuilding.getFreeBonus()).getChar()));
    The result is:
    [ICON_BULLET]Provides %d1_Num [COLOR_HIGHLIGHT_TEXT][LINK=%s2_BonusName]%s2_BonusName[\LINK][COLOR_REVERT] (%F3_BonusIcon)​

    or rather:
    • Provides 1 [Link=Earthenware] Earthenware [\LINK] ( ICON )
    That link will always lead to the Earthenware tech, when it should lead to the Earthenware Bonus. If the link had been to the tech in the same manner then it would also lead to the tech, that's because the code checks the description names of techs before bonuses.
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Link = literal ▬ means that the link equals the literal text that constitute the link.
    Since GC.getBonusInfo((BonusTypes) kBuilding.getFreeBonus()).getTextKeyWide() provide the description for the game object and not the type key, e.g. TECH_EARTHENWARE or BONUS_EARTHENWARE, the pedia can only guess on which of those two is correct when it receives only "Earthenware" as a link.
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Solution:
    <TEXT>
    <Tag>TXT_KEY_BUILDING_PROVIDES</Tag>
    <English>[ICON_BULLET]Provides %d1_Num [COLOR_HIGHLIGHT_TEXT][LINK=%s2]%s3_BonusName[\LINK][COLOR_REVERT] (%F4_BonusIcon)</English>​
    </TEXT>
    Code:
    szBuffer.append(gDLL->getText("TXT_KEY_BUILDING_PROVIDES", GC.getGameINLINE().getNumFreeBonuses(eBuilding), GC.getBonusInfo((BonusTypes) kBuilding.getFreeBonus()).getType(), GC.getBonusInfo((BonusTypes) kBuilding.getFreeBonus()).getTextKeyWide(), GC.getBonusInfo((BonusTypes) kBuilding.getFreeBonus()).getChar()));
    This would have to be done to all examples of [Link=literal] for the pedia links to work with different game objects with the same name.
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    @Thunderbrd : Are you in on fixing this one example I laid out as a test case, see if it works.
    I can change the XML if you make the dll change I pointed out.
     
    Last edited: Nov 13, 2018
    KaTiON_PT and raxo2222 like this.
  2. alberts2

    alberts2 Emperor

    Joined:
    Aug 16, 2012
    Messages:
    1,947
    Gender:
    Male
    Location:
    Germany
    Some of the changes you made look questionable but if they turn out to be working as your tests suggest I wont complain about them too much.
    However the UNITAI_HUNTER_ESCORT is now unused so it and all the usages should be removed at some point. This is because we already have lots of code so cleaning up unused or dead code should always be done.
     
  3. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,064
    Gender:
    Male
    Location:
    Las Vegas
    It's not unused at all. It's used very directly and effectively by the AI at this point according to my tests.

    What makes you think it was removed or now goes unused? If anything it's more effective than its ever been. I did make a mistake on the General AI and added it specifically to be called there when I don't think it was quite the intention (although if it was then my removing it in this commit was incorrect.)

    MOST of the changes (recently) were to back out of things I had done before that might have been having a negative effect and weren't terribly necessary but I may have undone some effective mechanisms in the process. So if anything you see looks questionable, let's talk about that!

    EDIT: If you're basing the belief that the AI isn't using the hunter escort AI anymore on the fact that wanderers aren't bothering with them, I figured out why that is. It probably only happens on Size Matters and it does so because Wanderers are very high combat quality to make up for their lack of group size. High quality instructs the hunter to avoid needing an escort. This is done primarily for the sake of the Master Hunting units but also does work with wanderers because with wanderers if they get out there quick to find what small game and goody huts they can before they die, the faster the better. And if they group up in SM, it's not that unlikely that whatever killed the first one will likely kill the second one soon after.
     
    Last edited: Apr 9, 2018
  4. amjh

    amjh Chieftain

    Joined:
    Jun 30, 2015
    Messages:
    41
    The AI seems to really hate settling inland, even if there's plenty of good terrain, resources and rivers available.
     
  5. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,064
    Gender:
    Male
    Location:
    Las Vegas
    Coast is preferable. By a lot. Specially if any water tiles will end up in the city radius. Prime city spots get first target treatment.
     
  6. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,274
    Gender:
    Male
    Location:
    Western IL. cornfields
    This is also Very dependent upon the stage/how far the game is in it's progression. If you are just talking about Prehistoric Era actions then yes they will stick to coasts. It's not until Ancient era and beyond that metals become revealed. Then the AI will become more interested in inland city building.
     
    KaTiON_PT likes this.
  7. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,064
    Gender:
    Male
    Location:
    Las Vegas
    Yup. Which is also probably very real world applicable. We can see from our webbed fingers and how our skin wrinkles when wet for a long time (to give us improved surface grip underwater) and a number of other things like how our systems seem to have an abnormal need for Omega fats (which is pretty much mostly found in seafood) that as a species we spent a lot of time evolving to a coastal lifestyle.
     
    Last edited: Apr 9, 2018
    KaTiON_PT likes this.
  8. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,820
    Location:
    Poland
    All these handicap modifiers changes made Flexible Difficulty much more stealthy now.
    That is you won't notice instantly, that handicap changed as production and research cost modifiers change for AI.

    If you keep watching closely properties, then you may notice, that crime and education gets easier or harder to control depending on handicap change.
    Also after watching scoreboard for some time you may notice, that AI suddenly accelerated or slowed down its expansion and advancement rate.
     
    Last edited: Apr 10, 2018
  9. Dr. Elephant

    Dr. Elephant Warlord

    Joined:
    May 8, 2017
    Messages:
    134
    Gender:
    Male
    Location:
    Québec, Canada
    Hello everyone, normally I am more active in the Subdued Animals thread, but just an quick post to metion this new about human origin: https://news.nationalgeographic.com/2017/06/morocco-early-human-fossils-anthropology-science/

    That could technically, mean that this NPC could be added too: http://humanorigins.si.edu/evidence/human-fossils/species/homo-heidelbergensis , since it could have time to appear and spread.

    Talking about NPC: I have found somes interesting papers (PDF), regarding Floriensis and Naledi, notably their body proportions. So, where I can post them for been useful for the mod?
     
  10. Dr. Elephant

    Dr. Elephant Warlord

    Joined:
    May 8, 2017
    Messages:
    134
    Gender:
    Male
    Location:
    Québec, Canada
  11. Noriad2

    Noriad2 Emperor

    Joined:
    Oct 23, 2014
    Messages:
    1,153
    Gender:
    Male
    Perhaps we should rename the goody huts (official name: tribal villages) to something that is more related to intelligent pre-modern human species like Homo Erectus Tribal Village. For greater immersion into the early prehistory.
     
  12. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,820
    Location:
    Poland
    Sometimes fairly large continent may get tribal villages but no player/AIs on it though.

    What would be normal barbarians then?
    Criminals, that were exiled and founded new city?
     
  13. SteelSterling

    SteelSterling Prince

    Joined:
    Jun 22, 2010
    Messages:
    323
    Gender:
    Male
    Location:
    Northern NJ
    Good idea. While "goody hut" is explanatory, it does take away from immersion. Maybe Homo Sapien Dwelling?
     
  14. amjh

    amjh Chieftain

    Joined:
    Jun 30, 2015
    Messages:
    41
    But humans are specifically reliant on abundant fresh water, shouldn't it's sources be preferred even more than sea for most of history? The game doesn't really have terrain to represent abundant smaller lakes which are a major one, though.
     
  15. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,820
    Location:
    Poland
    Fish can be found in both rivers and seas.
    Wrinkling skin is useful for any wet environment.

    I guess settling at coast with river or nearby lakes or very rainy weather should satisfy water needs for prehistoric people.
    Also some plants and fruits have so much water content, that you could stay hydrated just by eating them.
    You could also drink blood or milk from animals.
    Eggs also are good source of hydration - 100g of eggs contains around 75% of water.

    Rivers + coasts is best option, but in certain places you may survive without river.

    Streams, lakes and rain aren't shown in game, but some terrains can be assumed to contain some fresh water.
     
    Last edited: Apr 10, 2018
  16. amjh

    amjh Chieftain

    Joined:
    Jun 30, 2015
    Messages:
    41
    My point is, completely ignoring good locations with fresh water because they aren't seacoast isn't realistic.
     
  17. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    7,820
    Location:
    Poland
    Well game places settlers close to coast at beginning of game.
     
  18. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,064
    Gender:
    Male
    Location:
    Las Vegas
    No but being willing to place a city just a step back from the coast is terrible strategy and without as strong a weight for coastal placement as we have, they'll gladly do this to maximize resource access, even if that access overlaps with other cities workable zones. They don't completely ignore inland spots.. they just need very compelling reasons to go there over a coastal one if a coastal one is available.
     
  19. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,064
    Gender:
    Male
    Location:
    Las Vegas
    That or split off families that grew into tribes that simply don't care to establish a government or the trappings of organized civilization.
     
    KaTiON_PT and raxo2222 like this.
  20. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,543
    Gender:
    Male
    Location:
    Canberra, Australia
    Not always and not if you are playing on a pangaea map.
    Placing cities along the coast first and then moving inland later is my usual approach, unless there is a much needed resource inland that is eg stone. The first city on the coast increases the likelihood of you being the first to circumnavigate the globe ;)
     

Share This Page