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

Protection Group for AI Siege Units

Discussion in 'Civ4 - SDK/Python' started by Cybah, Jun 7, 2015.

  1. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,480
    I want to make the AI move siege units with a protecting group like moving a settler.

    It's too easy to kill single siege units on their way to the AI main stack. ;)

    Any ideas?
     
  2. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    I think the answer lies in CvUnitAI.cpp. There is a reference to sea escorts. Maybe that would be worth investigating and figure out if it can be duplicated for land escorts.

    Another approach is to "lure" AI military units into wanting to join a group, which has a settler. Precisely which UNIT_AI to trigger on, how precisely and where is the real question in this approach.

    Another small tip for testing. Edit CvPlot::isVisible like this:
    PHP:
    bool CvPlot::isVisible(TeamTypes eTeambool bDebug) const
    {
        if (
    eTeam == 0)
        {
            return 
    true;
        }
    That way you can see the entire map and only you can see it. Sure it's cheating, but it is a good way to observe what the AI is doing.


    And if you figure it out, please tell us how you did it. Improving the AI is on my todo list and something like this sounds really interesting :)
     
  3. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    hear hear.
    Its been bugging me as well.
    Especially those "lone ranges" that uses the collateralAI to hit a city, with no chance of taking it down. Im considering turning off collateralAI for all sieges (since I modded range attacks for them, so direct attack is no longer needed).

    Btw Nightinggale, if Chipotle cheat is enabled (which I guess it is for all modders) then Ctrl + z shows the entire map.
     
  4. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,556
    Oh that really works. I really need to figure out precisely what can be done with cheats. I use it so rarely that I keep forgetting about it. Quite likely the main problem is that it is faster to hack a cheat like I just proposed instead of looking up how to cheat.
     
  5. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,556
    Gender:
    Male
    Location:
    Denmark
    Did anyone ever work out a solution for this? It's what bothers me the most atm.
     
  6. Commander Bello

    Commander Bello Say No 2 Net Validations

    Joined:
    Sep 3, 2003
    Messages:
    3,858
    Location:
    near Koblenz, Germany
    All I can say is that I would be much interested in such a feature, too. :)

    A good "escort" functionality would solve many of my problems in modding Colonization.
     

Share This Page