Announcement

Collapse
No announcement yet.

citysize.txt why are there five?

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

  • citysize.txt why are there five?

    Why does the game have so many citysize.txt files with the same stuff in it?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    Re: citysize.txt why are there five?

    Originally posted by E
    Why does the game have so many citysize.txt files with the same stuff in it?
    For each level of difficuilty one. Actually, this is a stupid design. This means whenever you change the level of difficuilty you have to relaod the CitySizeDB.

    There are more elegant ways you could come up with, for instance with modifiers in DiffDB. Unfortunately Activision left this file untouched, and added their new CitySizeDB.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • #3
      ug, that is a bad design. Well I did poke around where citySizeDB is used and I think I might of found a way to check if city has a building that increased the squared radius and if that building is there then it would increase the radius. But the building is only effective IF its bigger than the citysizeDB

      The intent behind this is thepossibility of introducing culture borders like civ3.

      OR something better I think, in this case it based on 'communication' improvements like post office and phones etc where an influence increases by communication.

      The nice option to this is that you can actually have larger cities like New York but only in a small square but a huge population because its importing food (my other code) or has improvements.
      Formerly known as "E" on Apolyton

      See me at Civfanatics.com

      Comment


      • #4
        Originally posted by E
        ug, that is a bad design. Well I did poke around where citySizeDB is used and I think I might of found a way to check if city has a building that increased the squared radius and if that building is there then it would increase the radius. But the building is only effective IF its bigger than the citysizeDB

        The intent behind this is thepossibility of introducing culture borders like civ3.

        OR something better I think, in this case it based on 'communication' improvements like post office and phones etc where an influence increases by communication.
        thats an incredibly great idea...

        Originally posted by E
        The nice option to this is that you can actually have larger cities like New York but only in a small square but a huge population because its importing food (my other code) or has improvements.
        but i got lost right here. is this talking about the same thing?

        Comment


        • #5
          Originally posted by HuangShang


          thats an incredibly great idea...


          Originally posted by E
          The nice option to this is that you can actually have larger cities like New York but only in a small square but a huge population because its importing food (my other code) or has improvements.
          but i got lost right here. is this talking about the same thing?
          kind of. I am thinking its possible to have a city with a huge population but only have a 2 square radius because we can make improvements that have food bonuses or by importing food goods that increase food growth (that was a new code I did).

          One of the main reason I want to do this is that on an earth map Europe should have small borders but a huge population.
          Formerly known as "E" on Apolyton

          See me at Civfanatics.com

          Comment


          • #6
            wasnt the other part about improvements that can increase city radius, i like both ideas alot anyway

            Comment


            • #7
              The radius is a little more involved than I thought, it affects three source code files I see:

              CityInfluenceIterator
              Unitutil
              citydata

              I havent figure out how the expand borders works because I found generate and expand but they arent called in the cityevent file I think they are just initialized in citydata which makes it a pain so it may be awhile before i get anywhere on this.
              Formerly known as "E" on Apolyton

              See me at Civfanatics.com

              Comment


              • #8
                Good News!

                Code:
                void CityData::AddImprovement(sint32 type)
                {
                
                	MapPoint m_point(m_home_city.RetPos());
                	const BuildingRecord *rec = g_theBuildingDB->Get(type);
                
                	SetImprovements(m_built_improvements | ((uint64)1 << (uint64)type));
                	IndicateImprovementBuilt();
                	g_player[m_owner]->RegisterCreateBuilding(m_home_city, type);
                
                	if (buildingutil_GetDesignatesCapitol((uint64)1 << (uint64)type)) {
                		g_player[m_owner]->SetCapitol(m_home_city); 
                		g_player[m_owner]->RegisterNewCapitolBuilding(m_home_city);
                	}
                
                	sint32 intRad;
                    	sint32 sqRad;
                	//if (buildingutil_GetIncreasesBorders((uint64)1 << (uint64)type)) {
                	//	if (rec->GetIntBorderRadius(intRad) && rec->GetSquaredBorderRadius(sqRad))
                	//	GenerateBorders(m_point, m_owner, intRad, sqRad);
                	//}
                	//EMOD hopefully it increases radius
                	if (rec->GetIntBorderRadius(intRad) && rec->GetSquaredBorderRadius(sqRad)) {
                		GenerateBorders(m_point, m_owner, intRad, sqRad);
                	}
                	//EMOD hopefully it increases radius
                
                	buildingutil_GetDefendersBonus(GetEffectiveBuildings(), m_defensiveBonus);
                
                }

                In a spur of the moment i tried this and NOW we have buildings that create bigger borders. I have a few other things to add but this works!
                Formerly known as "E" on Apolyton

                See me at Civfanatics.com

                Comment

                Working...
                X