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

Hex Conquer and Release

Discussion in 'Civ5 - Mod Components' started by Rozumiyko, Jan 6, 2013.

  1. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    Hex Conquer and Release (v 3)
    Mod for Civilization V by Matviyko Rozumiyko

    Features:
    • Land combat units can conquer enemy plots they occupy and adjacent enemy plots.
    • Units, cities and citadels can control adjacent tiles to prevent them from being captured by enemy units.
    • The invader unit must spend one before gaining control over the occupied plots.
    • When a plot with a city or a citadel is captured, its adjacent tiles are captured as well.
    • Enemy plots not controlled by enemy units might be regained by the city which can work them.
    • When a city is captured, non-adjacent city plots need to be captured separately.
    • Isolated of partially isolated distant plots may switch to the closest city of another player.
    • Peace treaty reestablishes a reasonable border: plots not worked by one city switch to the city which can work them.
    Details:
    Spoiler :
    The mod establishes the following rules:
    1. A land combat unit can conquer an occupied enemy's land plot.
    2. A plot adjacent to the unit and adjacent to another friendly plot can also be conquered.
    3. A plot can be conquered by the unit if an adjacent plot does not have:
      a) an enemy unit
      b) a city
      c) a citadel
      Notice, units can control adjacent friendly plots, and prevent them from being captured by an enemy.
    4. Occupied plots are captured at the beginning of the next turn. The unit must survive the opponent turns before gaining control over the occupied plots.
    5. When the plot that has a citadel is captured, all enemy plots adjacent to the citadel are captured as well unless they are adjacent to:
      a) a city
      b) another enemy citadel
    6. A city can regain control over plots in its radius if:
      a) The plot is 3 or less plots away from the city.
      b) The plot must be adjacent to the plots of the city owner.
      c) The plot is more than 3 plots away from the closest enemy city of the player that controls the plot.
      d) The rule 3 is satisfied for the plot.
      e) The city is not a puppet city and is not in resistance state.
    7. When an enemy city is conquered:
      a) The conqueror receives six plots adjacent to the city plot.
      b) The rest of the plots that belonged to the city before it was captured are redistributed to the closest cities of the original owner.
      c) If there is no other city of the origial plot owner nearby (within 5 plots), then the plot flips to the new owner of the conquered city.
      d) The captured city acquires friendly plots not worked by other friendly cities.
    8. Isolated of partially isolated distant plots switch to another player if:
      a) The plot and plots adjacent to it are not controlled by the unit of the plot owner.
      b) The plot is not a city or a citadel and is not adjacent to them.
      c) The plot is closer to the city of another player than to the city of the plot owner.
      d) The plot is within 3 plots from the closest city of non-owner.
      e) Such a plot may switch regardless whether the players are at war or at peace.
    9. When two players sign a peace treaty, every plot not worked by a city of one player switches to a city of the other player if his city can work the plot. The exception to this rule is a plot with a citadel or adjacent to a citadel. Other plots remain with the player who controlled them at the time of the peace treaty. The players get an interface notification which tells which cities gained the plots and how many from one player to the other.

    >> Download <<
     

    Attached Files:

  2. Drawmeus

    Drawmeus Chieftain

    Joined:
    Jul 25, 2007
    Messages:
    1,213
    Oh interesting! All lua?

    Does the AI make use of it?
     
  3. Lord Yanaek

    Lord Yanaek Chieftain

    Joined:
    Aug 15, 2003
    Messages:
    1,494
    Nice.
    I was planning to do something similar, thought the conquest would work slightly differently. If you don't mind i'll have a look at your code to see how you did it.

    The "liberation" part is what was bugging me the most. Did you find a built-in feature like a plot original owner or did you create some table to store plot owners?
     
  4. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    8,646
    Location:
    France
    The AI does not really need to know how to use it, if it's coded to go on strategic plots for military reasons, they will simply switch to it side by its units moves.

    It works fine in my mods using it, the only weakness I can think of in this version is the AI pillaging a plot it will own next turn.

    But the rules seems good and not too complex here :goodjob:
     
  5. Lord Yanaek

    Lord Yanaek Chieftain

    Joined:
    Aug 15, 2003
    Messages:
    1,494
    I looked at the code. I see the "reclaim" is done using an "enumerator" method of the city object. So there is no way to know who was the plot owner (or no owner) directly from the plot itself, is there?

    Some pretty clever stuff there for us, non-programmers, to learn from. I like "errorFlagMain" :)
     
  6. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    I decided to avoid dealing with saving/loading new tables at this moment since it was an experiment and my first mod. I'll see if I need to do something like this in the future versions of the mod. The liberation is pretty simple. If your city cannot work the plot, and the enemy's city can work the plot, the plot goes to the enemy city. You can always prevent this by controlling these plots with your unit.
     
  7. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    This mod was actually inspired by your culture mod that allowed plot conquer. I decided to focus on this idea based on my philosophy on how to improve the gameplay.

    First, pillaging is not a problem. I've never seen a non-barbarian AI pillaging a land plot improvement. Second, The defenders must have a chance to defend their plots. The defenders have one turn to kill the invader unit or at least move their units close enough to take adjacent plots under control.

    Another thing that makes my mod conceptually different is the ability of the units to conquer adjacent tiles. Usually units tend to bypass forests and hills unless they want to end their turn there. Since they are able to capture adjacent plots as they move, you can rarely notice pieces of your land remaining in the enemy's rear. The border moves synchronously and the border curve looks smooth enough.

    I tried to write down the rules to make them sound not too much complicated. In the design for the future versions of the mod, I see another 7-10 rules to be added.
     
  8. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    Modifying AI is in the future for me. For this mod, AI behavior looks pretty natural. AI enemy units capture plots as they move towards your cities. The only change I would like to make for AI in this mode is to make units occupy plots adjacent to important resources at the border, build forts there and defend them persistently.
     
  9. JA_Lamb

    JA_Lamb Chieftain

    Joined:
    Aug 19, 2009
    Messages:
    231
    Location:
    The changing Dark Continent
    A very clever addition to the game, how does it work with Gedemon's culture mod?

    You're now giving the AI a real reason to worry about "you're too near us". :goodjob:
     
  10. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    I haven't tried to use it along with another mod. I think it should work okay with Gedemon's culture mod. Sure, in the culture mod, you want to turn off the game setup option that make plots flip from enemy units. Otherwise there is no reason to use Hex Conquer and Release mod. In my mod I want to follow the main idea that plots can change ownership only via war. No floating borders at peace. Only the war can resolve any territory conflicts.
     
  11. JA_Lamb

    JA_Lamb Chieftain

    Joined:
    Aug 19, 2009
    Messages:
    231
    Location:
    The changing Dark Continent
    So in effect, although the two mods are compatible at a coders level, they're incompatible at the conceptual/strategic level. You are now giving us a very different view of the world. Very interesting.

    So the next step, once your mod becomes stable, is to combine these two. Yours begins the game, and Gedemon's kicks in midway/after the Renaisance to mimic reality, so that initially one takes land militarily when populations are thin on the ground but to hold it one has to have a majority of the population be on his side and culture.

    If now we can throw in Killmeplease's Emmigration as well, we'll start to have more of an adult multifaceted game that will be a lot more engaging and immersive than the single slingshot strategies we were served with.

    An 'ubermod' that just manages when to kick in these three mods should be thought of, for the near future.

    EDIT
    PS With Emmigration, the Emmigrants should carry their culture with so that there is another diffusion item to add to the complexity.
     
  12. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    Version 2 is posted.
    Old rules were modified.
    New rules were added.
    All known bugs were fixed.
    Enjoy!
     
  13. albie_123

    albie_123 Modding In Secret

    Joined:
    Mar 12, 2010
    Messages:
    1,380
    Location:
    Sydney, NSW
    Is this for GaK as well?
     
  14. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    It was tested on G&K, but I think it should work fine with the older version.
     
  15. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    Version 3 has been released.

    Two major rules were added:
    1. Isolated and surrounded plots switch from their owners. The majority of the annoying isolated plots left by the attacking troops get removed.
    2. Peace treaty automatically switches some plots between the players such that a 'fair' border is established.
    See the mod description for more details.
     
  16. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    For those who downloaded and played the mod, please let me know if you notice any bugs or have any ideas on how to improve the mod. I would like to hear from those of you who actually downloaded and played the mod and who can share some critical or encouraging thoughts about it.
     
  17. Mars83

    Mars83 Chieftain

    Joined:
    Jun 13, 2011
    Messages:
    273
    Will it work with Cutural Diffision? or are they the same?
     
  18. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    It should work fine with the Cultural Diffusion mod. Before you start your game, try disabling the "Cultural Diffusion: Tile conquest" option.
     
  19. FramedArchitect

    FramedArchitect Reluctant Modder

    Joined:
    Mar 25, 2012
    Messages:
    797
    Location:
    Missouri
    I love the fluidity of the war border; thank you for sharing.
     
  20. Rozumiyko

    Rozumiyko Chieftain

    Joined:
    Jan 6, 2013
    Messages:
    24
    Location:
    Portland, Oregon
    You are welcome. Enjoy. :)
     

Share This Page