Why does the game have so many citysize.txt files with the same stuff in it?
Announcement
Collapse
No announcement yet.
citysize.txt why are there five?
Collapse
X
-
Tags: None
-
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?
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.
-MartinCiv2 military advisor: "No complaints, Sir!"
-
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.
Comment
-
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.
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.
Comment
-
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.
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.
Comment
-
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.
Comment
-
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!
Comment
Comment