Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: Some ideas
Home

[Freeciv-Dev] Re: Some ideas

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv dev list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Some ideas
From: Robert Rendell <rob@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 May 2000 14:39:20 +1000 (EST)

Tomasz Wegrzanowski wrote:
} 
} 5.
} Make an option (global or per-unit) to decrese attack power
} of navy when attacking land unit.

There are actually a number of "special combat situations" outlined in the
Civ2 manual (on pages 106-107), only some of which have been implemented in
freeciv:

    * a helicopter defending against a fighter or stealth fighter has its
            defense reduced by 50%, and its firepower reduced to 1.
        
    * figher or stealth fighter defending a city against bombers or stealth
            bombers get a 4x bonus on their defense, but don't benefit from
            SAMs

    * AEGIS cruiser gets 3x defense vs. planes and helicopters, and 5x vs.
            missiles (freeciv has 5x vs all air and missile units)

    * naval units have their firepower reduced to 1 when defending from
            within a city.

    * if an air or ground unit is attacking a naval unit in a city, the
            attacker's firepower is doubled (Pearl Harbour.  I gather that
            this is somewhat implemented, but not quite right or something,
            from a discussion in the mailing list archives I skimmed)

All these random fiddles with unit attack and defense and firepower would
be evil to hard-code in the server, since the units themselves come from
ruleset files.  Perhaps a way to do it would be to have extra rules in the
unit.ruleset files, for example:

[unit_helicopter]
name          = _("Helicopter")
move_type     = "Heli"
tech_req      = "Combined Arms"
...
attack        = 10
defense       = 3
defense_vs    = 1.5, unit_fighter, unit_stealth_fighter
hitpoints     = 20
firepower     = 2
firepower_vs  = 1, unit_fighter, unit_stealth_fighter
...

but it could get tricky and messy trying to give all the rules, especially
ones that interact with city improvements (like the 2nd rule about fighters
in cities defending against bombers ignoring SAM batteries).  Also, you'd
be doing a fair bit of duplication - rather than having a test in the
server code that causes all naval units in cities to have a firepower of 1,
you'd have an entry for every naval unit saying "firepower_in_city = 1" or
something.

Actually, rather than having special "_vs" "_in_city", "_vs_in_city" etc.
varients of attack, defense, firepower, you could have guard expressions,
and use the first that matches:

[unit_fighter]
name          = _("Fighter")
...
defense       = 6 in_city(building_sam_battery), 
vs(unit_bomber,unit_stealth_bomber)
defense       = 12 in_city(), vs(unit_bomber,unit_stealth_bomber)
defense       = 3
...

so a fighter has a defense of 6 in a city with a SAM battery vs bombers
(which the SAM will double to 12), or 12 in a city without a SAM vs
bombers, or 3 otherwise.

I guess the ideal would be that units, buildings and wonders all have
fragments of code in the ruleset files in some scripting language, and the
server just acts as an engine that executes that code for all the things
that have been built and are interacting.  Perhaps not just yet, though :)

                                                        Have fun,
                                                         Rob R.
                                                          \((/
                                                          ~oo~
                                                          /))\



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