Announcement

Collapse
No announcement yet.

What should be coded now?

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

  • What should be coded now?

    I've coded a lot of things for the ai, and want feedback on that before I go any further, so...
    What should I be doing now?

    Here's what the polls gave, reordered by priority:
    20) demo priorities
    a - Savegames. 4 25,0%
    d - Technology. 2 12,5%
    f - Social model. 2 12,5%
    g - Government/Riots models. 2 12,5%
    l - Graphics and GUI update. 2 12,5%
    b - Map generator. 1 6,3%
    e - economics/infrastructure. 1 6,3%
    i - Diplomacy. 1 6,3%
    k - Military AI. 1 6,3%

    The current code status vis a vis the demo:
    a - nothing done
    d - no extra code done, but Richard could probably do things with the existing code
    f - little or nothing done
    g - government code exists but sketchy
    l - an alternate military units building UI exists
    b - There are some map generators, which now include terrain types, but aren't playable
    e - don't know what's needed here
    i - some infrastructure exists but there is nothing usable
    k - some improvements

    Here are the options I think of (considering both how important that looks and how much I want to code that particular kind of things):
    1)Savegames
    2)Social model
    3)Econ user interface
    4)Map generator with random civs placement
    5)Diplomacy
    6)Infrastructure for Healing units
    7)Auto explore and spying
    26
    Save games
    19.23%
    5
    Social model
    23.08%
    6
    Econ user interface
    15.38%
    4
    Map generator with random civs placement
    11.54%
    3
    Diplomacy
    23.08%
    6
    Healing units
    0.00%
    0
    Auto explore and spying
    3.85%
    1
    Bananas
    3.85%
    1
    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)

  • #2
    Re: What should be coded now?

    Hi Laurent, thanks for putting up the analysis and overview!

    Originally I was going to vote for Bananas, but since there were no real details, I decided on Social Model instead. Since you are the one that is going to be doing the work, I'll just comment on your top 3:

    1)Savegames

    Despite many peoples' interest in this feature, I still think it is basically worthless at this point. Until the game gets more complex, and gets beyond 20 min. play times I don't see that this will generate player interest. I do agree that once social and govt. starts playing a bigger part in the game, and tech becomes more integrated in the scenarios, we will then have the depth to make saves worthwhile. The only reason I can see for doing them now is if they will help in debugging. OTOH, if you really want to do saves, at least it would get this discussion out of the way for good!

    2)Social model

    I had much of the social/govt stuff working at one point, although with some kludges. Then Gary refactored it, shutting off some of the stuff he didn't like. The documentation Rodrigo did is very good.

    Pro: It would not take a huge amount of time for you to get this Major program area working again. Most of the needed code is there. The interface is partway along.

    Con: I already have experience with it, and may have time to work on it over the holidays. However I am Awful with interfaces. . .

    3)Econ user interface

    Lee made some progress on this. Doesn't seem like it would take too much work to get it going. However I'm making that judgment base on relatively little knowledge. I haven't gone back to look at the state of play when it got dropped.

    Thanks for all the hard work Laurent! I'm looking forward to trying out the latest version of the new AI.
    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


    • #3
      About the social model:
      I agree that there are many documents, and data and equations explained, but:
      - I must check the current state of the code.
      - What effects on gameplay does the model have? This sounds like a nasty question at first, but it's really important: What amongst these would be most important?
      -Riots model
      -Effects of government
      -What else?
      If I go for the social model, I'd like to have something visible to the player.
      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
        Hi Laurent:

        I agree with you that having something that directly involves the player is key.

        Back when I was coding the social model I had a proposal for a scenario with some govt/social interactions as a key part. I'll try to find it this weekend. The basic idea was that in conquering a civ with different ethnicity, if you could unify your resulting multi-ethnic civ through even-handedness you would have a chance of surviving the attack of a really big civ later in the scenario. If you treated your conquests badly then they would tend to revolt as soon as the big baddies have you tied down.

        I think at least a simple version of the riots model is the easiest way to get the player into the social and governments model. But rather simple revolts, which I already had coded, would probably be sufficient.
        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


        • #5
          As a side note, CTP2 source code has been released. IT's C++, everyone seems to get more than a hundred compile errors with the code as is, not counting flex/yacc stuff, but I will be looking into this code to see if there's any idea worth mimicking. The default game ai was dumb, but with mods it could get quite effective, so maybe there's something in there worth looking at. This will slow me down a bit on Clash of course, but probably no more than a week or two. Lets more time for people to vote on the poll before I start implementing the secret clash bananas.
          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


          • #6
            I voted for banana's

            Actually I would prefer map a map generation feature and then a save game feature. But the thing that I miss most in clash is a fast interface. The screen redraw takes seconds after I press the mouse.

            btw - the demo download link is dead...

            Comment


            • #7
              I updated the gui for the government/ruler panel (multisliders didn't show the labels and lock/text values didn't work).
              I know the screen redraw is pretty slow , but there are many layers that have to be drawn on top one of another. I tried to make a few intelligent redraws, redrawing only the area that had changed or trying to reduce the number of layers, but it didn't work well. The java2D API is not very fast, so I'm not sure this can be accelerated much using our technology (I'm not a graphics pro so I may be wrong, but since I don't know how to do it, it's the same as if it couldn't be done).
              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


              • #8
                Thanks for the dead-link notification Nebula. I have launched some inquiries.

                For now anyone can d/l the Demo 7.2.1 from:



                Note that this is just the bare zip file. For info on how to install etc, please follow the instructions off the web page.
                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


                • #9
                  I checked the riots/social model code quickly. Here are my remarks. I don't make comments on the save or other topics because save has been defined quite well by Gary (though nothing is coded and I disagree on one detail) and the rest doesn't seem to stir as much interest. Note that the ruler interface now looks like something and the sliders work correctly.

                  Riots code overview:

                  game.economics.MilitaryUnitCreation imports game.social.riots.* which is a package containing a MilitaryUnitCreation class. I don't know why the package is imported, but the riots class should be renamed differently else catastrophs will happen. Looks like the import is superfluous.

                  SquareClass can manage social events.

                  SquareEconomy knows EthnicDiscontentEvent (hard coded IMO) and is able to build units from this event (adheres to EconomicActivityModifier). How's that supposed to fit in? Note that in this code, there is likely to be a (bug) ambiguity over which MilitaryUnitCreation class is being used.
                  Code exists (commented) in SquareEconomy to scan for existing social events and apply their effects.
                  Such events, however are never generated right now.

                  Religion.java What's the logic behind iscriminationFactor? Shouldn't this.discriminationFactor(this) return 0? Also, is Religion supposed to have social attributes like traditionalism/nationalism/land connection/importance of religion/corruption?

                  What needs be done:
                  In SocialTurn() create appropriate social events. How do I do that? Create a social event for every square systematically? Per EG? May be a tad expensive. Maybe do so only if discontent is big enough (pre filtering)?
                  Modify the interface so that MilitaryUnitCreation is something understandable by a coder (which package - rename) and there is no hardwiring of he class EthnicDiscontentEvent in the economy code (tsk tsk).

                  If I get it well, an event should be created with ethnicDiscriminationFactor and religiousDiscriminationFactor. The unit created is also hard coded, which is not necessary, as the same code that finds the best available militia unit could be used here.
                  The population (quantity of people) of the EG is nowhere taken into account in the code. It should probably. Right now, 1 person can spawn 3 units if he's really unhappy. What a great leader!
                  Should the effect on econ be the proportion of the EG in the square times the severity instead of severity/5?
                  About the quantity of persons, I think the best is to define that (EG population * fighting proportion of population * proportion of discontent) at most will fight, and figure how many units that translates into (rounding numbers down, so if they aren't enough, there will be 0 unit).
                  The creation of units probably requires some changing of the 'unit takes enemy square' algorithm in order to be playable. Can probably wait for tests, but otherwise, it would lead to a minority revolting, and then the majority revolting back...
                  What's the civ of the newly created riotting unit?
                  How do we show discontent to the player? Panels are OK when units are spawned but I HATE the 36 city screen panels in cov telling you city XXX is rioting. Sure, I know, I just caused a revolution! Also, how do you show this on the map? Or does it show? Do we need to be able to display discontent in, for example, the minimap?
                  Mark, it looks like 'much of the social/govt stuff' still leaves lots of room for coding.
                  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


                  • #10
                    Hi Laurent, a good set of comments. I have some statements to help explain some of the code oddities you mention. Following that I'll comment on your next steps section.

                    All the riot and unit creation stuff in the econ classes are an artifact of the case that I just put them there "temporarily" for a first very rough implementation. The code can go in SquareClass as you suggest. All the clearly nonsensical imports and/or references can be removed. My guess on MilitaryUnitCreation is that Gary began moving my test code out of econ and only got part way before he switched to something else.

                    SquareEconomy knows EthnicDiscontentEvent (hard coded IMO) and is able to build units from this event (adheres to EconomicActivityModifier). How's that supposed to fit in?
                    Code exists (commented) in SquareEconomy to scan for existing social events and apply their effects.
                    Such events, however are never generated right now.
                    An EthnicDiscontentEvent is, as it says in the header "Handles riots originating out of dissatisfaction with ethnic and religious discrimination, and their effect upon the game."

                    The two effects that I put in as a temporary implementation are screwing up the economy (what that commented-out code did) and allows for creation of military units. All these crude implementations can be modified at you will, especially to support a scenario that really gives the player something to do with the social/govt/riots models.

                    Religion.java What's the logic behind iscriminationFactor? Shouldn't this.discriminationFactor(this) return 0? Also, is Religion supposed to have social attributes like traditionalism/nationalism/land connection/importance of religion/corruption?
                    I'm not sure about these, and 5 min of looking into it didn't clarify things for me. I think I did the discriminationFactor stuff however Rodrigo specified it. I do believe religions are supposed to have those attributes. The attributes of the religion can influence those of an EG IIRC.

                    What needs be done:
                    In SocialTurn() create appropriate social events. How do I do that? Create a social event for every square systematically? Per EG? May be a tad expensive. Maybe do so only if discontent is big enough (pre filtering)?
                    The latter is what I had. I would say use your judgment

                    Modify the interface so that MilitaryUnitCreation is something understandable by a coder (which package - rename) and there is no hardwiring of he class EthnicDiscontentEvent in the economy code (tsk tsk).
                    Yeah, I agree and am duly chastised for my evil coding habits. . .

                    If I get it well, an event should be created with ethnicDiscriminationFactor and religiousDiscriminationFactor. The unit created is also hard coded, which is not necessary, as the same code that finds the best available militia unit could be used here.
                    Agree.

                    The population (quantity of people) of the EG is nowhere taken into account in the code. It should probably. Right now, 1 person can spawn 3 units if he's really unhappy. What a great leader!
                    Should the effect on econ be the proportion of the EG in the square times the severity instead of severity/5?
                    About the quantity of persons, I think the best is to define that (EG population * fighting proportion of population * proportion of discontent) at most will fight, and figure how many units that translates into (rounding numbers down, so if they aren't enough, there will be 0 unit).
                    The creation of units probably requires some changing of the 'unit takes enemy square' algorithm in order to be playable. Can probably wait for tests, but otherwise, it would lead to a minority revolting, and then the majority revolting back...
                    Agree.

                    What's the civ of the newly created riotting unit?
                    This can obviously get tricky. If a civ with that EG dominant exists in the game, I would have it become a unit of that civ. If more than 1 have that civ as majority I would go with the closest and break ties randomly. If no civ with the EG exists we have two options:
                    1. Have a single "Neutral" civ that gets control.
                    2. Make a new civ with that EG name.
                    I prefer #2, but it could get complicated.

                    How do we show discontent to the player? Panels are OK when units are spawned but I HATE the 36 city screen panels in cov telling you city XXX is rioting. Sure, I know, I just caused a revolution! Also, how do you show this on the map? Or does it show? Do we need to be able to display discontent in, for example, the minimap?
                    The message screen can give a message like "Ethnic Discontent in 32 squares" that can be selected by the player to get details. A mini-map seems the best way to get info on detailed ethnic discontent and rioting levels.

                    Mark, it looks like 'much of the social/govt stuff' still leaves lots of room for coding.
                    Yep, there is still an awful lot to do for a reasonably complete implementation. But I feel it should not be more than a month's worth of work to at least allow a crude alpha version that can interact with the player in scenarios. Perhaps I'm being overly optimistic.
                    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
                      I promised a bit back that I would look and find my previous proposals for scenarios that actively use the government/social models. The first writup I've found isn't detailed, but gets the big idea across. It is from the Demo 7.3 thru Demo 8 Proposed Plan thread. Note that the proposed scenario also contains a diplomatic component. I think that part can be finessed for now until there is a diplomacy interface. The relevant parts are:

                      Internal and External Threats

                      The purpose of this scenario is to introduce the government model, and ethnicity in the social model to the player. The player will have to master these to hold on at the end. The internal threats are from riots of captured peoples of other ethnic groups, The external threat is, as before, a massive barb invasion at the end. We will also include the need for some nuanced diplomacy.

                      1. Much of the government and social model will be needed for this. The player’s power to tax will be limited by the governmental setup. The properties of the government will also affect technological and economic growth. Deciding how to balance these issues, and the ethnic-based and other riots mentioned below will be the key to winning.

                      2. In addition to the player there will be several other civs, that must be diplomatically isolated one at a time to be conquered profitably. If the small civs are made to band together through inept diplomacy by the player then the player should have a very difficult time of it. This would allow introduction of the diplomacy model in a reasonable way. The player must expand through conquest since the Evil Empire is known to be heading this way, and only under a unified civ is there any hope of resistance.

                      3. The delicate intra-civ manuvering in this scenario, once the player conquers some of the smaller civs, is to provide the player with conquered peoples that need to be administered. The reason is that Discrimination-Based riots are relatively straightforward to implement, and provide the player with a reason to engage in internal power struggles using the govt. model. The short version of this challenge is that there is a strong religious power block in the civ that is intolerant, and the player can only reduce overt discrimination by using the governmental apparatus. Trying to wrest away power from the strong religious political block is one way to prevent extreme oppression of the conquered peoples, which causes them to riot and/or revolt.

                      4. At the end there will be a substantial invasion by a big civ “offstage”. Whether the conquered peoples fight for the player, or the invaders is based on previous player actions.

                      I am not quite happy with this one yet, so counter-proposals are very welcome.


                      Here is another version of this proposal

                      I had an idea for a social/govt model scenario for demo 7. It is a bit contrived, but it would show off some of the features of the govt model.

                      At start all civs are ethnically homogeneous, but each has a different EG. Assume there is a primitive riots model that looks at ethnic discontent from maltreatment, and adversely affects the economy, or leads to revolt if garrison is not sufficient. Also the size of civ's economies, in terms of multiples of X, assume AI is about like it is now. With better AI so that the comp players are harder to beat, they would need to be adjusted.

                      Player Civ:
                      ruler has 40-50% power
                      Religious component has a lot of power, 30-40%? and is ethnically and religiously intolerant
                      has X economic and military power, and is at war with non-player 1

                      Non-player 1:
                      has approximately X economic and military power, and a different religion and ethnicity from player Civ

                      Non-player 2:
                      has Twice X economic and military power. They are currently involved elsewhere, but are expected to be interested in conquering the other civs in 40 turns or so.

                      One solution for player civ to survive (no diplomacy allowed for now) is to conquer p1 and so have a civ big enough to hold off p2. The immediate problem with that is that given the hostile ED settings expected to exist, conquered peoples will be rioting all the time, screwing up the economy, and tying up needed troops.

                      Solution 1: player uses his influence on ethnic discrimination to reduce ED somewhat, lessening rioting/revolt.

                      Solution 2: player takes on the church and tries to move power away from the church to himself or other less xenophobic elements of society. This allows player/ruler to lower ED much more. Player might be able to influence the vote with a bribe to one faction or other.

                      Either of these might be enough to win. Without the solutions below, I expect both player and p1 will be conquered when p2 attacks. IMO this will let the player really Use the govt/social models in an entertaining way!

                      What do you think?


                      from the Government Model v. 3.1 thread (page 2).

                      Detailed discussion of these should probably go in another thread. Laurent, if you like the idea, we can start a new Demo 8 proposal thread and discuss where we want to go in terms of a specific govt/social related scenario. If this has turned you off on the social/govt coding idea, then we can just let this idea lie fallow.
                      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'm looking at the social model code now. I'll work on it because, if nothing else, it severely needs it. Some parts of it wouldn't have compiled in C++ using templates...
                        I have one question: What's supposed to be in PopulationData? Ethnicity objects or EthnicGroup objects? This kind of stopped my progression in the code. Ethnicities are put in, but some code casts the content into EthnicGroup. I think EthnicGroup should be in but I don't know for sure.
                        It's okay for me to have a new thread for the social model, or bump a relevant one.
                        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
                          Hi Laurent. Glad to hear you're working on the social code, but sorry to hear it really needs it!

                          Originally posted by LDiCesare
                          I have one question: What's supposed to be in PopulationData? Ethnicity objects or EthnicGroup objects? This kind of stopped my progression in the code. Ethnicities are put in, but some code casts the content into EthnicGroup. I think EthnicGroup should be in but I don't know for sure.
                          I really am not sure about this one, since it is all Gary's doing. However just based on the name, I agree with your analysis. It should be EGs. Anyway, since you are coding it now, do what you think is the right thing.
                          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
                            Okay here is the current code status:

                            Scenarios work more or less as they used to.
                            -Dawn works well but I got slaughtered at the end before my first chariot became available. Desert nomads tend to avoid direct attack so they have a better chance of taking a square than with the old ai.
                            -Carthago is a bit slow because Hannibal builds so many archers. I don't know why he builds so many, and suspect they move a bit randomly while trying to reinforce one another. I should have fixed this somehow but haven't tested it on Carthago scenario. Note that with the default ruler settings, there will be riots in this scenario, but the ruler can remove them altogether by reducing ethnic discrimination in his profile (the lowest value available must be arounf 45%, which is enough in this scenario).
                            -The siegewar scenario is much harder because the ai chariot won't impale itself on Minas Tirith but try to conquer the land around the city so you have to take it out before you can attack MinasMorgul.
                            -My reinforcement test scenario showed the ai is much better when introducing a simple tweak to the pathfinding. (This is what I really want to boast about by the way) One problem with pathfinding is that going from A to B and going from B to A don't always produce the same paths. This may result in units trying to join together just running around in circles, or taking different roads... I changed the algorithm so it always compute the path between A and B by starting from the same point (arbitrarily, the one with lowest X, then lowest Y if both X are equal). This changes the paths and helps reinforcements find their desired target a lot.

                            Social model coding is well underway. I reactivated a lot of code, and here's the status:
                            Riots do happen, but usually cause only a small amount of damage to the infrastructure. There are no riotting armies raised yet. It is possible to specify in the scenario file the minimum riot probability to be taken into amount. This is used in the Carthago scenario: I set a minimum probability of 0.19 for riots to happen, and the player can reduce them to less than that although they start at 0.2 almost everywhere on the map.
                            The government model is partly implemented: Only negociated policies and the negociation system are implemented. See my remarks in the government threads about the system we want to use.

                            So now I need a scenario to show the player the social/government model at work. This should be only xml work, not actual programming, although I may have to add a few features to the code if the scenario requires it.

                            Once that's done, I think a new demo should get out. There are quite a lot of new things since demo7, and then I should go for savegames.
                            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
                              Great progress Laurent! Its a shame that the units were chasing each other in circles. . . but good that its fixed. The AI improvements sound good. I always disliked the suicidal attack or halt by the goblin armies in the siege scenario.
                              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