I think you are getting into civ3 culture's area. In civ3 as cities expanded the game would evaluate who had a higher culturally sore and then determine who should own a contested square.
Announcement
Collapse
No announcement yet.
Area of Influence
Collapse
X
-
-
I like the idea of that though percuno. If the collection border of a city pushes so far it goes over another city's center-tile it absorbs that city's population and creates suburbs or something.Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Comment
-
hmm, that would go a bit farther than I intended, I don't want to take it to the point of taking over the other person's city like in Civ3. Although it is a nice way to avoid open warfare, it would change the spirit of the game, whereas I just want to make something that seems to me to be not completely kosher, into something that grok's well with the spirit of the game.
I'm trying to set up an example I can screen cap, but it's not oing well, guess I should have kept the game(s) in which they occurred originally, or SSed them when they were available.
Comment
-
Well i meant only absorb your own cities, absorbing someone elses cities is just weird.Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Comment
-
Kind of, but im thinking more of neighbouring towns that grow so big that they merge to form 1 big city.Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
CtP2 AE Wiki & Modding Reference
One way to compile the CtP2 Source Code.
Comment
-
besides just debating it, you may want to start here in the code:
Code:cityInfluenceIterator.cpp bool ExpandInfluence(Unit &city, const MapPoint ¢erPos, MapPoint curPos, const CitySizeRecord *rec); #if defined(ACTIVISION_ORIGINAL) void GenerateCityInfluence(const MapPoint &cpos, sint32 size) { MapPoint cur, wrappedCur; sint16 row = 0; const CitySizeRecord *rec = g_theCitySizeDB->Get(size); sint16 intRadius = (sint16)rec->GetIntRadius(); Assert(g_theWorld->GetCell(cpos)->HasCity()); Unit city = g_theWorld->GetCell(cpos)->GetCity(); while(row <= (2 * intRadius)) { sint32 i; cur.x = cpos.x - intRadius; cur.y = cpos.y + row; for(i = 0; i <= 2 * intRadius; i++) { if(WrapPoint(cpos, cur, wrappedCur)) { g_theWorld->GetCell(wrappedCur)->SetScratch(0); } cur.x++; cur.y--; } row++; } g_theWorld->GetCell(cpos)->SetScratch(1); if(cpos.GetNeighborPosition(NORTHEAST, cur)) ExpandInfluence(city, cpos, cur, rec); if(cpos.GetNeighborPosition(SOUTHEAST, cur)) ExpandInfluence(city, cpos, cur, rec); if(cpos.GetNeighborPosition(SOUTHWEST, cur)) ExpandInfluence(city, cpos, cur, rec); if(cpos.GetNeighborPosition(NORTHWEST, cur)) ExpandInfluence(city, cpos, cur, rec); if(g_tiledMap) g_tiledMap->RedrawTile(&cpos); } #else //---------------------------------------------------------------------------- // // Name : GenerateCityInfluence // // Description: - // // Parameters : cpos : location of city // size : size of city // // Globals : g_theWorld // g_tiledMap // g_theCitySizeDB // // Returns : - // // Remark(s) : - // //---------------------------------------------------------------------------- void GenerateCityInfluence(const MapPoint &cpos, sint32 size) { Assert(g_theWorld->GetCell(cpos)->HasCity()); Unit city = g_theWorld->GetCell(cpos)->GetCity(); CitySizeRecord const * rec = g_theCitySizeDB->Get(size); sint32 const intRadius = rec->GetIntRadius(); ClearScratch(cpos, size); g_theWorld->GetCell(cpos)->SetScratch(1); MapPoint cur; if(cpos.GetNeighborPosition(NORTHEAST, cur)) ExpandInfluence(city, cpos, cur, rec); if(cpos.GetNeighborPosition(SOUTHEAST, cur)) ExpandInfluence(city, cpos, cur, rec); if(cpos.GetNeighborPosition(SOUTHWEST, cur)) ExpandInfluence(city, cpos, cur, rec); if(cpos.GetNeighborPosition(NORTHWEST, cur)) ExpandInfluence(city, cpos, cur, rec); if(g_tiledMap) g_tiledMap->RedrawTile(&cpos); } #endif bool ExpandInfluence(Unit &city, const MapPoint ¢erPos, MapPoint curPos, const CitySizeRecord *rec) { Cell *cell = g_theWorld->GetCell(curPos); if(cell->GetScratch() != 0) return false; if(cell->GetCityOwner().m_id != 0 && cell->GetCityOwner().m_id != city.m_id) return false; if(UnitData::GetDistance(centerPos, curPos, 0) > rec->GetSquaredRadius()) return false; cell->SetCityOwner(city); sint32 newOwner = -1; if (city.m_id == 0x0) cell->SetOwner(-1); else { cell->SetOwner(city.GetOwner()); newOwner = city.GetOwner(); } cell->SetScratch(1); if(newOwner >= 0) { g_network.Block(newOwner); g_network.Enqueue(cell, curPos.x, curPos.y); g_network.Unblock(newOwner); } MapPoint nextPos; bool redrawMe = false; if(curPos.GetNeighborPosition(NORTHEAST, nextPos)) if(!ExpandInfluence(city, centerPos, nextPos, rec)) { redrawMe = true; } if(curPos.GetNeighborPosition(SOUTHEAST, nextPos)) if(!ExpandInfluence(city, centerPos, nextPos, rec)) { redrawMe = true; } if(curPos.GetNeighborPosition(SOUTHWEST, nextPos)) if(!ExpandInfluence(city, centerPos, nextPos, rec)) { redrawMe = true; } if(curPos.GetNeighborPosition(NORTHWEST, nextPos)) if(!ExpandInfluence(city, centerPos, nextPos, rec)) { redrawMe = true; } if(redrawMe && g_tiledMap) { g_tiledMap->RedrawTile(&curPos); } return true; } bool ExpandBorders(const MapPoint ¢er, MapPoint curPos, sint32 player, sint32 squaredRadius); void GenerateBorders(const MapPoint &cpos, sint32 player, sint32 intRadius, sint32 squaredRadius) { #if defined(ACTIVISION_ORIGINAL) MapPoint cur, wrappedCur; sint16 row = 0; sint16 intRad = (sint16) intRadius; while(row <= (2 * intRad)) { sint32 i; cur.x = cpos.x - intRad; cur.y = cpos.y + row; for(i = 0; i <= 2 * intRad; i++) { if(WrapPoint(cpos, cur, wrappedCur)) { g_theWorld->GetCell(wrappedCur)->SetScratch(0); } cur.x++; cur.y--; } row++; } #else ClearScratch(cpos, intRadius); MapPoint cur; #endif Cell *cell = g_theWorld->GetCell(cpos); cell->SetOwner(player); cell->SetScratch(1); g_network.Block(player); g_network.Enqueue(cell, cpos.x, cpos.y); g_network.Unblock(player); if(cpos.GetNeighborPosition(NORTHEAST, cur)) ExpandBorders(cpos, cur, player, squaredRadius); if(cpos.GetNeighborPosition(SOUTHEAST, cur)) ExpandBorders(cpos, cur, player, squaredRadius); if(cpos.GetNeighborPosition(SOUTHWEST, cur)) ExpandBorders(cpos, cur, player, squaredRadius); if(cpos.GetNeighborPosition(NORTHWEST, cur)) ExpandBorders(cpos, cur, player, squaredRadius); g_tiledMap->RedrawTile(&cpos); } bool ExpandBorders(const MapPoint ¢er, MapPoint curPos, sint32 player, sint32 squaredRadius) { Cell *cell = g_theWorld->GetCell(curPos); if(cell->GetScratch() != 0) return false; cell->SetScratch(1); if(cell->GetOwner() >= 0 && cell->GetOwner() != player) return false; if(UnitData::GetDistance(center, curPos, 0) > squaredRadius) return false; cell->SetOwner(player); if(player >= 0) g_network.Block(player); g_network.Enqueue(cell, curPos.x, curPos.y); if(player >= 0) g_network.Unblock(player); MapPoint nextPos; bool redrawMe = false; if(curPos.GetNeighborPosition(NORTHEAST, nextPos)) if(!ExpandBorders(center, nextPos, player, squaredRadius)) { redrawMe = true; } if(curPos.GetNeighborPosition(SOUTHEAST, nextPos)) if(!ExpandBorders(center, nextPos, player, squaredRadius)) { redrawMe = true; } if(curPos.GetNeighborPosition(SOUTHWEST, nextPos)) if(!ExpandBorders(center, nextPos, player, squaredRadius)) { redrawMe = true; } if(curPos.GetNeighborPosition(NORTHWEST, nextPos)) if(!ExpandBorders(center, nextPos, player, squaredRadius)) { redrawMe = true; } if(redrawMe) { g_tiledMap->RedrawTile(&curPos); } return true; }
Comment
-
yea, absorbing internation cities will make neighbors in constant warfare because they take over your cities, you get mad, and then try to take their city... and then the armies come in...
but wait, what about that other thing you said, when a city runs into another one, it grows the OTHER way?
i like that, so when all owned tiles have ...uh...one workers?... the city can add all empty spaces in the next ring, but of course, there wont be as much resourses b/c the further you get the more pop you need for ...one worker?
E, what does that code means?
Comment
-
HS,
the code explains (kind of) how cities expand. But its not an event that links growth to the expansion of the radius (as I can tell). I posted for a start if you guys REALLY want to get into and do some coding. Realy I knew very little and though I'm still am an amateur I'm able to understand atleast 50-75% of the above just by practicing these past weeks and with Martin's generous help. (I recommend starting with his lecture and then follow some ofmy code attempts to learn whats going on and then possibly try a piece of code)
Comment
-
yea, absorbing internation cities will make neighbors in constant warfare because they take over your cities, you get mad, and then try to take their city... and then the armies come in...
I think that if you want the land, you need to go and take it with your military. Once it's yours, THEN you should be able to 'recalculate influences' as if you were re-drawing your own internal provincial boundaries.
Comment
-
The point is that I wasn't originally talking about annexing a neighbouring city. I was talking about a city whose first ring was partly occupied by another player's third ring. There have been many instances in history where territory was transferred between nations, and not always due to war. Just look at the Louisianna [sp] Purchase as a primary example of one culture basically "stealing" a huge amount of land from another, simply because the other culture "didn't know what they had".
Comment
-
There have been many instances in history where territory was transferred between nations, and not always due to war. Just look at the Louisianna [sp] Purchase as a primary example of one culture basically "stealing" a huge amount of land from another, simply because the other culture "didn't know what they had".
Transfers are either consensual, or they are not. Expanding your city at the expense of the AI isn't consensual. If a large AI city were next to your territory, would you EVER click "yes" if a pop-up asked, "The foreign city of Teotihuacan requires additional room to grow. Shall we cede land from our city of Sparta to them? " Of course not... My point about the US-Mexican border was that any such "expansion", without permission, would be an "invasion" - an act of war.
I don't understand your Louisiana Purchase analogy.
The USA bought the land from the French. Napoleon was eager to sell, because he needed money to finance his wars in Europe and the British blockade had made the vast North American wilderness essentially worthless. Note that, in comparison, the French kept their far more valuable sugar colonies in the Carribean and South America (Haiti, French Guiana, etc.) The US was an almost unwilling buyer - Jefferson had second thoughts about the purchase because he was unsure of its constitutionality, and because he was unsure what such a huge new territory would do to his ideal nation of enlightened, independent, close-knit yeoman small farmers.
So both parties were willing, and the land was sold. No "stealing" there at all. And both certainly knew "what they had."
Now, if you're referring to the Native Americans -- who had far better title to the land than the French -- they were already at the wrong end of the musket. They were powerless to prevent the transaction, but to suggest that "they didn't know what they had" is absurd. And the US quickly moved to occupy the new land with military forces: first peaceably, with Lewis and Clark's expedition in 1804, and then more forcefully when the land was opened for white expropriation and forced resettlement (the Trail of Tears).
Comment
Comment