Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2003:
[Freeciv-Dev] Re: (PR#2581) Layers Patch

[Freeciv-Dev] Re: (PR#2581) Layers Patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Juhani Heino <juhani.heino@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2581) Layers Patch
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Fri, 23 May 2003 13:09:27 +0200

On Thu, May 22, 2003 at 03:35:20PM +0300, Juhani Heino wrote:
> Sorry if this mail seems odd - I hadn't subscribed to
> freeciv-dev  yet so I took it from the archives. So
> probably the threading won't work.
> > I didn't understand the need for the layer weights.
> > The layers discussed earlier gave sharp distinctions between the 
> > different layers. I like this since it makes the game rules 
> > predictable. First you attack your own layer, then you attack
> > the other layer. Only two layers are needed at this point:
> > 'ground' and 'air'. Sea units are 'ground'.
> They were not weights, but priorities given - only the units
> at the highest priority are compared otherwise. So this is meant
> to be totally predictable (if you know what units there are).
> And Sea units can't be 'ground' because ground units can't
> attack them. layer_priority() was made to be as general
> as possible.
> One afterthought - I commented that you can remove the
> strafing possibility by changing the fighter value to 15.
> But that would mean we should add a function is_cargo()
> to see if defending aircraft is in air or on carrier.
> Actually the function would be more general and apply
> to ground units too.
> Besides, I like the idea of strafing   8-)

I think that the ideal solution would be that each unit have a
different attack power for each layer. An attack power of 0 means the
unit can't attack this layer. So this means that for example that a
bomber could also attack another air-plane but with a very weak
attack. I'm not sure if we get this at some point in freeciv.

I'm not sure what layer_priority tries to solve. The case where 0 is
returned should be handled by can_unit_attack_unit_at_tile. The case
for F_AEGIS should be handled by get_defender. Also it should test
punit->transported_by so that you can't attack planes which are on a
carrier. If you want strafing the planes should loose HPs if the
carrier looses HPs.


 email: rf13@xxxxxxxxxxxxxxxxx
 "If at first you don't succeed... well so much for skydiving."

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