 |
|  |
 |
|
percuno
|
|
I don't know if this has been discussed before, there's a lot to go through in these forums, so I will just present the idea and see where it goes.
Frequently, when I take over a city and it is interfering with one of my own cities, I will melt it and convert it to a settler, sometimes even a really large city. Sometimes also, I will palce a new city near the edge of another player's territory, and purposely grow it quickly (terraform and max out the food production).
In both of these cases, I can never get my city to 'take over' territory that it should control, due to its growth. I could really use the ability to 'force' a recalculation of either a specific city's area of influence, or the entire map, based on the relative sizes of adjacent cities. Naturally, when next to another player's city, the existing player may possibly gain a 'prior resident' bonus in the recalculation, but in the other case this wouldn't apply at all, and if my city grew to a much larger size it should be able to take some territory over, especially when the third ring of the other player's city is occupying some of my city's first ring.
Maybe even a global recaulculation each turn, or each century after say, the year 1000AD, would be a good idea.
Any comments?
|
|
|  |
 |
|
percuno
|
|
It would take a long time for me to come up with some code, considering that I know absolutely nothing about the source code at this point, but when I get a chance between classes, work, and my fiancee, I'll look into it.
If possible, the event could be made as a simple trigger to recalculate when the city expanded by default, which would make it much simpler than what I described above, but I am not sure whether the code would handle it in a way that would result in what I am looking for. So far, every time a city has expanded, the now-vanished city's AoI stays in place, or the other player's city retains its AoI, even when my city is size 30+ and his is less than 15.
My approach to the idea would be to first set up a new control so that a player could choose when and how AoI recalculation would occur. After that, I'd have to dig into the source code and find out how it's done when a city is first created, and when it reaches the population levels that expand the AoI to the second ring and beyond.
I would make a recalculation that affected a single city, so that the individually triggered mode would be serviced, and then apply it iteratively to address global recalculation, perhaps even recursively with a recursion limit to prevent vacillation. Were I to really get into it deeply, some kind of tracking of map squares and when they last changed "ownership", such that an individual square wouldn't end up sqitching back and forth between players except due to the normal process of city takeover.
|
|
|  |
 |
|
percuno
|
|
As far as I know, I already have the latest, but maybe I am looking in the wrong place. I'll have a look around for something newer.
|
|
|  |
 |
|
percuno
|
|
ok, is that the one I need to compile myself?
Can I lay it overtop an install and still load a saved game, or do I have to start an entirely new one?
What I have currently is the 2004-07-26 Apolyton build from the downloads section, I'm not sure what is included with that, plus a few graphics mods (Apolyton TileFile and Martin Gühman's message icons) and some small changes to the text configuration files, as per my other post at
http://apolyton.net/forums/showthre...082#post3694082
|
|
|  |
 |
|
Maquiladora
|
|
No its already compiled, youll see in the rar. It includes Martins larger msg icons but not the Apolyton tile file.
As far as i know an old save will be compatible.
|
|
|  |
 |
|
percuno
|
|
Tried this out, and while it seems to be overall compatible, there were a few changes that uspet my game in progress, and a lot of really strange problems with the messages.
I don't know if this was because I used a save file from before patching in or not, but I was getting city names in place of messages that my tanks were going veteran, and in place of the message you're supposed to get when you conquer the last city of a nation. Also, I was getting such things as offers to remove troops from my territory, but in [top left corner] status messages, and not in the [bottom left corner] message box, and definitely not in the diplomacy dialog box.
Edit: I forgot to mention that I was also missing all of my earned terraforming icons in the PW box when I applied the patch.(/edit)
Edit2: Also, I was getting many other wierd messages in the message box (bottom right), in place of such ones as "Sillytown has built a zoo. The queue for Sillytown is now empty."(/edit2)
I restored my backup of the directory and am going to reapply the 2005/03/05 patch to a copy and start a new game, when I am done with my current one, as I'd like to see what the changes are, but avoid the strange message problems, if indeed they were caused by an incompatibility with the save file.
Last edited by percuno on 26-03-2005 at 23:23
|
|
|  |
 |
|  |
 |
|
percuno
|
|
I don't use any cheat editor, I am talking about two situations in the normal game.
1.) You snuggle a settler up against the border of another player and settle, then grow it really fast, such as by terraforming your owned territory all to grasslands and building all hydroponic farms, plus setting some population to be farmers, so tha it quickly grows to a higher population than the other player's city.
2.) You snuggle a settler up against the border of another player, then conquer his city and starve it until you can disband the city (size 1-3) into a settler.
On the main map, you can see the border of the AoI (Area of Influence) of your city, and you can also see it in the city manager. I'll paste some screenshots of one of each example once I get home and set them up, I'm at school atm.
Is the string database an actual db file or just a delimited text file? (yeah, I know, subtle difference, but it's good to know ).
|
|
|  |
 |
|
percuno
|
|
Ah, but it's not only the unoccupied AoI holes I want, it's the ones that my city should take over from another city by virtue of growing larger than it.
For instance, if I park my settler next to another civ's city that has a population of 17, and make a new city, and I grow it very fast to say 35, while his city only reaches say 19...I should be able to 'take over' squares that fall in the area of my first ring that are currently in his third ring of tiles, and perhaps even take over tiles that would be in both cities' second ring, if my city gets a lot bigger than his.
Of course, the other example of taking over completely unoccupied tiles, is even more logical.
|
|
|  |
 |
|
Maquiladora
|
|
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.
|
|
|  |
 |
|
percuno
|
|
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.
|
|
|  |
 |
|
Maquiladora
|
|
Well i meant only absorb your own cities, absorbing someone elses cities is just weird.
|
|
|  |
 |
|
percuno
|
|
Ah, like the way Civ3 cities absorb your outposts that come into the AoI of one of your cities?
|
|
|  |
 |
|
Maquiladora
|
|
Kind of, but im thinking more of neighbouring towns that grow so big that they merge to form 1 big city.
|
|
|  |
 |
|
E
|
 |
July 24,2005 Ctp2 Tiles in sig!
May 1999 time: 21:27
|
|
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;
}
|
|
|  |
 |
|
HuangShang
|
 |
USA, SoCal, L.A.
Jul 2002 time: 21:27
|
|
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? 
|
|
|  |
 |
|
percuno
|
|
lecture?
Anyway, trying to work my way through this code when I get a little time now and again, but it's really bad code, reminds me of going through old BASIC listings in BYTE back in the day.
|
|
|  |
 |
|
percuno
|
|
Thanks J
Not much use to me, however.
|
|
|  |
 |
|
wheathin
|
|
quote: 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... |
This is fine - and it's why even if you've got a larger city, you shouldn't be able to absorb your neighbors' territory. Laredo, Texas, is across the Rio Grande from Neuvo Laredo, in Mexico. 40% of US-Mexican trade goes via truck through the city. At night, the population on the US side is 200,000; by day, the population is 750,000. I doubt that the US would simply let the city of Laredo be annexed by its larger Mexican sister. Equally, I don't see Tijuana being annexed to San Diego County ("South Chula Vista?") any time soon, despite shared languages, radio stations, drug traffickers, work forces, pollution, etc...
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.
|
|
|  |
 |
|
percuno
|
|
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".
|
|
|  |
 |
|
wheathin
|
|
quote: 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).
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:27. Apolyton Time is 00:27. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|