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

Starting position problem

Discussion in 'Civ4Col - General Discussions' started by dve_podushki, Aug 19, 2017.

  1. dve_podushki

    dve_podushki Chieftain

    Joined:
    Aug 19, 2017
    Messages:
    16
    Gender:
    Male
    Good day. I have met with a strange issue. When I play on a random map of any size, I always start in the south-east corner. So I never start at equator or north east corner on. Does anybody meet with that problem? Is it a bug? Please help me, I'm a bit tired of producing coats. I want to make some rum! :)
     
  2. dalgo

    dalgo Emperor

    Joined:
    Feb 23, 2002
    Messages:
    1,425
    Gender:
    Male
    Location:
    Auckland, New Zealand
    Yes it is a bug. Strangely enough it was introduced with the patch, the original release did have a random start position. However I wouldn't recommend playing without the patch as it fixes many other problems.

    You can of course sail north from your starting position until you find the sugar!
     
    dve_podushki likes this.
  3. dve_podushki

    dve_podushki Chieftain

    Joined:
    Aug 19, 2017
    Messages:
    16
    Gender:
    Male
    Oh, I see. In principle I can change the starting place in editor every time. But I prefer automation. Maybe you know what files I should correct? Or people who knows that?
     
  4. dalgo

    dalgo Emperor

    Joined:
    Feb 23, 2002
    Messages:
    1,425
    Gender:
    Male
    Location:
    Auckland, New Zealand
    I don't know how to do that myself but I'm sure someone can help you.

    However exploring the map is easy enough to do. In my latest game I sailed north four turns before settling. I wasn't looking for sugar though, I wanted some coastal forest for timber for future shipbuilding.
     
  5. dve_podushki

    dve_podushki Chieftain

    Joined:
    Aug 19, 2017
    Messages:
    16
    Gender:
    Male
    A pity. May I write some off-topic? Do you have AoD II mod download link or archive? Original link is broken.
     
  6. dalgo

    dalgo Emperor

    Joined:
    Feb 23, 2002
    Messages:
    1,425
    Gender:
    Male
    Location:
    Auckland, New Zealand
  7. dve_podushki

    dve_podushki Chieftain

    Joined:
    Aug 19, 2017
    Messages:
    16
    Gender:
    Male
    O, yes. Thank you very much for clarification this bug. :thumbsup:
     
  8. M07

    M07 Prince

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    Hello,
    The changes has to be done in a c++ file inside the source code(CvGameCoreDLL). This project has to be compiled into a DLL.
    This DLL has to replaced the file CvGameCoreDLL.dll inside the Assets folder.
    It is a bit complicated if it the first time you do that.

    The file is called CvGame.cpp and the method is called assignStartingPlots.
    Basically, the change is to shuffle players list before assign players to their starting location (see shuffleSequence)

    I described the code that I have in my mod.
    Spoiler DoaNE source code :

    Code:
    void CvGame::assignStartingPlots()
    
    {
        PROFILE_FUNC();
    
        CvPlot* pPlot;
        CvPlot* pBestPlot;
        bool bValid;
        int iValue;
        int iBestValue;
        int iI, iJ, iK;
    
        std::vector<int> aiShuffledPlayers(MAX_PLAYERS);
        getSorenRand().shuffleSequence(aiShuffledPlayers, "Team starting plot");
    
        for (iI = 0; iI < MAX_PLAYERS; iI++)
        {
            PlayerTypes ePlayer = (PlayerTypes) aiShuffledPlayers[iI];
            CvPlayer& kPlayer = GET_PLAYER(ePlayer);
            if (kPlayer.isAlive())
            {
                if (kPlayer.getStartingPlot() == NULL)
                {
                    iBestValue = 0;
                    pBestPlot = NULL;
    
                    for (iJ = 0; iJ < GC.getMapINLINE().numPlotsINLINE(); iJ++)
                    {
                        gDLL->callUpdater();    // allow window updates during launch
    
                        pPlot = GC.getMapINLINE().plotByIndexINLINE(iJ);
    
                        if (pPlot->isStartingPlot())
                        {
                            bValid = true;
    
                            for (iK = 0; iK < MAX_PLAYERS; iK++)
                            {
                                if (GET_PLAYER((PlayerTypes)iK).isAlive())
                                {
                                    if (GET_PLAYER((PlayerTypes)iK).getStartingPlot() == pPlot)
                                    {
                                        bValid = false;
                                        break;
                                    }
                                }
                            }
    
                            if (bValid)
                            {
                                iValue = (1 + getSorenRandNum(1000, "Starting Plot"));
    
                                if (iValue > iBestValue)
                                {
                                    iBestValue = iValue;
                                    pBestPlot = pPlot;
                                }
                            }
                        }
                    }
    
                    if (pBestPlot != NULL)
                    {
                        kPlayer.setStartingPlot(pBestPlot, true);
                    }
                }
            }
        }
    
        if (gDLL->getPythonIFace()->pythonAssignStartingPlots() && !gDLL->getPythonIFace()->pythonUsingDefaultImpl())
        {
            return; // Python override
        }
    
    
        bool bDone = false;
        for (int iPass = 0; iPass < 2 * MAX_PLAYERS && !bDone; iPass++)
        {
            std::vector<int> aiShuffledTeams(MAX_TEAMS);
            getSorenRand().shuffleSequence(aiShuffledTeams, "Team starting plot");
    
            for (iI = 0; iI < MAX_TEAMS; ++iI)
            {
                TeamTypes eTeam = (TeamTypes) aiShuffledTeams[iI];
                CvTeam& kTeam = GET_TEAM(eTeam);
                if (kTeam.isAlive())
                {
                    for (iJ = 0; iJ < MAX_PLAYERS; ++iJ)
                    {
                        CvPlayer& kPlayer = GET_PLAYER((PlayerTypes)iJ);
                        if (kPlayer.isAlive() && kPlayer.getTeam() == eTeam)
                        {
                            if (kPlayer.getStartingPlot() == NULL)
                            {
                                CvPlot* pStartingPlot = kPlayer.findStartingPlot(false);
                                if (NULL != pStartingPlot)
                                {
                                    kPlayer.setStartingPlot(pStartingPlot, true);
                                }
                                break;
                            }
                        }
                    }
                }
            }
    
            //check all players have starting plots
            bDone = true;
            for (iJ = 0; iJ < MAX_PLAYERS; iJ++)
            {
                if (GET_PLAYER((PlayerTypes)iJ).isAlive() && GET_PLAYER((PlayerTypes)iJ).getStartingPlot() == NULL)
                {
                    bDone = false;
                }
            }
        }
    
        FAssertMsg(bDone, "Player has no starting plot");
    }



    A lot of mods fixed that issue, I suggest you to play one of them.
    Good game ;)
     
    dve_podushki likes this.
  9. dve_podushki

    dve_podushki Chieftain

    Joined:
    Aug 19, 2017
    Messages:
    16
    Gender:
    Male
    Great! Now I fully understand where is the problem. Thank you very much. I' ll think what I will do, cause I have recently found the Snoopy/Dale PatchMod, but download link doesn't work.
     
  10. devolution

    devolution Prince

    Joined:
    Oct 7, 2016
    Messages:
    383
    Gender:
    Male
    Location:
    Stavanger, Norway
    @dve_podushki I recommend that you play either "Religion and Revolution" or DoaNE if you want the best possible colonization experience. These are the only colonization mods that are still being updated with new features (while still remaining faithful to the original gameplay) They also have far fewer bugs than vanilla :D
     
  11. dve_podushki

    dve_podushki Chieftain

    Joined:
    Aug 19, 2017
    Messages:
    16
    Gender:
    Male
    @devolution Yes, they are good indeed. But I also like vanilla version because it is very simple and has fewer features :mischief:
     
  12. M07

    M07 Prince

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    In the vanilla version, i was crying when my soldiers were dying against colonists, farmers or pioneers. :cry:
    I never played this version after, it is too simplistic for me :)
     

Share This Page