Starting position problem

dve_podushki

Chieftain
Joined
Aug 19, 2017
Messages
17
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! :)
 
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!
 
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?
 
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.
 
A pity. May I write some off-topic? Do you have AoD II mod download link or archive? Original link is broken.
 
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 ;)
 
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.
 
@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
 
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 :)
 
Back
Top Bottom