Announcement

Collapse
No announcement yet.

Coding the "Society Model"

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

  • Hi All:

    Just trying to catch up with this thread by commenting where it seems needed. I have done some checking of my statements in the code, and docs, but still some of what I say may be incorrect. Also much of this is not set in stone, but is just as things were envisaged to work based on Rodrigo's docs and F_Smith, my, and Gary's coding.

    Originally posted by LDiCesare
    Note that when there are 2 ethnic groups in a square with the same ethnicity name are in theory possible in the code but would cause problems. I didn't check if this had any meaning.
    I haven't looked at the code, but this does seem like a potential bug source. Perhaps putting in a test when people are added to a square that the ethnicity name is unique. If it is not unique, a further test would see if the ethnicity objects are the same. If they aren't the same (the potential error condition) then we would either:
    1. mandate a name change for the newer ethnicity, or
    2. merge the ethnicities using weighted averages.
    For now maybe just an entry in a social log file that such an "ethnicity name collision" has happened would be enough. Long term I favor solution #1. There should be a way to merge very similar EGs, as we've IIRC discussed before. That will cause mergers of any similar ethnicities when they get sufficiently close, even if they have different names.

    I wonder whether nationality should be shared as part of Ethnicity?


    I think nationality belongs in Ethnicity as it is now. That allows us to distinguish between two components of an assimilating EG. FE when the Romans take over Gaul there would first be only a Gallic population. If the Romans rule well and some Gauls come to like living under the Romans there will be generated a "Romanized Gaul" or some such Ethnicity for the EGs. At first the only difference between the two ethnicities will be that the Romanized ones have a nationality of Roman, whereas the others still view themselves as conquered Gauls and would like to again be part of a Gallic civilivization not under the rule of the Romans.

    Now there are these things: tendencies and culturalAttributes. I understand tendencies as it is explained as: "Eventual equilibrium position that CulturalAttributes will evolve to given current environment". But culturalattributes are not clear. It is said also in the code that " Different ethnic groups with the same ethnicity differ ONLY in their opinions." So I suppose that nationality, tendencies and culturalattrbutes are all 'opinions'.
    If anyone can clarify these things for me, that would be greatly appreciated. It is normal that the code uses constructs like Ethnicity which allow to factor in certain concepts, so some differences with design documents are inevitable, but there are still things I'm not sure what they're supposed to do.


    CulturalAttributes describe behavior of people. Some uses of CA describe how an EG will actually behave in the game. Other types of CA are tendencies and prototypes.

    tendencies are a CA toward which an EG is evolving (but is not necessarily there yet).

    prototypes (culturalPrototype in Culture) is meant to be an "average" CA over a number of Ethnicities. The values are intended to be used to determine tension within the overall culture to determine when cultures split or reinvent themselves. A homogeneous Culture might span many provinces but in each case the EG CA is very similar to the Culture's CA. A heterogeneous culture will be one where EGs in different provinces have CAs that are very different from the prototype CA. Such a divergence would promote a name change and is how Goths become Ostrogoths and Visgoths, two independent Cultures.

    That's all I have time for right now. Just one post covered! I'll get back to this discussion when I can.
    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


    • Hi Guys:

      I'm going to stay out of the detailed language/ race modeling debate, because I've already commented on it above. Basically I think a language tree is nice but not essential, and while we're missing essential things it shouldn't be a top-drawer issue. If it's something that half the active playtesters request when the social model scenarios are out, then we might move it up in status provided Laurent (or another coder) is willing.

      Originally posted by LDiCesare
      (snip) You can have Latins and Romans in one square. You can't have Latin EG1 and Latin EG2 in one square. That doesn't seem to make sense (what would be the difference between these EG1 and EG2?). Actually this is already the case in Demo 7. I once saw a fight where goblins and humans both raised militia in the Siegewars scenario. No, my point was rather to ask what distinguishes 2 EGs of the same Ethnicity. To me it's only the location, but I may be missing something. This is important because in one case I can move the tendencies (better called trends?) into a separate class instead of having one instance of these per EG.
      I think I clarified this in my post above, but will state it agian. And frankly some things about the class structure are confusing. I think that comes from several coders working in sequence from Rodrigo's design, and each having their own ideas on which objects might be needed or most efficient. AFAIK the Culture in Ethnicity is meant to be an average or typical value over a group of EGs. Each of the EGs in their own squares will have its own independently-evloving CulturalAttributes (CAs).

      In the interest of keeping data down it might be desirable to remove EGs Nationality and CAs and have them be represented by only the Ethnicity values. This would however possibly result in aggregation issues for factors that influence the tendencies. Since we don't know the formulas for the tendencies yet, it is difficult to say what is the right course.
      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


      • I'll be moving the Nationality into the Ethnicity class instead of EG. The tendencies I will leave there, even though they are unused. The culturalAttributes of the EG are built from the prototype, so they can evolve separately afterwards, allowing for splits when the distance from the prototype is big enough, which sounds good.
        I'm working on having the ruler panel work properly and allow modifications of the EDF/RDF so that players can avoid riots. When ruler panel and riots model are usable, I'll start checking EG evolution and will need tendencies at this time. As long as we don't know how tendencies are supposed to work, though, it's hard to know where they are supposed to be.
        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


        • General Infrastructure Destroyed: 0.007769048
          Government Infrastructure Destroyed: 0.012948453
          Production Reduced: 0.003884554
          This is the output from the riots model, but it's really obscure to me. Mark, can you check how we could present this information in a better way? I think a percentage of the existing infrastructure/production would be a good indicator. 1% is easier to understand than the raw figures. I don't know where the reference value is in the square economy.

          I'd still like someone to provide ideas about how much suppression troops provide, and other ways to reduce discontent. Right now, it looks like a no-brainer to say that you want to reduce the various discrimination factors. What are the ill effects of promoting a policy far from the public opinion?
          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


          • Hi Laurent:

            Those values are the fraction destroyed or whatever. The .0077... means about 1% of the general infrastructure (farms, mines, etc.) were lost in the rioting.

            I'll try to look into the troop suppression. I could swear that I already had that in there. Either Gary switched it off, or I'm just plain mistaken. I will try to get back to you soon on this.
            Last edited by Mark_Everson; December 5, 2003, 16:06.
            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


            • Well, I have searched far and wide for the values that I once used for military unit suppression of riots. I think I wasted my time. Here is the old code:

              Code:
                   float suppression;
                    CombatData combatData 
                    = Units.getCombatData(location.getControllingCiv(), location);
                       float strength = combatData.getAttackStrength();
                      suppression = strength/2000f +(strength > 10? 0.05f: 0);
              I am embarassed the old approach was that Stupid! It doesn't include the size of the population to be controlled at all.

              After some thought, what I think is best is to have the suppression be related to both the military strength of units present, and also their manpower. The logic is that military power that is useful in fighting organized enemy units is not always that valuable against rioters.

              My first shot at a value (which should be on the RDF/EDF scale of [0,1] ) is something like:

              suppression = (military manpower) * 10 / square population + sqrt (A*strength/pop) / (B).

              The first term says that if the military manpower is 10% of the local population that they can suppress just about any rioting. The second term says as strength of the military unit grows, capability to suppress increases, but only as the square root. I don't know what the right size for A and B are. My notion is that A should be set so that for the most primitive militia A*strength/ (unit manpower) = 1 or so. B should be set so that the whole second term never gets vastly above 1 for practical situations unless there is a large military presence. (Again the aim is that 10% military can control most population, but it may take less with better weapons.)

              On the subject of promoting a policy far from public opinion. . . I think it should create riots similar to EDF/RDF ones. In a vector representation of all relevant policies, if the angle between the vectors is small, there should be no contribution to the Policy Riots. If the vectors are far off, it could approach 1. Then similar code to the EDF/RDF riots could be used. Hope this helps.
              Last edited by Mark_Everson; December 5, 2003, 17:47.
              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


              • This sounds good, but shouldn't there be a factor linked to the government? A government that oppresses population would have different suppression figures than one which only meddles when riots occur.
                Something like having more suppression with a big number of troops if you have an oppression policy, but less with few troops because people hate the soldiers/militians and would like to get rid of them? Or this policy would increase suppression effectiveness but increase discontent?
                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


                • Hi Laurent. I agree things like this should be in there. I don't have any particularly good ideas beyond what you proposed. Lets see if we get any other proposals. I don't have any issues with you putting in the type of interactions you propose if you'd like to see the effect it has on play.
                  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


                  • Hi all,

                    As Mark said earlier, I think part of the confusing things mentioned comes from the fact that several coders have been involved in trying to bring this model to life. And, of course, each one has "translated" my original design with his own approach.

                    Laurent: I have deep problems understanding the object oriented coding philosophy, so I can't help much in that part. But if you have specific question about the model design, just shoot.

                    So far, reading quickly the posts from late november, all I have to say is:
                    1) The nationality, which basically is nothing but a label, should be seen as a characteristic of the EG. The nationality is the tribe/nation the people of the EG feel they belong to.

                    2) I assume the first step, the one you're in now Laurent, is coding the basic structure for govt+social+riots models. You probably want to define the classes and all that OO stuff, and code equations later. With the very little knowledge on OO I have, a bit of intuition and basing on some things FSmith and other have said in the past, I wrote a document called something like "Coding the Society Model" where I suggest the general structure needed for govt+social+riot. There's a version of it at http://cullivan.com/coc/models/codin..._structure.htm. I can't remember now if that's the last version. I can't see now if I have a newer version because I have all my clash info on other computer. Can you check, Mark, if you have a document like that? I remember sending you the latest I had some time ago.

                    3) Tendency Values are the values of future cultural characteristics. The model computes what cultural values the EG should take in the long run and store them as "tendency values", so next turns are used mostly to adjust current values, slowly, toward the tendency values.

                    Comment


                    • Hi Rodrigo, great to have you back here! Laurent has all the most recent versions of the docs that I'm aware of. I can send those versions to you if you like so you can compare them to what you have. Just let me know if you want them.

                      Cya,

                      Mark
                      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


                      • Yes. Please send them, Mark.

                        Comment


                        • Hi Rodrigo,

                          Don't worry about the OO stuff. Most of my difficulties probably come from teh interpretations of the model by several coders, and, more so, by the fact they didn't finish what was started, so I've had to figure out what was the intended way of doing things...
                          I didn't find the equations to get the 'tendencies'. That's not urgent, though, because the model should already work statically before it changes with time (i.e. I should have the riots moel working before working on something else).
                          I've made it so the riots seem to work (not sure about uprising of armies), and some of the actions the player does in the Ruler panel affect the model (EDF works - for some reason, religious discrimination factor doesn't seem to change yet).
                          If you've better ideas than what I proposed about discontent caused by setting EDF lower than what the population wants, then I'm happy to code that. I've still to see whose opinion must be taken into account to check for discontent. Probably the preferred ethnicity would riot if the EDF is too low.
                          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


                          • Hi Laurent,

                            The equations for tendency values are in the document called "social model 3 technical". I understand you have that doc, but if you don't, give me your mail and I'll send it to you.

                            It seems I never finished the technical document (equations) for the riots model, but probably I have a half-finished document I can send you. Since I don't seem to have finished that, I'm a little intrigued about the equations you're using for EDF...... Are you using the equations from the "intolerant church scenario"?

                            I think the "intolerant church scenario" is too complex for a first step (I don't know why it looked fine to me as a starter back then!). Several things were also simplified in that scenario, but in such a way, that I'm affraid it's gonna be a pain in the a** later to build the rest of the model based on that scenario.

                            I'd propose this: you code the structure of the whole thing (no equations), based in general in the "coding the society model structure" document (with the changes you believe are needed), and I provide you a much simpler, wisely-simplified scenario (that is, a small group of equations to code, plus the needed values for relevant variables). What do you think?

                            Comment


                            • Rodrigo, I can't find the document... You can send it at laurent.di.cesare@wanadoo.fr .
                              Right now what I use for EDF is what was lareday coded when I took the code. So I don't know what lay behind.
                              The equation for riots now is:
                              PAF = 0.5f*(RDF+EDF);
                              probability = 0.8f * PAF - suppression;
                              I coded something to provide suppression by troops along the lines of what Mark proposed. RDF and EDF are set by the Ruler in the ruler panel.
                              I don't know where the original equation comes from.
                              The structure of the code is mostly here. The problem of coding a structure without equations is that I may end up coding something which is not used, which makes for bloated code (lots of unused stuff noone remembers why they are here and what they do).
                              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


                              • Originally posted by LDiCesare
                                Rodrigo, I can't find the document... You can send it at laurent.di.cesare@wanadoo.fr .
                                I went ahead and sent you the whole package Laurent.

                                Right now what I use for EDF is what was lareday coded when I took the code. So I don't know what lay behind.
                                The equation for riots now is:
                                PAF = 0.5f*(RDF+EDF);
                                probability = 0.8f * PAF - suppression;
                                This latter equation is something I threw in IIRC. Rodrigo's equation didn't give the results I expected. The old version was:
                                probability = (1/(1+ Math.exp(6-8*PAF)))
                                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

                                Working...
                                X