Announcement

Collapse
No announcement yet.

[C4:AC] python code for wonders and faction

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

  • [C4:AC] python code for wonders and faction

    Kindly Posted by ClassicThunder

    Python code for Planetary transit
    (pCity.setPopulation(3) #Sets population

    Python code for free perimeter defence for hive)

    pCity.setHasRealBuilding(gc.getInfoTypeForString(' Building_Name_Here, 1) #Adds building

    Can someone who is familiar with python please help me to do this?
    Come visit the SMAC Mod
    You can download the latest mod by
    http://code.google.com/p/civ4smac/
    Fan of the original SMAC? join us and help

  • #2
    I've got some skills with the SDK and could wipe up something along thouse lines with full XML tags and high degree of modibility. I've made a list of many of the functions that can not currently be replicated with Civ4

    Improvments Accessed early by Wonder (Weather Paradigm)
    Vote Modifiers (Lal's ability and several wonders) - I've already made this mod
    Social Enginering point Modifiers (Astetic Virtues) - Needs a modified SE system to feed into
    Facility Mimicking (The Virtual World) - Once facility acts as another
    Continuos Growth (The Cloning Vats) - This wonder was kind broken, might need nerfing
    Upgrade Cost Modifiers (Nano Factory) - Already made
    Heal Rate modifiers (Nano Factory)
    Global Drone elimination (Telepathic Matrix) - should be simple to globalize the Globe Theater
    All Bases Yield Modifier (Bulk Matter Transmiter, Economic SE)
    Global Building Count Commerce Bonus (Network Back Bone)
    All tile local Yield Modifier (The Merchant Exchange)

    Also for replicating the Tree Farm buildings...

    Local Improvment Yield Modifier


    None of these look very complicated outside the Social Enginering Modifiers, I assume Blake is managing your DLL, if I could work with him I could implement most of these as SDK/XML based mods so I can re-use their effects in my own Warlords DLL for new wonders.
    Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche

    Comment


    • #3
      Wow, Impaler, thats an amazing list...

      If you want access to the google svn I can give you access just sign up for a google account and send me the details. I am sure Blake and Rubin would like the help.

      The code can be accessed from here:



      I wll update your information on the smac wonder planning docs. here:
      Come visit the SMAC Mod
      You can download the latest mod by
      http://code.google.com/p/civ4smac/
      Fan of the original SMAC? join us and help

      Comment


      • #4
        I dont see any code in the subvertion repository and the whole Google Code thing is forign to me, I've used Tortise and SF before but this seems a bit different. I'll contact Blake directly and try to get the current code from him.
        Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche

        Comment


        • #5
          PS the heal rate modifiers for Nano factory can be done through xml.
          I have already completed the telepathic matrix in my working code.
          You can download the full code from the google code. it also uses tortoise to download the code from there too. click on the downloads section on the right and you will see the download there....

          here is the direct link, http://civ4smac.googlecode.com/files/C4AC.rar

          just use winrar or winace to extract it (both free)

          here is the link to the code in the svn http://civ4smac.googlecode.com/svn/trunk/
          Last edited by Gavin Berchler; January 6, 2007, 08:02.
          Come visit the SMAC Mod
          You can download the latest mod by
          http://code.google.com/p/civ4smac/
          Fan of the original SMAC? join us and help

          Comment


          • #6
            The first link is broken, the second dosnt have any source code (I just get the Assets and I dont see any way of downloading them). When I spoke to Blake he directed me to the SF project and added me as developer, is the SF the prefered repository (please say yes)? I'm still having some difficulty getting a checkout probably because i'm used to cvs style rather then cvn (what ever that is ). Can you list the apropriate Tortise settings to do a checkout?

            P.S. Did you do the NanoFactory with a Global promotion?
            Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche

            Comment


            • #7
              Ok might as well do a write up on the planned implementation methods for these effects so you guys can critique them.

              Improvments Accessed early by Wonder (Weather Paradigm) - CvPlayer is given a new array int which is initialized at zero, an additional || option for validation of improvments is added ware formerly only tech was checked, BuildingInfo is given a new tag group ImprovmentsValid containing ImprovmentValid which contains ImprovmentType and bValid. CvPlayer::ProcessBuilding rolls the boolean into the CvPlayer array to give the player early access to the improvment

              Vote Modifiers (Lal's ability and several wonders) - I've already made this mod, it adds a int modifier to CvPlayer which multiples their votes for all elections which happens on CvGame, I have it working for Traits (I think we should use traits as the means of providing all the faction bonuses with each Faction having its own trait). It should be a simple matter to fold the effect into Buildings.

              Social Enginering point Modifiers (Astetic Virtues) - Needs a modified SE system to feed into, I think this should be on hold untill the Social Enginering system is thouroly worked out. My initial though is to have an int array for CvPlayer containing their current SE values, each value coresponds to a Civic and these get removed/applied each time theirs a change in the SE value. The XML tag would simply be SocialEngineringBonuses, SocialEngineringBonus containg SocialEngineringCatagory and iSocialEngineringBonus.

              Facility Mimicking (The Virtual World) - Once facility acts as another, this one is tricky and is probably the modificatin most likly to be bumped off to Python for a narrower effect that will be specific to the Virtual World. For an XML based aproatch I was thinking of some kind of array again on CvPlayer which records the two buildings involved and code which could call ProcessBuilding (adding the effect) without setting the hasRealBuilding boolean. Likewise the effect could be removed when the Wonder is re-process on removal. Tag would be BuildingSubstitution containing ParentBuilding (NetworkNode) and ChildBuilding (Hologramtheater). Their would be a limit of only one such pairing for each Wonder.

              Continuos Growth (The Cloning Vats) - This wonder was kind broken, might need nerfing. Their are two possible ways to do this, first a kind of global 100% granary, basicaly retain all food in all cities after growth. This would be close but not quite the same effect. Also their the other means of achiving PopBoom by getting 6 on the growth scale so I'm thinking their should be a isPopBoom() function called durring growth and the city pop grows if that returns true and food is non-negative. isPopBoom will check the cities growth level against a GlobalDefine && a player level Boolean which is set by the CloningVats. The tag is a simple bGlobalPopBoom but it might be cool to have a localized on as well

              Upgrade Cost Modifiers (Nano Factory) - Already made, a rather straitforward Player level modifier called iUpgradeCostModifier all upgrades get modified.

              Heal Rate modifiers (Nano Factory) - I was also thinking of using a Player level modifier,

              Global Drone elimination (Telepathic Matrix) - aparently already done, presumably another global boolean much like Globe Theather

              All Bases Yield Modifier (Bulk Matter Transmiter, Economic SE) - My thoughts were a CvCity Yield bonus array holding the extra yield that is applied to the City tile itself, this can get modified by local buildings (Recycling Tanks) and Wonder and even Social Enginering (probably with run-time addition of several sources) A GlobalCityYieldBonuses with nested iYield tags should do it, likewise a local equivilent could handle the Tanks

              Global Building Count Commerce Bonus (Network Back Bone) - This will require that we track every instance of a building in the world and apply that to the City with the Wonder. The tracking is the hard part but I can steal most of the code from the Religion counter that gives Shrines their bonus. The city will need to hold a Matrix of Buildings/Yields to check against, none zero values initiate a call the the Global tracking system and the count is multiplied by the Commerce bonus to get the total net effect. The tag would be GlobalBuildingClassCountCommerceBonus containing a BuildingClass and a CommerceBonus group

              All tile local Yield Modifier (The Merchant Exchange) - A simple Yield array which applies its bonus to all worked tiles unconditionaly. The code should be simple and use a LocalTerrainYieldBonus contining iYield tags.

              The Tree farm would be handled by another CvCity array, for Local Improvment Yield Bonuses and maybe one for Features as well (are you keeping forests a feature or making it an improvment?
              Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche

              Comment


              • #8
                Originally posted by Impaler[WrG]
                The first link is broken, the second dosnt have any source code (I just get the Assets and I dont see any way of downloading them). When I spoke to Blake he directed me to the SF project and added me as developer, is the SF the prefered repository (please say yes)? I'm still having some difficulty getting a checkout probably because i'm used to cvs style rather then cvn (what ever that is ). Can you list the apropriate Tortise settings to do a checkout?

                P.S. Did you do the NanoFactory with a Global promotion?
                Sorry about the link, I used an extra "." at the end, which I have amended now you should be able to download. Before today the other code hadn't been updated in about 3 weeks, so the google code was the most up to- date (300+ changes to xml)

                I would prefere to use a single repos so I have asked blake to allow me access to the sourceforge. I have merged the changes in the xml and have made the download available. I use tortoise svn to get the stuff out and it works really well. Just enter the address!
                Last edited by Gavin Berchler; January 6, 2007, 14:19.
                Come visit the SMAC Mod
                You can download the latest mod by
                http://code.google.com/p/civ4smac/
                Fan of the original SMAC? join us and help

                Comment


                • #9
                  Originally posted by Impaler[WrG]
                  Facility Mimicking (The Virtual World) - Once facility acts as another, this one is tricky and is probably the modificatin most likly to be bumped off to Python for a narrower effect that will be specific to the Virtual World. For an XML based aproatch I was thinking of some kind of array again on CvPlayer which records the two buildings involved and code which could call ProcessBuilding (adding the effect) without setting the hasRealBuilding boolean. Likewise the effect could be removed when the Wonder is re-process on removal. Tag would be BuildingSubstitution containing ParentBuilding (NetworkNode) and ChildBuilding (Hologramtheater). Their would be a limit of only one such pairing for each Wonder.
                  Would it be easier to grant a free Hologram Theater at every city with a Network Node (updated each turn)?
                  "Cutlery confused Stalin"
                  -BBC news

                  Comment


                  • #10
                    It thought of that, but it is really different from the smac algorithm. there are some things such as the recycling tanks (civ 4 barracks) that make better sense using the civ4 model than the smac one.

                    I think its best that we move all the faciilties to the smac model, or as close as possible, and then anything missing,(eg granarys storage feature) we can add features to an existing facitilty.
                    Come visit the SMAC Mod
                    You can download the latest mod by
                    http://code.google.com/p/civ4smac/
                    Fan of the original SMAC? join us and help

                    Comment


                    • #11
                      Gravin: Ok your first link works now but again THEIR IS NO CODE THEIR, its just Xml and art files, their isn't even a DLL. You seem to refer to this as code?? To me code is only .cpp and .h files all the other stuff is just data. Do you know how to access the sourcecode on SF, I can browse SF and see that the code is their I just cant get Tortise to check it out because I must be enter some bad parameters.
                      Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche

                      Comment


                      • #12
                        Ok I figured it out I was using Tortise CVS when I should have been using Tortise SVN, I have checked out all the current code and "data" and I'm ready to rock and roll, expect the first of many commits tonight.
                        Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche

                        Comment


                        • #13
                          I have merged the code from the google and sourceforge so that we have one common basis. The sourceforge is missing about 500 or so changes. I am uploading a complete version onto yousendit as we speak...

                          Please can you commit it to the sourceforge, as I am unable to due to no admin yet.
                          Come visit the SMAC Mod
                          You can download the latest mod by
                          http://code.google.com/p/civ4smac/
                          Fan of the original SMAC? join us and help

                          Comment


                          • #14
                            Ignore the previous files. please download the files from here and upload to sourceforge




                            They are the latest merged code from you, rubin, and blake!
                            Come visit the SMAC Mod
                            You can download the latest mod by
                            http://code.google.com/p/civ4smac/
                            Fan of the original SMAC? join us and help

                            Comment


                            • #15
                              Your sign says I need to be loged in to download, please do not put stuff behind such websites, I will not register with them.
                              Companions the creator seeks, not corpses, not herds and believers. Fellow creators, the creator seeks - those who write new values on new tablets. Companions the creator seeks, and fellow harvesters; for everything about him is ripe for the harvest. - Thus spoke Zarathustra, Fredrick Nietzsche

                              Comment

                              Working...
                              X