Announcement

Collapse
No announcement yet.

Final (5.3) Tech Dynamics

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Coding for the technology model and its editor is all but complete. I have had some problems coding the technology level change as a function of helpers and RPs. The formulae do not seem to be all that stable and have not been summarized recently. It is taking time to get a coherent picture.

    The I and E parameters seem to be floating around - I don't know what to do with them. In passing, the symbol E is used for at least three different things in the model.

    The final provisional draft definitive idea for the technology interface is:

    Code:
    /**
     * Title:        TechnologyActivity
     * Description:  Technology specific aspects of activities
     * Copyright     2001, the Clash of Civilizations Development Group
     *
     * @author       Gary Thomas and Mark Everson
     * @version      0.1, Date: March 27, 2001
     */
    
    /**
     * The general interface for all connections to the technology model.
     * 
    
    
     * The calls are grouped according to their context.
     * 
    
    
     * Definition:
     * [b]owner[/b] or [b]Technology owner[/b]:
     * any entity (civilization, province, map square, city, scientific genius
     * character - the Einstein effect) that has a technology level profile.
     * The system keeps a list of owners, and they can interact.
     * 
    
    
     * In addition to this interface there are three static calls:
     * 
    
    
     * Create a new Technology object for a new technology owner
     * TechnologyInterface Technology.newInstance(String owner)
     * 
    
    
     * Find a Technology object for a technology owner
     * TechnologyInterface Technology.getInstance(String owner)
     * 
    
    
     * Update the technology levels for all owners
     * void Technology.update()
     */
    public interface TechnologyInterface {
    
      //---------------------- Affecting the interface itself -------------------
      /**
       * Remove this technology.
       * 
    
    
       * This does not destroy the interface object, it just removes the owner
       * from the owner's list. To get rid of the object, set it o null.
       */
      public void remove();
    
      //---------------------------- Other Technology ---------------------------
      /**
       * Clone this technology (the owner has split into two parts).
       * 
    
    
       * The new interface will be a copy of the old one, with all the same
       * levels
       * @param newOwner the owner's name for the new interface
       */
      public TechnologyInterface copy(String newOwner);
    
      /**
       * Merge this technology (two owners have merged)
       * 
    
    
       * Note that this does not remove the (now) redundant owner.
       * @param merging the name of the other owner
       */
      public void merge(String merging);
    
      //-------------------------- Technology levels ----------------------------
      /**
       * Get the level of a particular technology for this civilization
       * 
    
    
       * @param name name of the technology
       * @return the technology level for this technology
       */
      public float getLevel(String name);
    
      /**
       * Set the level of a particular technology for this civilization
       * 
    
    
       * @param name name of the technology
       * @param level the technology level to be set
       */
      public void setLevel(String name, float level);
    
      //----------------------------- Applications ------------------------------
      /**
       * Application, method to determine whether an application is buildable
       * 
    
    
       * @param name name of the application
       * @return true if the application can be built
       */
      public boolean isBuildable(String name);
    
      /**
       * Application, get the effect of an application from its name
       * @param name name of the application
       * @return the effect of technology on the application
       */
      public float getEffect(String name);
    
      //-------------------------- Research effects ----------------------------
      /**
       * Set the research effect related to an activity
       * 
    
    
       * @param activityData the activity data
       */
      public void addToResearch(String name, float value);
    
      //--------------------------- Diffusion -----------------------------------
      /**
       * Set diffusion from neighbour
       * @param neighbour name of neighbour
       * @param effect the effect (0.0 - 1.0) of the diffusion
       */
      public void setDiffusionFrom(String neighbour, float effect);
    
      /**
       * Set diffusion from neighbour
       * @param neighbour TechnologyInterface of neighbour
       * @param effect the effect (0.0 - 1.0) of the diffusion
       */
      public void setDiffusionFrom(TechnologyInterface neighbour, float effect);
    
    }
    To use this:

    1. For each technology owner, get an interface:
    TechnologyInterface parisTech = Technology.newInstance("Paris");
    If you need to find an existing interface, use:
    TechnologyInterface londonTech = Technology.getInstance("London")

    2. To get rid of an interface (when London burns, for example), use
    londonInterface.remove();

    3. If Paris splits into two different communes with the same tech levels, use
    TechnologyInterface newParisTech = parisTech.copy("New Paris");

    4. Then, when they reunite:
    parisTech.merge("New Paris");
    newParisTech.remove();

    5. To get the tech level for a particular technology, use
    float londonBottlers = londonTech.getLevel("Bottle washing theory");

    6. To set the tech level for a particular technology, use
    londonTech.setLevel("Bottle washing theory", 87.43);

    7. For applications, to see if London can build an automatic washing machine, use
    londonTech.isBuildable("Automatic washing machine");

    8. To get the effectiveness of said application, use
    float washerbility = londonTech.getEffect("Automatic washing machine");

    9. To add some research to an activity, use
    addToResearch("Cleanliness", 32.2);

    10. To update all the technology levels in the game at the end of a turn, use
    Technology.update()

    I have also added a couple of diffusion knoledge methods which I will discuss later:
    public void setDiffusionFrom(String neighbour, float effect);
    public void setDiffusionFrom(TechnologyInterface neighbour, float effect);

    That's enough for one post.

    Cheers

    Comment


    • I tried to post this a few moments ago but it got lost. 2nd attempt.

      A quote from Richard:
      quote:


      A preliminary idea for distribution or RP’s would be to give each tech a percentage of the total RP spent as follows:
      For every tech [associated with that Activity], raise 2 to the power of Z/2 and then subtract one. Call this the Y value.

      Add up all of these values to find the X value.

      Each tech gets a percentage of the total RP’s spent equal to Y / X.



      This is a strange transormation: 2Z/2

      Would it not be better to just store the proportions? Easier to code, and more importantly, easier to understand.

      Cheers


      Comment


      • I and E have been dropped out of the picture for now.

        What were the other two uses of E?

        Yes, we can certainly eliminate the 2Z/2. As I said, that was simply a rough draft of an idea. The ActivityEffect can simply be stored as a number. These numbers would typically be between 1 and 64. The RP distribution would then be based on a proportion. Example:

        A CivilizationActivity, Infrastructure, has the following techs with ActivityEffect numbers (Tier 3 techs omitted for brevity):

        Architecture, 50
        Civil Engineering, 60
        Construction, 30
        Roads, 35
        Masonry and Cement, 20
        Mapping and Surveying, 20
        Mechanical Engineering, 10

        Architecture would then get 50/225, or 22.2%, of the RP's generated by investment in the Infrastructure infraclass.


        Hmm, would it be easier to have the techs store a percentage? So Architecture would be assigned 20% Infrastructure. The designer would then have to make sure that the percentages added up to 100%, but it might be a more intuitive way to assign the values.

        At a glance, your plan looks good, but I haven't taken time to go over it well.

        I wish I has known about the ,sup. tags earlier. That would have made the equations look a lot better. Where can I go to get an overview of useful html code?

        Comment


        • The companion to &ltsup&gt is &ltsub&gt

          There is a very useful O'Reilly book: HTML Pocket Reference. This has everything you need, it is small and cheap.

          Here is a random sample of some other stuff from one of my JavaDoc comments in another project:

          "The model is:

          yr = f(xr, q) + er(q)


          the dependence on q being implicit. The index r
          indicates the rth sample, r = 1, n. Bold face indicates a vector.




          For brevity these are represented by:
          yr = fr + er




          Let
          M = Srer2

          and the function to be minimized (using maximum likelihood) is




          F = -&frac12 n log M

          "

          I hope it comes out right!

          For the percentage weightings, the editor program will take any numbers and scale them before saving. If you then edit the Activity you will get the scaled values which can then be adjusted.

          Cheers

          Comment


          • Excellent stuff Gary! And those HTML codes are gonna come in handy too...

            "Bottle washing theory" - LOL

            One thing you need:

            addToResearch(String name, float value) needs to also support adding RPs directly to a tech, a opposed to an activity. That is for the case where Roosevelt says, Here's $2B (1942 dollars), go find out how to build an atomic bomb. Or the modern US govt says use $X for basic Physics research. If you can already do this, then its just the doc that needs to be updated.

            [This message has been edited by Mark_Everson (edited April 04, 2001).]
            Project Lead for The Clash of Civilizations
            A Unique civ-like game that will feature low micromanagement, great AI, and a Detailed Government model including internal power struggles. Demo 8 available Now! (go to D8 thread at top of forum).
            Check it out at the Clash Web Site and Forum right here at Apolyton!

            Comment


            • From Mark:
              quote:


              One thing you need:

              addToResearch(String name, float value) needs to also support adding RPs directly to a tech, a opposed to an activity. That is for the case where Roosevelt says, Here's $2B (1942 dollars), go find out how to build an atomic bomb. Or the modern US govt says use $X for basic Physics research. If you can already do this, then its just the doc that needs to be updated.



              One way of achieving this is to create the appropriate Activity for each such transfer, with a single technology as the recipient. Doing it this way has the advantage of using a single mechanism.

              After all, spending on basic research (such as bottlewashing) is an activity. Also, in spite of the goverment's efforts there might be some spill-over into another type of research, which the activity system can reflect.

              On the other hand, if the idea is that any technology can have research applied, then the program could be easily modified to allow a technology name as well as an activity name.

              Cheers

              Comment


              • It is some time since the research formulae have been summarized, and there have been some changes. Here is the equation as it is currently implemented in the code:














                ytthe technology level at time t
                mgrowth rate (the product of the base growth rate and the specific technology modifier)
                cupkeep (product of base upkeep and the specific technology upkeep)
                sThe level of a technology when it is first discovered
                HThis variable is the total influence of all helper technologies.
                yitthe level of the ith helper technology at time t
                hithe effect of the ith helper technology
                dithe offset for the ith helper technology
                Wadjustment variable
                Rdiminishing returns factor (product of base diminishing returns and the specific technology modifier)
                rresearch points available
                Gadjustment variable for exponent
                Mbase of exponentiation


                then H = 2Sihi (yit + di - yt)/W

                Let V1 = rm - c M(yt - s)/G



                If V1 < 0 then let V2 = V1

                otherwise let VM = HV1R

                                     G log(M(yt - s)/G + V2)
                Now    yt+1 = ---------------------- + s
                                            log M

                Is this right?

                Sorry about the funny font sizes!

                Cheers


                [This message has been edited by Gary Thomas (edited April 05, 2001).]
                [This message has been edited by Gary Thomas (edited April 05, 2001).]

                Comment


                • quote:


                  H = 2Sihi (yit + di - yt)/W


                  Should be:

                  H = MSihi (yit + di - yt)/W

                  quote:


                  Let V1 = rm - c M(yt - s)/G

                  If V1 < 0 then let V2 = V1

                  otherwise let VM = HV1R



                  Should simply be:

                  VM = rRmH - c M(yt - s)/G

                  You were using an outdated plan. Sorry.

                  quote:

                  The formulae do not seem to be all that stable and have not been summarized recently.

                  I knew that they were unstable, and I changed them before. I mentioned the changes in this post, but did not explain them fully. The proper equations were in the spreadsheet and the spreadsheet instrictions, but I must have forgotten to post them.

                  My test of the system will be to plug exactly the same numbers into the spreadsheet and the Java code. The results will hopefully be the same.

                  You can get the tech spreadsheets at My website or the Clash website in the tech section.
                  [This message has been edited by Richard Bruns (edited April 05, 2001).]

                  Comment


                  • It turned out that the code, which is a modification of Mark's original code, had the right equations. I just got the wrong ones when I was trying to summarize it.

                    quote:


                    You can get the tech spreadsheets at My website or the Clash website in the tech section.


                    Getting equations from a spreadsheet is unbelievably tedious and error prone. Going from the correct equations is much better.

                    The code, as far as the model goes, is now complete and I am working on the test harness.

                    There are, however, gaps in the model, or perhaps in my understanding of it.

                    There are various mentions of "when the technology is first discovered" or "the starting level for the technology". There is nothing in the equations to indicate how this works. From an earlier comment that general technologies ("missile weapons") cover the whole gamut from throwing a rock to throwing an ICBM, I rather thought that all technology owners start with all technologies, at however primitive a level. Is this so?

                    If not, what is the triggering mechanism?

                    In the main Clash menu, the description of the tech model starts with a differential equation. I suspect the equation is wrong - it bears a close resemblance to a generalized logistic (and the text suggests that a logistic is intended), but for a logistic, the "RP" (x) term should be "tech level" (y). I haven't checked whether the equations reflect the solution of the differential equation. There is, presumably, some theoretical basis for the equation, otherwise why include a strange term like 1/(log 2) or 1/(log M)?

                    Cheers

                    Comment


                    • Yes, there are some technologies that only appear olater in the game. The Helper Technologies for a certain tech determine when that tech will be discovered.

                      quote:

                      For Helper Techs (Once for each of a technology's helper techs):
                      ...
                      Tr = TechRequirement


                      When all of the helper techs have reached Tr, the technology comes into existence at a level of Ts.

                      The differential equation in the main write-up is horribly outdated. Pay it no heed. I should probably submit a comprehensive updated description for the webpage.

                      Comment


                      • I will implement that for the first coding release for ClashD5

                        I am about halfway through the unit testing of the code. Should be available by Easter, complete, documented, and working.

                        At that point I would like to clarify all the issues relating to the model. There are quite a few parameters whose use seems a bit dubious, or at least unclear to me. I would like to be able to include in the JavaDoc system an exact specification of what the code does.

                        Just as an example, what possible reason is there for any technology to start at a value other than zero?

                        The editor will allow editing of TechnologyData, ApplicationData and ActivityData. In this context all of these relate to their impact on technology only. It will be quite simple to add other aspects of these objects, or to add other objects such as EthnicGroupData, MajorReligionData, or whatever.

                        Cheers


                        [This message has been edited by Gary Thomas (edited April 08, 2001).]

                        Comment


                        • The tech system is defined so that a tech level of 100 represents the highest publicly known implementation of a certain technology as of January 1, 2000. Yes, it's quite arbitrary, but we needed a concrete baseline. This definition, combined with the rule that 10 levels equals double the knowledge or skill, means that the technology will often have to start at a fairly high level.

                          Consider Genetic Engineering as a Tier 3 technology. We look at what it could do in 2000 and then trace backwards to what it could do when it first started. WE aren't measuring raw data accumulated, we are looking at the practical use of the skill. I'd estimate that this process is about sixteen times as effective and does sixteen times as much as when they first developed it. So if it was at level 100 in 2000, then it would have to start at level 60 in 1980.

                          Comment


                          • quote:


                            The tech system is defined so that a tech level of 100 represents the highest publicly known implementation of a certain technology as of January 1, 2000. Yes, it's quite arbitrary, but we needed a concrete baseline. This definition, combined with the rule that 10 levels equals double the knowledge or skill, means that the technology will often have to start at a fairly high level.



                            I am afraid that I do not think that this is a very good idea. A new technology (nanotechnology, for example) which is embryonic at 2000 would still get a 100 rating. By the year 2100 it will be something like level 20000. My personal preference would be to define a "mature level" for a technology, and set that to 100, regardless of the year at which it was achieved.

                            I am uncertain in other areas. Assuming that "the internal combustion engine" would not be an application, but rather an applied technology (it is certainly not a unit), the history of the internal combustion engine, under this system, effectively, has gone from something like 90 to 100 in a hundred years.

                            In fact most specific technologies of this kind do not improve very greatly. There are, of course some exceptions - electronics and its spin-offs are obvious examples.

                            Since the "doubling" is utterly subjective, it is actually just adding another parameter without, as far as I can see, any practical contribution to the game's playability or realism. The growth rate factor already adjusts for scale.

                            Cheers

                            Comment


                            • quote:

                              Since the "doubling" is utterly subjective, it is actually just adding another parameter without, as far as I can see, any practical contribution to the game's playability or realism. The growth rate factor already adjusts for scale.


                              I don't understand. The doubling is not subjective at all. It is central to the operation of the whole system. The effect on applications and as helper techs depends on the scaling rule where 10 levels is double the ability.

                              quote:

                              A new technology (nanotechnology, for example) which is embryonic at 2000 would still get a 100 rating. By the year 2100 it will be something like level 20000


                              Remember that the tech level is a logarithmic scale. 110 is twice as good as 100. Sending the tech to a level of 200 means that its effectiveness has been multiplied by 210, or 1024. That is an enormous change in power and usefulness.

                              The internal combustion engine has become quite a lot more effective. Compare the difference between a model T and the best modern car available. The speed, range, efficiency, and load carrying capacity have been multiplied by at least eight, putting that tech at a start of about 70.

                              Besides, I don't see anything wrong with starting a tech at level 90. If skill only doubles in the time period, that seems a reasonable thing to do.

                              I have tried to make a system that would make it easy to create an accurate tech tree. By referencing the modern world instead of some arbitrary value, I can know exactly what a tech level means. I know instantly that "60" means 1/16th as good as what we have today. There is no question about what the number represents.

                              Since I will probably be the one entering all the numbers, this is very important. If I have to invent some arbitrary ideal level for every tech, then it will take me a lot longer and be very hard to debug. How does anyone else know what I mean by the 'mature level' for genetic engineering? How can I describe that to the person who makes a military unit? If there isn't any good, clear standard, then nobody will know what a tech level means.

                              Remember that the numbers in the core model do not have to be the ones seen by the player. They are for internal game mechanics. Most of the time, the interface will have no numbers at all. The numbers only matter if someone is micromanaging and shooting for a particular application, and then all we have to say is "Raise your Chemistry tech by 8.2 levels to get Gunpowder." They don't need to see the actual levels at all.

                              Comment


                              • I still perfer having all technologies start at 1 and not ness. Reach 100 for December 31, 2000. The main reason is because certain technogies didn't appear until certain other ones were at a specific level. The problem with the 100 mark is that some technologies have increased more than that amount within the past several thousand years. You can't have it both ways, either one or the other.

                                As for inputting the numbers i'll help alot also.
                                Which Love Hina Girl Are You?
                                Mitsumi Otohime
                                Oh dear! Are you even sure you answered the questions correctly?) Underneath your confused exterior, you hold fast to your certainties and seek to find the truth about the things you don't know. While you may not be brimming with confidence and energy, you are content with who you are and accepting of both your faults and the faults of others. But while those around you love you deep down, they may find your nonchalance somewhat infuriating. Try to put a bit more thought into what you are doing, and be more aware of your surroundings.

                                Comment

                                Working...
                                X