Announcement

Collapse
No announcement yet.

DESIGN: Unit Values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • There are a lot of bonus combinations I'll post hecdb so you can see:

    Code:
    #-----------------------------------------------------------------------------
    #
    #  Project      : Call To Power 2
    #  File type    : dbgen input
    #  Description  : Unit type descriptor
    #  Id           : $Id:$
    #
    # ----------------------------------------------------------------------------
    #
    #  Disclaimer
    #
    #  THIS FILE IS NOT GENERATED OR SUPPORTED BY ACTIVISION.
    #
    #  This material has been developed at apolyton.net by the Apolyton CtP2 
    #  Source Code Project. Contact the authors at [email]ctp2source@apolyton.net[/email].
    #
    #-----------------------------------------------------------------------------
    #
    #  Modifications from the original Activision code:
    #
    #  - Government specific options added (Martin Gühmann).
    #  - MapIcon database added (22-Feb-2007 Martin Gühmann)
    #  - Leader option added.
    #  - NoBarbarian             : Added by tombom
    #  - CantGroup               : For future use to make solo moving units
    #  - CanSettleOn             : Added by E restricts settling to certain
    #                              terrains
    #  - UpgradeTo               : FutureUse to create Upgrade Paths, cost based
    #                              on difference ShieldCost x Gold?
    #  - CultureOnly             : Added by E -- can only build units if civ has
    #                              certain citystyle
    #  - CityStyleOnly           : Added by E -- can only build units at cities
    #                              with certain citystyle 
    #  - SettleImprovement       : Future use - for units to make specific imps
    #                              like forts
    #  - HiddenNationality       : Future use for Civ3 like trait maybe same as
    #                              Cloak?
    #  - IsWorker                : Future use -- with TerrImp flag NeedsWorker to
    #                              limit certain imps or Civ3-like mods
    #  - PopCostsToBuild         : Added for future use to deduct more than one
    #                              pop for units
    #  - CanCaptureTile          : For FutureUse to change ownership of tile
    #  - GoldHunger              : Add for future possibility of gold cost per
    #                              turn per unit
    #  - CantGroup               : For future use to make solo moving units
    #  - IsPeaceKeeper           : FutureUse have higher regard cost if attacked
    #                              and ignore territory
    #  - NeedsCityGood           : Added by E to implement strategic resources
    #  - PrerequisiteBuilding    : Added by E to limit units to cities with 
    #                              certain buildings
    #  - NeedsCityGoodAll        : FU attempt to implement strategic resources
    #  - AllTerrainAsImprovement : Future use - like AllTerrainRoads
    #  - ObsoleteByUnit          : FU instead of avdance for later upgrade
    #  - NonLethalBombard        : Lessen bombard strengthen like old civ3
    #  - CanBombardTiles         : Allows bombarding of tile improvements
    #  - CollateralTileDamage    : If a defender is on a tile then improvements cut
    #                              too
    #  - GoodyHutExcluded        : Prevents Some Units from appearing
    #  - ExcludedByWonder        : Prevents Units being built in cities with wonder
    #  - PrerequisiteWonder      : Needs Wonder in city to be built
    #
    #-----------------------------------------------------------------------------
    
    Sprite : Int
    Sound : File
    MapIcon : File
    SpecialEffect : Int
    
    SpecialAttackInfo {
    	Record Sound         SoundID
    	Record SpecialEffect SpriteID
    }
    
    Unit {
    	Bits MovementType {
    		Land,
    		Sea,
    		Air,
    		Mountain,
    		Trade,
    		ShallowWater,
    		Space
    	}
    
    	#uint32 cargo_flag;
    	Bits CanCarry {
    		SmallLand,
    		MedLand,
    		LargeLand,
    
    		SmallAir,
    		MedAir,
    		LargeAir,
    		
    		SmallWater,
    		MedWater,
    		LargeWater,
    
    		SmallSpace,
    		MedSpace,
    		LargeSpace
    	}
    
    	Record Advance              EnableAdvance
    	Record Advance[0..5]        ObsoleteAdvance
    	Record Building[] PrerequisiteBuilding  // Added by E to limit units to cities with certain buildings
    	Record Building[] ExcludedByBuilding    //to prevent some units being built
    	Record Government[] GovernmentsModified
    	Record Terrain[] CanSettleOn			// Added by E restricts settling to certain terrains
    	Record Unit[]     UpgradeTo				// Upgrade Paths, cost based on difference ShieldCost x Gold?
    	Record Unit[]     ObsoleteUnit			// If unit is available then this unit cant be built
    	Record CityStyle[] CultureOnly			// Added by E -- can only build units if civ has certain citystyle
    	Record CityStyle[] CityStyleOnly		// Added by E--can only build units at cities with certain citystyle 
    	Record Civilisation[] CivilisationOnly	// Added by E -- can only build units if player is a specific civ
    	Record TerrainImprovement[]     SettleImprovement // entrenching units make specific imps like forts
    	Record Resource[] NeedsCityGood         // Must have good in radius of city or buying resource to build 
    	Record Resource[] NeedsCityGoodAll		// A city must have all resources listed to build unit
    	Record Resource[] NeedsCityGoodCapitol	// not implemented
    	Record Resource[] NeedsCityGoodAnyCity	// must have a good in any city to build
    	Record Feat[] NeedsFeatToBuild			// Feat must have occured for unit to be built
    	Record Wonder[] PrerequisiteWonder		// Added by E to limit units to cities with certain wonders
    	Record Wonder[] ExcludedByWonder		// to prevent some units being built
    
    
    	Bit(Int) MoveBonus						// Instead of specifying an imp why not define the movecost here? by E
    	Bit(Int) PWMoveCost						// FU - Deducts PW when unit moves
    	Bit(Int) MerchantGold					// FU - to allow a unit to grant gold in other territory
    	Bit      IsGreatBuilder					// FU - completes building 
    	Bit      IsGreatArtist					// FU - one day I may add culture / influence 
    
    	Record TerrainImprovement[]     AllTerrainAsImprovement // future use - like AllTerrainRoads
    	Record Unit [] ObsoleteByUnit 			// Intead of advance for later upgrade
        Bit NonLethalBombard					// lessen bombard strengthen like old civ3
    	Bit CanBombardTiles						// allows bombarding of tile improvements
    	Bit CollateralTileDamage				// if a defender is on a tile then improvements cut too
        Bit PrecisionStrike						// When bombing city only destroys buildings
        Bit TargetsCivilians					// When bombing city only kills a pop
        Bit ImmuneToHostileTerrain				// Protects units from terrain that deducts HP
    
    	Bit CanRebase							// FU to rebase CantMove units
    	Bit MultipleAttacks						// Can attack more than once in a turn (Civ3 - blitz)
    	Bit CanBeGifted							// Disbanding unit gives it to the friendly player
    
    	Bits Size {
    		Small,
    		Medium,
    		Large
    	}
    
    	Struct SuccessDeath {
    		Float Chance, DeathChance
    	}
    
    	Struct SuccessDeathEffect {
    		Float Chance, DeathChance
    		Record Sound Sound
    		Record SpecialEffect Effect
    	}
    
    	Bit LossMoveToDmgNone
    	Bit LossMoveToDmgTwo
    	Bit NoFuelThenCrash
    	Bit TransformPartial
    
    	Bit IgnoreZOC
    	Bit NoZoc
    
    	Bits CanBombard {
    		Land,
    		Air,
    		Water,
    		Space,
    		Mountain
    	}
    
    	Bit CanCounterBombard
    
    	Bit CanLiftOff
    
    	Bits Settle { 
    		Land,
    		Water,
    		Mountain,
    		Space
    	}
    	Record Unit SettleCityType
    	Int SettleSize = 1
    	Record Building[] SettleBuilding
    
    	# Int is number of turns to stay in space
    	Bit(Int) SpaceLaunch
    	Bit SpaceLand
    
    	Bit CantCaptureCity
    	Bit HasPopAndCanBuild
    	Bit IsTrader
    	Bit ExertsMartialLaw
    
    	Bit CanEntrench
    	Bit CanPatrol
    
    	Bit NeedsNoSupport
    	Bit CanExpelPop
    	Bit IsFlanker
    	Bit CanBeachAssault
    
    
    	Bits Defend {
    		Land, Air, Water, Space, Mountain	//
    	}
    
    	Bit(Float) DefendAgainstSpies
    	Bit CanBeExpelled
    	Bit CanBeSued
    	Bit AttackFromSpaceship
    	Bit CantBeAttacked
    	Bit CargoPod
    	Bit IsFoot							// Added by E for additional battle modifiers Dec-7-2005	
    	Bit IsMounted	
    	Bit IsSiege  						// Added by E for additional battle modifiers Dec-7-2005
    	Bit IsWheeled 						// Added by E for additional battle modifiers Dec-7-2005
    	Bit IsMechanized 					// Added by E for additional battle modifiers Dec-7-2005
    	Bit IsHelicopter 					// Added by E for additional battle modifiers Dec-7-2005
    	Bit IsSubmarine			
    	Bit IgnoreCityWalls	
    
    	Bit NoLandAttack
    	Bit NoSeaAttack
    	Bit NoAirAttack
    	Bit NoSpaceAttack
    	Bit NoUnderwaterAttack
    	Bit NoMountainAttack
    	Bit NoShallowWaterAttack
    
    	Bit Paratrooper
    	Bit AssistedDrops
    	Bit BonusAgainstFoot 				// Added by E for additional battle modifiers Dec-7-2005
    	Bit BonusAgainstMounted
    	Bit BonusAgainstSiege 				// Added by E for additional battle modifiers Dec-7-2005
    	Bit BonusAgainstWheeled 			// Added by E for additional battle modifiers Dec-7-2005
    	Bit BonusAgainstMechanized 			// Added by E for additional battle modifiers Dec-7-2005
    	Bit BonusAgainstHelicopter 			// Added by E for additional battle modifiers Dec-7-2005
    	Bit BonusAgainstGuerrilla 			// Added by E for additional battle modifiers Dec-13-2005
    	Bit BonusAgainstSpecialForces 		// Added by E for additional battle modifiers Dec-13-2005
    	Bit BonusAgainstSubmarine 			// Added by E for additional battle modifiers Dec-13-2005
    	Bit SingleUse
    	Bit BonusAirDefense
    
    	Bit WoodenShip
    	Bit AttackFootBonus 				// Added by E for additional battle modifiers Dec-7-2005
    	Bit AttackMountedBonus 				// Added by E for additional battle modifiers Dec-7-2005
    	Bit AttackSiegeBonus 				// Added by E for additional battle modifiers Dec-7-2005
    	Bit AttackWheeledBonus 				// Added by E for additional battle modifiers Dec-7-2005
    	Bit AttackMechanizedBonus			// Added by E for additional battle modifiers Dec-7-2005
    	Bit AttackHelicopterBonus 			// Added by E for additional battle modifiers Dec-7-2005
    	Bit AttackSpecialForcesBonus		// Added by E for additional battle modifiers Dec-13-2005
    	Bit AttackCivilianBonus 			// Added by E for additional battle modifiers Dec-13-2005
    	Bit AttackGuerrillaBonus 			// Added by E for additional battle modifiers Dec-13-2005
    	Bit AttackWoodenShipBonus
    	Bit HasAttackCityBonus	
    	Bit HasAttackBonusSubmarine
    
    	Bit(Int) ReplaceWithCargoModule
    	Bit VisibileAttacking
    
    	Bit(struct SoundAndEffect) NuclearAttack
    
    	Bit CanSue
    	Bit IsStealthy
    	Bit SeeSurfaceFromSpace
    
    	Bit EstablishEmbassy
    	Bit ThrowParty
    	Bit HearGossip
    
    ##	Struct AttackAgeBonus {
    ##		Record Age Age
    ##		Bit Bonus
    ##	}
    
    	Struct StealTechnologyData {
    		Float RandomChance
    		Float SpecificChance
    		Float DeathChance
    		Record Sound Sound
    		Record SpecialEffect Effect
    	}
    	Bit(Struct StealTechnologyData) StealTechnology
    
    	Struct InciteRevolutionData {
    		Float Chance
    		Float EliteChance
    		Float DeathChance
    		Record Sound Sound	
    		Record SpecialEffect Effect
    	}
    
    	Bit(struct InciteRevolutionData) InciteRevolution
    
    	Struct AssasinateRulerData {
    		Float Chance
    		Float EliteChance
    		Float DeathChance
    	}
    	Bit(Struct AssasinateRulerData) AssasinateRuler
    
    	Struct InvestigateReadinessData {
    		Float Chance
    		Float EliteChance
    		Float DeathChance
    	}
    
    	Bit(Struct InvestigateReadinessData) InvestigateReadiness	
    	Bit NullifyCityWalls
    
    	struct ChanceEffect {
    		Float Chance
    		Record Sound Sound
    		Record SpecialEffect Effect
    	}
    
    	Bit(Struct ChanceEffect) CreateFranchise
    
    	Struct CauseUnhappinessData {
    		Float Chance
    		Int   Timer
    		Int   Amount
    		Record Sound Sound
    		Record SpecialEffect Effect
    	}
    
    	Bit(Struct CauseUnhappinessData) CauseUnhappiness
    
    	Bit(struct SoundAndEffect) ConductHits
    	Bit(struct ChanceEffect) BioTerror
    	Bit(struct ChanceEffect) NanoTerror
    	Bit(struct ChanceEffect) Plague
    
    	Struct SlaveRaidsData {
    		Float Chance, DeathChance
    		Int Timer, Amount
    		Record Sound Sound
    		Record SpecialEffect Effect
    	}
    	Bit(Struct SlaveRaidsData) SlaveRaids
    
    	Struct SoundAndEffect {
    		Record Sound Sound
    		Record SpecialEffect Effect
    	}
    	Bit(struct SoundAndEffect) SettlerSlaveRaids
    
    	Bit(struct SoundAndEffect) SlaveUprising
    
    	Bit(struct SuccessDeathEffect) UndergroundRailway	
    	Bit VictoryEnslavement	
    
    	Bit DefuseLandMines
    	Bit DefuseSeaMines
    	Bit DefuseXrayMines
    
    	Bit(struct SoundAndEffect) IndulgenceSales
    	Bit(struct SuccessDeathEffect) ConvertCities
    	Bit BuildXrayMines
    
    	Bit BuildWonder
    	Record Government[] GovernmentType
    	Bit NoSlaves
    	Bit CreateRift
    	Bit CanCloak
    	Bit HiddenNationality 						// future use for Civ3 like trait maybe same as Cloak?				
    	Bit SneakAttack 							// Can attack without war declared
    	Bit SneakPillage 							// Can Pillage without war declared
    	Bit SneakBombard 							// Can Bombard without war declared
    	Bit ParatrooperTransport
    	Bit CantBuild
    
    	Struct PlantNukeData {
    		Float Chance, EscapeChance
    		Record Sound Sound
    		Record SpecialEffect Effect
    	}
    	Bit(Struct PlantNukeData) PlantNuke
    
    	Bit IsTelevangelist
    	Bit(struct SoundAndEffect) CanSoothsay
    
    	Bit CanBeRustled
    	Bit(struct SoundAndEffect) CreateParks
    	
    	Bit (struct SoundAndEffect) CanInjoin
    
    	Bit WormholeProbe
    	Bit HasBonusFood
    	Bit LandCityCanBuild
    	Bit SeaCityCanBuild
    	Bit SpaceCityCanBuild
    	Bit IsSpecialForces				// EMOD
        Bit IsPeaceKeeper				// EMOD
    	Bit IsGuerrilla  				// EMOD
    	Bit IsWorker 					// Future use -- with TerrImp flag NeedsWorker to limit certain imps or Civ3-like mods
    	Bit NotAffectedByLandMines
    	Bit InternalReserved
    
    
    	Bit DeathEffectsHappy
    	Bit EnableCarrierDefenses
    	Bit ActiveDefenseOnlyWhenCarryingEnablers
    	Bit BuildingRemovesAPop
    	Bit(Int) PopCostsToBuild				// Added for future use to deduct more than one pop for units
    	Bit Explodes
    	Bit Advertise
    	Bit CanRustle
    	Bit OnlyBuildOne
    
    	Bit CanExpel
    
    	Bit(struct SoundAndEffect) CanReform
    	Bit CanPillage
    	Bit CanPirate
    	Bit CanCaptureTile						// change ownership of tile
    	Int ReducesDefensesBonus = 0			// FU
    
    	#uint32 visibility_classes;
    	Bits VisionClass {
    		Standard,
    		Underwater,
    		Stealth,
    		UnusedBit3,
    		UnusedBit4,
    		UnusedBit5,
    		UnusedBit6,
    		UnusedBit7,
    		UnusedBit8,
    		UnusedBit9,
    		UnusedBit10,
    		UnusedBit11,
    		UnusedBit12,
    		UnusedBit13,
    		UnusedBit14,
    		UnusedBit15
    	}
    
    	#uint32 visibility_abilities;
    	Bits CanSee {
    		Standard,
    		Underwater,
    		Stealth,
    		UnusedBit3,
    		UnusedBit4,
    		UnusedBit5,
    		UnusedBit6,
    		UnusedBit7,
    		UnusedBit8,
    		UnusedBit9,
    		UnusedBit10,
    		UnusedBit11,
    		UnusedBit12,
    		UnusedBit13,
    		UnusedBit14,
    		UnusedBit15
    	}
    
    	# uint32 attackFlags;
    	Bits CanAttack {
    		Land,
    		Sea,
    		Air,
    		Mountain,
    		Trade,
    		ShallowWater,
    		Space,
    		Underwater
    	}
    			
    	Struct CargoData {
    		Int MaxCargo
    		Record Sound Load
    		Record Sound Unload
    	}
    	Bit(Struct CargoData) CargoData
    
        Int ShieldCost
    
    	Int PowerPoints
    
        Int MaxHP
        Float MaxHPr = 1.0
        Float Attack
        Float Defense
        Int Firepower
    	Int ZBRangeAttack
    	Float Armor
    
        Bit(Int) BRange
        Bit (Int) BRadius
    
        Int VisionRange
        Int ActiveDefenseRange
        Bit (Int) ElectronicCombatFactor
    
        Float MaxMovePoints
        Int MaxFuel
    
    	Bit(Int) TransType
    
    	Bit(Int) ProbOfBombHit
        Bit(Int) BombRounds
    
        Int ShieldHunger
        Int FoodHunger
        Int GoldHunger = 0					// Add for future possibility of gold cost per turn per unit
        Record Sprite DefaultSprite
    
    	
    	Bit(Int) LaunchPollution 
    	Bit(Int) DeathPollution 
    
    	Bit(Float) MountedBonus
    	Bit(Float) AirBonus
    	Bit(Float) WoodenShipBonus
    	Bit(Float) AttackCityBonus
    	Bit(Float) AttackBonusSubmarine
    	Bit(Float) FootBonus				// added by E for additional battle modifiers Dec-31-2005
    	Bit(Float) SiegeBonus				// added by E for additional battle modifiers Dec-31-2005
    	Bit(Float) WheeledBonus				// added by E for additional battle modifiers Dec-31-2005
    	Bit(Float) MechanizedBonus			// added by E for additional battle modifiers Dec-31-2005
    	Bit(Float) HelicopterBonus			// added by E for additional battle modifiers Dec-31-2005
    	Bit(Float) SpecialForcesBonus		// added by E for additional battle modifiers Dec-31-2005
    	Bit(Float) CivilianBonus			// added by E for additional battle modifiers Dec-31-2005
    	Bit(Float) GuerrillaBonus			// added by E for additional battle modifiers Dec-31-2005
    	Bit(Float) AgainstMountedBonus
    	Bit(Float) AirDefenseBonus
    
    	Bit(Int) CargoModule
    
    	Bit(Float) SpyVsSpy
    
    	Struct InvestigateCityData {
    		Float Chance,
    			  EliteChance,
    			  DeathChance
    	}
    	Bit(Struct InvestigateCityData) InvestigateCity
    
    	Bit(Int) BonusFood
    
    	#uint32 govs
    	#Record Government[] Govs
    
    	Bit(Int) BombardRange
    
    	struct RevolutionData {
    		Record Sound Sound
    		Record SpecialEffect Effect
    	}	
    	
    	Bit(struct RevolutionData) Revolution
    
    	Record Sound SoundSelect1			
    	Record Sound SoundSelect2			
    	Record Sound SoundMove				
    	Record Sound SoundAcknowledge		
    	Record Sound SoundCantMove			
    	Record Sound SoundAttack
    
    	Record Sound SoundWork
    	Record Sound SoundVictory
    	Record Sound SoundDeath
    	Record Sound SoundLoad
    	Record Sound SoundUnload
    
    	# This doesn't need to be here any more.
        Record SpecialAttackInfo[0..8] SpecialAttacks
    
    	Bit(Float) CityGrowthCoefficient
    
    #	uint32 userFlags
    
    	Bits UserFlags {
    	  UF1,
    	  UF2,
    	  UF3,
    	  UF4,
    	  UF5,
    	  UF6,
    	  UF7,
    	  UF8,
    	  UF9,
    	  UF10,
    	  UF11,
    	  UF12,
    	  UF13,
    	  UF14,
    	  UF15,
    	  UF16,
    	  UF17,
    	  UF18,
    	  UF19,
    	  UF20,
    	  UF21,
    	  UF22,
    	  UF23,
    	  UF24,
    	  UF25,
    	  UF26,
    	  UF27,
    	  UF28,
    	  UF29,
    	  UF30,
    	  UF31
    	}
    
    	Record Icon DefaultIcon
    	Bit NoIndex
    	Bit (int) CheatIndex
    	StringId Description
    	Bit (StringId) Advice
    	StringId Category
    
    	Bit GLHidden
    
    	Bit CantMove
    
    	// set this flag for units that non-evil AI's should not attack
    	Bit Civilian
    
    	Bit NoBarbarian 				// Added by tombom
    	Bit GoodyHutExcluded			// Prevents Some Units from appearing by E
    	Bit CanHarvest					// Added by E to add Gold and Shields from terrain
    	Bit CantGroup 					// For future use to make solo moving units
    	Bit SpawnsBarbarians			// Entrenched unit spawns barbs in foreign territory
    	Bit CanSinkInSea				// to implement ConstDb Chance_lost_at_sea
    
    	Bit Leader						// Special "king" unit
    
    	#Energy Code
    	Int   EnergyHunger = 0
    	Int   ProducesEnergy = 0
    }
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • Excellent E! I hope we can use some of those.

      I'm going to go through the changes now and post the files changed later.

      Here's the CtP1 Artillery BTW.
      Attached Files
      Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
      CtP2 AE Wiki & Modding Reference
      One way to compile the CtP2 Source Code.

      Comment


      • Maq,

        here is the latest units.txt. It has the corrected tank and helicopter and I added the goldhunger values (game option)

        hope you didnt get too far.
        Attached Files
        Formerly known as "E" on Apolyton

        See me at Civfanatics.com

        Comment


        • Nope, it only took me 5 minutes to back track so it's fine.

          I was thinking about possible bonuses, creating a kind of paper, scissors, stone (or rock, paper, scissors if you like ) system, something like this:

          Ancient/Classical:

          Legion: Bonus vs Hoplites.
          Hoplite: Bonus vs M. Archers.
          M. Archer: Bonus vs Legion.

          Range/Siege as support.

          Note: Elephant would work better as the flanker here, but it's not important now.

          Medieval:

          Samurai: Bonus vs Pikemen.
          Pikemen: Bonus vs Knights.
          Knights: Bonus vs Samurai.

          Range/Siege as support.

          Renaissance:

          Musketeer: Bonus vs Infantryman.
          Infantryman: Bonus vs Cavalry. Maybe remove this and leave it to Pikemen (if they were stronger) to defend against mounted in both eras.
          Cavalry: Bonus vs Musketeer.

          Range/Siege as support.

          Industrial/Modern/Computer: This is a tricky one as we don't have an obvious counter for Tanks at the front. For the moment lets suggest the counter is from range. That would leave something like this:

          Fascist/Marine/Para: Bonus vs Artillery/Missiles.
          M. Gunner: Bonus vs Fascist/Marine/Para.
          Tank: No bonuses, blitz?
          Artillery/Missiles: Bonus vs Tank.

          Genetic/Diamond/Future: again counter from range as the armour at the front is too low to stay alive long enough to really counter Tanks.

          Hover Inf: Bonus vs War Walker.
          Plasmatica: Bonus vs Hover Inf.
          Fusion Tank: No Bonuses, blitz?
          War Walker: Bonus vs Fusion Tank.

          If i understand it right, at the moment the only way we can differentiate between "attack" and "defense" units, is if we assign the current flags like this:

          Attack: IsMechanized or IsWheeled. No other units would have to use these anyway.
          Defense: IsFoot.
          Flank: IsMounted.
          Range: IsSiege.

          Also units of a different era would get bonuses. For example Infantryman would get bonuses vs Tank and Fusion Tanks, but would do no damage because of Tank armour, so it's still realistic.

          This is all assuming our coders don't add anymore flags at least.
          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
          CtP2 AE Wiki & Modding Reference
          One way to compile the CtP2 Source Code.

          Comment


          • Woah... well I guess that's a nice proposal Maq, sounds pretty ok

            Comment


            • What I'm not sure of is what the bonus gives, it looks like a bonus to attack only? Which would mean range units bonus would be ineffective against Tanks, until it came onto the frontline, but then it'd be destroyed pretty quickly.
              Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
              CtP2 AE Wiki & Modding Reference
              One way to compile the CtP2 Source Code.

              Comment


              • Originally posted by Maquiladora
                If i understand it right, at the moment the only way we can differentiate between "attack" and "defense" units, is if we assign the current flags like this:

                Attack: IsMechanized or IsWheeled. No other units would have to use these anyway.
                Defense: IsFoot.
                Flank: IsMounted.
                Range: IsSiege.

                Also units of a different era would get bonuses. For example Infantryman would get bonuses vs Tank and Fusion Tanks, but would do no damage because of Tank armour, so it's still realistic.

                This is all assuming our coders don't add anymore flags at least.

                The Is and BonusAgainst flags are easy to add so if you have suggestions I'll add them.

                I never tried the age bonus thing because it has a lot of variables (dianond versus classic, you'd almost have to label all the ages).

                But if you want to add more "Is" and "BonusAgainst" just list them here.
                Formerly known as "E" on Apolyton

                See me at Civfanatics.com

                Comment


                • here's the code:

                  Code:
                  double UnitData::GetAttack(const UnitRecord *rec, const Unit defender) const
                  {
                  	UnitRecord const *	defrec		= defender.GetDBRec();
                  
                  	if(!(rec->GetCanAttack() & defrec->GetMovementType())) 
                  	{
                  		return 0.0;
                  	}
                  
                  	double const		baseattack	= rec->GetAttack();
                  	double				attack		= baseattack;
                  
                  	if (defrec->GetWoodenShip()) 
                      {
                  		attack += baseattack * rec->GetAttackWoodenShipBonus();
                  	}
                  
                  	MapPoint	dpos;
                  	defender.GetPos(dpos);
                      double		cityAttack;
                  	if ((g_theWorld->GetCell(dpos)->GetCity().m_id != (0)) &&
                          rec->GetAttackCityBonus(cityAttack)
                         ) 
                      {
                  		attack += baseattack * cityAttack;
                  	}
                  
                      double submarineAttack;
                  	if (defrec->GetIsSubmarine() &&
                          rec->GetAttackBonusSubmarine(submarineAttack)
                         ) 
                      {
                  		attack += baseattack * submarineAttack;
                  	}
                  
                  	// EMOD
                  	double	bonus;
                  	if (defrec->GetIsFoot() && rec->GetFootBonus(bonus))
                  	{
                  		attack += baseattack * bonus;
                  	}
                  
                  	if (defrec->GetIsMounted() && rec->GetMountedBonus(bonus)) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  
                  	if (defrec->GetIsSiege() && rec->GetSiegeBonus(bonus)) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  
                  	if (defrec->GetIsWheeled() && rec->GetWheeledBonus(bonus)) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  
                  	if (defrec->GetIsMechanized() && rec->GetMechanizedBonus(bonus)) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  
                      if (defrec->GetIsSpecialForces() && rec->GetSpecialForcesBonus(bonus)) 
                      {
                  		attack += baseattack * bonus;
                  	}
                  
                      if (defrec->GetIsHelicopter() && rec->GetHelicopterBonus(bonus)) 
                      {
                  		attack += baseattack * bonus;
                  	}
                  
                  	if (defrec->GetCivilian() && rec->GetCivilianBonus(bonus)) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  
                  	if (defrec->GetIsGuerrilla() && rec->GetGuerrillaBonus(bonus)) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  //EMOD Civ Bonuses July 2, 2006
                  
                  	if (defender.GetMovementTypeLand() && (g_theCivilisationDB->Get(g_player[m_owner]->m_civilisation->GetCivilisation())->GetOffenseBonusLand(bonus))) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  	if (defender.GetMovementTypeAir() && (g_theCivilisationDB->Get(g_player[m_owner]->m_civilisation->GetCivilisation())->GetOffenseBonusAir(bonus))) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  	if (defender.GetMovementTypeShallowWater() && (g_theCivilisationDB->Get(g_player[m_owner]->m_civilisation->GetCivilisation())->GetOffenseBonusWater(bonus))) 
                  	{
                  		attack += baseattack * bonus;
                  	}
                  //end EMOD
                  
                  	return attack;
                  }
                  defense

                  Code:
                  double UnitData::GetDefense(const Unit &attacker) const
                  {
                  	const UnitRecord *attackRec, *myRec;
                  	Cell *cell = g_theWorld->GetCell(m_pos);
                  
                  	attackRec = attacker.GetDBRec();
                  	myRec = GetDBRec();
                  	
                  	double def = GetPositionDefense(attacker);
                  
                  	if(cell->GetCity().m_id != (0)) {
                  		const CityData *cityData = cell->GetCity().GetData()->m_city_data;
                  		Assert(cityData);
                  
                  		if(attackRec->GetIgnoreCityWalls()) {
                  			
                  			def -= cityData->GetDefendersBonus();
                  			
                  			def += cityData->GetDefendersBonusNoWalls();
                  		}
                  	}
                  
                  
                  
                  	double value = 0.0;
                  	if(attackRec->GetIsMounted()) {
                  		if(myRec->GetAgainstMountedBonus(value))
                  			def += myRec->GetDefense() * value;
                  		else if(myRec->GetBonusAgainstMounted())
                  			def += myRec->GetDefense();
                  	}
                  
                  	if(attackRec->GetMovementTypeAir()) {
                  		if(myRec->GetAirDefenseBonus(value))
                  			def += myRec->GetDefense() * value;
                  		else if(myRec->GetBonusAirDefense())
                  			def += myRec->GetDefense();
                  	}
                  
                  	//Additional Battle Modifiers by E 12-05-2005
                  	if(attackRec->GetIsFoot()
                  	&& myRec->GetFootBonus(value)
                  	){
                  		def += myRec->GetDefense() * value;
                  	}
                  
                  	if(attackRec->GetIsSiege()
                  	&& myRec->GetSiegeBonus(value)
                  	){
                  		def += myRec->GetDefense() * value;
                  	}
                  
                  	if(attackRec->GetIsWheeled()
                  	&& myRec->GetWheeledBonus(value)
                  	){
                  		def += myRec->GetDefense() * value;
                  	}
                  
                  	if(attackRec->GetIsMechanized()
                  	&& myRec->GetMechanizedBonus(value)
                  	){
                  		def += myRec->GetDefense() * value;
                  	}
                  
                  	if(attackRec->GetIsHelicopter()
                  	&& myRec->GetHelicopterBonus(value)
                  	){
                  		def += myRec->GetDefense() * value;
                  	}
                  
                  	if(attackRec->GetIsGuerrilla()
                  	&& myRec->GetGuerrillaBonus(value)
                  	){
                  		def += myRec->GetDefense() * value;
                  	}
                  
                  	if(attackRec->GetCivilian()
                  	&& myRec->GetCivilianBonus(value)
                  	){
                  		def += myRec->GetDefense() * value;
                  	}
                  
                  	if(attackRec->GetIsSpecialForces()
                  	&& myRec->GetSpecialForcesBonus(value)
                  	){
                  		def += myRec->GetDefense() * value;
                  	}
                  
                  
                  	// End EMOD
                  
                  	sint32 intDef = (sint32)def;
                  	sint32 modDef = g_slicEngine->CallMod(mod_UnitDefense, intDef, m_id, attacker.m_id, intDef);
                  	if(modDef != intDef)
                  		def = modDef;
                  
                  	return def;
                  }
                  Formerly known as "E" on Apolyton

                  See me at Civfanatics.com

                  Comment


                  • Originally posted by E

                    The Is and BonusAgainst flags are easy to add so if you have suggestions I'll add them.

                    I never tried the age bonus thing because it has a lot of variables (dianond versus classic, you'd almost have to label all the ages).

                    But if you want to add more "Is" and "BonusAgainst" just list them here.
                    I don't think we need anymore just yet. First I'd like to test more if it's worth setting up.

                    Do you know if it's feasible to add a range attack bonus against certain units? I don't know if it checks what type of unit the ranged unit is targetting from the back line, but it would have to.

                    If not then it may be that we just have to have some frontline unit that is deadly against Tanks. Marines are the only suitable one that springs to mind, and later Hover Inf against Fusion Tanks.
                    Last edited by Maquiladora; May 9, 2007, 13:39.
                    Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                    CtP2 AE Wiki & Modding Reference
                    One way to compile the CtP2 Source Code.

                    Comment


                    • Originally posted by Maquiladora
                      Do you know if it's feasible to add a range attack bonus against certain units? I don't know if it checks what type of unit the ranged unit is targetting from the back line, but it would have to.
                      how does a ranged attack bonus work? I'm not up on the mechanics on how ranged units work in ctp2. With more detail I can find in the code
                      Formerly known as "E" on Apolyton

                      See me at Civfanatics.com

                      Comment


                      • I'd say we keep the ranged attack of siege units as 1, since the movement's now lower than before.

                        I thought about Maq's idea of adding a bonus to MMS against tanks, but then the War Walker would need to have this bonus too. (we are changing CTP2's WW spider-horse-monkey thing sprite to CTP1's WW multirocketed mech, right?).

                        Interesting coincidence, I was watching the History Channel today, they were talking about the "TOW Missiles" (anti-tank missiles), which can be equipped either by infantry or humvees, because of their relative small size. Now, the TOW missiles are about, the size of an average adult human arm... so that would be akward launching a relativelly small missile from a ballistic missile platform...

                        I guess then, we would need another unit, to act as an anti-tank? (Something like the land version of a PT Boat?) Or we just make an additional range bonus against tanks, with the MMS and the WW? Or we increase the Fortify bonus of Defensive units / or, if possible, progresivelly increase the Fortify defense bonus after each turn until a limit, thus removing any exploit in a important zone, and giving cities a more easy time defending against attackers? (50%-75%-100%-150%-200%?)

                        Originally posted by E
                        how does a ranged attack bonus work? I'm not up on the mechanics on how ranged units work in ctp2. With more detail I can find in the code
                        I guess it should be something like the Defense bonus of Pikemen vs Mounted Units, but instead of Defense -- Ranged attack.
                        Last edited by LemurMadness; May 9, 2007, 14:31.

                        Comment


                        • Given that we may not be able to have specific range attack bonuses (although I don't think it's any great loss), here's a quick revision:

                          Ancient/Classical:

                          Legion: Bonus vs Hoplites.
                          Hoplite: Bonus vs M. Archers.
                          M. Archer: Bonus vs Legion.

                          Range/Siege as support.

                          Note: Elephant would work better as the flanker here, but it's not important now.

                          Medieval:

                          Samurai: Bonus vs Pikemen.
                          Pikemen: Bonus vs Knights.
                          Knights: Bonus vs Samurai.

                          Range/Siege as support.

                          Renaissance:

                          Musketeer: Bonus vs Infantryman.
                          Infantryman: Bonus vs Cavalry.
                          Cavalry: Bonus vs Musketeer.

                          Range/Siege as support.

                          Industrial/Modern/Computer:

                          Fascist/Marine/Para: Bonus on city attack.
                          M. Gunner: Bonus vs Fascist/Marine/Para.
                          Tank: No bonuses, blitz? ignore city walls?
                          Fighter: Bonus vs Tank.
                          Missiles: Bonus vs Air.

                          Siege/Bomber as support.

                          Genetic/Diamond/Future:

                          Hover Inf: Bonus on city attack.
                          Plasmatica: Bonus vs Hover Inf.
                          Fusion Tank: No Bonuses, blitz? ignore city walls?
                          Stealth Fighter: Bonus vs Fusion Tank.
                          War Walker: Bonus vs Air.

                          Siege/Stealth Bomber as support.
                          Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                          CtP2 AE Wiki & Modding Reference
                          One way to compile the CtP2 Source Code.

                          Comment


                          • Originally posted by LemurMadness

                            I guess then, we would need another unit, to act as an anti-tank? (Something like the land version of a PT Boat?) Or we just make an additional range bonus against tanks, with the MMS and the WW? Or we increase the Fortify bonus of Defensive units / or, if possible, progresivelly increase the Fortify defense bonus after each turn until a limit, thus removing any exploit in a important zone, and giving cities a more easy time defending against attackers? (50%-75%-100%-150%-200%?)
                            I totally missed it before, but can't air units just act as the anit-tank? It's actually quicker to get to Aerodynamics than Tank Warfare, so it's not a problem there. Another problem might be though that air units go to the back line just like range units, but this might be something to do with its range stats being equal or higher than its attack. I don't know the exact sorting order. But it's better than Missile/War Walker receiving the tank bonus IMO.

                            IMO anything below 100% bonus (fortify, bonus or terrain) is meaningless. It hardly has any effect on the outcome, which is not very intuitive and sometimes annoying for the player.
                            Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
                            CtP2 AE Wiki & Modding Reference
                            One way to compile the CtP2 Source Code.

                            Comment


                            • Originally posted by Maquiladora
                              I totally missed it before, but can't air units just act as the anit-tank? It's actually quicker to get to Aerodynamics than Tank Warfare, so it's not a problem there. Another problem might be though that air units go to the back line just like range units, but this might be something to do with its range stats being equal or higher than its attack. I don't know the exact sorting order. But it's better than Missile/War Walker receiving the tank bonus IMO.
                              You've got a point there I can hardly think about a tank firing shells at a plane, and actually hitting it. Bombers and Fighters are very weak units, so we can give them a proper use, I haven't seen the AI actually using Fighters or Bombers, which is a weird thing IMHO... I also don't know the exact sorting order, but I guess Fighters would go as attackers (front line = equal ranged and attack) and Bombers as ranged (back line = higher ranged than attack). I guess a bonus of 100% (Ranged and Attack) against Tanks (Tanks, Fusion Tanks) is ok? Althought that would make people using Tanks would go with MMS (Active Air Defense)...

                              Originally posted by Maquiladora
                              IMO anything below 100% bonus (fortify, bonus or terrain) is meaningless. It hardly has any effect on the outcome, which is not very intuitive and sometimes annoying for the player.
                              What about progresivelly increase the fortify bonus?
                              I what I meant in the thread before, (Sorry for not properly defining it), is that in every turn, the fortified unit increases it's defense until a limit, from 50%, then the next turn 75%, then the next one 100%, then 150%, and then 200%. The next turn just keeps the 200%, without any bonus increase, thus giving it a total of 5 turns to build a 200% defense, and effectivelly defending cities, and important points before the enemy decides to strike them, besides doing this will allow the host civilization to recapture their cities without much effort.

                              EDIT: It's possible for the Spy Plane not to refuel? Sleep in the air?
                              Last edited by LemurMadness; May 9, 2007, 16:39.

                              Comment


                              • The m.archer used to have 20 range, but only the seventh unit can use this, now that it is ranged, even the second unit can use it, so I'm saying that m.archer attack should be 15. Also, it comes before the legion so it shouldn't be better.

                                Tank buster idea is very good, when we see a tank, just change the missile to AP.

                                I prefer war walker and plasmatica to move 2.

                                The thing about samurai coming one advance before pikes is that legions are newer and better than hoplites.

                                Comment

                                Working...
                                X