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

BFTTree - Multiple Page Tech Tree

Discussion in 'Civ5 - Mod Components' started by FiresForever, Oct 1, 2010.

  1. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    That will be coming in a way as part of the "Mod Specific Technology Trees" this will basically allow a user to create a mod eg. "Decimatus Religion Mod" the user installs this mod and the BFTTree and then when opening the mod tree instead of being taken to the technology tree you will be taken to a page that contains buttons for each of the 'technology tree mods' that you have installed, in this case you would have two buttons one that opens the default tree and the other which opens the "Decimatus Religion Mod" tree.

    It would even be possible that in this example the "Decimatus Religion Mod" could itself have multiple trees.

    Lots of work to do but will get there :lol:
     
  2. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    I think you might like this new screen shot of what i have been busy doing :)

    This now opens by default on selecting open technology tree, each category has a different tree accessed by clicking the button.

    I will be needing more suggestions on tree categories so if anyone has a good idea let me know ;)
     

    Attached Files:

  3. Decimatus

    Decimatus King

    Joined:
    Oct 22, 2005
    Messages:
    853
    Oh sexy.

    Growth, Science, Economy, Production, Seafaring, Resources, City States, Diplomacy.

    Maybe break combat into Offense and Defense?


    Can it be made so that techs in other trees have prereqs in the main tree, but without the pipes running to them? Not sure if you can have both systems or not. Having pipes shown to be running around 10 different pages would probably make it unreadable... :p


    Is there a way to make certain trees exclusive of each other? So if I went the religion route in the tech tree, learning Buddhism would lock out all the other religion trees?
     
  4. Arrorn

    Arrorn Chieftain

    Joined:
    Jan 9, 2010
    Messages:
    25
    Location:
    Michigan, USA
    This has so much potential!
     
  5. blazekid87

    blazekid87 Warlord

    Joined:
    Oct 5, 2010
    Messages:
    179
    Location:
    NYC
    NICE JOB!
    Im currently working on an expanded tech tree and this would be nice to have, especially with the little room available. Is it possible to be able to scroll up and down instead of changing the whole screen?? I noticed if you set the GridY to 11 it appears under the scroll bar.

    My other question is do you know how to edit the TechTree.LUA file to be able to add new Eras and edit the existing ones. I would greatly appreciate it if you can point me in the right direction.

    Your mod looks great though, keep up the good work. Thanks in advance.
     
  6. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    When i tried making the screen scroll up and down it messes up the era panels as they seem to be linked with how the screen scrolls. So it unfortunately does not appear to be a simple job.

    I have not looked in detail about adding era panels yet, this is something i will probably be doing next week, if all goes well. What i can tell you however is that all of the Era information is in this file:

    CIV5Eras.xml

    Which is found here:

    C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization v\Assets\Gameplay\XML\GameInfo

    Adding a new era should be simply a matter of using this information and applying a similar method to how you add a new technology.

    Hope you find some of that useful if you need anything else just ask :)
     
  7. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    Yes techs in other trees can have prereqs in the main tree, and atm there will not be any pipes running to them, I will only add the pipes when i have developed a system that looks clean i have some ideas but they are not a priority atm so will be a while before it is added.

    Also i like the ideas for the categories and will be including them when i wake up :D
     
  8. blazekid87

    blazekid87 Warlord

    Joined:
    Oct 5, 2010
    Messages:
    179
    Location:
    NYC
    Ive tried to add an Era like you said but it didnt seem to work...I found a TechTree.LUA file and it contains a function for creating the Era lines.

    Spoiler :
    function AddEraPanels()
    -- find the range of columns that each era takes
    for tech in GameInfo.Technologies() do
    local eraID = GameInfo.Eras[tech.Era].ID;
    if not eraColumns[eraID] then
    eraColumns[eraID] = { minGridX = tech.GridX; maxGridX = tech.GridX; researched = false; };
    else
    if tech.GridX < eraColumns[eraID].minGridX then
    eraColumns[eraID].minGridX = tech.GridX;
    end
    if tech.GridX > eraColumns[eraID].maxGridX then
    eraColumns[eraID].maxGridX = tech.GridX;
    end
    end
    end

    -- add the era panels
    for era in GameInfo.Eras() do
    local thisEraBlockInstance = g_EraManager:GetInstance();
    -- store this panel off for later
    eraBlocks[era.ID] = thisEraBlockInstance;

    -- add the correct text for this era panel
    local textString = "TXT_KEY_ERA_"..tostring( era.ID );
    local localizedLabel = Locale.ConvertTextKey( textString );
    thisEraBlockInstance.OldLabel:SetText( localizedLabel );
    thisEraBlockInstance.CurrentLabel:SetText( localizedLabel );
    thisEraBlockInstance.FutureLabel:SetText( localizedLabel );

    -- adjust the sizes of the era panels
    local blockWidth = (eraColumns[era.ID].maxGridX - eraColumns[era.ID].minGridX + 1);
    blockWidth = (blockWidth * blockSpacingX);
    if era.ID == 0 then
    blockWidth = blockWidth + 32;
    end
    local blockSize = thisEraBlockInstance.EraBlock:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.EraBlock:SetSize( blockSize );
    blockSize = thisEraBlockInstance.FrameBottom:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.FrameBottom:SetSize( blockSize );

    blockSize = thisEraBlockInstance.OldBar:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.OldBar:SetSize( blockSize );
    blockSize = thisEraBlockInstance.OldBlock:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.OldBlock:SetSize( blockSize );

    blockSize = thisEraBlockInstance.CurrentBlock:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.CurrentBlock:SetSize( blockSize );
    blockSize = thisEraBlockInstance.CurrentBlock1:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.CurrentBlock1:SetSize( blockSize );
    blockSize = thisEraBlockInstance.CurrentBlock2:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.CurrentBlock2:SetSize( blockSize );

    blockSize = thisEraBlockInstance.CurrentTop:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.CurrentTop:SetSize( blockSize );
    blockSize = thisEraBlockInstance.CurrentTop1:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.CurrentTop1:SetSize( blockSize );
    blockSize = thisEraBlockInstance.CurrentTop2:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.CurrentTop2:SetSize( blockSize );

    blockSize = thisEraBlockInstance.FutureBlock:GetSize();
    blockSize.x = blockWidth;
    thisEraBlockInstance.FutureBlock:SetSize( blockSize );
    end

    end


    and

    Spoiler :
    function RefreshDisplay()

    for tech in GameInfo.Technologies() do
    RefreshDisplayOfSpecificTech( tech );
    end

    -- update the era panels
    local highestEra = 0;
    for thisEra = 0, 6, 1 do
    if eraColumns[thisEra] then
    if eraColumns[thisEra].researched == true then
    highestEra = thisEra;
    end
    end
    end
    for thisEra = 0, 6, 1 do
    local thisEraBlockInstance = eraBlocks[thisEra];
    if thisEra < highestEra then
    thisEraBlockInstance.OldBar:SetHide( false );
    thisEraBlockInstance.CurrentBlock:SetHide( true );
    thisEraBlockInstance.CurrentTop:SetHide( true );
    thisEraBlockInstance.FutureBlock:SetHide( true );
    elseif thisEra == highestEra then
    thisEraBlockInstance.OldBar:SetHide( true );
    thisEraBlockInstance.CurrentBlock:SetHide( false );
    thisEraBlockInstance.CurrentTop:SetHide( false );
    thisEraBlockInstance.FutureBlock:SetHide( true );
    else
    thisEraBlockInstance.OldBar:SetHide( true );
    thisEraBlockInstance.CurrentBlock:SetHide( true );
    thisEraBlockInstance.CurrentTop:SetHide( true );
    thisEraBlockInstance.FutureBlock:SetHide( false );
    end
    end

    end


    Since my experience with LUA is nill, some help on pointing me in the direction would be appreciated. It looks like this script updates the Era lines based on the Technology.XML file in the main directory. If there was somehow a way to point the directory to the mod dir instead I believe that may work. Is it possible to include the TechTree.LUA file with my mod and edit it to point to the updated Technologies.XML file?
     
  9. Pouakai

    Pouakai It belongs in a museum. Moderator

    Joined:
    Jun 16, 2010
    Messages:
    7,158
    Location:
    Aotearoa
    Awesome mod, well done with near infinate potential.

    Would it be possible to do the following?

    - Make certain events (i.e. Adopting a policy, Building a wonder etc.) unlock a technology in a certain page
    - Have different pages unlock in different eras
    - Have certain pages hidden
    - Have pages revealed by gaining a tech in them?
    - Have technologies become obsolete (i.e. like having certain policies become locked by other policies)

    What I am thinking of is having a tech gained via building a wonder etc., unlock a whole new page of technologies.

    Say you adopted the Piety policy tree. That might unlock the Piety tech page, giving access to Piety technologies, allowing you to build religious buildings etc.

    This would allow a much more flavoured game, say if you wanted to go for a cultural victory, and so you adopted a cultural policy, or built a cultural wonder, you get access to the culture page of the tech tree, which has techs based mainly on culture.
     
  10. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    blazekid87:

    I will let you know what my findings are after i have taken a sledgehammer to this code next week :)

    Pouakai:

    These are all great ideas and as i do with all good ideas i will keep them in mind as i design stuff ;)

    Having pages unlock when an era or specific technology has been reached seems possible.

    atm however being able to assign a technology a prereq that is not another technology does not seem possible, not until more of the game is released to edit, i am sure someone will solve it and will open up those ideas as being possible.
     
  11. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    Good news! It seems i have solved the final puzzle piece for adding civilization specific technology trees :)

    I got a lot of grunt work ahead of me now and i expect the next version of the mod to be out sometime next week, there will be lots of changes in it both cuts and additions.

    I will also be looking for someone who can alter the appearance of all the buttons to make them more visually meaning (eg. Swords on the offensive tech tree button, shields on the defensive tech tree button, etc) at some point, so let me know if you can and are wiling to do this.
     
  12. Decimatus

    Decimatus King

    Joined:
    Oct 22, 2005
    Messages:
    853
    Nice!

    Will it work similar to the Unique buildings, as in if you play China you see only the China tree on the Unique Civ Tech page?
     
  13. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    Yes it will work like that, when you click Open My Civilisation Tech Tree button (i havent decided what to call it yet) it will open a tree with just the specific technologies of the civilization you are playing.

    There will be another button to allow you to browse all the other civilization specific trees but you wont be able to research them.
     
  14. Decimatus

    Decimatus King

    Joined:
    Oct 22, 2005
    Messages:
    853
    That is awesome.

    I have a feeling it is going to take months if not years for modders to make good on all the potential that this is giving them.
     
  15. RandomPete

    RandomPete Chieftain

    Joined:
    Oct 8, 2010
    Messages:
    34
    Firstly, thanks for your great work! I'm starting to develop a mod that adds a whole load of new technologies and I've been using your mod to get space to build new trees :)

    However seeing the direction you are taking this mod I have a couple of comments:

    1. Having all those extra buttons appear makes things very complicated. I would prefer if the default tech tree opened straight away and just had tabs to switch to different categories.

    2. Do all the category buttons appear, even if they are empty?

    3. It might be better to be able to completely customise what categories are added, perhaps with a new Civ5TechCategories.xml and have LUA read those from the database. (Is that even possible?) This would make it much more plug and play in that several mods with new techs could be combined and each would add their techs to the respective buttons or add new buttons as preferred. Of course this will add all kinds of problems with techs appearing on the same grid squares etc.

    4. Pipes to techs on a different page are of course a big problem, have you got any solution for this in the new version?

    5. I kind of prefer blazekid87's idea of scrolling up and down, I'll have a play with this myself in the UI xml and see if I can achieve anything... My mod is supplementing the current tech tree and just adding a few more choices rather than the fairly limited path you have to any specific tech / era. So I don't need pages and pages of stuff and it'd be nice to see more clearly how the techs tie in to the existing tree.

    Anyway thanks for all your effort on this, currently my mod would be very lacking without it! I don't want to post any files or reveal anything much until I've got some more interesting stuff working, at the moment I have just a handful of mostly unconnected new techs and not many buildings or units, but I've got some interesting ideas to flesh out :)
     
  16. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    Thanks for the feedback :)

    Firstly ATM Version 3 is going to remove the Up and down buttons for the main Technology tree, as personally i feel that the categories are better in a lot of ways. However if after this new version 3 is released i could incorporate it back in if someone demands it, perhaps a version that just has this feature. But i would ask for everyone to try the new system and see how it feels first, and give feedback both good and bad :eek:

    To your questions 1-3, all buttons do appear even if they are empty I know this is very ugly and complicated but this is how Version 3 will be, as it is more about developers than users at this stage. Version 4 however will only show buttons if there are technologies in the tree, making it a lot more user friendly, i have a few different ideas on how to make this work. Allowing Developers to add their own categories directly is the ultimate goal, perhaps version 5, until then you can tell me what categories you need and i will add them into the mod.

    I will add more info on a projected road map of the project to the main post at some point. I hope this answers some of your questions ;)
     
  17. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    FiresForever, have you or anyone else here figured out how to add a Y-scroll to the tech tree? It's a darn shame that my added techs just run off the bottom of the screen. I tried the dumb-headed addition below in TechTree.lua (thought I might get lucky), but no luck:

    Code:
    	-- make the scroll bar the correct size for the display size
    	Controls.TechTreeScrollBar:SetSizeX( Controls.TechTreeScrollPanel:GetSize().x - 150 );
    
    	-- added by Pazyryk - doesn't do anything
    	Controls.TechTreeScrollBar:SetSizeY( Controls.TechTreeScrollPanel:GetSize().y - 150 );
    	-- end add
     
  18. Pouakai

    Pouakai It belongs in a museum. Moderator

    Joined:
    Jun 16, 2010
    Messages:
    7,158
    Location:
    Aotearoa
    Is there any way to change what page shows up for the 'select new tech' sidebar? I have both pages show up at the same time, could ruin category style.
     
  19. FiresForever

    FiresForever Prince

    Joined:
    Sep 30, 2010
    Messages:
    584
    Firstly some good news, the new version is almost ready, unless anymore horrible problems need to be solved fingers crossed, :eek:

    Note to self and anyone adding many new pages to ingame.xml, this can break the game, with surprisingly few new entries in fact needed to do so :cry:, BFTTree as such is now down to 4 .lua files. At some point i will get this down to 3 and then hopefully 2, to make it as compatible as possible :)

    Pazyryk:

    see this bit of code in the TechTree.xml file whihc is about 10 lines down:

    <ScrollPanel Anchor="L,C" Size="Full,705" Vertical="0" ID="TechTreeScrollPanel">​

    Change the Vertical value to 1, this will make the scroll bar at the bottom now make it scroll up and down instead of side to side, you should be able to spot the problems this makes when this is done ;)

    Pouakai

    This is possible, but will wait and see what feedback people start saying once BFTTree is being used and lots of techs are added to each of the categories. I think the sidebar is better for making very quick selections, splitting it up might slow this process down and be annoying.
     
  20. Decimatus

    Decimatus King

    Joined:
    Oct 22, 2005
    Messages:
    853
    I was thinking.

    Would it be possible to add separate colors for the tech tree pipes and then have the pipes all enter and exit a given tech at separate points?

    Probably a lot of work, but it could help out with pipes moving all over the place and especially if the pipers were going to different pages.


    Of course, there are plenty of potential problems with that, the least of which is making your tree look like an electrical cabinet.. :p


    Any of you ever seen the actual blueprint tech tree printout that came with Call to Power? I kind of laugh every time I see it. It is great, but I can understand how it would be horribly confusing to anyone used to your standard linear tech tree.
     

Share This Page