Announcement

Collapse
No announcement yet.

DESIGN: Trade

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

  • #16
    But oil is used in lots of things its not just a fuel source.
    Allways vote banana, its high in potassium!

    Comment


    • #17
      I know that but it’s an example however if you don't take the hydrocarbons you don’t need less then 1/2 the oil would be used for the creation of plastics.
      "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
      The BIG MC making ctp2 a much unsafer place.
      Visit the big mc’s website

      Comment


      • #18
        I like the new trade ideas. Should these also be options in diplomacy too? or strictly with the caravans?

        Civ3 (to cherry pick) also lets workers be traded. Since there is no workers in CtP2, and as horrible as it sounds, what about slave trading?

        I like the bonuses with goods (I'd like to see certain goods have different bonuses besides happiness, maybe increase in PW for oil, etc we could gave a separate thread on that if interested).
        Formerly known as "E" on Apolyton

        See me at Civfanatics.com

        Comment


        • #19
          Slave trading has long time been a dream of many people (to represent real world)
          The problem with that is that that slaves come from some wear your civ for instance so you would by your own people back to be enslaved.
          "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
          The BIG MC making ctp2 a much unsafer place.
          Visit the big mc’s website

          Comment


          • #20
            Slave trading sounds too complicated what about if Public works points could be traded in diplomacy? That might be usefull.

            My thought is that if there is slave trading from civ to civ you would have to have some nice fat penalties and such to make it balanced.

            Also one thing that earks me the most about the trade system is that the routes never take the best route to a city. They allways stay in shallow water if they can even if theres a shorter distance over deep water. This becomes problematic because they AI doesnt really ahve to work too hard to pirate routes. Since all routes end up jumbled together in the shallow water. This is my experience anyway anybody else notice this?
            Last edited by tyrantpimp; January 24, 2004, 12:55.
            Allways vote banana, its high in potassium!

            Comment


            • #21
              pw is easy.

              Trade does take the long way around. You know it is possible for the good to go almost around the world to reach a city at the side of you. it because a good will only go over terrain that has been discovered.
              "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
              The BIG MC making ctp2 a much unsafer place.
              Visit the big mc’s website

              Comment


              • #22
                Trade takes the long way around no matter what, i have the whole map explored and the routes stay the same. This is after breaking them and making new ones. Routes favor the shallow water for some reason.
                Allways vote banana, its high in potassium!

                Comment


                • #23
                  Originally posted by tyrantpimp
                  Trade takes the long way around no matter what, i have the whole map explored and the routes stay the same. This is after breaking them and making new ones. Routes favor the shallow water for some reason.
                  Actual the routes use the wrong path, I got the notion that their path is like they were air units but have to respect the terrain move costs, but ignore rivers and roads/railroads/maglevs.

                  Well this is actual just a guess into the blue so far, actual my indention is to use the Fraight flag in terrain.txt and now also in tileimp.txt to calculate the path. But that is more difficuilt than I thought, because I lost me in the Tradeastar.cpp or how the file is called and I didn't try again recently.

                  -Martin
                  Civ2 military advisor: "No complaints, Sir!"

                  Comment


                  • #24
                    At first I thought tyrantpimp was playing the wrong version of the game. For all I knew, CTP2 always had straight-to-the-goal trade routes. I remember CTP1 having
                    routes that followed roads, and me wondering why this silly AI that was creating trade routes right through my cities when at war with me.

                    After some testing, I realised he was correct after all. When crossing water, strange bends may appear in the routes for CTP2. Time to find out how it really works, and delve into the pathfinding.

                    The A* pathfinding is based on 2 values for each tile.
                    The first value is the real cost it took you to get to a tile from the city that is going to send a trade good (start). This is 0 at the start, and goes up until you reach the city you want to send the good to (goal).
                    The second value is an estimate of what it will cost to get to the goal from a tile. This starts at some value in the start, and goes down or up, depending on whether you move towards or away from the goal.
                    Now, you basically begin at the start, and expand it by determining the real and estimated costs for each of its neighbour tiles. After this, you select the unexpanded tile with the lowest sum of real and estimated costs, expand it, and repeat the process until you reach the goal.

                    First observation: unlike for the army movement paths, the real costs for the trade routes do not depend on the terrain, nor on its improvements. The only thing that matters is the direction. For N, S, E, and W "movements", the real costs are 5. For NW, NE, SE, and SW "movements", the real costs are 4.75. So, the trade routes prefer a straight NW + NW (cost 9.5) over a bended N + W (cost 10) path.

                    Second observation: the estimated costs do depend on the terrain movement costs, which are recomputed every barbarian turn. For the actual values, see the Movement values in terrain.txt and the MoveCost values in tileimp.txt. Typical values are 100 (plains, grassland, all water tiles),
                    50 (rivers, cities), and 33 (roads).

                    Third observation: for the trade route computation, the value of a tile does not only depend on the movement cost of the tile itself, but also on its surroundings. Have a look at .
                    The bottom part of this picture shows a block of 8 tiles with XY coordinates, starting at the top left of the map. You may ignore the top part of the picture. It is showing the same block with RC coordinates. I was just too lazy to remove it.
                    The map is divided into a repeating pattern of blocks of this shape, and all tiles of a block share the same value, being the smallest of the movement costs of the 8 tiles. So, if you have only water tiles in a block, the value is 100. It will also be 100 when e.g. 7 of the 8 tiles are mountains (movement 400) and only 1 of the tiles is water. Note also that after completing a road on any of the mountains, all tiles of the block would get value 33.

                    Fourth observation: it gets even worse. After having assigned each block a value, the actual estimated cost is not value of the block, but the smallest value of a group of (up to) 9 blocks, consisting of the block itself and its directly neighbouring blocks. So, completing a road at tile (7,7) may set the value of tile (0,0) to 33, even when all tiles in the block of 0,0 are unroaded mountains or water.

                    This explains why water tiles far from the coast stay at value 100 for a long time (until you start building underwater tunnels), while tiles near to the coast will get lower values earlier in the game (when you construct cities and roads).

                    Fifth observation: unexplored tiles will never be used in a trade route path, but will be taken into account in the value computations. So, the AI is not the only one to cheat.

                    Last observation: the estimated cost for a tile is simply the product of the remaining tile distance to the goal and the value of the tile. Tiles with value 100 will just not get selected for expansion, unless there really is no other option to get to the goal. With a real value of 5, a city or river somewhere on the coast would already enable a detour of at least 10 tiles.

                    It really is a pity that the original code comments have been removed. It would be interesting to see whether it has been designed in this way deliberately. And the real cost code of CTP1 has been lost as well.

                    Comment


                    • #25
                      Yup, first thought is that. Water tile effective move cost (for trade calculations) should be changed by certain naval techs, rather than being fixed.

                      Comment


                      • #26
                        Actual the original idea was to do it like in CTP1. But they forgot to implement the CalcTerrainFreightCost() method afterwards I implemented it, you can see the results on the attached image.

                        Note if there are no maglevs then the path between Chichen Itza and Uxmal would follow the coastline on the shallow tiles.

                        -Martin
                        Attached Files
                        Civ2 military advisor: "No complaints, Sir!"

                        Comment


                        • #27
                          Uh? Could you explain that again, Martin?

                          Comment


                          • #28
                            Well,

                            The problem is that you have in the ..\ctp2_code\gs\world\wldgen.cpp a method called CalcTerrainFreightCost, in the original version all it does is returning 5, instead of the actual FreightCost of the terrain. All I did was to add a similar function to the Cell class and modelled like the CalcMoveCost method there, but it retrieves the fright cost from the TerrainDB and TileImprovementDB instead the move costs and that it is. So I hope you can see the trade route in the picture above, actual there are two following the maglevs and one following the river more or less, without the maglevs the a trade route from Chichen Itza to Uxmal what go through the shallow water along the South cost of that continent instead following the maglevs. Of course I used the cheat editor to place the cities and the maglevs.

                            Another interesting thing I have to note is that the number of Caravans you need to build a trade route depends on the Freight costs of the terrain between the cities, on the maglevas the costs are the lowest and you need instead of 25 Carvans just 1.

                            So now it does make sense that you loose a Caravan if you break the route, because when you build the route again and you have a better connection between the cities you save some caravans.

                            -Martin
                            Civ2 military advisor: "No complaints, Sir!"

                            Comment


                            • #29
                              I still don't see how why it would follow the shallow water tiles, if they cost the same as un-roaded, un-rivered plains/grassland. I.E. 100

                              Surely the land route is better either way... although it might take a slightly different route on the river, if the maglev isn't there.

                              Comment


                              • #30
                                Originally posted by MrBaggins
                                I still don't see how why it would follow the shallow water tiles, if they cost the same as un-roaded, un-rivered plains/grassland. I.E. 100

                                Surely the land route is better either way... although it might take a slightly different route on the river, if the maglev isn't there.
                                Well that would be true if all terrains have a base Freigth of 100, but in fact that isn't true, Forest have a base Freight of 200 like there Movement is Glacier for example have a Freight of 500 in comparision to Movement 300, and finally all Water tiles have a Freight of 33 in comparision to Movement of 100, so the sea route is in fact cheaper, and I think that was also in reality the case.

                                -Martin
                                Civ2 military advisor: "No complaints, Sir!"

                                Comment

                                Working...
                                X