Announcement

Collapse
No announcement yet.

Demo 6 Technology Model

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

  • Demo 6 Technology Model

    Edit: The recent name change means that this thread title is obsolete. Tech will be partially implemented in Demo 7, formerly known as 5.2, and will hopefully be fully integrated into demo 8. Where you see "Demo 6" in this thread, read "demo 8."

    OK, it seems that nothing happened to the tech model while my motherboard was fried. The timing couldn’t have been worse; my computer messed up shortly after Gary finished the code that would have allowed me to actually do something productive. So there has been a delay of several months, during which time Demo 5 has apparently been finished. The tech system is then planned for Demo 6.

    For a while, I was planning to do a big summary of the tech system. Since we are prepared to begin development for Demo 6, this is probably a good time to do it. So I will write a tech summary with the following goals:

    1. Describe the tech system so that newcomers can understand it without having to reference any previous posts.
    2. Eliminate archaic holdovers such as bizarre variable names.
    3. Re-familiarize myself with the technical details of the model
    4. Provide a clean starting point for discussion of how the model will fit into Demo 6.

    Note that this is not documentation for the code, nor is it a guide to writing more code. It is intended to be a high level overview of the model, nothing more. Due to various computer problems, I haven’t even seen the code or the tech tree data editor. So I may have to retract some of these statements if it turns out that I was mistaken about how something was coded.

    The Basics (veterans can skip this)

    Clash will not be using the prerequisite-based technology “trees” that most strategy games use. Given the scale and complexity of Clash, this would probably be a nightmare to create and debug. Instead, we will be using a system of gradually increasing skills that is similar to the character development system in RPG’s.

    There will be several Tiers of technologies or skills, each representing a different level of effect on the civilization. They all have the same basic equations, but the player interacts with them differently.

    Tier 1 techs, or “Theory” techs, measure the level of general scientific theories like Chemistry or Psychology. These broad categories of knowledge affect many aspects of the civilization, and can serve as a useful benchmark of overall scientific progress. There are about twelve of these.

    Tier 2 techs, or “Field” techs, like Explosives or Mass Communications, measure the level of a more specific field of study. These have a greater impact on a smaller number of civilization activities than the Theory techs. There will be several dozen of these.

    Tier 3 techs, or “Skill” techs like Artillery or Propaganda Techniques, measure the civilization’s skill in a narrow technical area that has direct effects on the daily activities of the government and society. The number of these could rise into the hundreds, but since they are mostly controlled by economic factors and other technologies, the player will not have to micromanage them.

    In addition to affecting the society, military, and economy of the civilization, the technologies will affect each other. For example, the civilization’s skill level in the Chemistry tech will affect the rate at which the Explosives technology skill level increases. This will in turn determine the development of the Artillery technology, which will have direct effects on the battlefield.

    Just like an RPG character, the civilization’s skills will increase as it gains experience. The development team recognizes that throughout history, many technical advances have come ordinary people in the course of their daily lives and activities. To reflect this, technology rise is a result of the labor input of various activities within the civilization. The more people that are working on some activity, the more potential there is for new ideas and mundane improvements that result in more efficiency for that activity.

    For example, assume that an ancient civilization has started a big public works program, building sewers and aqueducts for several cities. This will result in the hiring and training of many engineers, project foremen, and skilled laborers who are working these systems. Many of these people will have ideas for doing the job better, and as they do their job they will learn more about the job. But they are learning more than just the basic skills for that particular project. They are learning more general scientific facts, as well as skills that are good for other things. In the future, they will be able to take some skills to other areas like the construction of roads or buildings. A few people will develop general scientific theories based on their work experience.

    So in game terms, investing labor in the construction of aqueducts and sewers would result in a lot of improvement in the Skill tech of Water Systems, some improvement in the Field techs of Architecture and Civil Engineering, and a little improvement in the Theory techs of Mathematics, Physics, and Chemistry. This experience will allow the civilization to become a lot better at making aqueducts, somewhat better at working on other buildings and big public projects, and a little better at understanding the basic concepts of science.

    This system of advancing knowledge means that civilizations will develop in a more natural and realistic way. The people will not wake up one morning to learn that the government scientists have developed “Construction” and that they can now make something that they had never heard of before. Of course, the government can still invest in research and education, but that is not the only source of innovation in the Clash world.

    This technology system also allows technological skill to fall if it is not maintained. A certain amount of effort must go into recording and maintaining data and teaching the next generation the skills that were learned. If this is not done, then skills are lost and civilization becomes less effective at doing certain things.

    RP Generation and Allocation

    In Clash, the experience that a civilization gains by investing in various activities is measured by Research Points, or RP’s. This number is at the core of the technology equations.

    The technology system starts by fetching data from the economy model. In addition to this, the player has the option of directing scientific research toward certain areas.

    Note that the technology rise is based on labor input, not product output. If output were used, then the level could easily spiral out of control as higher levels led to higher output which instantly led to higher levels, ad infinitum. It is also more logical to base the RP’s on input, since that represents the amount of thought people put into something.

    I think that the Demo 6 tech system should ignore the effects of technology diffusion based on trade and conquest. In any case, this tech diffusion affects the levels directly, using a mechanism that is different from the RP spending.

    After the labor data is gathered, that data is turned into RP’s. This is done with the civilizationActivity objects. There is a 1:1 correlation between these and the infraclass objects, so each object is responsible for turning the labor input of an infraclass into a RP number that will be used in the technology equations. For now, we can probably get away with something as simple as 1 unit of labor input equals 1 RP. The concept is arbitrary anyway and the technology equations are flexible enough to handle big differences in RP production.

    Example: The economy model shows that 2430 units of labor were spent on the Health Care infraclass. In addition to this, the government funded research that generated 854 RP’s for health care. This means that the civilizationActivity object must distribute these 3284 RP’s among all technologies that would benefit from an increase in health care spending. Formerly this was done with something called “Z values” but Gary and Mark advised that we move to a simple percentage system, which would work much better. So the tech system designer inputs the percentage of RP’s that go to certain technologies. A partial list for the Health Care activity might look like this:

    Theory
    10% Biology
    5% Chemistry

    Field
    40% Medicine

    Skill
    10% Surgery
    20% Pharmaceuticals
    15% Nutrition

    So the Biology tech gets 328 RP’s, Medicine gets 1313, Nutrition gets 493, ect. These values are passed directly to the technology equations, in keeping with the black box design philosophy and good coding practice (I think.)

    I think that the technology data editor allows the user to create civilization activities and set their percentage allocation of RP’s. Gary, correct me if I’m wrong.

    Hmm, it just occurred to me that decimal RP values would probably work better, especially with little-used sectors of the economy. These work fine with the spreadsheet, but is there anything in the code that would be affected by allowing RP’s to be decimals?

    Technology Change Equations

    Note: These equations and their related values are a mathematical ‘kernel’ that the players do not have to see. It would be a simple matter for the interface to interpret these values so that “Gunpowder level 50” is presented to the player as a “Gunpowder level 40” or possibly “Gunpowder AD 1720.”

    There are several concepts used by these equations:

    Knowledge is a linear scale that defines the civilization’s understanding of a technology. It is ideally a direct measurement of quality, performance, productivity, or what can be accomplished with the technology. If the knowledge of Ranged Weapons has doubled, then the civilization will be able to produce military units that are twice as powerful. If the knowledge of Architecture has doubled, then the civilization will be able to produce buildings that are twice as good. If the knowledge of Chemistry has doubled, then the civilization is twice as good at using chemicals to improve the lives of the people. Note that this does not necessarily mean that a library holding all of the facts the civilization knows would be twice as big. It is the application of the knowledge, not its volume, that counts.

    The starting level of a technology, the point of minimal usefulness, is defined to have Knowledge equal to 1. In 1903, our knowledge of Heavier than Air Flight was 1. It is possible for knowledge to fall to fractions below 1 without the system failing. This rare case would represent a civilization discovering the fundamentals of something, but then losing the ability to do anything useful with it. They would probably be able to bring the knowledge back to 1 with minimal effort.

    The technology model defines several values used to transform RP into knowledge. In the code, all of these are the result of a Basexxx global value times a xxxMultiplier value set for each tech. This allows us to customize the technologies but also to change default values easily while keeping the relative values of the techs the same.

    RPDiminishingReturns: This value can be used to handicap larger civilizations. It is normally set to 1, and since the number of RP’s generated is raised to this power, a small change can have very large effects.

    GrowthRate: This value multiplies the number of RP’s produced. It is the primary way to change the growth rate of the technology

    Upkeep: Logically, the amount of effort required to maintain knowledge is directly proportional to the amount of knowledge the civilization has. This value multiplies knowledge, forming a term that is then subtracted from the total RP generation.

    TotalHelperEffect is a working variable, defined later, that summarizes the impacts of the helper technologies.

    So the change in knowledge is as follows:
    Knowledge = previous Knowledge + (TotalHelperEffect * GrowthRate * (RP^ RPDiminishingReturns)) - (Upkeep * Knowledge)

    These values are defined in the data editor and used by the tech system creator to determine the activity of the technology.

    Technology Level is a working variable that makes the knowledge number easier to work with. It is simply a logarithmic scale of knowledge where the tech level changes as follows: When Knowledge is multiplied by the MultiplierVariable (default 2), the tech level increases by the GrowthVariable (default 10). So in the normal game, a doubling of knowledge will result in the tech level rising by 10.

    In order to make tech comparisons easier for the person designing and debugging the system (me), The Technology Level for the default game us designed so that a Tech level of 100 in all technologies represents the most advanced publicly known application as of January 1, 2000. This means that if I look in a reference book and I see that manufacturing productivity in 1750 was 1/50th of what it is today, I can quickly calculate the proper Manufacturing tech level. 100+10((ln1/50)/(ln2)) = 44 Using this benchmark, the ‘proper’ growth rate of knowledge can be calculated and tested.

    This method is also used to calculate the starting tech level, where Knowledge equals 1. The starting tech level will be different for each technology, because of the vastly different rate at which technology has grown. Our current knowledge of one tech might be thousands of times the point of minimal usefulness, while our knowledge of another tech might only be a few times the starting point.

    So Knowledge is equal to MultiplierVariable ^ (( Tech level – Starting Tech level ) / GrowthVariable)

    Helper Technologies and Technology Requirements

    Obviously, not all technologies have existed since the beginning of time. Many technologies cannot appear until a certain level of basic technology exists to support it. The Wright Brothers could not have made their plane if there had been no light engines to power it. They also required a certain amount of physics knowledge to make their calculations. So the required technologies for Heavier Than Air Flight would be a certain level of Physics (Theory) and Engines (Field).

    In addition to being requirements, a high level of these technologies will speed up the rate at which new and better planes can be developed. Better engines and more physics knowledge can make airplane research a lot easier. These helper effects are one of the primary motivations for a player to invest research into the Theory technologies.

    The calculation of the effects of helper technologies is one of the main reasons for using the tech level instead of simply basing all calculations on Knowledge. The following are used in the calculation of TotalHelperEffect:

    Each Helper Technology object associated with a tech contains certain values:

    HelperTechEffect: This is the primary value that determines the amount that the level of the helper tech affects the growth of the technology it helps. It will normally be between 0.1 and 0.5

    HelperLevelOffset is a number added or subtracted to the level of the helper tech in order to make fine corrections to the growth rate.

    TechRequirement: This is the level of the helper tech required for the other technology to exist. The amount that the helper tech affects the technology is based on the difference between this and the current value of the helper tech.

    So each helper tech adds its effect as follows:

    HelperTechEffect * ( Current level – TechRequirement + HelperLevelOffset )

    This equation is run for every helper tech, and the results are added together to form a working variable called RelativeHelperLevel. This value is then run through the following equation to determine the TotalHelperEffect value used in the RP to knowledge equation:

    TotalHelperEffect = MultiplierVariable^( RelativeHelperLevel / (Growth Variable * GlobalHelperEffect))

    GlobalHelperEffect is a value that determines the strength of the connections between the technologies. The value is typically set to something near 1.5. It is lowered to increase the effect of helper tech and raised to decrease it.

    Alert readers will notice that this equation can have a large effect on the growth of a technology. If all the required technologies are 50 levels higher than the requirements, then the RelativeHelperLevel can also get as high as 50. This means that the TotalHelperEffect could multiply the RP generation by 30 or more. In real life, this makes sense. Knowing 32 times as much about Biology will probably make farming research proceed at about 30 times the rate, since all of the theory and background facts will aid a researcher or a farmer immensely. But this could cause problems with game mechanics of not handled properly.

    The main balancing mechanism is the Upkeep value that reduces RP generation based on the knowledge level of the technology. If Biology is 50 levels higher, the upkeep for that tech will be 32 times as much as it once was. That upkeep will reduce the available RP’s for the civ, somewhat balancing the helper effects. But it will not balance completely. Since Biology provides no benefit for the civ other than those helper effects, a high level in Biology will actually hurt the player if its upkeep is higher than its helper effect.

    But the tech being helped also has upkeep requirements. And since the Tier 3 Skill techs do not usually help other techs a lot, their upkeep will be higher than any helper effect they might have on other techs. This helps keep the total system in balance.

    So if helper techs start reinforcing each other too much, we can increase the Global Upkeep value and the Upkeep multiplier value for certain techs.

    Another more direct check on the system is GlobalHelperEffect. It serves to directly limit the effects of the helper techs. Note, however, that if it drops below 1, it will generate synergy that will almost certainly send the tech levels spiraling to infinity.

    Another way to avoid problems is by good design practice. If the total of all HelperTechEffect values for a technology is less than one, the TotalHelperEffect value will be small enough not to cause problems.

    The full thing was too long for one post, so it will be continued as a reply...
    Last edited by Richard Bruns; December 13, 2001, 01:08.

  • #2
    Applications and Tech Effects

    Now we come to the central purpose of the tech model: its effect on the rest of the game. The primary effect will be to make Applications available and to improve them over time. Another effect will be to enhance the overall productivity of an Infraclass.

    An Application is anything that a civilization wants to make or do. A howitzer is an application. Holding an election is an application. A cathedral is an application. Clearing a forest tile for farmland is an application. The level of a civ’s technology will obviously have a big effect on which of these applications the civ can accomplish and how well they can be done.

    The ApplicationEffect value multiplies the effectiveness of the application. This number starts at 1 when the application can first be built. Since the other models define the applications, the base effectiveness is set by those model creators.

    Application effects are very similar to helper tech effects. There are requirements and factors that affect how much affect a technology has on the application:

    ApplicationLongTermGrowth determines how well the application will stand the tech of time. A 0 means that the application will be obsolete after a few years, while a 10 means it will never be obsolete. A library will be useful for thousands of years, so this value will be 9 or possibly even 10. A certain military formation or unit might only be useful for a few years, so the value would be set to 1 or even 0. Note that this does not represent the physical decay of infrastructure; it represents the obsolescence of the general idea.

    ApplicationShortTermGrowth increases the application effectiveness in a linear rather than an exponential fashion. It represents the speed at which an application can be improved in the short term. It also ranges from 0 to 10.

    ApplicationLossModifier takes effect in the special case where the technology level required for the application is falling. This number represents the ability of the application to be used even while the core theory is decaying.

    In addition to these values, there are certain values that are associated with all of an application’s required techs:

    TechRequirement is the level of the tech that the application needs to be invented. If the tech falls below the requirement, the application can exist, but its effectiveness will be greatly reduced.

    TechEffect is the main number that determines how much the technology influences the effectiveness of the application.

    Each required tech affects the application as follows:

    TechEffect * (Current level – TechRequirement)

    This equation is run for every required tech, and the results are added together to form a working variable called RelativeTechLevel. This value is then run through the following equation to determine ApplicationEffect

    ApplicationEffect = RelativeTechLevel * ApplicationShortTermGrowth + (1+.1*(MultiplierVariable-1)* ApplicationLongTermGrowth) ^ (RelativeTechLeve/GrowthVariable) when RTL is positive or zero.

    E = (GrowthVariable + RelativeTechLevel)* ApplicationLossModifier when RTL is negative.

    Please note that this part of the model has not been tested like the other parts. We may need to modify these equations if they end up producing odd effects.

    Aside from the specific applications, techs have an overall effect on the functioning of the civilization. The CivilizationActivity objects have the job of exporting an efficiency value to the Infraclass objects they are associated with. This value is simply called “T” in the economy model.

    Calculating T is done by simply multiplying Knowledge by a number called ActivityEffect that is similar to the effect values used in the helper and application effect equations. Each CivilizationActivity object will hold a list of technologies that affect the efficiency of the infraclass, along with the ActivityEffect value for that technology. T for the infraclass is then the sum of ActivityEffect*Knowledge for each tech in that CivilizationActivity object. It is up to the economic model people to decide exactly how T will be used to define production efficiency.

    I believe that is everything. I have traced the cycle from RP production to the effects on other models. Since I may have gotten something wrong, I’d like the people who know about the tech model to proofread this and point out any errors you find in the summary.

    I have attached my technology spreadsheets to this post. The zip file contains the sheets and instructions for using the spreadsheets. The spreadsheet uses the old, concise names so it can fit on a single screen, but the attached instructions translate the old names into teh new ones.

    Edit: How on Earth did the text get duplicated like that?
    Attached Files
    Last edited by Richard Bruns; March 4, 2002, 12:34.

    Comment


    • #3
      Hi Richard, thats Quite a recap there! I have to admit I didn't read the whole thing carefully, more like a shallow read. That didn't spot any problems beyond potential ones we've discussed already.

      I'm sure more issues will come up as things get fleshed out. BTW here's what I said in the Planning for D6 thread (paraphrased):

      (responding to Gary)
      As I understand it, most of the work for tech would involve interfaces for the player to get info and give orders to the tech system, since the core part is done (coding). This of course depends on Richard doing the entry and early testing for system stability etc. I would like to add: use of the tech system in the econ and military models as appropriate. Implementation: (Mark/Gary) and (Laurent/Gary) respectively on the addition.

      Please respond there with what you think of that plan.
      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


      • #4
        I don't know how I would go about testing for stability, but I can get started on the data entry now. I seem to be unable to run the tech editor properly, but I managed to run enough for it to start generating the xml file, so now I can edit abd add to that file directly if I have to. The tier 1 techs are mostly entered already, and I should be able to finish a rough sketch of the whole system within a week. When I do that, I'll post the xml file for comments.

        However, I see from the editor window that I didn't do a good job of explaining how the Activities work. The Activity itself looks good, if that Multiplier parameter is what I think it is: a value that multiplies the sum of the ActivityEffect values by some number. But each technology in an Activity uses the following parameters and nothing else:

        Percentage of RP's recieved
        ActivityEffect

        Until that is changed, I won't be able to define the Activities and their parameters.

        Comment


        • #5
          Tech Data 6.0.0.1

          I have input a very basic sketch of the tech system. It has all of the current Tier 1 and 2 techs, and the main ("vital") linkages between them. I have set start levels for the helper techs of things a civ should not start with, but otherwise everything starts at zero. I also have not changed any other parameters.

          Attached is a zip file containing the data editor (clashd5.jar), the required xerces.jar file, the .xml file that contains the data, and a batch file for running the editor easily. Just unzip all of this into one folder and run the batch file. Then you can load the .xml from the editor. For future updates, I will only include the .xml file. (unless the editor itself is updated by Gary)

          Note: The included .xml file is formatted to be human-readable and easy to work with in Notepad. It can be read by the editor, but the editor will destroy the human-friendly formatting when it saves the file. I highly recommend backing up the original or saving any changes you make under a different name.

          ----Edit----
          I tried to attach the file, but the browser sat there for over 12 minutes while appearing to be doing nothing. Then I looked at the control panel on my firewall and saw that over 500 Megabytes of data had been uploaded by my browser. The zip file was only about 700k. So I have no idea what was going on. Instead of putting it here, I will upload the zip file to my website.

          Comment


          • #6
            An XML file that zips to 700K bytes, is about the size of seven full size novels, around 30,000 lines of text or about 600 pages.

            Something is not right here.

            How big is the XML file itself (unzipped)?

            Cheers.

            Comment


            • #7
              Re: Tech Data 6.0.0.1

              Originally posted by Richard Bruns
              Attached is a zip file containing the data editor (clashd5.jar), the required xerces.jar file, the .xml file that contains the data, and a batch file for running the editor easily.
              The xml file itself is only 26k unzipped.

              What I want to know is why my browser tried to send over 500 megabytes of data. Was it sending out packets that never reached the Apolyton server, and then blindly churning out more in an attempt to connect?

              Comment


              • #8
                Send the file to me (don't bother to zip it) and I will see what I can do.

                Cheers

                Comment


                • #9
                  Hi Gents:

                  I don't know where things finally ended up on this, but I propose that as soon as D5 is launched that we try to push forward on tech. Once there is basic tech data in the program, I'll try to hook it up to economy and see how it works!

                  What do you two think about it, and what are the possible impediments to getting tech going?

                  Also, Gary, I am hoping to be able to use the technology interface as a template for the econ interface. For my own selfish purposes, it would then be best for you to bring the whole tech model into the D6 framework. That way when I steal part of the design to implement the econ interface, it'd be sure that all the support stuff for NamedObject etc is there. Please let me know if you think this is practical in the short term, or would best be put off till later.

                  I'll also cross-post this last into the D6 Planning thread.

                  Cya,

                  Mark
                  Last edited by Mark_Everson; October 21, 2001, 11:35.
                  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


                  • #10
                    Ok, back to work

                    Now that I've played demo 5, I have a better idea of what to do. I don't think we need to try and implement the whole tree yet, just the basics.

                    Gary, I can't remember if I sent you the file earlier. Let me know if you need me to send it now.

                    I'll copy what I posted in the planning for demo 6 thread:
                    I have constructed a super-simple tech tree for testing with demo 5.1. The only applications are the military units, and I added a new unit: legion. These techs all depend on Military Tactics, and some of them require Metallurgy or Warhorses.

                    The techs that affect the economy are simple: Production and Farming. Farming and Warhorses are both under Biology. Metallurgy is under Production. Production level 5 is also a prerequisite for trireme production.

                    I think we should aim for the following basic functionality:

                    Tech requirements and helper effects work as they should.

                    The player can allocate research to all techs, and the mechanics work properly.

                    The Production and Farming techs allow more investment in the various production categories, as well as increasing efficiency a little. The amount of money spent on these production categories determines the research put into the tech. Farming should also increase the Biology tech a little.

                    Military Tactics increases the power of all units. Fighting battles and moving troops increases this tech.

                    Warhorses affects the speed or movement range of cavalry units.

                    Metallurgy has a small affect on unit power, and affects the cost of the unit.

                    Once we test the functionality of this basic system and stamp out bugs, we can increase the complexity.


                    After posting that, I realized that the tech editor and xml file have no provision for changing different attributes of an a unit. I wasn't planning ahead very well. Instead of a single number for the effects of the helper/required tech, we will want a few different options available for what the application's required techs will change.

                    It also occurs to me that out hard-coding of formulas for things like longtermgrowth and shorttermgrowth is horribly restrictive and unintuitive. Another archaic holdover from my initial bad modeling. Is there any way to allow the user to input any basic formula into the xml file, to be read by the game?

                    Something like this would be very good:

                    - {application}
                    {name}Light Cavalry{/name}
                    {type}Military Unit{/type}
                    {description}Improvements in horse breeds allowed soldiers to ride on the animals instead of relying on chariots, resulting in more mobile and powerful troops.{/description}
                    {attributes}
                    {attack}480{/attack}
                    {health}9{/health}
                    {defense}33{/defense}
                    {movement}3{/movement}
                    {/attributes}
                    {icon}ltcav02.gif{/icon}
                    {sound}horse02.wav{/sound}

                    - {requirement}
                    {name}Warhorses{/name}
                    {startlevel}10.0{/startlevel}
                    {leveloffset}0.0{/leveloffset}
                    {effect}
                    {type}Movement{/type}
                    {amount}+.1 per level{/amount}
                    {/effect}
                    {effect}
                    {type}Attack{/type}
                    {amount}+1 per level{/amount}
                    {/effect}
                    {/requirement}

                    - {requirement}
                    {name}Military Tactics{/name}
                    {startlevel}10.0{/startlevel}
                    {leveloffset}0.0{/leveloffset}
                    {effect}
                    {type}Attack{/type}
                    {amount}+10 per level{/amount}
                    {amount}*1.3 per 10 levels{/amount}
                    {/effect}
                    {effect}
                    {type}Defense{/type}
                    {amount}+2 per level{/amount}
                    {/effect}
                    {/requirement}
                    {/application}

                    The effects would be for the current tech level minus the startlevel. So if Tactics was at 15, the attack would be 602 instead of 480, and the defense strength would be 43 instead of 33. If tactics fell back to 8, the numbers would go down to 431 and 29. The warhorses tech would be handled in a similar fashion.

                    This would replace the old longtermgrowth and shorttermgrowth values with something much more flexible and easier to use. Can it be done?

                    I'm still hacking the xml directly using the editor output as a template, since the editor doesn't yet meet my picky specigications. It occurs to me that we may have been going about this the wrong way. I don't know how to properly request features, so maybe development can go like this:

                    I give the programmer a desired xml file output and/or a request for functionality.

                    The programmer codes that into the program.

                    The programmer then creates an editor to allow anyone to replace the data.

                    This way, the programmer can easily sculpt the editor to fit the existing architecture, instead of trying to make an architecture from the wishes of an ignorant end user.

                    Basically, it occurs to me that since an editor is nothing more than an xml file generator, we should design the xml file before designing the editor.

                    edit: I had to replace the brackets with {} and fix some math
                    Last edited by Richard Bruns; November 7, 2001, 14:36.

                    Comment


                    • #11
                      Clarification (I hope)

                      I realized that my formula example wasn't very clear, so here's a shot at describing it better.

                      In the {effect}{amount} tag, the designer enters a formula. Each formula is calculated based on the starting parameter defined in the {attributes} tag, the current level of the required tech, and the start level of the required tech.

                      What happens in the code is that the program would calculate the difference between the current and start level and plug that into the formula. The code formula would be a concatenation of the user formula and "Value=BaseValue"

                      So if we let L be the current tech level minus the starting tech level, a user-defined formula might be as follows:

                      *(1.3(L/10))

                      and the code runs as follows:

                      Value=BaseValue*(1.3(currentValue-startValue)/10)

                      Ideally, there could be multiple {amount} tags and the code would run them both based on the BaseValue and add the results. But it may be easier to limit the file to one {amount} formula.

                      Oh, and I also need to attach the new .xml file in this thread. This is the simple test system, a copy of what I posted in teh planning thread.
                      Attached Files

                      Comment


                      • #12
                        Richard, what you propose fits very well with the military xml file.
                        One question, however:
                        {amount}+10 per level{/amount}
                        {amount}*1.3 per 10 levels{/amount}
                        Is it a typo or do you mean both apply??

                        You will have to put military applications in the military xml file, which is different from the tech file, so you tweak different files, but I don't think it is a problem.

                        Currently, the military elements have a list of attributes like attack etc, a default value and a cost tag which itself contains kapital, training, etc. sub-tags. Having a requirement tag is easy.
                        As for modifiers, I'd rather not have a user formula, because it requires parsing it and I have already done that at work so I don't want to repeat that again. I changed team to get rid of that part!
                        I would rather limit the bonus to two kinds, either
                        addPerLevel
                        or
                        factorPerLevels
                        So {addPerLevel}0.1{/addPerLevel} is +0.1 * L.
                        As for multipliers, the syntax would be:
                        {factorPerLevels}1.3 10{/factorPerLevels}
                        Giving: Value=BaseValue*([1 + 1.3(currentValue-startValue)/10)
                        (am I right with the 1? You get 0 value at start tech without, which may not be what you want).
                        Note one addPerLevel and one factorPerLevel could be combined.
                        Also, what is leveloffset for?
                        Last edited by LDiCesare; November 8, 2001, 08:39.
                        Clash of Civilization team member
                        (a civ-like game whose goal is low micromanagement and good AI)
                        web site http://clash.apolyton.net/frame/index.shtml and forum here on apolyton)

                        Comment


                        • #13
                          Originally posted by LDiCesare
                          Is it a typo or do you mean both apply??
                          I meant for both to apply. The attack numbers I listed are a result of combining the formulas.

                          You will have to put military applications in the military xml file, which is different from the tech file, so you tweak different files, but I don't think it is a problem. Currently, the military elements have a list of attributes like attack etc, a default value and a cost tag which itself contains kapital, training, etc. sub-tags. Having a requirement tag is easy.


                          So the tech xml only needs a single tag pointing to the name in the other file? The military file can handle the tech requirements and the changes due to changing tech levels?

                          If the military xml and other model-specific xml files have that information already, we may not need to list applications in the tech xml at all.

                          As for modifiers, I'd rather not have a user formula, because it requires parsing it and I have already done that at work so I don't want to repeat that again. I changed team to get rid of that part!


                          Ok, if it's that difficult we certainly don't need it. What you proposed should work well.

                          (am I right with the 1? You get 0 value at start tech without, which may not be what you want).


                          You are right. I messed up the formula. It should be:

                          Value=BaseValue*([1 + 0.3(currentValue-startValue)/10)

                          So the tag would be {factorPerLevels}0.3 10{/factorPerLevels}

                          Note that this is basically the same thing as a longtermgrowth value of 3, but it is easier to understand.

                          Also, what is leveloffset for?
                          What it does is change L before the formulas are applied. L is actually the current tech level minus the starting tech level plus the offset. I don't know if it is useful anymore with the new formulas.

                          Comment


                          • #14
                            Richard, I am right now doing the work for the military parser to hold the stuff. I may change the tag "name" though I am not sure. I won't use startoffset now since it seems useless. One question on the effects side, though: How does decay affect the abilities of the units (or else) if tech drops below the requirements? Is there a need for a new tag or can we extrapolate from the "positive" ones?
                            Clash of Civilization team member
                            (a civ-like game whose goal is low micromanagement and good AI)
                            web site http://clash.apolyton.net/frame/index.shtml and forum here on apolyton)

                            Comment


                            • #15
                              It would probably be best to make a different equation for decay effects. So we have, in the tech xml file:

                              {requirement}
                              {name}Military Tactics{/name}
                              {startlevel}10.0{/startlevel}

                              {effect}
                              {type}Attack{/type}
                              {addPerLevel}10{/addPerLevel}
                              {factorPerLevels}0.3 10{/factorPerLevels}
                              {decayPerLevels}10%{/decayPerLevels}
                              {/effect}

                              {effect}
                              {type}Defense{/type}
                              {addPerLevel}2{/addPerLevel}
                              {/effect}

                              {/requirement}

                              So the attack power of the unit would be decreased by 48 for each tech level loss, until the unit disappears entirely at -10 tech levels. Or, to be consistent, we could use this tag:

                              {subtractPerLevel}48{/subtractPerLevel}

                              Although I think it would be good to accept either a value or a percent in the add and subtract tags.

                              Does anyone see the need to accept growth equations other than linear ({add..) and exponential ({factor..)?

                              Comment

                              Working...
                              X