Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [Patch] Watchtower version 2
Home

[Freeciv-Dev] Re: [Patch] Watchtower version 2

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Patch] Watchtower version 2
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Mon, 27 Aug 2001 15:16:48 +0100 (BST)

 --- Bert Buchholz <bertbuchholz@xxxxxx> wrote: 
> Okay, here the second version of my watchtower patch, I hope I included
> everything that was discussed so far, but after all, I'm just a German.
> ;-)

What do you mean "just a German"?

Anyway, the patch is much better but not there yet.

Problems:
1. Upgrading part is not handled correctly.
2. Do freetext search for vision_range.  Most hits are irrelevant but
some are useful, e.g. waking up sentried units when enemy appears in the
range.
3. In
  +  /* Enhace vision if unit steps into a fortress, only if its a
  +     groundunit */
the bit about groundunit is redundant ;)


> - A unit gets killed inside a fortress (vr reduced)
make sure "gets disbanded" is handled in the "gets killed" case (I think
it does)

> I'm unfogging the necessary tiles, but there's another piece of code
> I'm not sure of:
> 
>     {
>       int range = get_unit_type(punit->type)->vision_range;
>       square_iterate(punit->x, punit->y, range, x1, y1) {
>         map_set_known(x1, y1, plr);
>       } square_iterate_end;
>     }

I think it is redundant (from the time there was not fog of war) because
the unfog_area call which follows sets the known flags anyway.  But there
might be a reason for it to be as it is.  I am currently experimenting
with it.  I suggest you update it to hadle vision enhancements, add a
comment saying "it is probably redundant" and maybe ask Thue (he made fog
of war) about it.

> Another issue: Having in mind this change of visionrange-"calculation"
> to a somewhat more fine grained version, it might be useful to replace
> every 
> 
> unfog_area(unit_owner(punit), punit->x, punit->y,
>                get_unit_type(punit->type)->vision_range);
> 
> with something like
> 
> unfog_area(unit_owner(punit), punit->x, punit->y,
>                get_vision_range(punit));
>                ^^^^^^^^^^^^^^^^^^^^^^^

I think this is how the things should be done.
Unfortunately you will also need to pass coordinates x,y to
get_vision_range, not just get them from punit.

Best,
G.

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie


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