Announcement

Collapse
No announcement yet.

Fli questions for Daniel (or anyone else).

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

  • Fli questions for Daniel (or anyone else).

    This is the segment from the outputs fli dealing with road construction. I want to set to so that the AI sets aside 5% of PW for road construction. How would I do that?

    // pick roads or no roads
    output inst_road_coef[0.0, 100.0] = 0.0
    tri zero_roads(inst_road_coef, 0.0, 0.001)
    tri no_roads(inst_road_coef, 0.05, 0.001) // WW from .01
    tri yes_roads(inst_road_coef, 1.0, 0.001)

    I think most of the stuff I want to tinker with is in the outputs fli, so if you could pick a section, and give a detailed explanation of what each term and number means, I think I could make some more improvements to the game.
    [This message has been edited by WesW (edited October 13, 1999).]

  • #2
    Hi,

    I will tell you what I think based on my understanding of CTP but I haven't made a test and one would be in order.

    I would change outputs.fli to be:

    // pick roads or no roads
    output inst_road_coef[0.0, 100.0] = 0.0
    tri zero_roads(inst_road_coef, 0.0, 0.001)
    tri no_roads(inst_road_coef, 0.01, 0.001)
    tri some_roads(inst_road_coef, 0.05, 0.001)
    tri yes_roads(inst_road_coef, 1.0, 0.001)

    and I would change set_inst_priority.fli to be:

    if (yes_opening_game_strategy)
    {
    zero_roads
    } else {
    some_roads
    }

    or something like that depending on what exactly you want to do. A test is in order and I suggest that if you do one, set some_roads to 50% instead of 5%, it will be easier to see if it works. Also the % might be calculated of the total PW (and the AI set the PW most of the time to 30%)so if you want to achieve 5% of overall production you will need to set some_roads to 16.7% (16.7% x 30% = 5.01%). I might do a test this weekend if I have time. If you do one please let me know.

    Comment


    • #3
      Actually, that is the way things are already set up, except that no_roads acts like your some_roads.

      // pick roads or no roads
      output inst_road_coef[0.0, 100.0] = 0.0

      The segment 0.0, 100.0- this defines the range of accepted values, right? Shouldn't the highest value be 1.0, since were talking about percentages? Also, why is it set equal to zero? Is this just a place holder figure?

      tri zero_roads(inst_road_coef, 0.0, 0.001)
      tri no_roads(inst_road_coef, 0.01, 0.001)
      tri some_roads(inst_road_coef, 0.05, 0.001)
      tri yes_roads(inst_road_coef, 1.0, 0.001)

      Finally, what does the .001 figure represent?

      I quess what I really need is a booklet about this programming language. I've had a few basic courses, about 10 yrs. ago, in Apple Basic, Dos, and Fortran, but I don't think any of them used this language's format.

      Also, most of the other blocks in the outputs fli seem to set up differently than this one. If you could detail one of them, it would be very helpful.

      Comment


      • #4
        You say: it's already the way things are set up ?

        I have added 1 line to the output statement, the one that define some_roads and changed inst_priority that used to be no_roads to some_roads and that should do what you want.

        Unless when you say it's already set-up like this you mean that it's what you did in you're mod. In this case I am sorry I was not able to keep current with what mod makers have been doing for a couple of months.

        Now for explanations; I realize re-reading my last post that I was short on them. I humbly submit my toughts to you.

        In:

        output inst_road_coef[0.0, 100.0] = 0.0
        tri zero_roads(inst_road_coef, 0.0, 0.001)
        tri no_roads(inst_road_coef, 0.01, 0.001)
        tri some_roads(inst_road_coef, 0.05, 0.001)
        tri yes_roads(inst_road_coef, 1.0, 0.001)


        The 0.0 and 100.0 in brackets are indeed ranges that define the min. and max. values.

        Why is it 100.0 instead of 1.0 ? The reason is simple, those values are not representing anything concrete with reality or something you see inside the game. They might use [0, 2] to represent how often an AI will keep it's word, 1.9 might means that it will keep it 90% of the time. The reason behind this is that the engine of CTP is a fuzzy logic engine, it digest all kinds of values, do complex calculations to achieve a results. So the numbers you see are the one the programmers liked best sometimes for reasons or sometines for no reasons.

        In any case it is not a problem for you because you almost always know what they represent. True or false is always 1/0.

        Why in the above example is it initialize to 0 ?

        I am pretty sure that it is because that block of code is only there to "define" no_roads, zero_roads and yes_roads. Whatever value it is initialize to is overwritten in inst_priority.

        What do represent 0.001 ? In this particular case nothing. That part is very inportant in a input statement where it is use to define a range. I would need to check back some code to tell you for output statements, now i am at the office and i have none in front of me.

        I've got to run, bye for now.

        Comment


        • #5
          This is a section of inst_priority that I referred to about the roads.

          if (yes_opening_game_strategy)
          {
          zero_roads
          } else {
          no_roads
          }
          As you can see in my earlier post, I changed the setting from .01 to .05. CD had earlier set it to .01 from, I believe, 0. Thus, I had it set to devote 5% of PW to roads, and was checking with you to verify this, as I had become confused.

          What I specifically want to change in the game now is the amount of food that the AI aims for when placing workers. I pieced some things together from CD's comments, and I think that the AI's target value comes out to a growth every 10 or 11 turns for a city with a granery and an aqueduct. This seems too fast to me. I would like to set it so that cities grow about every 13 or 14 turns. (I know that the AI always places the worker on the best food tile whenever one of my cities grows.)
          I believe the code for this is in the first half of the outputs fli. CD made several changes in this section to try and achieve this same thing, I believe, but I can't make sense of them.

          Comment


          • #6
            My appologies, WestW. I have read you're question to fast and I never noticed that you had modified the piece of code. Of course changing the value of no_roads is very good and will acomplish the same thing.

            To get back to the output statement I made verifications and the range (the third argument) is widely use. It is very logical to assume that CTP try to shoot to be within that range when it can but I can't tell you what would happened if you make the values overlap. I guest it could depends on what values.

            I have took a quick look about the food and saw that as the game advance and the number of city increase the rations are increased as well. It makes calculations about the %of surplus of food but I didn't see where it aims at a 10 or 11 turns growth target. I will take a look at it and get back to you. I will also download CD's modifications to take a look at. Are they part of is main mod or is it a different one ?

            Comment


            • #7
              About CD's modifications; I think they are in two places- in his mod in the aidata and aip folders, and here at this site in the modification section.
              About my calculations on the food; I have checked out what the computer is doing in my current game, and I may be wrong. I think maybe the computer shifts workers around a lot depending on the situation. I think this is what CD found out, too, and why he didn't spend a lot of time trying to change it.
              I think I'm going to go ahead and submit the files as they are now. If someone discovers a significant improvement in the future, we can always submit a new version.
              Thanks for your help.

              Comment

              Working...
              X