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

Can the Tech Tree Be Dynamic?

Discussion in 'Civ4 - Creation & Customization' started by Anondod, May 29, 2009.

  1. Anondod

    Anondod Chieftain

    Joined:
    Apr 26, 2009
    Messages:
    74
    For a fantasy mod I'm working on I'd like each civilization to be able to choose one or two of a small set of key technologies that will lead to the bulk of powerful tech. Tentatively these are Magic, Religion, Mechanics and Nature (and possibly Forbidden Knowledge, but I haven't decided on that yet). I want it to be possible to either focus completely on one branch or to split between two of them (combining Magic and Mechanics, for example), with unique technologies being available depending on which one(s) you choose. However, it should not be possible to go into more than two of these groups, and if you go for both Magic and Mechanics you shouldn't get access to all the technologies of the "pure" trees of either type.

    That's the goal, but I don't know how to get there. I could possibly do it with events that give breakthroughs for certain technologies - for example, all the techs in the Magic branch are hideously expensive until you research the first (cheap) one, and if you do that an event triggers that give you breakthroughs on all the others, effectively reducing their cost to a manageable level, but the event won't trigger if you have already researched two of the other "base" techs. However, this seems very clunky and risky - if something goes wrong with the event triggers, you'll be completely screwed.

    It would be possible to do it with leaders, but I want to keep those two choices distinct. I definitely don't want to key it off which civilization you pick - part of the fun is having the elves being just as able to go full out Mechanics as the dwarves.

    Is there some option I've overlooked?
     
  2. Tholish

    Tholish Emperor

    Joined:
    Jul 5, 2002
    Messages:
    1,344
    Location:
    Japan
    Well, you could use the FirstFreeTech tag, but how it worked would depend on how many civs were in the game. However, you could dictate that. Say eight civs. The first 8 techs all cost very little and each gives you two free techs. Each civ will probably be the first to one of them, depending on if two go for the same one--its a guessing game like getting religions. The next 4 techs available, all prohibitively exensive and non tradeable, are the first techs in the tree of each sphere, prereqs for all others. There are also second techs in each sphere that are prohibitively expensive and non tradeable prereqs for all the really advanced techs in the sphere, but they require only the basic tech for the sphere. So, when you get your first tech, you can pick two other techs, either the basic prereq for two different spheres, or the basic and advanced tech for one sphere. However, there's an added complication that you and another civ might go for the same "first turn" tech as you, in which case somebody is caught holding the bag and not getting to pick ANY tech, whereas others might sometimes luck out and get more. So, the initial 8 techs should allow some basic kind of technology, and the basic prereq tech for each sphere shoudl be very expensive but eventually attainable.
     
  3. Elkad

    Elkad Emperor

    Joined:
    Mar 26, 2007
    Messages:
    1,044
    Can you make a tech go obsolete like a unit? If so, there's your method. Even allowing 2 of 5 trees could be done. (either by If statements, or by making duplicate trees)
     
  4. Anondod

    Anondod Chieftain

    Joined:
    Apr 26, 2009
    Messages:
    74
    Using FirstFree seems risky; I'd prefer breakthroughs in that case. I want to allow more than one civ to go for the same one, especially since there will be more civs than special techs.

    I don't think tech can go obsolete, but I'll have a look at that.
     
  5. Sephi

    Sephi Deity

    Joined:
    Jan 25, 2009
    Messages:
    2,941
    I would use
    def canResearch(self,argsList):
    def cannotResearch(self,argsList):

    in Cvgameutils.py
     
  6. Anondod

    Anondod Chieftain

    Joined:
    Apr 26, 2009
    Messages:
    74
    I'll have a look at that. I haven't really delved into python yet but if there is a good function there for this then I'll get my hands dirty.
     
  7. henrebotha

    henrebotha proud Fender owner

    Joined:
    Sep 27, 2008
    Messages:
    621
    Location:
    Cape Town, South Africa
    I don't know anything at all about modding, but couldn't you replace each civ's Palace with a uniquely-named Wonder? (So if your game has 12 civs, there will be 12 different Palaces.) So when a civ founds their capital, this Wonder is built, and the Wonder gives you two free techs, Oracle-style. Since each civ's Palace is unique, there's no risk of people getting beaten to the free techs.

    You then structure your tech tree so that it starts with four prohibitively expensive techs (call them the sphere techs): Arcanism, Religion, Mechanics, and Nature Knowledge (just example names). Now, the first techs in (for example) the Magic sphere all require Arcanism (the way the core game's Metal Casting requires Pottery), plus any of the other sphere techs (with the little arrows, like how Animal Husbandry in the core game requires either Hunting or Agriculture). This prevents the player from choosing Arcanism and the first tech in the Magic sphere as his two free techs - he must have Arcanism and one other sphere tech before he has access to any other technologies.

    Furthermore, to implement your super-specialisation (ie choosing *only* Magic as your sphere), you add four more prohibitively expensive sphere techs (Deeper Arcanism, Advanced Mechanics...) which all require the relevant base sphere tech, but also lead to the sphere's first techs like the base sphere techs do. Each sphere then has techs that branch off the main sphere paths, but require the advanced sphere techs in addition to other prerequisites.

    Requires virtually no coding, just some Wonder and tech tree design. :)

    (I only realise now, after typing all of this with my thumbs, that I could have just waited until I got home, and drawn up the whole thing in Paint. :mad: :lol: )

    Like I said, I know nothing about modding. I spend my time making ridiculously contrived triggers in Warcraft 3's World Edit, so pay me no mind. :)

    EDIT: Crap, I completely missed this post...
    Tholish brings up a good point: tech trading. You'd have to somehow make the sphere techs non-tradeable. (Unless you want a Magical civilization to be able to teach a Mechanical one the arcane ways.)

    Also, by unique Palaces, I meant you give each civ a UB Palace, dig? But my (or should I say "our", Tholish? :)) idea relies on the assumption that creating a Palace when settling is the same as finishing a Wonder; in other words, that it triggers the "building complete" script.

    ...And you'd probably have to disallow moving the Palace.
     
  8. henrebotha

    henrebotha proud Fender owner

    Joined:
    Sep 27, 2008
    Messages:
    621
    Location:
    Cape Town, South Africa
    Example attached.
     

    Attached Files:

  9. Tholish

    Tholish Emperor

    Joined:
    Jul 5, 2002
    Messages:
    1,344
    Location:
    Japan
    If the sphere techs are prohibitively expensive, tech trading would also be highly discouraged by that.
     
  10. henrebotha

    henrebotha proud Fender owner

    Joined:
    Sep 27, 2008
    Messages:
    621
    Location:
    Cape Town, South Africa
    Except trading the sphere techs for one another wouldn't be discouraged.

    But I read on here that there is indeed a parameter that can be set for each tech in the game to make it "tradeable" or "not tradeable", so setting this for the sphere techs should be a simple matter.
     

Share This Page