1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[MODCOMP] New Profession: Inventor w/ TechTree

Discussion in 'Civ4Col - Mods and Files' started by Kailric, Mar 23, 2010.

  1. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    This is my attempt to add a Tech Tree to Civ4Col. I have been able to do lots more than I thought I would. This is a work in progress as are all my mods:) I have worked hard to make this very modder friendly so you can add your own new techs and build upon what I have started. I explain things below.

    Download Link v. 1.1c


    Core Mod 1.0 Download
    This is the Core Mod for the Inventor w/Tech Tree mod meaning that it is a stripped down version for Modders. There are no extra mods, art, etc. only the basic components that make the Mod work. If you load up this mod without any changes you will be playing Vanilla Colonization and the Reasearch Advisor will show no techs. This version is to make it easier for Modders to integrate this Mod into their own projects. Then, by adding new techs you can change how the game plays.

    Patches for Previous Versions
    All Previous Patches to v 1.1d fixed
    Just unzip and place this in the Mod/Inventor folder. Combines all previous patches/updates.

    This is the "fixed" version of the patch as I copied the wrong dll.

    Search for Update 1.1 in the SDK for Patch Changes
    Also, added two new defines to the GlobalDefinesAlt.xml
    TK_ALLOWS_NATIVES_TO_RESEARCH - set to 1 to allow Natives to research. I have not tested the effects of this. The current Tech Tree was not designed for this feature. This feature is added for modders to who create thier own Tech Trees.
    TK_NATIVES_GET_FREE_TECHS - If this is set to 1 natives get all techs that are listed as NATIVE_TECH in the CivicInfos.xml.
    -Techs that Allow certain classes should display the correct class in the Help Text.
    -The completed Research project is no longer selectable in the popup.

    Acknowledgments
    Androrc the Orc (Coding and Ideas)
    KJ Jansson (Button Art and Ideas)
    Aymerick (MultiYields Consumed Mod)
    Deliverator(Unit Art)
    The_Coyote(Culverin Unit)

    Tech Trees
    If you create a good tech tree let me know and we can post them here for others to check out

    Current Things to note and bugs
    -When playing a "Custom" game sometimes the Tinker's House is not given as a free building when you found a city. If this is the case just hit ctrl-W and add one in through the world builder.


    Feature Planned in Coming Updates
    - make it so you can select any tech and you will start to reseach all previous techs in order
    - add a feature to Hide Techs you can not research as to add to the feel of the Unknown
    - New Founding Fathers and points gained from Researching
    - New Goodies that award Techs

    Version Changes
    Spoiler :


    v 1.1
    - The changes I made in the SDK are maked with ///TK Update 1.1
    - Fixed a few graphical errors
    - Adjusted the tech tree somewhat
    - the Balloon unit can now move in none friendly territory
    - fixed crash bug when Canceling a Deal
    - If a Yield is not allowed and it has a profession such as Tobacco for example, if you Learn from Natives to be an Expert Tobacco planter you will automaticly learn the Tobacco Technology. This gives you several ways to learn these techs. Learn from Natives, Trading on the Trade Screen, Demanding tribute, or Researching the Tech
    - I edited the Worldbuilder.py so you can select any profession for a Unit. I would not select City professions when you have no city.. not sure of the side effects of this

    v 1.0
    -I have added Text to the GlobalAltDefines.xml and the CIV4CivicInfos explaining what the attributes do
    -Tech Tree is vastly improved
    -Prolific Inventors are aquired from doing research. You gain Prolific Inventor experience from research. The amount can be see at the bottom of the Research Advisor Screen.
    -Industrial Victory is now available. See in game tech tree for explanation.
    -The Culverin Unit can be upgraded to a Cannon. You need to be in a city that can create Cannons. Also the Icon for upgrading units is kinda large by default, I'll fix this in an update hopefully.
    -The following FF have been adjusted to keep the Ballance between Techs and FF. Ben Franklin, Sor Juana, Alexis De Tocqueville, John Jay, John Smith
    -Balloon units are not used by the AI atm, it was causing a crash as they don't know what to do with a scout unit that isn't a Colonist

    v0.9a Quick Fix
    -Fixed a CTD bug and a few other bugs
    -If you have a partner in Research its Icon is shown at bottom of the Research Advisor. I'll add more info to this later.


    v0.9
    -Fixed a few bugs Namely Tech Yields will now be consumed
    -Players can now make Research Pacts with other Nations. This will allow you to share Research points per turn gained. Must have Open Borders Pact and both sides must be able to Research the Tech. Also, the AI will somewhat determine if the Pact will be of any benefit to them. If you don't have any research points being accumilated or not enough or if they are almost done with the project themselves the AI want agree to this.
    -Added some GlobaDefineslAlt.xml defines explained below

    v0.8
    -Techs Now show turns to complete
    - AI Techs is here! They will research Techs and you can trade techs now. Indians start with all the Native techs and you have to befriend them to purchase techs from them. Natives don't want white man techs so don't bother trading that to them. AI will sometimes try to make Tech deals with you.
    - several minor tweaks

    v0.7
    -You should be able to add as many new Techs as you want
    -Added Aymerics MultiYield Produced Mod
    -Added a few more XML tags listed below
    -Added some example techs for the new xml tags
    -Changed the Layout of the Research Adviser
    -Research Progress is no longer lost when changeing research

    v0.6
    -Added Aymerics MultiYield Consumed Mod
    -Techs can now take multiple Yields (Haven't tested for non cargo Yields)
    -Added another Category to the Tech Tree called Trade
    Note: the Tech tree is not filled in and the techs I have are for examples for modders to go by
    -Added several new xml Tags explained below

    v0.5
    -Fix the issue of resolution in the Research Advisor and slightly improved functionality
    -Inventors want spend tools if there is nothing to Research. I will fix it later so that you will get a pop up to select research if you don't have a project going
    -turns to complete is no longer shown in the Research Help. It will take some time in coding to get that to work properly

    v0.4
    -Added new Research Advisor. It can be accessed from the Top buttons or by pressing F3. Revolution Advisor is now Shift + F3.
    -A lot of the new XML tags mentioned below are there in the xml but they don't do anything yet in the game
    -added New Native tech Flora


    Research:
    There is a new "Research" Icon at the top of the screen. Click on that to bring up the Research Advisor. In current state of the mod, Techs are divided into 5 Categorys and you can add as many Categorys as you want. The Categorys are: Native, Military, Invention, Trade, and Medicine. You can only research one Project at a time. Open the Research Window as show below:

    The New Research Screen is similar to the Civ4 Tech screen. You can scroll up or down to see all the techs. Mouse over all the techs to see what they have to offer. Techs that you can research will say "Click to Rearch". The current Tech you are Researching will be Highlighted. Turns to complete will appear at the bottom of the screen. Completed Research is Labeled in Green with a darkened backgroud.
    Spoiler :


    New Unit

    Prolific Inventor: May be found on your Docks or can be purchased in Europe but with increaseing cost. Doubles the output of Research.

    Now, to the City Management Screen.
    To start Learning new techs drop one of your colonists into the "Tinker's House". The Tinker's House has two upgrades, Workshop, then Laboratory. Mouse over the Tinker's House "Research" lightbulb icon to see the current project, current progress, and turns to complete. You can also change projects here by clicking on the Research Icon below the Tinker's House as shown in the screen:


    Projects Complete:

    To see what projects you have already completed click on the Domestic Advisor and select the "Research Completed" icon as show in the screen shot. *This while still a feature is no longer needed as you can see what Research you have completed in the Research Advisor. I plan to convert this to some other use*
    Spoiler :


    AI and Techs

    The AI will start to do their own Research Projects. You can trade techs and form Research Pacts to help each other learn new techs. AI will accassionaly ask to make Tech trades with you. The Indians all know the Native Techs.
    Spoiler :


    Explaining the XML:

    -I have added Text to the GlobalAltDefines.xml and the CIV4CivicInfos explaining what the attributes do

    Here are the xml tags and what they do. There are two files you Mod so you can add new Technologys they are the CIV4CivicInfos and the CIV4TraitInfos. The one to know most is the CIV4CivicInfos:
    Spoiler :

    • iAIWeight -this modifier helps determine the Value the AI places on this tech. Only used during trades atm
    • <CivicOptionType>CIVICOPTION_INVENTIONS</CivicOptionType> - All new Inventions have to be labled as such.
    • InventionCategory -I explain adding new categorys below
    • RequiredUnitType -Must be a UnitClass, UnitTypes want work. If a UnitClass is listed here Research requires this unit to be assisting on the project in the City or no Progress will be made.
    • RequiredInvention -You must have this Inventioned Research first. The order of the CivicInfos is important here. If a Project requires an previous Project it must be listed before this one in the CIV4CivicInfos
    • RequiredInvention2 -Same as above The second Invention requirement
    • RequiredInventionOr -If a tech is listed here the code will check for RequiredInvention. If RequiredInvention not there it will check to see if the Or tech is there. If RequiredInvention2 is present it will check the Or for the 2 Required tech but not the first.
    • iCostToResearch -This is Currently the second Modifier to Number of Tools each project requires. The first Modifier is found in GlobalDefinesAlt.xml, the "TK_RESEARCH_IDEAS_MOD" attribute. The Formula for Cost in Tools is (iCostToResearch * TK_RESEARCH_IDEAS_MOD)
    • RequiredYields -This is where you put the yields that are required for research. The number needs to be positive but other than that it has no effect in the game. The Default is tools.
    • iX_Location & iY_Location this two are not fully funtional yet
    • AllowsYields -This allows Yields to be Harvested and Processed. If a Yield is listed here you want be able to Purchase, Produce, or Harvest, or even Identify this Resource. Nor be able to build any buildings associated with the process of this resource. See Screen shot:

    • AllowsBuildingTypes --Buildings can not be Built until they are Researched
    • AllowsUnitClasses -Units can not be built until they are Researched
    • AllowsPromotions -Your units can not recieve these Promotion until it has been Researched
    • AllowsProfession -Units can not aquire these Professions until it is Researched
    • AllowsTrait -This allows you to use the TraitInfos to add even more Techs with the attributes found there.
    • iCheaperPopulationGrowth -Reduces the Growth ThresHold. Currently it takes 200 food for Population growth... this reduces that by the amount added here
    • iCenterPlotFoodBonus -This Increases the Food output of the Center Plot of each City by the amount Shown
    • iGoldBonus -free gold for discoverying this tech
    • iGoldBonusForFirstToResearcholdBonus -Currently not used
    • AllowsBuildTypes -This is actually Improvements and not builds. List improvements here. Set the varable to 1 or -1 to allow or disallow. I have an example Plantations in the game for this that takes the place of farms.
    • AllowsBuildTypesTerrain -If an Improvement is listed above the code will check to see if Terrans are allowed. This for example would allow Plantations to be build in Hills. I haven't fully tested this yet though
    • RouteMovementMod -Increases movement along roads for all units. For example set this to 1 to allow all your units 1 extra movement along roads

    GlobalDefinesAlt.xml

    - TK_RESEARCH_IDEAS_MOD: Hels Determines the cost in Yields to do Research
    - TK_RESEARCH_FIND_COORDINATES: not used yet
    - TK_IDEAS_CITY_VALUE: this is the value modifier of Research in AI Cities. The lower this number the more the AI will want to do research
    - TK_RESEARCH_TRADE_VALUE: This is the initial value in gold for your Techs. The other modifier is iAIWeight in the CivicInfos.xml
    - TK_RESEARCH_PACT_IDEAS_THRESHOLD -the higher this is the less likely Nations will want to form Research Pacts with you.




    Adding new Research Categorys
    Spoiler :

    First open the Civ4CivicInfos.xml. Add the Category but don't give it any attributes other than its name and leave the <InventionCategory/> not filled in as such. Techs with no <IventionCategory> are automaticly assigned as Categorys in Python. Now simply add your new Techs using this new Category in the <IventionCategory> field.

    Remember all the new Techs and Categorys must have the label <CivicOptionType>CIVICOPTION_INVENTIONS</CivicOptionType>. Also, new Techs must be placed in order they are required.

    Examply new Category:

    Code:
    <CivicInfo>
          <CivicOptionType>CIVICOPTION_INVENTIONS</CivicOptionType>
          <Type>NATIVE_TECH</Type>
          <Description>Native</Description>
    Example new Tech:

    Code:
    <CivicInfo>
          <CivicOptionType>CIVICOPTION_INVENTIONS</CivicOptionType>
          <Type>NATIVE_TECH1</Type>
          <Description>Native Flora</Description>
          <Civilopedia>TXT_KEY_NEED_DESCRIPTION</Civilopedia>
          <Strategy>TXT_KEY_NEED_DESCRIPTION</Strategy>
          <Button>Art/Buttons/NativeFlora.dds</Button>
          <iAIWeight>0</iAIWeight>
          <iGreatGeneralRateModifier>0</iGreatGeneralRateModifier>
          <iDomesticGreatGeneralRateModifier>0</iDomesticGreatGeneralRateModifier>
          <iFreeExperience>0</iFreeExperience>
          <iWorkerSpeedModifier>0</iWorkerSpeedModifier>
          <iImprovementUpgradeRateModifier>0</iImprovementUpgradeRateModifier>
          <iMilitaryProductionModifier>0</iMilitaryProductionModifier>
          <iExpInBorderModifier>0</iExpInBorderModifier>
          <iNativeAttitudeChange>0</iNativeAttitudeChange>
          <iNativeCombatModifier>0</iNativeCombatModifier>
          <iFatherPointModifier>0</iFatherPointModifier>
          <bDominateNativeBorders>0</bDominateNativeBorders>
          <bRevolutionEuropeTrade>0</bRevolutionEuropeTrade>
          <YieldModifiers/>
          <CapitalYieldModifiers/>
          <Hurrys/>
          <SpecialBuildingNotRequireds/>
          <ImprovementYieldChanges/>
          <FreeUnitClasses/>
          <ProfessionCombatChanges/>
          <ImmigrationConversion>NONE</ImmigrationConversion>
          <InventionCategory>NATIVE_TECH</InventionCategory>
          <RequiredYield/>
          <iCostToResearch>18</iCostToResearch>
          <AllowsBuildingType/>
          <AllowsUnitType/>
          <AllowsPromotion/>
          <AllowsProfessions/>
          <AllowsYield/>
          <AllowsTrait>INVENTION_NATIVE1</AllowsTrait>
        </CivicInfo>  
    Remember all the new Techs and Categorys must have the label <CivicOptionType>CIVICOPTION_INVENTIONS</CivicOptionType>.



    Attribute Request
    If you have any suggestions for attributes other than the ones listed above please feel free to let me know and I just may can add them to the mod. The possiblities are endless:eek:

    Cheats
    Spoiler :
    While in the City Management Screen hold shift and Ctrl and hit "=" to complete the current research project.


    Example application

    If you must research say, "Tobacco" and it requires a "Converted Native". You will first have to set up a mission at an Indian Village, aquire a Converted Native then have him assist one of your Researchers in order to learn to Grow Tobacco:goodjob:
     

    Attached Files:

  2. Androrc the Orc

    Androrc the Orc Chieftain

    Joined:
    Apr 19, 2004
    Messages:
    1,620
    Location:
    Vienna, Austria
    :eek: this is awesome!

    Gave it a try, is working pretty nicely. Only noticed one bug, that was that it seemed that unproduced research (that is, research that becomes unproduced because there weren't enough tools to make) would result in negative research, so at one point I had negative percentage of research done.
     
  3. KJ Jansson

    KJ Jansson Chieftain

    Joined:
    Oct 7, 2008
    Messages:
    509
    Great! :goodjob:

    I'm afraid that soon I'll open the Civ4Colonization game not for the improvement/testing/modding, but for the normal playing.
     
  4. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Yeah, I noticed that too once.. thought I imagined it cause I didn't see it again but I'll fix that after work this evening.

    I also forgot to mention two things an instant Research cheat and that all new Inventions in the CivicInfos have to be listed as CivicOptionType CIVICOPTION_INVENTIONS. I add that to the main page.

    Also, I am trying to decide if New Inventions should be Stored on the player or each City, like each City can have its own Research Project going much like they can build different items. It really needs to be play tested a lot though to see how much research can be done in a 300 turn game.
     
  5. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I think I found the bug that was causing the negative research and I uploaded a patched dll. Check it out on main page.
     
  6. Willi_Tell

    Willi_Tell praefectus praetorio

    Joined:
    Feb 8, 2008
    Messages:
    259
    Location:
    City of the Bears, Switzerland
    I totally agree: this is amazing, Kailric! :clap:

    An interesting point - it would be more accurate and realisitc to have several Research Projects running: in each city with the required unit/building one should be able to research different things IMHO
    If you limit it to 1 Project per Player and several cities of that player research for it: from which city would the needed tools be taken...?
    :crazyeye:
    By the way: does the AI also know how to handle Researching?
     
  7. Androrc the Orc

    Androrc the Orc Chieftain

    Joined:
    Apr 19, 2004
    Messages:
    1,620
    Location:
    Vienna, Austria
    About the invention categories, I think it would be good if, when you hovered the invention button in the research selection popup, the name of the category of the research appeared.

    Do you mean each city researching a different thing or each city having their own set of completed research as well as researching per city?

    Having each city contribute to different projects seems like a good idea to me, but only if it can be automated, so that it doesn't become too much micromanagement.

    Having each city having it's own set of researched inventions would be ideal, but it might be too much processing for the game to do.

    That can be easily tweaked through the research costs, so I don't think it is a problem.

    Good point. Even if the AI just selects research projects randomly, it's far better than choosing no research to do at all. About the tools, I don't think it actually takes tools from cities, but rather decreases the player's stored research points, which are generated by consuming tools.
     
  8. KJ Jansson

    KJ Jansson Chieftain

    Joined:
    Oct 7, 2008
    Messages:
    509
    Two remarks.

    1. The words "Unidentified Native Pant" are found in the CvGameTextMsr.cpp file.
    - "Pant" or "Plant"?
    - What means "Unidentified Native Pant" on the tile where should be bonus tobacco?



    P.S. Found in CivPedia: I have to study "Native Potato" and only then Tobacco will be available for harvest.

    2. Buildning LABROTORY. Maybe Laboratory?
     
  9. Androrc the Orc

    Androrc the Orc Chieftain

    Joined:
    Apr 19, 2004
    Messages:
    1,620
    Location:
    Vienna, Austria
    I imagine you are correct in both accounts. There's also "Worskshop" - "Workshop"?

    EDIT: While CvDefines.h is included, it apparently doesn't have any changes.
     
  10. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Currently each city working on the project just generates the new Resource called "Research". Its accumalted like Crosses. So the tools are taken from the city and turned into Research.

    I like the one idea I have where each Tech requires its own individual Resource. That way research is limited also by what the player can gather or produce.

    Like with Tobacco you mentioned, untill its researched the bonus Tobacco are labled as "Unidetified Native Plant". I thought about makeing it require "Tobacco" as a resource. How can you research Tobacco if you don't have any Tobacco you ask? You have to trade it from the Indians... much like in real life. The Indians showed the whites what Tobacco was and how to grow it and so the whites started to grow it trading in it.

    The AI does not do Research at this point. Its a lot more tricky and harder to test what the AI is doing but I plan on adding that in for sure.

    It should actually be very little processing going into research, it just cruches a few more numbers each turn.. simple math so I don't see that being any kind of factor.

    Yeah, as soon as I add in the "Categorys" to the xml and get that working I will add that to the help text.

    And yeah, I can't spell that great and make a lot of typos. If you see any more spelling errors just send me a private message and I will fix those.

    CvDefines.h is not used.

    Thanks for comments guys. :goodjob:
     
  11. KJ Jansson

    KJ Jansson Chieftain

    Joined:
    Oct 7, 2008
    Messages:
    509
    Thus, all natural resources from the New World (tobacco, potatos, coffee, cacao, etc.) that were unknown in Europe, probably could be educated only by talking number times to the Chief and if a Converted native is present in your city.

    Or educated in native villige, too?

    If both methods give the same result what is the reason of "home research". Maybe easier to send your colonist in a native vilage and after a nubmer turns to get a full specialist in tobacco, etc planting?

    The balance between these methods is not clear yet.
     
  12. Androrc the Orc

    Androrc the Orc Chieftain

    Joined:
    Apr 19, 2004
    Messages:
    1,620
    Location:
    Vienna, Austria
    I think the idea that Tobacco research consumes the Tobacco yield is a good one, and would make the little yield gifts that natives give much more valuable. It would be nice too if the required research assistant could be one out of an array; for instance, for Tobacco research one would either have to have a Converted Native or a Master Tobacco Planter.

    EDIT: Also, I think AllowsBuildingType, AllowsUnitType, AllowsPromotion and AllowsProfession should all be arrays. Having a "NotAllows" field for some of those would be nice too, for example, if you want to make units or professions obsolete.
     
  13. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    One reason is that there isn't always a local Indian village nearby to "Learn tobacco" from. Lots of times the "education" you want are several turns away from your starting colony. But, in game respects it will be assumed that the native plants are available for research all the time. It just takes longer to research them on your own. Edit: Or in some cases it may be faster depending on how far away the natives are.

    Also, just like in Civilization you can Research Techs, find them in Goodies, or trade them with your neighbors. There is more than one way to learn new things and I want that in the mod as well. Eventually I want to make the techs tradeable.

    "You give us Horse knowledge... we give you tobacco knowledge... good trade, yes?"

    Remember this is a Mod in progress and it is by no means complete. I am posting it so that others can see what I am working on and contribute there ideas. If you have ideas for a "Tech Tree" please let me know what you think.

    I only have three Native Techs at the moment so I am going to add a forth which will be the first one to be researched called "Native Flora" which preludes you into researching "Tobacco" and the others.
     
  14. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Well, if you have a "Master Tobacco Planter" then you already know Tobacco :) cause you can't purchase them in Europe. I haven't coded it yet but when you learn from natives, "Tobacco", then you automacticly learn the Tech.

    I would like to play a game where when you arrive in the new world there is all kinds of new things that you don't know nothing about and you have to research them or discover them in other ways. If its not an "aggravation" then it would seem to add to the feel of actually coming to a new world, like you are Christopher Columbus himself.

    Yes, it will be a good idea to make those xml tags an "array" I will add that soon as I can. Arrays are just more of a pain to add and makes it easier for me to have bugs. Also, I already had it planned to add a "Not Allows" tag so we are thinking alike on that one.

    Edit: Yeah, thats exactly what I thought when I added that feature is those gifts from Natives... your like, "What is this.. hmm, I need to research this!" :)

    Looking at the current Traits code I can make a simple addition to make it so that the xml tags for <FreeBuildingClasses/> actually allows or disallows those buildings. Also, you can already with the version I have posted add multiple Promotions allowed or disallowed just by useing the Traitinfos <FreePromotions/> tag, so when you research the project those can become available.

    So, I just need to add in AllowsUnitTypes and AllowsProfessions as arrays.

    Edit: Actually, CivicInfos already have a tag for "FreeUnitClasses", but those units are added to population automaticly so if you add units like ships it doesn't work right. So, I will add some more tags that say:

    "bFreeUnitsAreNonePopulation" for when you want to give free ships or whatever and you don't want them added to population.
    "bFreeUnitsNotAllCities" so it doesn't give units to all your cities.
    "bFreeUnitsAreAllowMods" so if you want to determine if they are allowed or not
    Just trying to save myself some coding time and less chance for bugs.
     
  15. Androrc the Orc

    Androrc the Orc Chieftain

    Joined:
    Apr 19, 2004
    Messages:
    1,620
    Location:
    Vienna, Austria
    I did code for enabling professions and buildings through founding fathers in SoI, if you want to take a look (if you don't want to download the whole thing, all the code is in the files of the SoI beta patch - the files you need are CvCity.cpp, CvInfos.cpp, CvInfos.h, CvUnit.cpp, Civ4GameInfoSchema.xml and Civ4FatherInfos.xml). I think it could be ported to CivicInfos with only minor modifications.
     
  16. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,759
    Wow Kailric, that's quite an impressive modcomp! :goodjob::king: I like it, discovering techs should really add a lot to the game.

    I agree, it's more satisfying to discover things gradually. Do you think you could have some tile bonuses start actually invisible and then be revealed by tech discovery, like the <TechReveal> tag in bonusinfos.xml from normal Civ4? That would enable discovering things like valuable mineral deposits later on using Prospecting techs. Another good tag for techs would be an AllowsImprovement tag.

    I also like your idea of some techs consuming different yields for research. Would the system be that production of each unit of Research consumes one unit of Tools and one unit of RequiredYield? It might be even better to make it further customizable, so each tech could potentially have a different RequiredYield2 instead of using Tools. Perhaps research of some cultural/political techs could consume Bells or Crosses or one of the Founding Father Point types.

    One thing I think would be really cool is to re-enable use of the Civics system prior to revolution, and discover techs that would unlock various civic choices. The very best civics could remain those only available after Revolution.

    For eventually showing a tech display screen, perhaps you could adapt some of the existing python from screens/CvFoundingFatherScreen.py to display the screen with various tabs for the tech categories, maybe showing a progress bar like already exists for the Founding Fathers.

    It's important to get the AI to do research too, but I'd guess it would probably be difficult to make it do much complicated planning for the various techs. Maybe just giving it some research bonuses depending on game difficulty level in civ4handicapinfos.xml would be enough to help it do well. One issue is to make sure the AI can only start a given research project when it has the appropriate unit and yield requirements so progress can be made. In my mod I've seen it get stuck trying to construct things when it doesn't have enough Tools :crazyeye: Having the native civs able to eventually discover or trade for some of the techs the Europeans have would be a very cool feature indeed.
     
  17. KJ Jansson

    KJ Jansson Chieftain

    Joined:
    Oct 7, 2008
    Messages:
    509
    "Native Flora" could be not only preludes to researching "Tobacco", but also "Native Medicine".

    It is well known that European colonists died from local diseases. And study of "Native Medicine" could prevent various tropical diseases between European colonists.

    From another side the European colonists could give/sell/exchange "European Medicine" to natives. Here also, as we know from the history of colonization, many natives died after contacts with Europeans. The microflora on both continents was too different, and the first time no one was immune to the unknown diseases.

    "Native Medicine" and "European Medicine" could open way to introduce the "Health" parameter in the game where each unit or city will have some "quantity" of Health.

    Three variant could be possible if some disease attacks the city or unit:

    1. unit/city can easily pass the disease, if Health is much more than a certain limit,
    2. unit/city can lost some power, if the Health value and strength of disease are comparable,
    3. unit can die, if the Health is less than illness strength. A city will lost one citizen.

    "Native Fauna" is the second possible variant. Wild animals in New World are different and European colonists have to study how to hunt/protect theyself from native fauna. Knowledge of "Native Fauna" could give some bonus in Hunting or in the moving on the undiscovered territory.

    What we have already?

    I introduced wild animals in New World in "Model: Mortally Dangerous Colonization" mod. I used "JAnimals A Wild Wilderness 1.001" by Jeckel as a basis, then I adapted it for 1.01 patch and corrected some errors.

    I showed in this mod how easy it "Wild animal" can be replaced by any natural phenomenon (I used "Tornado" as example). Absolutely the same technique can be used for the spread of diseases. Thus, the spreading of diseases and wild animals in the New World is not a difficult problem.

    2. The medical drugs were introduced in "1492: Global Colonization. Resource Pack" and could be also easily combined with any mod.

    Thus, "Native Medicine" and "Native Fauna" together with local diseases and wild animals could create very realistic atmosphere in the game.
     
  18. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I'll add the AllowsImprovement tag in an update soon. And I'll look into what it takes to make bonuses start invisble as you say. Not sure what all that takes.

    I'll prolly just make RequiredYields into an array and you can add what ever Yields you want to require and the cost of each.

    Yes, I thought of this as well cause the cool Civics feature doesn't come in until the end of the game. But, then again you are not really a "Self Governing" nation yet and only until you declare independence do you write up a constitution. But, then again for future mods and such I thought it would be cool to have like Statesmen able to Research new Governing Pholosophys or Techs and such.

    Yeah, I'll prolly do something like when I get the chance. I still need to learn a bit more about Python. I fixed the bug in the Domestic Advisor now and the Completed Tech screen now clears out when you change tabs.

    And about the AI, I'll make it so that to start with they just randomly gain a Tech. Then I will add actual AI that starts to do Research and the Speed is based on Difficulty levels. Then I want to add the abililty to trade techs.

    @KJ Jansson

    Those are all really good ideas. Adding a "Health System" would go along with Techs nicely plus add to the Authenticy to the game so that could be added at some point.

    If any of you guys want to help out with this project with coding or art that would be good. Just let me know and we can figure out what needs to be done.

    Edit: Posted Update v.0.2 Its just fixes a couple of the bugs and the Typos mentioned
     
  19. KJ Jansson

    KJ Jansson Chieftain

    Joined:
    Oct 7, 2008
    Messages:
    509
    I'm ready to help. Please, read details in my private message.
     
  20. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Thanks for offer to help KJ, I sent you a PM.

    I finally figured out Python enough that I think I can make a seperate "Research" Screen. This is what I have planned. The screen will be split in two. On one side will be things you Discovered on the other things you have yet to Discover.. you can mouse over them all to see the effts. As you discover techs they get moved over the other other side. The Techs will be split into their categorys and in order they can be researched. In the Middle of the screen will be your current research and the progress. You can Select what project you want from this screen as well.

    Hows that sound?
    ~Cheers
     

Share This Page