Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#1870) FreecivAC: borders patch
Home

[Freeciv-Dev] Re: (PR#1870) FreecivAC: borders patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ben@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#1870) FreecivAC: borders patch
From: "Rafa³ Bursig" <bursig@xxxxxxxxx>
Date: Thu, 3 Jul 2003 17:29:16 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Dnia 2003.07.03 16:25, Ben Webb napisaÅ?(a):
> On Thu, Jul 03, 2003 at 06:56:21AM -0700, Rafa� Bursig wrote:
> > Dnia 2003.07.03 14:54, Ben Webb napisaÅ?(a):
> > > I've not played CivIII, so don't know how culture works.
> > > If it's just a simple function of the city size, it could probably
> 
> > > more easily just be calculated each time.
> > >
> > Basicaly culture power of city is border range of this city. In this
> 
> > case each city have different border size.
> 
> Yes, I understand that, but how is the border range determined? Is it
> a function of the population of the city, how old the city is, any
> special buildings you have, etc.?
> 

Current you hard coded only founded turn.

> > > Not true: you are only prohibited from working in enemy 
> territory. Anybody can work neutral tiles.

> > And this is wrong your workers should work only on your territory.
> >
> > Allowing work on neutral is only hack becouse many times borders
> don't claim city ocean tiles.
> 
> Fishing fleets and oil rigs frequently operate in international
> waters, as I understand it. For example, the UK claims territorial 
> waters 12 nautical miles from its coasts (3 miles before 1987). There 
> are many oil and gas installations in the North Sea well outside this 
> limit, and even an old World War II air defence tower on a sandbank 7 
> miles out from the Thames estuary, which claims to be an independent 
> state (see http://www.sealandgov.com/ and http://www.havenco.com/).
> 
This is all about "deep" ocean action but city don't have acces to 
neutral area only for own or enemy tiles (if enemy city is close).

If you build coast city you get acces to 2 lines of ocean tiles and 
currect code (in best case) give ownership only for one line of tiles.
Normaly borders end on coast and those 2 lines of tiles will be outside 
your territory and this is plain wrong becouse city can access to those 
tiles.

you fix it by allowing work on neutral tiles but this is hack which 
IMHO is wrong way.

> > But city ocean tiles are outside borders and this is wrong becouse
> > it is you territory.
> 
> In the case of an enemy city located close to your own, many tiles
> within your city radius will also not be in your territory.
> 
And you wont be able work here. You should work only on yours terrains.
If there is conflict between to close city then size/how old/culture/
effects/etc will define numbers own tiles.

> > > > Another problem that you have with continent/land limit are
> ocean
> > > lakes and dettection it (in this case IMHO current code is poor).
> > > This has been discussed already - Ross's solution seems the most
> > > sensible to me. Your screenshots merely demonstrate the same
> > > behaviour that Christian and Per have already commented on.
> > but you still must make those checks
> 
> Yes, but this is a more general problem (e.g. the AI building naval
> units on 1x1 lakes).
This is not map problem only AI. Boders are map functionality.

> > > Are you suggesting that land cities should claim territory on
> > > different continents, if they are close enough? The current code
> > > doesn't do this.
> > Are you sure look to attach !
> 
> I can't tell from the attachment whether that's a different 
> continent. Borders do suffer from a "Gibraltar" effect as mentioned 
> in the README, but that's because we use map distance rather than 
> unit travel time to determine the border radii.
> 
I check it and this player is on other continet.

> > What is wrong when border will claim other continent ?
> 
> It's all about the level of simulation. Ideally, you wouldn't be able
> to work ocean tiles until you knew how to build ships, and borders 
> would be determined not only by the location of cities, but by the 
> presence of military units, fortresses, etc. But that would add 
> complexity, so we must compromise.
> 
Sorry but such level of simulation isn't implemented in game.
Current you can work on all "free" tile belong to city range/map/work 
area/etc, no matter that this is land, ocean or other continent.

> > What is when coast city can work on other continent ?, Those tiles
> > aren't yours ?
> 
> Those are neutral tiles. Same point as above.
As I say above city NEVER get access to neutral terrains only to own or 
enemy. Tiles that you call "neutral" and belong to city aren't neutral.
For me "Neutral" tiles are tiles placed outside your cities : work 
area, border range. And don't belong to other player.
Allowing work on so called "neutral" tiles is only workaroud and hide 
IMHO wrong implementation way.

> > What about ocean city that was build near land you made different
> code for that or simple lands terrains wont be yours ?
> 
> If you mean - what happens if you join two continents by transforming
> ocean to land? - then borders are recalculated in this case. I'm also
> assuming that by "ocean city" you mean a coastal city. The borders
> code also supports cities physically located in the sea, which are 
> possible in SMAC and in FreecivAC.
> 
I think about cities physically located in the sea.

> > Simple rule that you own all terrains in border range will reduce
> may problems , save resources and IMHO is easy to implement.
> 
> It's very easy to patch server/maphand.c to do this - be my guest. ;)
If there have to be limit territory to land please add support for 
claiming city area tiles (with oceans and other continents). And this 
can be make in this way :

/* for better changes flexibility */
static bool is_first_city_more_importand(struct city *pc1, struct city 
*pc2)
{
   return pc1 && (!pc2 || (pc1->turn_founded < pc2->turn_founded);
}

static struct city *map_get_adjc_city(int x, int y)
{
   struct city *closest = NULL;   /* Closest city */
   struct tile *ptile;

   ptile = map_get_tile(x, y);
   if (ptile->city) {
     return ptile->city;
   }

   /* search in city work area */

   adjc_iterate(x, y, xp, yp) {
     ptile = map_get_tile(xp, yp);
     if(is_first_city_more_importand(ptile->city, closest)) {
       closest = ptile->city;
     }
   } adjc_iterate_end;

   if(!closest) {
     square_iterate(x, y, 2, xp, yp) {
       if(xp == x - 2 || xp == x + 2
          yp == y - 2 || yp == y + 2) {
         ptile = map_get_tile(xp, yp);
         if(is_first_city_more_importand(ptile->city, closest)) {
           closest = ptile->city;
         }
       }
     } square_iterate_end;
   }

   return closest;
}

This fix city area problems but not coast problems (ocean near your 
land should be in your territory)

Rafal




[Prev in Thread] Current Thread [Next in Thread]