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

Gedemon's Civilization, development thread

Discussion in 'Gedemon's Civilization, a total overhaul project' started by Gedemon, May 7, 2017.

  1. DemonEmperor

    DemonEmperor Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    57
    Weird. Don't think I've been able to build coastal wonders at all, actually.

    More feedback/suggestions:
    • I'm actually perfectly fine with taxation as-is. Reducing tax on the higher classes, because theoretically the lower classes will make up the difference is a common economic concept. Whether you agree with it is up to you.
    • Would like to find a way to block buildings from being shown if there's no way for the city to get the resource in question. e.g.: no brickmakers, if there are no floodplains, or there is no connection to another city actively harvesting clay
    • ^ regarding the above, recommend some logic like: "can build if city has a source of at least one of the requirements for at least one of the productions, or the building produces food"
    • On a similar note, have seen materials being transferred across cities, but it's still kinda mysterious and opaque - some in-game clarifications/details somewhere would be nice
    Edit: suggested plague system shoved over to health thread (forgot that existed)
     
    Last edited: May 6, 2020
  2. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
  3. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    Update:
    Code:
    - fix Medieval Builder unit models size
    - UI: show the Production Bonus provided by a Building for its upgrade
    - balance: BrickMaker also upgrade to Workshop, like Stonemason and Carpenter
    - balance: add upgrade path to all Housing Buildings and tweak Ancient Era Housing texts to clarify the Upgrade path
    - balance: add <BuildingProductionBonus> table to quickly set modifiers allowing a BuildingType to give a production bonus when constructing a specific Building
    - balance: add era-related Buildings to <BuildingProductionBonus> for all "Central Square" Buildings (those give better bonus for City created in later Eras)
    - balance: raise production rate of Blank Scrolls, Tablets, Books
    - balance: University now stock and produce Books and Scrolls
    - feature: Land Surveyors Policy is now adapted to the mod and provide 50% reduction to Territory Administrative cost at the Empire and Cities level
    - feature: Scribe House, Library and University can now copy Tablets, Scrolls and Books of Technologies unlocked for research
    - feature: Tribal Village will give Technological Tablets (Ancient), Scrolls (Classical) and Books (Medieval and above), bring those back to your scribes !
    - balance: remove a few other Dead End in Tech Tree
    - balance: lower MaxStock value for Tablets, Scrolls, Books of known Technologies
    - optimization: cache MaxStock value for cities
    - fix: remove a few potential Divide by 0, thanks DemonEmperor
    - balance: Population is unaffected by the "Transport" parameter for Migration from a city to one of its own plots (should result in more Rural population)
    - balance: split the "maxPopulation" variable between "maxPlotPopulation" (sustainability, aka "MaxSize") and "maxHousedPopulation" (best between available Employment and MaxSize) to allow more Population on plots with high employment and low fertility (only when the plot is owned by a city, and depend of the city own rationing, while free plots are still only dependent of their local food resources)
    - fix: CityBanner ToolTips should now be rendered above everything (except Resource Icon ToolTip, let me know if you find why)
    - add small functions to handle delayed execution using coroutines (For when the UI cache is not synchronized with Core but is the only way to get a Core value)
    I'll surely have to do another pass on the Housing upgrade path, the housing values and the production bonus.
     
    CalebR_300 likes this.
  4. DemonEmperor

    DemonEmperor Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    57
    Cheers!

    Would like to report a bug with the prior version: one of my spies got caught, and the escape path chooser screen refused to pop up. Currently sticking print statements in the file so I can find out what's going on
     
  5. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    thanks, old bug, I though it was fixed at some point.

    Let me know what you find.
     
  6. DemonEmperor

    DemonEmperor Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    57
    @Gedemon have located the line of failure

    print statements are as below:
    Code:
    function OnOpen(testParam)
    
        print (testParam);
    
        local localPlayer = Players[Game.GetLocalPlayer()];
        if (localPlayer == nil) then
            print("IT SAYS ITS NIL!?!?!")
            return;
        end
        print("success?")
    
        local spyUnitID = localPlayer:GetDiplomacy():GetNextEscapingSpyID();
        local spyUnit :table = localPlayer:GetUnits():FindID(spyUnitID);
    
        print("found spy metadata")
    
        local currentCity = Cities.GetPlotPurchaseCity(spyUnit:GetX(), spyUnit:GetY());
        local spyName = spyUnit:GetName();
        local lootName = spyUnit:GetLootName();
        local pursuitSpyName = spyUnit:GetPursuingSpyName();
    
        print("found situation metadata")
    
        local choice1Turns = GameInfo.Districts[district1].TravelTime;
        local choice2Turns = GameInfo.Districts[district2].TravelTime;
        local choice3Turns = GameInfo.Districts[district3].TravelTime;
        local choice4Turns = GameInfo.Districts[district4].TravelTime;
    
        print("fetched travel time metadata")
    The log reads:
    Code:
    YnAMP_InGame: Current Ruleset =     RULESET_STANDARD
    EspionageEscape: 23
    EspionageEscape: success?
    EspionageEscape: found spy metadata
    EspionageEscape: found situation metadata
    EspionageEscape: 23
    EspionageEscape: success?
    EspionageEscape: found spy metadata
    EspionageEscape: found situation metadata
    EspionageEscape: 23
    EspionageEscape: success?
    EspionageEscape: found spy metadata
    EspionageEscape: found situation metadata
    EspionageEscape: 23
    EspionageEscape: success?
    EspionageEscape: found spy metadata
    EspionageEscape: found situation metadata
    EspionageEscape: 23
    EspionageEscape: success?
    EspionageEscape: found spy metadata
    EspionageEscape: found situation metadata
    EspionageEscape: 23
    EspionageEscape: success?
    EspionageEscape: found spy metadata
    EspionageEscape: found situation metadata
    
    did you perchance modify/get rid of GameInfo.Districts somehow? would recommend replacing with hardcoded values regardless. Going to do so now and see what happens
     
  7. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    the Harbor !

    removed it in a recent update.

    edit:
    try to replace
    local district2 = "DISTRICT_HARBOR";

    with
    local district2 = "DISTRICT_CITY_CENTER";

    bad hardcoding, Firaxis, bad !
     
  8. DemonEmperor

    DemonEmperor Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    57
    @Gedemon yea confirmed that's what broke it.

    Do you end up changing escape values? because if you don't plan on changing it, using hardcoded stuff as below is marginally better
    (fewer memory accesses (i.e. arrays) is always good, except when recalculating that value takes significant longer. hardcoded = 0 computation, always most efficient. it's just bad coding practice for maintainability, but comment it good enough, and it should be fine, especially since civ VI needs to squeeze all the tiny optimizations it can lol)
    Code:
    local choice1Turns = 1;
    local choice2Turns = 2;
    local choice3Turns = 3;
    local choice4Turns = 4;
    
    edit: the logic becomes wrong though, I'll see if I can find a way to fix it
    edit2: yeah I have no idea how to fix it.

    the issue is, the actual functionality of calculating chance of escape is done here:
    Code:
    function OnButton1()
        local tParameters = {};
        tParameters[ PlayerOperations.PARAM_DISTRICT_TYPE ] = GameInfo.Districts[district1].Index;
        UI.RequestPlayerOperation(Game.GetLocalPlayer(), PlayerOperations.SET_ESCAPE_ROUTE, tParameters);   
        ContextPtr:SetHide(true);
    end
    function OnButton2()
        local tParameters = {};
        tParameters[ PlayerOperations.PARAM_DISTRICT_TYPE ] = GameInfo.Districts[district2].Index;
        UI.RequestPlayerOperation(Game.GetLocalPlayer(), PlayerOperations.SET_ESCAPE_ROUTE, tParameters);   
        ContextPtr:SetHide(true);
    end
    function OnButton3()
        local tParameters = {};
        tParameters[ PlayerOperations.PARAM_DISTRICT_TYPE ] = GameInfo.Districts[district3].Index;
        UI.RequestPlayerOperation(Game.GetLocalPlayer(), PlayerOperations.SET_ESCAPE_ROUTE, tParameters);   
        ContextPtr:SetHide(true);
    end
    function OnButton4()
        local tParameters = {};
        tParameters[ PlayerOperations.PARAM_DISTRICT_TYPE ] = GameInfo.Districts[district4].Index;
        UI.RequestPlayerOperation(Game.GetLocalPlayer(), PlayerOperations.SET_ESCAPE_ROUTE, tParameters);   
        ContextPtr:SetHide(true);
    end
    specifically, in the one function UI.RequestPlayerOperation, which I suspect is hardcoded in the game, and I have no idea how to get access to it.

    the issue is, options corresponding to harbor, commercial hub, and city center, all appear to the game as if you chose city center, every single time.

    Another potential issue is, by removing districts from the districts table, it may change the Index field (i don't actually know if it does) of the things, if the table auto-calculates them. (I find this unlikely)

    if the function code hardcodes in what the indices are (which I'm relatively sure it does), then if you could extract those indices, and hardcode in the expected indices in those 4 functions, we would have vanilla behavior replicated
     
    Last edited: May 6, 2020
  9. DemonEmperor

    DemonEmperor Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    57
    Posting a bug report.
    Can build multiple of the housing building tiers at once. e.g. BUILDING_ANCIENT_LOWER_HOUSING_1 and BUILDING_ANCIENT_LOWER_HOUSING_2 and BUILDING_ANCIENT_LOWER_HOUSING_3 can be queued in any order.
    Likewise, can queue ancient housing and medieval housing, in any order.. From the comment in Buildings.xml that says it should be handled by upgrade path, I take it that (at least the first issue), is not intentional
     
  10. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    quick hot fix before work, I'll answer later
    Code:
    - bug fix: show escape route for Spy
    - bug fix: the Workshop should provide more production than the sum of the buildings it replaces
    - bug fix: make correct number of copy for Tablets, Scrolls, Books
     
    CalebR_300 likes this.
  11. CalebR_300

    CalebR_300 Chieftain

    Joined:
    Jul 12, 2016
    Messages:
    25
    Just starting a game on the latest patch. Notes so far:
    • Had a unit go into a tribal village and collect (amongst other things) '0 Code of Law Tablets'. Pretty sure there shouldn't be a tooltip if they didn't collect any of a said item.
    • It's possible to soft-lock the game by selecting a government without enough civics to fill it. I selected Autocracy, but had no military civics unlocked; game wouldn't let me advance the turn nor revert to chiefdom. Had to reload the previous turn.
    • Rural population/land tile fix seems to have worked, farms are booming, and cities have an easier time feeding themselves.
    • Had another instance of a rival civilizations levied troops disappearing when the leader attempted to sue for peace (I refused). I wonder if the negotiation screen temporarily stops the 'war' state, thus disbanding the troops (who are only levied whilst the war is active)?
    • Noticed some inconsistencies is processing rates of the fruit market and market. For instance, bananas convert 45 -> 11.25 food in the fruit market, and 60 -> 51 food in the market. Most other food converts on a 1:1 ratio.
    • The dead sea is treated as a fresh water source for units. :lol:
    • The Land Surveyors civic is a boon for reducing empire cost for land. Population is still the biggest factor though; maybe a 'Census' civic to reduce population empire cost (say, -25%) would be handy?
    • It's not uncommon for all my cities to have near 100% stability, yet my empire stability is considerably lower (30-40%). Feels de-synced, as if my empire is a series of well run city states that don't get along.
    • Aqueduct and trader have no material cost.
    • The production boost to medieval housing (when upgrading) seems to result in very high material costs per turn. Even developed cities with a workshop had difficultly meeting the per turn material cost, resulting in city production costs suddenly skyrocketing.
    • Steel sword storage in cities is way below other weapons, maxes at 280, whilst other weapons expand to 1400. Unsurprisingly steel swords have a way higher price compared to other weapons.
      upload_2020-5-9_14-12-29.png
    I'll probably just extend this post if I find anything else.
     
    Last edited: May 9, 2020
  12. DemonEmperor

    DemonEmperor Chieftain

    Joined:
    Jan 17, 2017
    Messages:
    57
    Two things: Something failed somewhere, and so pyramids graphics are shown over Setubal, even when pyramids are already built elsewhere (in this case, outside of Cairo)

    Edit: retract this point - reloading fixed it - that's probably a base game fault somewhere, not part of this mod

    Second, haven't seen this bug in action yet, since I haven't played on faster speeds, but you're still able to build buildings that can be upgraded to higher tier buildings, massively inflating the building list. (the check only shows a failure if the upgrade building is already built, but until that happens, you can still build the non-upgraded versions)
     

    Attached Files:

    Last edited: May 7, 2020
  13. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    I'm adding a filter to the production list

    The upgrade for buildings is different than the (vanilla) upgrade behavior for units, you can product both as long as you've not produced the upgrade.

    That way you can produce entry-level buildings in small cities, to upgrade later thanks to the production bonus they give to the upgrade.

    Filter in action:
    upload_2020-5-7_23-2-41.png
     
    mbaratta83 likes this.
  14. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    Small QoL update
    Code:
    - add filters to the Buildings production list
    - hide "Palace" from the Buildings production list
     
    CalebR_300 likes this.
  15. mbaratta83

    mbaratta83 Chieftain

    Joined:
    May 15, 2012
    Messages:
    39
    Yay, the mod is back on track! So, some thoughts on these latest iterations of the mod.

    I like the new administrative efficiency mechanic, although some aspects of it are still rather opaque to me. What determines the flow of scrolls/books/tablets from one city to another, and from the city level to the empire level? A city can have a thousand administrative books and the subsequent boost to city admin efficiency for several turns, and then suddenly almost all of them disappear, while another nearby city never seems to have any. Of course, cutting nearby trees seems to solve the problem in the short term, but where does it all go? I suspect the administrative products are being siphoned into generating research points, but I'm not sure.

    I love how housing is much more meaningful. Housing is actually a constraining factor on city growth now, whereas before the cities kept growing as long as the food supply kept up. As such, I can more directly control city growth. Unfortunately, this also means the growth of AI cities are stunted even more than before, since it is still inconsistent in whether or not it produces housing. The situation is compounded by the smaller production multiplier resulting from the AI not producing administrative books/scrolls. The AI was able to build at least some decent sized cities before these changes.

    In earlier versions of the mod (before the long hiatus), the policy screen would unlock every time you discovered a new policy. Since the policies have been merged into the tech tree and the culture tree is gone, the only way to unlock now is to pay money. Any way to restore the old functionality? Also, is there any way to add support for the mouse scroll wheel in the city details screen instead of needing to physically drag the scroll bar down?

    Finally, in the latest version, one of my games suddenly started to have extremely long wait times after ending my turn, and I'm not referring to how turns gradually become longer the further into the game you play. It was like at least triple the usual wait time. I've started a couple other games and this still hasn't happened after at least 200 turns of gameplay. I've included a lua log just in case there's anything to it.
     

    Attached Files:

    • Lua.txt
      File size:
      963.5 KB
      Views:
      32
  16. CalebR_300

    CalebR_300 Chieftain

    Joined:
    Jul 12, 2016
    Messages:
    25
    I can confirm this, similar thing happened to me around turn 237. I rebooted the game just in case, but the situation remained the same. Seems the 'Plots DoTurn timer' and 'Plots DoTurn Fourth Pass timer' increase significantly?
    I'm posting my log, but not so useful due to the reboot cutting it short.

    PS. Updated my previous post with a few new things. (Them darn steel swords again).
     

    Attached Files:

    • Lua.txt
      File size:
      40.2 KB
      Views:
      35
    Last edited: May 9, 2020
  17. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    Thanks everyone for the feedback, I copied then edited a few posts in the bug report section to track them

    a few more answer:
    I needed a simple way to show an unit size based from its Military Organisation Level, it's based on that:
    https://en.wikipedia.org/wiki/NATO_Joint_Military_Symbology#Unit_sizes

    Unit's name (in the flag's Tool Tip) change with the organization level too.

    I'll see if I can add another Tool Tip over the Roman numeral describing the effect of the organization level. (size, strength, "healing" speed, supply line range)

    I'd like to had a feature to the recon line allowing to claim un-owned small islands (3 tiles max) automatically, if they are close enough to one of your city when you disembark on them.

    That's for when the "Front Line" mechanism will be implemented.

    The taxe is based on the city gold output, not its population size.

    An early "do nothing" project would stay all game (didn't code a way to make them obsolete yet), and may confuse the AI.

    It's intended for the health effect, the city can't directly "work" them, but it does collect resources on them. But the effect is scaled with distance IIRC.

    First points are tricky, as you can get a lot of clay from another city over trade routes, and you may want to build it before the route exist, in prevision.

    transfer/trade details are on the city screen. I need to rework it to filter "tech resources"

    see below how this city is receiving war horses to reinforce the nearby unit from cities it has a trade route with
    Spoiler :

    upload_2020-5-9_14-1-12.png


    I assigned 2 trader units to manually create the routes as the city automatic routes were linked to closer German cities. Not that the other cities are not the primary source of the war horses, they are breed/trained in another city with a stable and horses resource nearby.
    Spoiler :
    upload_2020-5-9_14-5-22.png


    Created a thread in the bug report to track the resource conversion inconsistencies, there are others.
    https://forums.civfanatics.com/threads/inconsistencies-in-processing-rates-of-resources.657787/

    Note that 1:1 is NOT mandatory, but when there is (for example) a 1:3 ratio for a specific resource conversion, it should be kept for later buildings, except when a rise in efficiency make sense with the tech unlocking the new building.

    Dead Sea is handled like that by the core game, when calling "Plot:IsFreshWater()". Can't change the core, hardcoding an exception in Lua would slow down the mod even more.

    Empire and Cities Administrative efficiencies are separated to allow Separatist movements.

    About resource cost, I need a way to slow down production speed maybe. ATM you can micromanage by doing one turn of production then switch to something else, but I don't want this kind of micromanagement in the mod.

    High storage means higher demand, and so even higher prices. The issue is the low production rate, but I want it to be low (for this specific case). Solution would be the ability to switch on/off buildings or specific buildings production in the UI to focus on them (or stop producing them), planned, but no ETA.

    Administrative resources are consumed by a city Administrative cost, up to a minimum percentage of the "stock" that represent the "Archive" providing support to the Empire administration.

    I'll add policies to change the minimum percentage (+/-) so you can chose to have more stock/archive available for Empire administration or more stock that can be used for the City administration.

    Research resources are separated, but share the same raw resources, ATM you may want to chose between science or administrative buildings in some cities until a way to manually manage resources production in cities is added.

    May depend on the difficulty level, with an immortal AI, some of the other Civilization cities are near my own in size.

    As coding the AI would take time, even if the source code was released now, and the mod progress is already slower than what I want, I'm more and more inclined to use asymmetrical gameplay between humans and AI, when I'll get to that point.

    And that does cripple the AI, as it doesn't change Government. I'll think of another method.

    mouse scroll is a new (bad) vanilla behavior AFAIK.
    processing cost of the mod code is exponential, when it start to show, it will skyrocket pretty fast.

    The migration calculations may be the culprit, but pathfinding trade routes is still another.

    Pray for the source code if you want the ability to play this on big maps, as I won't cut down features.

    I'm trying my best to optimize and cache values when possible, and I'm sure there are a lot more optimization possible, but Lua is not meant to handle so much.

    The mod has now more than 20,000 lines of Lua code as of today
    Code:
    http://cloc.sourceforge.net v 1.64  T=1.81 s (31.5 files/s, 23506.0 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    Lua                             18           3540           2566          20017
    XML                             23           1081           2681           8982
    SQL                             16            553           1160           2012
    -------------------------------------------------------------------------------
    SUM:                            57           5174           6407          31011
    -------------------------------------------------------------------------------
    (that's not counting the UI files of the base game that are overriden and edited for the mod, it's only the script files here)
     
    Last edited: May 9, 2020
    CalebR_300 and mbaratta83 like this.
  18. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    Working on a Migration visualization option, what do you think of that ?

    Spoiler :
    upload_2020-5-11_0-22-32.png


    Spoiler :
    upload_2020-5-11_0-23-34.png
     
    CalebR_300 likes this.
  19. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,556
    Location:
    France
    The River/Desert effects are clearly shown here
    Spoiler :
    upload_2020-5-11_0-27-11.png
     
    Last edited: May 10, 2020
  20. mbaratta83

    mbaratta83 Chieftain

    Joined:
    May 15, 2012
    Messages:
    39
    So if I'm understanding this correctly, the arrows inside a hex pointing towards the center of that hex are indicating migration into that hex, while the arrows pointing away from the center of the hex indicate migration out of the hex. Also, in the second picture, what are the numbers indicating? I'm guessing 7 migrated into the hex from the direction indicated, and the new total population of the hex is 1981 after accounting for whoever migrated out as indicated by the second arrow?
     

Share This Page