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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: raahul_da_man@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2581) Layers proposal redux
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sat, 24 May 2003 02:46:30 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sat, 24 May 2003, Raimar Falke wrote:
> >- You cannot attack a tile which contains any not-at-war units or a
> > not-at-war city. (Treaty sanity rule.)
>
> Seems unrelated.

If we didn't put this in here, we'd have to consider what-if for
not-at-war units in all other points.

We can add this rule before layers, though. It stands on its own.

> > New killstack rules:
> >- If you kill any unit on target tile, all units in the same layer on
> > that tile are destroyed. Units in other layers are unaffected.
>
> >- Exception: Cities, airbases and fortresses. As before.
>
> You can remove this if you move
>
>  - Cities, airbases and fortresses flatten layers, and all units in them
>  are treated as being in a single layer.
> above.

Those are different rules entirely. They are treated as single layer for
target selection, but there is no killstack at all in cities, airbases
and fortresses.

> >- Otherwise, a unit always attacks a unit in the highest layer where it
> > can find a unit that it can attack.
>
> No. My plan still stands that there will at some point different
> attack power for different layers. This would mean that an
> sub-hunter-plane will attack the ship with its weak bombs instead of
> using the very dangerous water-bombs for the subs.
>
> The rule should be similar to the defender: you attack the layer which
> is "best" for you. We still have to define what "best" here means but
> in the above case it should be the subs.
>
> So if the attack is allowed the server does this:
>  if enemy in own layer:
>   attacked layer = own layer
>  else:
>   attacked layer = choose best layer to attack
>  choose best defender in the attacked layer
> do the combat

I agree my rule is not attacker-optimal, but it has the advantage of being
simple and predictable. Also should this rule really be attacker-optimal?
When picking a defender, this is done defender-optimally, why should
picking a layer be attacker-optimal? We may just as well assume the
defender engages the attacker from his layer as assume the attacker
engages the defender from his.

You haven't described an algorithm for choosing 'best layer'. I think this
is a rather hard problem. You'll need to calculate the danger and worth of
particular units, which is a calculation that is very hard to do locally.

Maybe if you look only at build cost and risk to attacker of losing when
attacking, you could get a local calculation that works, but you will find
that the target selection will often not make sense in practice. Why
didn't we bomb that A12 D1 BC40 SAM unit that will shoot us down next turn
instead of blasting that A0 D1 BC50 surveillance satellite? - My rule
would give the same result but it would be understandable since it makes
no pretense of trying to make any attacker-optimal target selection.

> > Misc:
> >- Cargo transported by a transporter which resides in a different layer
> > are unaffected if their transporter is killed, so they should be
> > un-sentried. We assume that they scramble into their own layer when
> > attacked. At the moment, this only applies to carriers and air units.
>
> If we have an carry-all plane with two armors the armors should
> die. Same for ships with land-units. Only planes on a ship surrive.

Good point. I think we agree on the result. I am not sure how to rephrase
the above to work for carry-alls, but that is not very important, since
the code does not support them in any case, and it is non-trivial to add.

> > (If we want to extend this at a later date to cover
> > which-unit-can-attack-which-unit, then these points apply:
> >- By default, units can attack their own layer and only that.
> >- You still must be able to move into (in principle) a tile in order to
> > be able to attack a unit there.
> >- Unit effects can specify additional attack properties, such as ability
> > to attack other layers, additional defense power against attacks from
> > specified layer, additional attack power when attacking a specified layer,
> > etc.)
>
> > I think that should cover everything. Comments?
>
> I still think that we should give each unit a different attack power
> for each target layer. This way we can for example remove the aegis
> special case. And we can add a ship-buster plane. Or an anti-aircraft
> ground unit.

Can we do this as suggested above: Later, and using unit effects?

If not, do you have a concrete suggestion of when and how it might be
implemented?

  - Per




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