Announcement

Collapse
No announcement yet.

Coding the "Society Model"

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

  • Coding the "Society Model"

    The Riots Model (or Happiness Model), Social Model and Government Model can be seen as parts of a bigger model I'll call the "Society Model". In terms of coding it's better IMO to consider the Society Model rather than the individual 3 models. At least for coding the structure (objects and their relations).

    Although my knowledge of OO-coding is poor, I've created a document that should help real coders get started wiht the Society Model. You can find the document in the Clash web site or you can follow this link:


    I know our beloved coders might be busy now with other things and coding the Society Model might have to wait, but I wanted to create this thread to be ready when the time comes.

    Important: This is a thread devoted to coding. Discussions over how good/bad the models are and how can they be upgraded should go in the threads devoted to each specific model.

  • #2
    Thanks roquijad, that will be an enormous help!

    Cheers

    Comment


    • #3
      I think your proposal will help a lot. Just one point though: You bundle 2 things in EG: The EG characteristics and its population. It would probably be better to separate them. You'd have a EG class holding EGData, and one, which is referred by the squares, which has a population, points to a (shared) EGData, and maybe a mute() method which copies and changes the EGData if it has to be modified locally instead of in a widespread way. I am not sure that changes can happen on a wide level however, so I may be wrong here.
      I say EGs (at least population) belong to a square because military code manages conquest square-wise, so if there are to be effects of conquest on EGs it must be at square level. Also, the econ is managed in squares, so if building an army reduces population, this has to be tracked at square level.
      Thus my proposal would be, more or less, to have EGData at Province level and EGPopulation at square level.
      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


      • #4
        I agree with Laurent about, in effect, separating the EG archetype from its accidental or momentary population. This is in line with the way the coding is accomplished elsewhere.

        Personally, I am in favour of having much more widespread ethnic groups than a single square.

        Cheers

        Comment


        • #5
          Gentlemen: Thanks for your interest. Most of the things you say are beyond my understanding, so please consider normal not having me commenting in this thread. I think I'll only be able to help if you have specific questions for me. Until such questions appear, I won't post here and will just observe you work.

          Cheers.
          Rodrigo

          Comment


          • #6
            Announcement

            When I was writting the equations for the social model I realized a couple variables were missing in the "Coding the Society Model Structure" document, so I had to update it. The new version (2) of this document will be up in the web site soon (I just sent it to Dom).

            I assume no-one was working with the document, so I don't see the need to tell where the changes are.

            Comment


            • #7
              Hi Rodrigo:

              Now that I'm coding the model I have been reading it a lot more carefully. I think it is Outstanding! Before I launch into tonites topic, I should say that you should re-send anything that hasn't gotten onto the web site to Dom. He lost a bunch of things, so safest is to look at the site, and see what he need to be sent.

              Govt model coding discussion points

              1. I would like to use ethnic group identifier tags. EG Identifiers like "German" help in aggregation of EG info from myriad squares, with no loss of independent evolution (I'll discuss this later). Ethnic Groups are currently held at the map square level. Each local ethnic group will evolve in its own environment. The environment consists of the civilization it is in, and how it is treated therein as in your coding doc. All these independent EGs at the MapSquare level will each have a name for the ethnic group. When called upon to get aggregated statistics we will get them by aggregating EGs by name within a given civ. In this approach when a square is conquered by another civ, no special bookkeeping is needed with regard to EGs. An EG in a MapSquare simply starts evolving in a new environment

              For simplicity there should be a minimum size in population for an EG. If it falls below a given threshold in population its people should be divided among other existing EGs in the square. We can exclude EGs that are growing from this culling.

              One Issue: Eventually as the people of an original Goth EG evolve independently, the cultural attributes will diverge from the original assumed-to-be-uniform EG characteristics. At some point it will no longer be meaningful to refer to these EGs as a single ethnic group. When that point is reached we can either ignore it, or use some sort of clustering algorithm to divide the previous EG. FE Western Goths, and Eastern Goths. I expect we'll do the latter eventually, but it won't have to be done too often.

              2. I would like to rename Nationality something like NationalAffinity. Since the term Nationality is misleading when the controlling civ is different from the Nationality. NationalAffinity or some such word conveys that that is the nation they Aspire to belong to, without necessarily being a part of it. NationalAffinity would be a pointer to the civ of which they would prefer to be a part. The actual affinity is already covered in the Nationalism attribute.

              3. Moral Code attributes Individualism and Obedience. It seems to me that these two are complementary, at least at the level of abstraction Clash deals with. I would eliminate Obedience, and use 1-Individualism in any calculations where Obedience formerly occurred. This change would make Individualism an important attribute that has both economic and governmental ramifications. Another idea would be to combine Aesceticism and Natural Affinity. They do not always go together, but the correlation is fairly high. I think each attribute we keep should be very important in one or more areas. If we can't make that case, best to get rid of it.

              4. Current Nationalism approach looks Really Good!

              5. Attributes Ethnic Tolerance and Religious Tolerance are defined in same direction to Governmental policies Ethnic Discrimination & RD. But the words Tolerance and Discrimination mean opposite things. To me a high Ethnic Tolerance should mean the culture is tolerant of others, but a high Ethnic Discrimination should mean the opposite. We should pick one direction and stick with it or there will be confusion IMO.

              6.
              Province's Autonomy Level (PAL): PAL is set by the ruler individually for each province.
              Although Feudal Units are loyal to the civ's ruler and aren't, therefore, "enemies", they want to preserve their autonomy. To simulate this, the number of Feudal Units present in a given province defines a minimum PAL. The ruler can't decrease PAL beyond that limit. In order to do it, he'd have to fight and destroy Feudal Units.
              Good!

              Please let me know what you think! Also, please try to get demo 6 to run, because if you can do that I can send you the early demo 7 code with the existing social/govt system, and I can get your feedback early. (and maybe get you to write the manual for the social/govt part.
              )
              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


              • #8
                Hi Mark. I have to be quick because I'm leaving for my vacations.

                Everything you say seems good to me. Keep on that track. The only thing I'm not convinced enough is the individualism-obedience stuff. Individualism is supposed to control economic preferences, while obedience political ones. Probably the names of the attributes aren't the best, but maybe as you say they're correlated. I need to think it more and I can't do it. For now I prefer you follow your own judgement. We'll see later.

                Comment


                • #9
                  I forgot to say that at the end I was able to run the demo. When I'm back from my vacations I'll be able to give you feedback on that.

                  Comment


                  • #10
                    Hi Rodrigo:

                    Thanks for the last-minute comments.

                    I'm making good progress with the code update. I think in several more weeks I will have much of the model done, aside from some details! I've got a question, and I thought I'd post it before I forgot.

                    I assume economic planning is gone as a govt characteristic. I vaguely recall your getting rid of it, but wanted to make sure.

                    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


                    • #11
                      Hi Again, another "before I forget"

                      The formula: Civil Rights=ES*((0.5*(IND-TRAD)-p)/(1-p)

                      must have a typo in it. Although all inputs are in [0,1], as written there's absolutely no guarantee the result won't be negative. Just for testing purposes I have modified it as follows:

                      Civil Rights=ES*(1 + p + IND-TRAD)/3

                      Please let me know what it Should be when you have a chance.
                      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


                      • #12
                        I have a question on how you want the EG to be handled...using your german idea would you put each square as german_00001 and german_00002...or what to show breakups and mergers of EGs.
                        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


                        • #13
                          Hi LGJ:

                          I think mergers will be rare. Mostly that will be done through the ruler declaring a new unified EG for the country so its not a problem.

                          On splitting of EGs I guess I'll put in some descriptors to handle these situations. If one side is in a single civ we could call them German-Americans. If the split is by geography, East Germans vs West Germans would work. I think we can figure some decent rules as things get further along. Even I wouldn't do german_0001 !
                          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


                          • #14
                            Hi Rodrigo, another important note:

                            Regime supports for social classes are done! Well, mostly . I can tell already you're going to have quite a tuning job on this when you are back from hanging out in the sun .

                            [/QUOTE]To compute the vector components values we first build and auxiliary vector with "raw" support. Then the share is computed as RAW/T, where T is the sum of all components of the raw support vector. The raw support for a given regime is:
                            Exp(0.08*KL*DL*(BASE-BAN+S1+S2+S3+S4+S5+S6))[/QUOTE]

                            Because the numbers inside the Exp() vary by orders of magnitude and can swing from positive to negative there is a large chance of getting a mathematical overflow because of the exp. So something needs to be done to change this expression in the long run.

                            In game terms, I think an exponential dependence may be too sharp anyway. Relatively small differences in parameters for two Regimes can give quite different support levels because of the exp. Please at least think about it.
                            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


                            • #15
                              Here is some raw diagnostic output from the govt model, just to show where things are. Right now I'm finishing off Political Block (PB) government preferences. I'm maybe 70% of the way to the first landmark of running negotiations correctly.

                              Just so its clear there are several different versions of govt preferences shown here.
                              What the ruler/player wants the govt to look like
                              What the current govt is
                              EG characteristics (two sets, though the numbers are the same for now, since there is yet no evolution of EG characteristics)


                              Then there is detailed output on the Warrior social class in the capital city, and what they'd want in terms of the govt.

                              Then there is a regime readout that says what the regimes that are actviely considered by PBs in the civ look like...

                              [edit] 1.0 is the highest an attribute or level of power can be.
                              Everything on a 0-100 scale in the interface is shown on a 0-1 scale here.

                              The Output: comments in ()

                              Social/Government characteristics of civ -- Roman

                              Ruler Profile ++++++++++++ (what ruler wants)
                              Ruler: Fabian
                              Ruler Government Preferences
                              Government Policies: --------------
                              Labor: 0.0
                              Warfare: 0.3
                              Human: 0.05
                              Ruler: 0.34
                              Capital: 0.1
                              Administrative: 0.0
                              Ethics: 0.2

                              Negotiated Policies --------------
                              Tax Rate: 0.1
                              Civil Rights: 0.3
                              Ethnic Discrimination: 0.7
                              Religious Descrimination: 0.5
                              Slavery: 0.3
                              Foreign Policy: 0.8
                              Regime Policies --------------
                              Private Property: 0.5
                              Social Policies: 0.3

                              Government Profile +++++++++++ (actual govt)
                              Government Policies: --------------
                              Labor: 0.0
                              Warfare: 0.3
                              Human: 0.05
                              Ruler: 0.34
                              Capital: 0.1
                              Administrative: 0.0
                              Ethics: 0.2

                              Negotiated Policies --------------
                              Tax Rate: 0.1
                              Civil Rights: 0.3
                              Ethnic Discrimination: 0.7
                              Religious Descrimination: 0.5
                              Slavery: 0.3
                              Foreign Policy: 0.5
                              Regime Policies --------------
                              Private Property: 0.5
                              Social Policies: 0.5

                              Majority (Ruling) Ethnic Group++++++++ (I have left in, v3 has no ruling EG)
                              Ethnic Group: Roman
                              Religion: Roman Paganism
                              Cultural Attributes -- Roman *****
                              Moral Code: *******
                              Aggressiveness: 0.9
                              Ethnic Tolerance: 0.6
                              Religious Tolerance: 0.9
                              Asceticism: 0.0
                              Individualism: 0.6
                              Basic Social Attributes: *******
                              Traditionalism: 0.6
                              Nationalism: 0.9
                              Land Connection: 0.5
                              Importance Of Religion: 0.5
                              Corruption: 0.0
                              Social Classes: *******Roman Aristocracy: Pop = 0, PCI = 5.0
                              Roman Clergy: Pop = 0, PCI = 5.0
                              Roman Military: Pop = 0, PCI = 5.0
                              Roman Workers: Pop = 0, PCI = 5.0



                              Main EG in Capital Characteristics: Ethnic Group: Roman
                              Religion: Roman Paganism
                              Cultural Attributes -- Roman *****
                              Moral Code: *******
                              Aggressiveness: 0.9
                              Ethnic Tolerance: 0.6
                              Religious Tolerance: 0.9
                              Asceticism: 0.0
                              Individualism: 0.6
                              Basic Social Attributes: *******
                              Traditionalism: 0.6
                              Nationalism: 0.9
                              Land Connection: 0.5
                              Importance Of Religion: 0.5
                              Corruption: 0.0
                              Social Classes: *******Roman Aristocracy: Pop = 940, PCI = 5.0
                              Roman Clergy: Pop = 1880, PCI = 5.0
                              Roman Military: Pop = 1880, PCI = 5.0
                              Roman Workers: Pop = 89300, PCI = 5.0


                              Warrior Social Roles: Military
                              Warfare: 1.0
                              Human: 1.0


                              WarriorPrefs: Government Policies: --------------
                              Political Structure ----------- (Fraction of power each PB has)
                              Labor: 0.0
                              Warfare: 0.25
                              Human: 0.06
                              Ruler: 0.4
                              Capital: 0.1
                              Administrative: 0.0
                              Ethics: 0.16

                              Negotiated Policies --------------
                              Tax Rate: 0.3035
                              Civil Rights: 0.4333333
                              Ethnic Discrimination: 0.39999998
                              Religious Descrimination: 0.100000024
                              Slavery: 0.39999998
                              Foreign Policy: 0.91499996
                              Regime Policies --------------
                              Private Property: 0.14994529
                              Social Policies: 0.031226136

                              ** Warrior effective pop in Warfare PB: 1880.0, Ethics PB: 0.0
                              (just to make sure warriors in this case have no effect on ethics PB)


                              Regime support:
                              Active Regimes and their Support by Military:
                              Conservative Regime -- Support = 38.89571%
                              Ruler's Regime -- Support = 38.89571%
                              Despotism -- Support = 9.017558%
                              Classical Republic -- Support = 13.191017%

                              Active Regimes:
                              Regime Conservative Regime : ________
                              Labor: 0.0
                              Warfare: 0.3
                              Human: 0.05
                              Ruler: 0.34
                              Capital: 0.1
                              Administrative: 0.0
                              Ethics: 0.2

                              Regime Policies --------------
                              Private Property: 0.0
                              Social Policies: 0.0

                              Regime Despotism : ________
                              Labor: 0.0
                              Warfare: 0.0
                              Human: 0.0
                              Ruler: 1.0
                              Capital: 0.0
                              Administrative: 0.0
                              Ethics: 0.0

                              Regime Policies --------------
                              Private Property: 0.2
                              Social Policies: 0.2

                              Regime Ruler's Regime : ________
                              Labor: 0.0
                              Warfare: 0.3
                              Human: 0.05
                              Ruler: 0.34
                              Capital: 0.1
                              Administrative: 0.0
                              Ethics: 0.2

                              Regime Policies --------------
                              Private Property: 0.0
                              Social Policies: 0.0

                              Regime Classical Republic : ________
                              Labor: 0.0
                              Warfare: 0.2
                              Human: 0.2
                              Ruler: 0.3
                              Capital: 0.2
                              Administrative: 0.0
                              Ethics: 0.1

                              Regime Policies --------------
                              Private Property: 1.0
                              Social Policies: 0.1
                              Last edited by Mark_Everson; January 31, 2002, 15:46.
                              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