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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ben@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: borders patch (PR#1870)
From: "Jason Short" <jshort@xxxxxxxxxxxxxx>
Date: Mon, 9 Jun 2003 15:26:07 -0700
Reply-to: rt@xxxxxxxxxxxxxx

--On Monday, June 09, 2003 08:07:23 -0700 Ben Webb 
<ben@xxxxxxxxxxxxxxxxxxxxxx> wrote:

>
> I've just updated the FreecivAC patch to add borders to Freeciv, at
> http://freecivac.sf.net/ (newborders-20030609.patch). Features:
>
> - Applies to current CVS
> - Incorporates Jason's map coordinate/drawing fixes etc.
> - Full support (iso and non-iso) for GTK+ and GTK2 clients
> - Partial support for XAW client (no display of player colour)
> - Partial non-iso support for other clients that use mapview_common.c
>   for their drawing
>
> See doc/README.borders_patch for more info.

I've only looked at it briefly, and tested it out with gui-gtk...

It looks very good.  Three issues:

1.  The fog-of-war "bug" is still there.  Is this a bug or a feature?  How 
should it be handled?

The server tracks the nationality of each tile, and sends this information 
to the client.  The client uses it to draw the borders, a rather simple 
process.  When a tile's nationality changes (it is taken over by another 
country, or gained or lost by one country), the server sends a tile update 
to every client that can see that tile.  But not if the tile is fogged - it 
is only sent if the tile is known _and_ seen.  This has implications in a 
number of situations - some good, some bad.

For instance if you explore the whole island, then found a new city you 
won't "know" (even though it is obvious) what land you actually control. 
The borders will end up being drawn right on the edge of the fog.  And if 
you explore the fog from an alternate direction you'll see some odd-looking 
behavior (see the attached borders-bug-1.png).

If you disconnect and reconnect you will be sent all information about the 
tiles - so in the above case if you disconnect and reconnect you will 
spontaneously know the entire area you control.

This becomes more complicated when two players are involved.  You aren't 
automatically shown enemy cities when they're founded, so you shouldn't 
automatically be shown enemy borders on fogged territory either.  But in 
this case, you shouldn't know them if you disconnect and reconnect either.

Solving this is not trivial; the problem is similar to the one with 
continent numbering but has more effect on gameplay.  The current method is 
clearly flawed IMO.  But an omniscient POV is not so good either.  The only 
consistent yet fair thing I can imagine is to have server-side PPOV for 
this - so that the server tracks what each player knows about each tile. 
Yet this solution was found to be very complicated for continent numbering. 
I may point out that this problem is likely to crop up elsewhere, and that 
it might be worthwhile to implement server-side PPOV in a general way for 
all player knowledge of tiles.  But I know little about this part of the 
code.

2.  When loading a savegame, an assertion is encountered.  This seems to be 
reproducable - if not I have a savegame.  I haven't looked at it closely.

(gdb) bt
#0  0x401aaf31 in __kill () from /lib/libc.so.6
#1  0x401aabfc in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x401ac3fb in abort () at ../sysdeps/generic/abort.c:88
#3  0x401a4c0e in __assert_fail () at assert.c:59
#4  0x8064347 in update_city_tile_status_map (pcity=0x84bd008, map_x=1,
    map_y=0) at citytools.c:1931
#5  0x8077458 in map_calculate_borders () at maphand.c:1638
#6  0x808cbd2 in game_load (file=0xbffffa18) at savegame.c:2147
#7  0x80536a5 in load_command (caller=0x0,
    arg=0xbffffc17 "/afs/andrew.cmu.edu/usr5/jshort/jason-game.sav.gz")
    at stdinhand.c:3255
#8  0x804f4b3 in srv_main () at srv_main.c:1552
#9  0x804a1c5 in main (argc=3, argv=0xbffffaf4) at civserver.c:154
#10 0x401a49f1 in __libc_start_main (main=0x8049c90 <main>, argc=3,
    argv=0xbffffaf4, init=0x8049568 <_init>, fini=0x80c8c44 <_fini>,
    rtld_fini=0x4000ad64 <_dl_fini>, stack_end=0xbffffaec)
    at ../sysdeps/generic/libc-start.c:92

3.  The code to draw borders in iso view is gui-specific (it is in 
gui-xxx/mapview.c), but it doesn't need to be.  IMO the 
tile_draw_borders_iso() function should go in mapview_common and should 
call a GUI function (draw_line or draw_border) just to draw the line 
itself.  This is similar to what the non-iso code does.

jason

PNG image


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