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

Unit automation

Discussion in 'Civ4Col - Medieval: Conquests' started by Nightinggale, Jan 24, 2015.

  1. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    While searching for interesting modcomps, I came across this rather interesting one about unit automation.

    http://forums.civfanatics.com/showthread.php?t=368841

    It's for BTS and I haven't looked at the source code yet, but I find a few of the automation orders rather interesting. :hatsoff: to Afforess for this masterpiece.


    1. City Defense:
      The unit will defend your cities. If a nearby, weaker enemy approaches, the unit will engage and destroy the enemy, and return to defending the city of origin.
    2. Border Patrol
      The unit will wander around the edges of your border, searching for potential enemies, and engage them.
    3. Hunt
      The unit will search and destroy any enemy units it can find.
    4. Auto-Hurry
      Not useful for normal BTS, but for any mods that add units that can hurry or speed up production of buildings in a city via the <iBaseHurry> XML tag will be able to be automated.
    5. Auto-Pirate
      Privateers and any other sea-faring, hidden, always hostile units will be able to cause terror on the open seas, sinking weak transports and blockading wealthy harbors.
    6. Auto Protect
      Allows the Player to select a unit to escort and protect. If you select a tile with multiple units, a popup will appear directing you to specify which unit.

    1, 2 and 6 sounds like they can be used as they are.

    3: we talked about precisely this for hunter automation. The exception being that we should be able to give it a plot to start on and then it will not move further than X plots away from it. That should prevent him from spending 30 turns on a return trip.

    4: while this one is not particularly useful for our case, it sounds like it is a "loop all your cities and move to a city where this function is true". That could be modded into something really useful. In fact I hope we can include this in a way, where we can easily make multiple automation schemes where they only differ in the criteria for city to travel to.

    5: not sure about this one. Might be useful, but pirates need to return with plunder.


    As I'm busy coding other stuff right now, I will not look further into this now. However spotting this made me decide that we needed a unit automation thread :)
     
  2. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Nice find, I should of thought to look into Civ4 for player unit commands. This will make it much easier to add this commands later.

    1. I have already added this for the AI units. That's the reason you see those messages, "A Magyar Warrior has killed a Bandit near your Realm", they will jump out, kill a bad guy, and move back. This would be a cool command for Players as well, like a Aggressive Sentry command.

    2. I plan to add this kind of command with the Planned Military Expansion

    3. Also planned for the Huntsman, but would work good for collecting bounties on Bandit type units as well. To remind you when a Bandit type kills a Unit it steals gold, then if a Player kills it he gets the gold. Like if your Peddler is taken that carries 500 gold worth spices, the Bandit will add 500 gold to his stash

    5. Auto Pirates would be awesome indeed

    6. I really like this one, like hiring a Guard to follow your Peddlers through hostile territory.
     
  3. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    I know we planned some of those functions, but it would appear we can just grab the code now, which would be way easier than designing it from scratch. That's the big news :)

    Wouldn't it make more sense to make bandit gold decay each turn? If you capture a bandit 10 turns after he got hold of a lot of gold, he would have been drunk for 10 turns and only have half the gold left.
     
  4. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Spoiler :

    Just so y'all know I leave little traps of information around to see if anyone is paying attention and to make you feel like it is you that is coming up with these grand ideas:scan:


    Yeah, that is on the todo list. As mentioned in the NPC thread they will also have a hidden base to stash their goods. The Bandit units and bases will lose gold over time to put a since of urgency on the players to get it back.
     
  5. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    Yeah, I added this one to my Wish list in the FTTW SDK thread.

    Wow... 2 YEARS!! ago... well, 1 and a half maybe.

    Those are certainly cool features though.

    I want a hunter/pillager style ai/automation, and the border patrol and guard unit ones too! :D
     
  6. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Yeah, once I work with them and get them into M:C it should be easy to work them into any other mod.
     

Share This Page