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

Historical Spawn Dates

Discussion in 'Civ5 - Mod Components' started by Gedemon, Mar 2, 2013.

  1. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,783
    Location:
    France
    The AI may move it's settler to another position when spawning mid-game.

    It's also needed in case of spawning right in the middle of an ancient civ territory, so I don't want to force a city spawning at the TSL.
     
  2. Glassmage

    Glassmage The Desert Flame

    Joined:
    Apr 23, 2011
    Messages:
    1,623
    Location:
    USA
    hmmm is there a place in the mod where I can force settlers to settle in place? or would that cause problem/crash?
     
  3. MAHRana

    MAHRana Warlord

    Joined:
    May 22, 2010
    Messages:
    281
    Settler maps would rename the cities if settled somewhere else, and could help prevent civs from settling strange places.
     
  4. Erudain

    Erudain Chieftain

    Joined:
    Feb 19, 2011
    Messages:
    50
    Great work.....now if you could find a way to force the AI to settle their cities where they actually are on those simulated turns as in RFC I would go crazy and not leave my house for days.

    Or at least not moving into another Civ. spawn area.
    Tested it last night playing as Japan, and China settled Shangai at Seoul spawn point, when Korea spawned, they were inside Shangai's culture borders and coudn't settle.

    Also, Istambul doesn't spawn on its actual location, it spawns like 3 or 4 hexes to the east, not on the bosphorus strait....it this because it share's the spawn location with Byzantium?
     
  5. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    Can you explain this formula for me and how it affects the barbarian conversion rate?

    CONVERT_BARBARIAN_RANGE * (era+1*CONVERT_ERA_RANGE_MOD/100)
     
  6. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    Anyone? lol
     
  7. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,783
    Location:
    France
    ho, thanks, I think you were right about Sweden barbarian, range is too big, formula should be

    Code:
    local range = Round(CONVERT_BARBARIAN_RANGE * math.max(((g_Era + 1) * CONVERT_ERA_RANGE_MOD / 100), 1) * GetConvertionRangePercent(playerID) / 100)
    
    not
    Code:
    local range = Round(CONVERT_BARBARIAN_RANGE * math.max((g_Era + 1 * CONVERT_ERA_RANGE_MOD / 100), 1) * GetConvertionRangePercent(playerID) / 100)
    Value are set in Defines.Lua
     
  8. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    Care to explain that formula then? I have discovered a "fix" to the settlers not settling in the right place. It seems whenever the AI converts barbarians that are a little far away (ie, 2 hexes or so) it discovers more of the map for em, and potentially better spots for cities. This causes them to move their settlers in that direction rather then settling in the correct capital location.

    I propose that you make it convert only a 1 hex radius (including the one that they spawn on) that away this doesn't happen. Could you explain your formula a little better, as it looks completely different then the past ones?
     
  9. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,783
    Location:
    France
    which version of the mod were you using ?
     
  10. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    Version 4
     
  11. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,783
    Location:
    France
    v.4 use that (in HSD_Functions.lua, the comment in Defines.lua is just a reminder):

    Code:
    local range = Round(CONVERT_BARBARIAN_RANGE * math.max((g_Era + 1 * CONVERT_ERA_RANGE_MOD / 100), 1) * GetConvertionRangePercent(playerID) / 100)
    
    Values are in Defines.lua
    Code:
    [B]CONVERT_BARBARIAN_RANGE[/B] = 4 
    [B]CONVERT_ERA_RANGE_MOD[/B] = 45 
    And g_Era is the highest era reached by any player

    Era values are:
    Code:
    ANCIENT = 0
    CLASSICAL = 1
    MEDIEVAL = 2
    RENAISSANCE = 3
    INDUSTRIAL = 4
    MODERN = 5
    POST_MODERN = 6
    FUTURE =	7
    GetConvertionRangePercent is used to lower the range of barbarians conversion for spawning CS.

    Say you're civilization is spawning, and the most advanced civ in game is in Renaissance era (=3)

    GetConvertionRangePercent for a major civ is 100, so the range would be:

    range = Round(CONVERT_BARBARIAN_RANGE * math.max((g_Era + 1 * CONVERT_ERA_RANGE_MOD / 100), 1)

    ->
    range = Round(4 * math.max((3 + 1 * 45 / 100), 1)

    ->
    range = Round(4 * math.max(3.45, 1)

    ->
    range = Round(4 * 3.45) = 14

    (In next version it will be range = Round(4 * math.max(((3 + 1) * 45 / 100), 1) = 7)
     
  12. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    Gotcha. Well, how would I go about setting the conversion range to 1 hex radius (I assume it's already set in radius) for all civs? The whole thing about civs not settling in the right capital bothers the hell out of me ha.
     
  13. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,783
    Location:
    France
    use this

    Code:
    CONVERT_BARBARIAN_RANGE = 1 
    CONVERT_ERA_RANGE_MOD = 0
    edit:

    or as the v.4 formula is wrong, simply change

    Code:
    local range = Round(CONVERT_BARBARIAN_RANGE * math.max((g_Era + 1 * CONVERT_ERA_RANGE_MOD / 100), 1) * GetConvertionRangePercent(playerID) / 100)
    to

    Code:
    local range = 1
     
  14. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    With the old formula or the new one?
     
  15. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,783
    Location:
    France
    the new one, but see my edit.
     
  16. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    Alright, thanks. Will test soon and report back!
     
  17. Glassmage

    Glassmage The Desert Flame

    Joined:
    Apr 23, 2011
    Messages:
    1,623
    Location:
    USA
    So in the beginning of the game in India or China for example, there are no other civs and cs's nearby that would block settling in place but I think they move around anyway.
     
  18. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    Confirmed, and only using a 1 hex radius makes for really difficult starts. Especially since I am using a mod that makes barbarians smarter.

    It's really hard to balance out the game with the unpredictability of the AI. My proposal is:

    Somehow make sure that the first city is always built in the default spawn position. If this doesn't happen, it makes for some very weird spawning of other civs. If the celts settle too far down, England has very little chance of surviving. The only way I know of doing this late game (when civs spawn in other civs culture) is to make sure that whatever block they spawn on is converted to their culture. Settlers maps would be nice, but I think it takes away a dynamic element to some extent.
     
  19. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,783
    Location:
    France
    I can start by forcing the AI to settle at the starting position if there are no other civs nearby.
     
  20. Acoustic

    Acoustic Warlord

    Joined:
    Sep 24, 2010
    Messages:
    270
    I think that in its self would make for a much better experience. How difficult would it be?
     

Share This Page