Announcement

Collapse
No announcement yet.

DESIGN: Tile Improvements

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

  • DESIGN: Tile Improvements

    These may need balancing as well. I for one think early farms should use my Needsirrigation and IsIrrigation flags. That way you have to build near fresh water rivers or other farmland. It would make rivers more strategic.


    Another thing thats up for debate is the 'DeniedToEnemy' flag. Somehate it. But i think civ3/4 went to far in limiting roads and railroads. I think roads shouldbe left alone but railroads should be denied to someone at war because its impractical and too much of an advantage to get a 1/10th move into a territory. a big exploit for humans.




    Code:
    #-----------------------------------------------------------------------------
    #
    #  Project      : Call To Power 2
    #  File type    : DbGen input
    #  Description  : Terrain improvement record definition
    #  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:
    #
    #  - Sound                 : Added for construction sound like in CTP1. (Martin Gühmann)
    #  - Freight               : Tileimp gives new trade freight costs for its 
    #                            cell for trade routing. (Martin Gühmann)
    #  - GovernmentsModified   : Added for tielimp government modification.
    #  - DisplayLevel          : Tileimp is forced to be displayed on a certain 
    #                            level of tileimps at its location to support 
    #                            visible wonders. (E)
    #  - CantPillage           : Tileimp cannot be pillaged to support visible wonders. (E)
    #  - GovernmentType        : Tileimp can only be built under the given government (E)
    #  - CultureOnly           : Tileimp can only be researched if civ has a certain citystyle (E)
    #  - IsRestrictedToGood    : Tileimp can only be built on a certain good. (E)
    #  - Added bit Wonder for visible wonders in
    #    - Class                 (FutureUse)(by E)
    #    - Excludes              (FutureUse)(by E)
    #  - Added bit Urban for city sprawl in
    #    - Class                 (FutureUse)(by E)
    #    - Excludes              (FutureUse)(by E)
    #  - NeedsWorker           : Tileimp needs worker unit on its square to be built. (FutureUse) (E)
    #  - NeedsWaterSupply      : Tileimp Can only be build on rivers or adjacent to 
    #                            rivers or other tileimps with flag IsWaterSupply (FutureUse) (E)
    #  - PlantGood             : Tileimp is replaced by a good on construction completion (FutureUse) (E)
    #  - Enablesgood in Effect : Tileimp is replaced by a good on construction 
    #                            completion according to the position's terrain type (FutureUse)(E)
    #  - Added CanUpgrade flag for terrain dependent upgrading (Dec 24th 2006 Martin Gühmann)
    #
    #-----------------------------------------------------------------------------
    
    TerrainImprovement {
    	Bits Class {
    		Farm,
    		Road,
    		Mine,
    		ATM,
    		OceanFarm,
    		OceanMine,
    		OceanATM,
    		OceanRoad,
    		Structure1,
    		Structure2,
    		LandDetector,
    		OceanDetector,
    		Terraform,
    		Wonder,             // For visible wonders (E)
    		Urban               // For future Urban Sprawl (E)
    	}
    
    	Bits Excludes {
    		Farm,
    		Road,
    		Mine,
    		ATM,
    		OceanFarm,
    		OceanMine,
    		OceanATM,
    		OceanRoad,
    		Structure1,
    		Structure2,
    		LandDetector,
    		OceanDetector,
    		Terraform,
    		Wonder,            // For visible wonders (E)
    		Urban              // For future Urban Sprawl (E)
    	}
    
    	Bits CanSee {
    		Standard,
    		Underwater,
    		Stealth,
    		UnusedBit3,
    		UnusedBit4,
    		UnusedBit5,
    		UnusedBit6,
    		UnusedBit7,
    		UnusedBit8,
    		UnusedBit9,
    		UnusedBit10,
    		UnusedBit11,
    		UnusedBit12,
    		UnusedBit13,
    		UnusedBit14,
    		UnusedBit15
    	}
    
    	Struct Effect {
    		Record Terrain[] Terrain
    		Bit(Int) BonusFood
    		Bit(Int) BonusProduction
    		Bit(Int) BonusGold
    		Bit(Int) MoveCost
    		Bit(Int) Freight                    // For trade routing (Martin Gühmann)
    		Bit Radar
    		Bit NeedsWorker                     // FutureUse - can't build unless IsWorker unit is on square
    		Bit Airport
    
    		Bit Colony                          // FU (future use)
    		Bit Fort                            // FU
    		Bit Urban                           // FU
    		Bit Installation                    // FU
    		Bit DeniedToEnemy                   // FU
    		Bit(Int) BonusFoodExport                // installation gives a food modifier
    		Bit(Int) BonusProductionExport          // Installation Gives PW
    		Bit(Int) BonusGoldExport                // Installation gives Gold
    		Bit(Int) FranchiseProduction			// Exports production value as a franchise to pay mil costs 		
    		Bit CanBeCaptured                   // FU
    		Bit CanUpgrade                      // FU
    		Bit(Float) Minefield                // FU
    		Record TerrainImprovement[]     GrowsToImprovement
    		Bit(Int) TurnsToGrowth
    
    		Bit ListeningPost
    		Bit Endgame
    		Bit(Int) VisionRange
    		Bit(Int) RadarRange
    		Bit(Float) DefenseBonus
    		Record CityStyle[] CultureOnly      // Can only build imps if civ has certain citystyle
    		Record Advance EnableAdvance
    		Record Advance[] ObsoleteAdvance
    		Int ProductionCost
    		Record Resource[] EnablesGood       // Having a TI gives a city a good
    		Bit(Int) GoldHunger                 // FU
    		Bit(Int) GoldCost                   // FU
    		Int BonusScience = 0                // Tileimps can give a city science points
    		Int HappyInc = 0                    // Allows tileimps to add (or subtract) happiness
    		Int ProductionTime
    		Int TilesetIndex
    		#not implemented by maybe later
    		Int   EnergyHunger = 0
    		Int   ProducesEnergy = 0
    		//Bit IsWonder  //remove?
    		Record Wonder[]	IsWonder			// ties this tileimp to a wonder that must be built
    		Bit NeedsIrrigation                     // Can only be built on rivers or adjacent to rivers or other tileimps with flag IsIrrigation
    		Bit IsIrrigation                     // 
    		Bit NextToCity                     // Can only be built on next to Cities or other NextToCity flags
    		Bit RiverOnly                     // Can only be built on rivers
    		Bit Obstacle                     // FU makes cell impassable
    		Bit IsUrban
    		Bit NextToUrban
    
    	}
    
    	#Added Sound by Martin Gühmann
    	Record Sound Sound
    	Record Terrain[] CantBuildOn
    	Record Government[] GovernmentsModified
    	Record CityStyle[] CultureOnly          // Can only build imps if civ has certain citystyle (E)
    	Record Government[] GovernmentType      // A copy of unit Government type code (E)
    	Record Resource[] IsRestrictedToGood    // Can only build imps if tile has good (E)
    	Record Resource[] EnablesGood           // Having a TI gives a city a good (E)
    	Bit(Struct Effect) Effect
    	Struct Effect[] TerrainEffect
    	Bit DeniedToEnemy                       // FU
    	Bit CanExportTileValue                  // New Colony code (E)
    	Bit CanExportGood                       // New Colony code (E)
    	Bit CanExportTileValueRadius
    	Record TerrainImprovement[]     PrerequisiteTileImp
    	Bit IsCanal								//FU
    
    	Record Icon Icon
    	#MDS 090800 not sure about this, trying to add 2 new fields...
    	StringId Tooltip
    	StringId Statusbar
    
    	Int Level # If a farm, is it farm 1, farm 2, farm 3?  same thing for any type.
    	Int[] ConstructionTiles
    
    	Bit(Record Terrain) TerraformTerrain # Only meaningful if Class == Terraform
    	Bit(Int) Column # ignored except for terraforms
    
    	Bit(Int) IntBorderRadius
    	Bit(Int) SquaredBorderRadius
    	Bit(Int) MoveBonus
    	Bit      Colony                         // sends good every turn to a city
    	// moved to effects
    	//Bit(Int) BonusFoodExport                // not implemented
    	//Bit(Int) BonusProductionExport          // Installation Gives PW
    	//Bit(Int) BonusGoldExport                // Installation gives Gold
    	//Bit(Int) FranchiseProduction			// Exports production value as a franchise to pay mil costs 
    
    
    	Bit GLHidden
    
    	# Display level (0 = ground level = under roads, > 0 = on top of roads)
    	Int DisplayLevel = 0
    	# Pillage prevention
    	Bit CantPillage                         // Tileimp cannot be pillaged (E)
    	Bit SpawnsBarbarians                    // Spawns Barbarians
    	Bit CanBuildAlly						// can be built in ally territory
    	Bit CanBuildWasteland					// can be nuilt in unclaimed land, to connect cities
    	Bit CanUpgrade
    	Bit IsCityRuin							//left when cities are destroyed
    
    
    		#Energy Code
    	Int   EnergyHunger = 0
    	Int   ProducesEnergy = 0
    }
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    Re: Design: Tile Improvements

    Originally posted by E
    These may need balancing as well. I for one think early farms should use my Needsirrigation and IsIrrigation flags. That way you have to build near fresh water rivers or other farmland. It would make rivers more strategic.
    I wouldn't mind using it either, but the problem is the AI.

    If the farms provide irrigation to adjacent tiles, then the AI needs to know how to chain them from city to city. If the AI can't chain farms, then it's obviously bad to use IsIrrigation on farms.

    If farms can only be built next to/on rivers (NeedsIrrigation only), then it's easy for the AI to use. But you could have many cities without any farms at all, so you'll either need serious food trade working (we haven't got that), or farms need to be made less crucial like in CtP1 (which also required rivers for farms IIRC) and granary (which is available in any city) much more beneficial. I know the granary in CtP1 was much better for the same reason.

    To summarize, if farms are weakened and granary bonus increased, then next to/on rivers is fine with no chaining.

    My only worry is cities with rivers will become too good, so much so that rivers shouldn't give any food, just +5 gold, and provide irrigation.

    The AI's obsession with mines on flatland will also become useful

    Another thing thats up for debate is the 'DeniedToEnemy' flag. Somehate it. But i think civ3/4 went to far in limiting roads and railroads. I think roads shouldbe left alone but railroads should be denied to someone at war because its impractical and too much of an advantage to get a 1/10th move into a territory. a big exploit for humans.
    I can't see how it can harm the AI at the moment. If the AI is taught to use balanced armies and it's invading armies are strong and large, then they're slow. The high movement from rails in enemy terrain is only exploited by the human, by pillaging tactics and capturing smaller cities in the weak centre of a civ. Both of which the AI doens't do, and even if it does pillage it would be only on the way to attacking a city.
    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


    • #3
      Thanks Maq.

      The irrigation flags allow for chaining. Not sure if the AI will figure that out or not. So far when I've added 'CanBuildwasteland' to roads the AI has built roads through wasteland to connect cities. It may do it for farmland we may have to test.

      thats another thing we should look to adding "canbuildwasteland" to roads. but not railroads


      DeniedToEnemy is something we can test out as well.
      Formerly known as "E" on Apolyton

      See me at Civfanatics.com

      Comment


      • #4
        Originally posted by E
        Thanks Maq.

        The irrigation flags allow for chaining. Not sure if the AI will figure that out or not. So far when I've added 'CanBuildwasteland' to roads the AI has built roads through wasteland to connect cities. It may do it for farmland we may have to test.
        I don't think that would tell the AI to chain to another city to provide irrigation though. Building roads it knows to go from city tile to city tile in the shortest route, but it just puts farms on the inner ring working outwards when it decides the city needs a farm (rarely!).

        I imagine it would only be by pure coincidence if it chained one together.
        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


        • #5
          Just looking at CtP1 and how Adv. Farms come much later (Oil Refining), I think this is part of the reason specialists are so much better in CtP2, because theres such a surplus of food really early in the game. It makes trading posts mostly useless when you have scientists to generate science, and you have so much food that you can still grow quickly and use many specialists.

          There's also the point the actual graphic for the farm represents something more modern, but that's not the main point that they're too early.

          One choice is Railroad. It has no tile imp, fits pretty well with the timeline and in a historical sense, RR did revolutionise agriculture.

          Another is Electricity (Refrigeration), this would IMO mean moving Listening Post (Watch Tower?) to Geometry or somewhere earlier where it's actually some use and worth building.
          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


          • #6
            E how does NeedsIrrigation work? I put it under farm entry but it still allows me to place farms anywhere. Do i need to put anything anywhere else?
            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


            • #7
              It supposed to work where the tile must be located next to (1 space) a river or another tileimp (1 space) that has IsIrrigation (that way we can limit it to rivers).

              Let me see whats wrong, I tested it before and it worked.


              EDIT


              It has to go under the effect part i.e/

              Code:
                 TerrainEffect {
                    Terrain TERRAIN_DESERT
                    Terrain TERRAIN_GRASSLAND
                    Terrain TERRAIN_PLAINS
              
                    BonusFood 20
                    EnableAdvance ADVANCE_AGRICULTURAL_REVOLUTION
                    ProductionCost 500
                    ProductionTime 2
                    TilesetIndex 8
                   [b]NeedsIrrigation[/b]
                 }
              I might have not removed the older code.
              Formerly known as "E" on Apolyton

              See me at Civfanatics.com

              Comment


              • #8
                yeah I tested and that is probably your problem. it worked for me.

                I also have an urban version where you can only build next to cities or other "IsUrban" tileimps
                Formerly known as "E" on Apolyton

                See me at Civfanatics.com

                Comment


                • #9
                  I just put exactly the same thing as above and it brought two popups, "Expected Record Name" and "Unknown Token". Using rev732b. Any ideas?
                  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


                  • #10
                    as per the cdb above:
                    Bit NeedsIrrigation
                    Bit IsIrrigation
                    Bit IsUrban
                    Bit NextToUrban


                    all go under the effect part. I just did NeedsIrrigation for 732b and it worked. Just try that one first.
                    Formerly known as "E" on Apolyton

                    See me at Civfanatics.com

                    Comment


                    • #11
                      Thanks E got it working now. Seems like I didn't extract 732b into the right install. Confusing when you have 3 or 4 installs
                      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

                      Working...
                      X