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

An Idea for Techs!

Discussion in 'Civ4 - Creation & Customization' started by moopoo, Mar 14, 2008.

  1. Tholish

    Tholish Emperor

    Joined:
    Jul 5, 2002
    Messages:
    1,344
    Location:
    Japan
    A simple way to do something like this is just make a tech for each unique unit and building, and make them available to all civs with the tech. The tech has as a prereq the prereq for the regular unit that the uu used to replace, ie the Praetorian tech would require Ironworking and cost the same as iron working. Unless you seriously cared to specialize in one type of unit your best bet would always be to just go for the regular one (Swordsman). That could be done in XML and would be essentially similar. Of course, there's no random element there. Maybe you could make shadow civs which are all identical to each other from as far as the player is concerned, ie there are 5 Romes, all of which have the same text and leaders and city lists and everything, except they have these hidden free techs that allow different follow up techs to standard techs, so one game you might be Rome4 and find that IronWorking gets you the opportunity to get Praetorian, while in another game you may discover that you ar Rome2 and it may allow you to get a different unit.

    Regarding trading beakers, simple way to do that is with intermediate do-nothing techs that exist just to be traded.

    There's probably some simple way in python to give a free random tech from among a list, upon getting another specific tech. Some kind of event. Then you could build what you want on that. There might be something you could copy somewhere and then just modify it to suit your purpose.
     
  2. mujambee

    mujambee Chieftain

    Joined:
    Jan 13, 2009
    Messages:
    32
    Location:
    Madrid, Spain
    I've been working on it, and have a working prototype I hope I can post later today (needs some testing).

    I've added a couple of techs to the game, "Hunting 1" and "Hunting 2" (not terribly creative, I know). Both are regular techs that can be researched, and both depend on Hunting and have a base cost of 4, which is a 10% of base cost of Hunting.

    I've removed the spearman unit and replaced it with "Spearman 1" and "Spearman 2". Both units need Hunting, but each of them requires also its corresponding Hunting subtech. This means that if you look a the civilopedia entry for Hunting you will see both units there. (Art is the same for both units; only difference is one of them has 100% bonus to defend cities and the other one has 100% to attack).

    I've also added a new tag to the techinfos: ParentTech. This tag links subtechs to their main tech. In this example, both Hunting 1 & 2 have Hunting as parent tech. This new tag is exported to Python.

    I've modified CvTeam::setHasTech in the SDK. Whenever a team gets a tech, it checks for subtechs and, if found, randomly chooses one of them and assigns it to you.




    I have the idea of adding a weight system, so some subtechs have a greater chance of being assigned than others, and maybe you could associate probability with traits.

    For example, a more elaborate Spearman scheme could be:

    Subtechs:
    - Spear hunting -> Gives access to regular spearman
    - Bird hunting -> Gives access to atlatl javelin, which has a 50% bonus when attacking cities
    - Mamoot hunting -> Gives acces to heavy spearman, which has a 50% bonus when defending cities


    Spear hunting gets a base weight of 5
    bird hunting gets a base weight of 1, plus a 5 weight for aggresive leaders
    mamooth hunting gets a base weight of 1, plus a 5 weight for protective leaders

    So if you tech hunting while playing Brennus (Spiritual/Charismatic) you get a 1 in 7 chance of getting each of the extended units, and a 5 in 7 chance of getting regular spearmen.

    If you aquire hunting while playing Saladin (Protective/Spiritual) you get a 6 in 12 chance of getting the heavy spearman, 5 in 12 of getting a regular spearman and only 1 in 12 of getting to atlatl javelin.

    Tokugawa, who is both aggresive and protective, would get a 6 in 17 chance of getting to each of the extended units and a 5 in 17 of getting to the regular one.



    Of course, this is open to discussion, I've only taken moopoo's initial idea and implemented it in a very simple way.

    I must say I don't particularly like the resource dependent tech, since it gives you what you need, effectively negating the resource dependency.
     
  3. mujambee

    mujambee Chieftain

    Joined:
    Jan 13, 2009
    Messages:
    32
    Location:
    Madrid, Spain
    Here it is. It still needs a lot of work, but it is a starting.

    Could only test it when you do the research by yourself and it works. It doesn't work when you get the tech for free, hopefully I'll be able to spare some more time during the week.
     

    Attached Files:

  4. moopoo

    moopoo King

    Joined:
    Jan 5, 2008
    Messages:
    729
    Location:
    Adelaide, Australia
    WOW sweet. People working on it.

    Actually, I just read through your post, and i think what you've done is exactly what i imagined. I think i might just start working on this then. Fantastic.

    What i imagined was that say for hunting, I could label that as a parent tech. I would then create 3 other new techs that would be it's children. When the player researches hunting, it also gets one of these techs randomly.

    If i understand what you've written, that's what you've done. Are these tags set in XML? Will I need python work?

    This is great. I'm going to start planning a tech tree up. Thankyou for doing this. :D
     
  5. mujambee

    mujambee Chieftain

    Joined:
    Jan 13, 2009
    Messages:
    32
    Location:
    Madrid, Spain
    Yes, that is. Have a look at the XML's, and see how hunting 1 & 2 are linked to hunting by means of the <ParentTech> tag. That's the only thing available now, a parent tag. It just works, but it needs a lot of polishing (I.E. Trading teches, save/load, ... )

    Right now, we have

    HTML:
    <ParentTech>TECH_HUNTING</ParentTech>
    what I have in mind is something like

    HTML:
    <ParentTech>
      <TechId>TECH_HUNTING</TechId>
      <Weight>1</Weight>
      <Trait>
        <TraitId>TRAIT_PROTECTIVE</TraitId>
        <Weight>5</Weight>
      </Trait>
    </ParentTech>
    
    so when you work on that design bear in mind that you could have specific weights. And if you come with whatever condition just let me know and I'll try to fit it in there.

    I'll try to spare some time to polish that prototype, and make it work properly.

    And don't worry about that Phyton thing. I can do all the work on the C++ side so you can focus on the XML.
     
  6. moopoo

    moopoo King

    Joined:
    Jan 5, 2008
    Messages:
    729
    Location:
    Adelaide, Australia
    That's really cool. I'd love for something for that.

    A more pressing concern would be the influence of resources, and to a lesser extent, terrain. That's really the heart of this, that your research is defined by your situation and needs, rather than your predetermined game plan =)

    Thankyou again for working on this. I'm off to plan techs!
     
  7. moopoo

    moopoo King

    Joined:
    Jan 5, 2008
    Messages:
    729
    Location:
    Adelaide, Australia
    I just noticed this :) I agree with you to a certain extent. It is interesting to have to fight for resources, taking cities and spots as strategic moves to gain that advantage. However, I think (hope) this will create a different strategic bent on the situation, one in which civs pick their targets based on what they have available, or defend based on what they know their enemy has.

    EDIT: also, i think There will still be some fight for resources - I plan to have several more strategic resources, and decreasing the occurrence of each, so if you want a particular unit, you'll have to fight to get to its resource.
     
  8. mujambee

    mujambee Chieftain

    Joined:
    Jan 13, 2009
    Messages:
    32
    Location:
    Madrid, Spain
    Ok, been working on this for some more time.

    I've defined a three phase development:

    1. Analyze all ways in wich you can get a tech and give subtechs if appropriate
    2. Implement subtech weigths
    3. (optional) Tweak the AI to make use of this

    Currently phase one is almost finished, the only missing part is when you get the tech via Oracle or Great Library/Internet. In this phase all subtechs have a weight of 1, and the only XML tag available is ParentTech, which links all subtechs with its parent. I've attached prototype 2 for testing.


    This is how subtechs are assigned:

    • Trough research: If you research a tech you get one subtech for free. It is randomly chosen among all subtechs of the main one, considering weigthing.
    • Initial tech: If any of your initial techs has subtechs, you get your random subtech just as if you have researched it.
    • Goodie hut: Same as above, you get one random among all posible subtechs.
    • Oracle and such: Just the same, free random.
    • Trade: If you trade a tech that has subtechs, you get one random subtech, but it is selected from those that the donor has. Weighting works the same as above, using the receiver's status to compute them, but only among the subteches that the donor has. If you want any other subtech you'll need to trade again for that specific one.
    • Great Lib/Internet: Same as trade.
    • Tech steal: Same as trade.
    • Grant independence: No problem, tech tree is the same for both.
    • Advanced start: Not sure about this, never used it. The easiest way to go on this is just make players pay for subtechs the same way they pay for parents.

    Research cost of subtechs shouldn't affect their weighting, only <WEIGHT> tag will (when implemented).


    Now on resouces. The simplest way of checking resources is just go trough all your cities and if any of them has access to one resource then it is available and activates its weight. A somewhat more complex approach is check the map to see if the resource is withing the catchment area of any of your cities (big fat cross plus one tile).


    Terrain types could be just a sum of what you have inside your cultural borders, but I can't see how can those affect the weigthing.
     

    Attached Files:

  9. thrallgor

    thrallgor Chieftain

    Joined:
    Oct 9, 2007
    Messages:
    37
    Location:
    Texas
    Also a great idea, because not everyone gets the same results from researching things (in real life).
     
  10. thrallgor

    thrallgor Chieftain

    Joined:
    Oct 9, 2007
    Messages:
    37
    Location:
    Texas
    Great work mujambee also. I have thought of exploring the subtech idea.
     
  11. moopoo

    moopoo King

    Joined:
    Jan 5, 2008
    Messages:
    729
    Location:
    Adelaide, Australia
    how did i miss updates for this?!?

    I really like your ideas regarding how subtechs are discovered, very much in line with what i was thinking. I did think, however, that it would be cool to be able to trade and steal specific subtechs
     
  12. Olleus

    Olleus Deity

    Joined:
    Oct 30, 2005
    Messages:
    6,478
    Location:
    England
    Could be fun, but would undermine the entire idea of Civ4 being a strategy game.
     
  13. moopoo

    moopoo King

    Joined:
    Jan 5, 2008
    Messages:
    729
    Location:
    Adelaide, Australia
    I disagree. I think strategy games need some kind of random element, lest they become a pre-learnt set of moves. i think strategy (and thus strategy games) should have an element of adaptability, which i only ever really get from civ when i set my civ/leader choice to random.

    also, with regards for testing for resources, couldn't you just test if the capital has the resource? A much more awesome way would be if each city could only contribute to the tech if they had access to the relevant resource, but that is stupidly overkill.
     
  14. Olleus

    Olleus Deity

    Joined:
    Oct 30, 2005
    Messages:
    6,478
    Location:
    England
    Well yes, I agree with you that randomness can be could for strategy. But which requires the most tactics, chess or snap?

    IMO, randomness is best when it can be influenced. You can never be sure to win any combat, but if you send stronger units, you are more likely to win. You can never be sure that you wont be backstabbed, but being nice in diplomacy will reduce the change.
    I personal believe that your idea just leaves a little too much to chance and leaves the player with too little to do. But thats just my two cents, Im sure that your idea could be tweaked so that its more responsive to the players actions (ie, have lots of hills, you get a unit that has bonus in hills, rainforest start? you get units with a woodsman bonus ect...).
     
  15. moopoo

    moopoo King

    Joined:
    Jan 5, 2008
    Messages:
    729
    Location:
    Adelaide, Australia
    That's exactly the idea, Olleus, that the techs, wonders, units etc, line up with that which you start with/decisions you make.
     
  16. buffalo6542

    buffalo6542 Nuke Maniac

    Joined:
    Mar 12, 2008
    Messages:
    272
    I understand and like the idea. Giving a more variety of units.
     
  17. The Genktarov

    The Genktarov Chieftain

    Joined:
    Oct 10, 2010
    Messages:
    10
    Your original idea for tech is intriguing. It would take extensive modding to the code, but would be possible. You would randomly award research with unlock chips that are trade-able. You could research the same tech multiple times (to try to get a different bonus), but would only have to research it once to advance to the next tech. The programming is quite feasible.

    Programming the AI to deal with that would be absolutely terrible.

    Here's an idea that makes the math and programming rather simple as well:

    You have a generic unit that some people will get. But, you have a chance to get a unique unit as well.

    So, instead of having the program automatically give you swordsmen after iron working, the program goes something like this.

    If (science counter for iron working= or >discovery threshold)
    then iSword=RandInteger(0,10)
    If iSword>3
    then [unlock swordsman]
    If iSword<4
    then [unlock praetorian]

    So the praetorian can be unlocked by any civ, and by multiple civs. Same could apply for buildings, etc.

    Also, if someone wanted to get really involved, they could have certain environmental factors affect the unit change. For example, one could choose to use a great general to get praetorians instead of swordsman (as it actually happened for Rome; they didn't fight that differently from everyone else until Gaius Marius, a brilliant military stragegist/drillmaster, reformed the army in the 160s BC. His "cohors reformata" are what we think of with Roman legions and such today.)
     
  18. moopoo

    moopoo King

    Joined:
    Jan 5, 2008
    Messages:
    729
    Location:
    Adelaide, Australia
    Ooooh, i love the idea of expanding great people roles
     
  19. tchristensen

    tchristensen Emperor

    Joined:
    Jul 21, 2010
    Messages:
    1,241
    Location:
    Grand Rapids, Mi
    Sounds like a very interesting idea. I would propse doing it by creating a huge interconnecting web of technology. Not just basic concepts, but concepts with layers representing all the ideas you speak of.

    so instead of just having a Tech with Bronze Working, but rather 10 to 20 techs with all the possible layers of use of the Bronze-Working, each attached to another 10 to 20 techs. Each Civ would then create their own path thru the labyrinth of technologies, yet always very close to one another. Each of the layered techs, could have a specific unit or promotion attached to it, so as to create infinite replayable and tactical decisions along the way.
     

Share This Page