Announcement

Collapse
No announcement yet.

[SDK / AI] We love the coast - city placement tweak for 1.61

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SDK / AI] We love the coast - city placement tweak for 1.61

    Sick of AI's founding cities 1 tile inland?

    There's a bug - or some very bad logic, in the city placement code, which results in coast (ie those 1-0-2) tiles being considered bad tiles - in the same class as tundra. In short, the AI is ignorant of Lighthouses - it literally doesn't know about the lighthouse when it comes to founding cities. There's a bit of a hack in the code which gives a MASSIVE point-boost to coastal cities, the problem is the check for "excessive bad tiles" overrides that - which results in cities which REALLY need to be on the coast, getting founded 1 inland. Oops.


    So I fixed that with a bit of lighthouse awareness, coast is now only considered evil if the city itself isn't coastal.


    Additionally I added some seafood awareness. When founding cities, it's easy to place cities in such a way that seafood is permanently blocked (and the AI delights in doing this). So what I did was add a pretty hefty point boost for seafood, if there is seafood offshore, the AI will try to found a city which uses that seafood.

    Finally I tweaked the way it deals with founding cities on top of resources. The AI feels VERY strongly about founding cities on top of resources, in short the point value of a city on top of a resource is cut by 75%. I've relaxed that restriction a bit - now it's such that founding on top of a resource is considered about the same as losing a resource - now it might found on top of a resource if doing so will bring in an additional seafood.

    As a side effect of these changes the guy who draws the blue circles for settlers is no longer high as a kite (the player-hints system uses the AI code). I'm not saying to trust the blue circles now, but they will be a lot closer to what I'd do.

    Note that the compiled GameCoreDLL includes my bugfix since I can think of no conceivable reason why you'd not want those bugs fixed.

    Files:

    AICoastCities_CvGameCoreDLL
    Place the DLL in your CustomAssets folder or place it in it's own mod folder. This mod will not cause save game incompatability.

    CvPlayerAI
    For the curious or for those making compilations, the CvPlayerAI.cpp file. Changes are restricted to the function int CvPlayerAI::AI_foundValue.

    I'd love any feedback on this. Both if you find it improved, and (oh no!) if you find it worse.
    Last edited by Blake; September 28, 2006, 23:04.

  • #2
    Sounds really good! Perhaps you should indicate if this is for warlords or not.

    The problem is that the game (warlords) wont start for me. It crashes right at the start. I don't even get into the main game menu.

    Comment


    • #3
      Sorry, in the title it says for "1.61". That means it's for CIVanilla only.

      I have no intention of making Warlords AI Tweaks until the patch comes out.

      Comment


      • #4
        This is awesome work, thank you so much for doing it! But I do have a minor recommendation. Could you change the instructions to not have players put it in their customassets directory. Doing that breaks all SDK mods they may try to use.

        Better to have it set as its own mod, and then have the game set to autoload that mod if they always want to use it.

        Comment


        • #5
          I've done so, but bear in mind this is an strictly "Bugfix" type mod, which doesn't change gameplay mechanics in the way a normal mod does.

          ALso I cannot guarantee that it wont interfere with the operation of mods, since my code is tweaked more to the standard game settings. The 1.61 code is quite flexible when it comes to mods and such, my code, less so.

          Comment


          • #6
            Yeah I understand, and I dont expect your change to do anything but make things better. But since the game can only load one CvGameCoreDLL.dll it will load yours instead of the mods if its in CustomAssets and then the mods functions wont seem to work.

            Comment


            • #7
              Just played thru the BC's and what a game it has been so far...15 points is alll there is between 1st and 2nd civ and the choices made by the AI for settling - much better. It does seem the spread real fast


              ok so I will never play above warlord again...gads

              anyone care to test in a PBEM (after my trip in Nov)
              anti steam and proud of it

              CDO ....its OCD in alpha order like it should be

              Comment


              • #8
                My apologies if this is a newbie question, but does this affect starting AI settler placement at all?
                For some the fairest thing on this dark earth is Thermopylae, and Spartan phalaxes low'ring lances to die -- Sappho

                Comment


                • #9
                  i'm sorry, i'm new to modding... do i just put this file in:

                  %UserProfile%\My Documents\Sid Meier's Civilization 4\CustomAssets

                  is there a subfolder it should go in or just here?
                  "Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt." - Sun Tzu

                  Comment

                  Working...
                  X