These are the final equations for technology change and the plans for coding a technology tree creation utility. If you see the need to make any changes, this is the last chance to do so before programming time is invested in the system and tech editor.
I will not rederive any of the equations or discuss any of the math here. I will simply trace the path from RP to tech level change, show how tech level change affects things, and describe what the editor needs to do. The discussion of the tech tree is in the Technology System Version 5.1 thread.
These equations are the same for all levels of technologies. The only real difference between Level 1, 2, and 3 technologies is the way the interface treats them.
Constants and Variables for Tech Growth:
Tn: The tech level on the turn before the calculations.
Tn+1: The tech level after the calculations.
m: This constant determines the effect that RP’s have on the growth and maintenance of a certain technology. It will probably be set to about 0.01, but can be changed for each tech.
c: This constant determines the amount of upkeep that a certain technology requires. It will usually be around 0.02, but can be different for different techs.
Ts: This is the level that a technology is at when it is first discovered.
E: This variable influences the difficulty of maintaining a technology. It will be influenced by the social and government model, among other things. It will not be functional for Demo 5, but we should prepare a place for it. For now, it will be equal to one.
H: This variable is the total influence of all helper technologies. It is determined by the following constants, variables, and equations:
HT1 through HTx are the technology levels of the tech’s helper technologies. These would logically have to be the technology levels at the previous turn. A level of technology that was just calculated would not be able to impact something that is theoretically happening simultaneously. For this reason, Tn for every tech should be stored until all of the tech level calculations are finished.
h1 through hx are constants that determine the influence of each helper technology. O1 through Ox are the tech level offsets applied to each helper technology. They give a bonus or penalty to the helper tech levels so that research is easier or harder.
W determines the overall influence of the helper techs. After all of the playtesting is done, we might fix this at a single value, but for now we should keep the ability to alter it so we can test different values.
RHL = (h1*(HT1n +O1-Tn) + . . . + hx*(HTxn +Ox-Tn))/(h1+ . . .hx)
H = 2^(RHL/W)
I: This variable influences the difficulty of raising technology levels. Like E, It will be influenced by the social and government model, among other things. Also like E, it will not be functional for Demo 5, but we should prepare for its inclusion and set it equal to one for now.
DR: This determines what diminishing returns, if any, will be applied to excess RP generation. Like W, it is here for testing purposes and might be fixed in the final model.
The steps from RP to tech change are as follows. V will describe some quantity based on RP’s that is carried over from one step to the next.
1) V1 = RP*m - E*c*(2^((Tn-Ts)/10))
2) If V1 < 0, then V2 = V1.
Otherwise:
V2 = H*I*V1^DR
3) Tn+1 = 10/ln(2)*ln((2^((Tn-Ts)/10))+(V2))+Ts
After this process is completed for every technology, the effects of the technology change must be calculated. Some technologies like Sanitation have direct effects on other models based on their level. These effects will probably not be in Demo 5, but we will have to prepare for that functionality in the tech model.
It might seem like these changes should be calculated in the other models. For example, the disease model could simply import the level of some tech and use that number in calculations of the spread of a plague. This would be easier, but it would cause big customizability problems. A scenario designer would have to remember that slot #87 and no other will affect the spread of disease. Civ 2 had many problems like this.
To ensure flexibility, each technology will have to have "Alter Variable" commands that can be defined in the tech editor. All of the variables in other models are defined independently of the technologies. Each individual technology would have the ability to affect those variables in some way. For example, the disease model might define some variable named CLEAN. The number of new people infected by a disease is divided by his variable. The Sanitation technology would then have an Alter Variable command like, "CLEAN=CLEAN*(.04T)" As the tech level increased, CLEAN would increase and disease spread would slow.
Another effect of technology increase is to allow access to a new technology. If the requirements for some technology are met, then that technology is set to its starting tech level and the player is notified of its invention. On the next turn, the tech level of that technology is recalculated.
The main effect of technology, and the one that will be included in Demo 5, will be applications and application factors. The application factors will be calculated for each application as follows:
E is the application effectiveness factor. If the application is a unit, it changes the unit's power. If the application is an improvement, it changes the effect that the thing has.
T1 through Tx are the levels of the technologies that are requirements for the application. R1 through Rx are the tech level requirements for the application. h1 through hx are constants that determine the influence of each required technology on the growth of the application. L is a constant defined for each application that determines the expected lifetime of the application.
RTL = (h1*(T1 - R1) + . . . + hx*(Tx - Rx))/(h1+ . . .hx)
E= RTL/10 + (10+L)/10 ^ (RTL/10) when RTL is positive or zero.
E = (10+RTL)/10 when RTL is negative.
Applications should also eventually have an Alter Variable command. The effect that the application has on some other thing is determined by the application level. For example, a sewer system would have an Alter Variable equation like, "CLEAN=CLEAN*(.2E)" There should also be a tag that tells how much of the civ is affected by this application. In this case, only a small area is influenced. But that is still pretty far in the future.
I would like the tech tree utility to do the following things. If anything here is not feasible, please let me know.
1. Set default values for m, c, W, and DR.
2. For every technology, input:
a. Technology name and text description.
b. The level of the technology.
c. Technology requirements and Ts.
d. Values for m, c, and DR. It would be a big help if these were defined in terms of the defaults (default c times some value). This way, we can change the default values and not have to redo individual values; they would keep the same ratio.
e. Helper technologies with O and h for each helper tech, as well as a W value defined in terms of the default value.
It would be nice if parts a through e were in different sections. Also, space should be left for the the Alter Variable section and sections dealing with E and I.
3. For every application, input:
a. Application name and text description.
b. The L value of the application.
c. Technology requirements with an h value for each requirement.
Later, the application editor should have much more functionality, but that is all we need for now.
With this editor, we should be able to define a technology like:
a. Farm Machinery and Equipment
b. Level 3
c. Requires: Agriculture 10% Ts: 10
d. c=default*.7 m=default DR=default
e. Helpers: W=default
Agriculture h=3 O=0
Mechanical Engineering h=2 O=2
f. (later) E=default
g. (later) I=default
h. (later) Alter Variable commands (more food, etc.)
I think that is everything. Could everyone make sure that this is good?
[This message has been edited by Richard Bruns (edited February 29, 2000).]
I will not rederive any of the equations or discuss any of the math here. I will simply trace the path from RP to tech level change, show how tech level change affects things, and describe what the editor needs to do. The discussion of the tech tree is in the Technology System Version 5.1 thread.
These equations are the same for all levels of technologies. The only real difference between Level 1, 2, and 3 technologies is the way the interface treats them.
Constants and Variables for Tech Growth:
Tn: The tech level on the turn before the calculations.
Tn+1: The tech level after the calculations.
m: This constant determines the effect that RP’s have on the growth and maintenance of a certain technology. It will probably be set to about 0.01, but can be changed for each tech.
c: This constant determines the amount of upkeep that a certain technology requires. It will usually be around 0.02, but can be different for different techs.
Ts: This is the level that a technology is at when it is first discovered.
E: This variable influences the difficulty of maintaining a technology. It will be influenced by the social and government model, among other things. It will not be functional for Demo 5, but we should prepare a place for it. For now, it will be equal to one.
H: This variable is the total influence of all helper technologies. It is determined by the following constants, variables, and equations:
HT1 through HTx are the technology levels of the tech’s helper technologies. These would logically have to be the technology levels at the previous turn. A level of technology that was just calculated would not be able to impact something that is theoretically happening simultaneously. For this reason, Tn for every tech should be stored until all of the tech level calculations are finished.
h1 through hx are constants that determine the influence of each helper technology. O1 through Ox are the tech level offsets applied to each helper technology. They give a bonus or penalty to the helper tech levels so that research is easier or harder.
W determines the overall influence of the helper techs. After all of the playtesting is done, we might fix this at a single value, but for now we should keep the ability to alter it so we can test different values.
RHL = (h1*(HT1n +O1-Tn) + . . . + hx*(HTxn +Ox-Tn))/(h1+ . . .hx)
H = 2^(RHL/W)
I: This variable influences the difficulty of raising technology levels. Like E, It will be influenced by the social and government model, among other things. Also like E, it will not be functional for Demo 5, but we should prepare for its inclusion and set it equal to one for now.
DR: This determines what diminishing returns, if any, will be applied to excess RP generation. Like W, it is here for testing purposes and might be fixed in the final model.
The steps from RP to tech change are as follows. V will describe some quantity based on RP’s that is carried over from one step to the next.
1) V1 = RP*m - E*c*(2^((Tn-Ts)/10))
2) If V1 < 0, then V2 = V1.
Otherwise:
V2 = H*I*V1^DR
3) Tn+1 = 10/ln(2)*ln((2^((Tn-Ts)/10))+(V2))+Ts
After this process is completed for every technology, the effects of the technology change must be calculated. Some technologies like Sanitation have direct effects on other models based on their level. These effects will probably not be in Demo 5, but we will have to prepare for that functionality in the tech model.
It might seem like these changes should be calculated in the other models. For example, the disease model could simply import the level of some tech and use that number in calculations of the spread of a plague. This would be easier, but it would cause big customizability problems. A scenario designer would have to remember that slot #87 and no other will affect the spread of disease. Civ 2 had many problems like this.
To ensure flexibility, each technology will have to have "Alter Variable" commands that can be defined in the tech editor. All of the variables in other models are defined independently of the technologies. Each individual technology would have the ability to affect those variables in some way. For example, the disease model might define some variable named CLEAN. The number of new people infected by a disease is divided by his variable. The Sanitation technology would then have an Alter Variable command like, "CLEAN=CLEAN*(.04T)" As the tech level increased, CLEAN would increase and disease spread would slow.
Another effect of technology increase is to allow access to a new technology. If the requirements for some technology are met, then that technology is set to its starting tech level and the player is notified of its invention. On the next turn, the tech level of that technology is recalculated.
The main effect of technology, and the one that will be included in Demo 5, will be applications and application factors. The application factors will be calculated for each application as follows:
E is the application effectiveness factor. If the application is a unit, it changes the unit's power. If the application is an improvement, it changes the effect that the thing has.
T1 through Tx are the levels of the technologies that are requirements for the application. R1 through Rx are the tech level requirements for the application. h1 through hx are constants that determine the influence of each required technology on the growth of the application. L is a constant defined for each application that determines the expected lifetime of the application.
RTL = (h1*(T1 - R1) + . . . + hx*(Tx - Rx))/(h1+ . . .hx)
E= RTL/10 + (10+L)/10 ^ (RTL/10) when RTL is positive or zero.
E = (10+RTL)/10 when RTL is negative.
Applications should also eventually have an Alter Variable command. The effect that the application has on some other thing is determined by the application level. For example, a sewer system would have an Alter Variable equation like, "CLEAN=CLEAN*(.2E)" There should also be a tag that tells how much of the civ is affected by this application. In this case, only a small area is influenced. But that is still pretty far in the future.
I would like the tech tree utility to do the following things. If anything here is not feasible, please let me know.
1. Set default values for m, c, W, and DR.
2. For every technology, input:
a. Technology name and text description.
b. The level of the technology.
c. Technology requirements and Ts.
d. Values for m, c, and DR. It would be a big help if these were defined in terms of the defaults (default c times some value). This way, we can change the default values and not have to redo individual values; they would keep the same ratio.
e. Helper technologies with O and h for each helper tech, as well as a W value defined in terms of the default value.
It would be nice if parts a through e were in different sections. Also, space should be left for the the Alter Variable section and sections dealing with E and I.
3. For every application, input:
a. Application name and text description.
b. The L value of the application.
c. Technology requirements with an h value for each requirement.
Later, the application editor should have much more functionality, but that is all we need for now.
With this editor, we should be able to define a technology like:
a. Farm Machinery and Equipment
b. Level 3
c. Requires: Agriculture 10% Ts: 10
d. c=default*.7 m=default DR=default
e. Helpers: W=default
Agriculture h=3 O=0
Mechanical Engineering h=2 O=2
f. (later) E=default
g. (later) I=default
h. (later) Alter Variable commands (more food, etc.)
I think that is everything. Could everyone make sure that this is good?
[This message has been edited by Richard Bruns (edited February 29, 2000).]
Comment