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

City State Diplomacy Mod (Updated)

Discussion in 'Community Patch Project' started by Gazebo, Oct 18, 2010.

  1. Seek

    Seek Deity Supporter

    Joined:
    Aug 7, 2010
    Messages:
    3,410
    @rhammer - I've been thinking of suggesting something along the same lines, but to make *all* city-states use a caravan system. Basically have food and culture yields be caravans. Could make a fourth CS type as well with production caravans! It would make balancing much much easier, as well as create more strategic depth through the decision of which city to send the caravans to.
     
  2. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    You could very easily tweak this in and try it if you want with CSD. Simply replace the XML string for each diplo unit that gives them the influence mission (name has left my mind) and replace it with the 'hurry production' modifier from the Great Engineer. Should work with no problem.

    Edit: Furthermore, we could give the CSD units the Great Engineer AI and change the flavors to see if the AI would actually use them. Probably wouldn't use them successfully...but possibly. My two suggestions for this would be to reduce movement speed for the caravans to 1 hex per turn off road, 2 on roads and 3 on rails and make them have high upkeep. Otherwise you could spam the hell out of them and use them to wonder rush.

    If you are REALLY interested in this I can work on a basic model this afternoon. It wouldn't be too tough, I imagine.
     
  3. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    This is a fun idea, however there is no way as of now to trigger the diplo units to convert a city-state/state-in-anarchy (as that is the model you would use here) to join your empire. If someone wants to write in some code that could force CSs to join your empire, I could somehow include a high-level (500+ influence) turnover system that makes CSs join your empire out of love. :)


    That's what the World Trade Organization is for!! :) No one seems to use it...I really like it, but oh well...

    I've thought about it, but I think the + movement bonus would be a bit limp compared to a production bonus. I know for myself I would skip that policy until the very end of the tree. Have you tried building roads to CSs you want to ally with? Costs GPT, but it is pretty handy for quick traveling.
     
  4. Thalassicus

    Thalassicus Bytes and Nibblers

    Joined:
    Nov 9, 2005
    Messages:
    11,057
    Location:
    Texas
    I'm finally going to sit down and give this a try. :)

    I'd been attempting until now to salvage the existing CS system, but I've come to the conclusion there's just no way with current tools to tweak vanilla values to give it the depth and complexity necessary to make it fun. In particular the quest system needs an overhaul with more quests and a tiered structure of quest priorities, and it's not something we can easily do right now.

    I look forward to my next game with this mod now active! :goodjob:

    From the research I did on the subject I think load order is determined by the order mods are installed, and stored somewhere in the game's data files (it does not read from creation dates of the mod files). The only way I've found to reliably change load order is to remove mods and re-install them using the ingame install button.

    I'm not certain about that, but I do know all mod database changes are made at once when the "single player" menu option is selected on the Mods submenu. This is why that button lags so much. :lol:

    On the topic of language translations, I'd highly recommend translate.google.com. It's a bit tedious because it doesn't recognize some code elements well (especially stuff in { } curly braces), but overall is a great service.
     
  5. Seek

    Seek Deity Supporter

    Joined:
    Aug 7, 2010
    Messages:
    3,410
    Load order does seem to be important for unit graphics (if not for anything else) based on experience and testing with CSD/RED, discussed at length in this thread. I almost mentioned that a while back when you were discussing it in your thread, but thought it off topic.

    Glad you're trying this mod, I've played every game for months with it; hope you enjoy it.:D
     
  6. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    Thanks for giving it a try, I always appreciate feedback.

    As Seek mentioned, I'm pretty sure art depends upon the order of checking mods in the browser, as I've tried checking things in different orders and have had different, art-related results. This would make sense (as the browser hangs for moment once you've selected your mods and move on to the custom game browser), so I believe that's the point in which the game loads the art from the mods, in the order that you checked them. You've done more research than me, so what we're experiencing may be a symptom of a deeper phenomenon.

    I've tried to make CSD work with mods such as yours and on its own, so feel free to test with or without other mods.

    And most of all, have fun! I might be biased, but you've picked the best city-state diplomacy overhaul mod for Civ5! (by default)
    G
     
  7. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    Seek,
    Do you still want me to look into the supply train system? Snow still blanketing the world here and the university is closed, so I'm homebound all day.
     
  8. Seek

    Seek Deity Supporter

    Joined:
    Aug 7, 2010
    Messages:
    3,410
    Me too.:lol:

    Yeah, if you're willing to, I think it could be a lot of fun! I did mention the idea to Thal (small discussion here) and he wasn't sure if the AI could handle it.
     
  9. rhammer640

    rhammer640 Russian Monk

    Joined:
    Aug 9, 2010
    Messages:
    386
    @Thal

    I'm glad you are giving this mod a try, Ive been using both yours and this one together for months and they work great together. I think it could also help with the issues you've been trying to work out in your own mod regarding city-states.

    @Gazebo

    So do you mean that the caravans would be what you got instead of the instant payoffs from city-states and you would have to bring them back to a certain city? Cause if so that is an awesome idea and i think would def be worth a try. Something that thal does over at the Balance combined mods is to release beta mods only on the forum for testing while things get worked out before releasing to the public per say. It works well so that ppl that want to try the new changes can do so while not messing with everyone else using the mod through the mod-browser. Maybe you could do something similar if you decide to try out these new changes
     
  10. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    I'm not sure if it would be quite so complex in the beginning - I'm simply going to replace the diplomacy mission (the 55 influence) with a hurry production modifier to make supply wagon-esqe things. Kind of like Colonization, but without all the fun and function (and why the hell has THAT mechanic never been ported to civ?? I'll never understand....)

    I will post a simple version once I finish it.

    G
     
  11. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,352
    Location:
    France
    Yeah, I've abandoned the idea to understand how the load order works for now... seems like combined modpack with all the tedious file merging are the only way to go until we finally got the dependancy option in modbuddy...

    I'll love that.
     
  12. rhammer640

    rhammer640 Russian Monk

    Joined:
    Aug 9, 2010
    Messages:
    386
    ok so there would be another unit type that would conduct trade missions in exchange for caravans to bring to cities? That would be cool and a lot easier to do as well as not breaking a mechanic that already works well, thanks to your awesome mod!
     
  13. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    Ok, here's my alpha-stage attempt at a supply system. There are three new units (Caravan, Merchant and Freight Train) and two new buildings (Warehouse and Train Depot). Costs etc. are in the mod.

    The idea here is that you can build a unit (i.e. the Caravan) for its cost and 50% of that cost can be transferred to another city using the hurry mechanic (like a Great Engineer). So, for example, Caravans are unlocked with 'the Wheel' and cost 60. 30 of that 60 production can be spent in another city.

    The two buildings give +% bonuses to Trade unit production. The warehouse grants 5% and the train depot grants 10%. Thus, if you have both, you will be transferring roughly 9 more production every time you use a Caravan (60x.15=9). Buildings such as the Forge and Arsenal grant blanket bonuses to land units, so you can build those as well to gain +35% more (50% total). Thus, with all four of these buildings, your Caravan will be transferring 30 more production (100% efficiency).

    Anyways, that's how its supposed to work. My math may be off....but we'll see. The AI knows how to use it, so it should work fairly well.

    Also, I'm using standard Civ5 art (Workshop art for buildings, Merchant art for units), so don't be alarmed.
     
  14. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    I'm not quite sure how to code in a mechanic that would instantly replace a unit with another unit....once I figure that out, though, it could be possible.
     
  15. rhammer640

    rhammer640 Russian Monk

    Joined:
    Aug 9, 2010
    Messages:
    386
    Sounds awesome! I wont be able to test for a while though as im super busy :mad:
    I dont see any reason it shouldn't work great though. I'm assuming the merchant and freight train are just upgraded versions of the caravan? If you figure out other ways of trading on top of this one it would be cool to have a giant trade/diplo system similar to the CSD mod.

    Any ideas on how to expand on this idea of increased trade systems? I'm fresh out now but ill keep thinking about it.

    edit: just realized your icon and name are from munchkins and almost cracked up in the middle of work, oops! Love that game!
     
  16. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,352
    Location:
    France
    just a quick copy/paste from my UU for CS mod that could help you, skip the promotion part, the code was made for replacing same class units...

    Spoiler :
    Code:
    function ChangeUnitTo ( playerID, unitID, unitType ) -- player ID, Unit ID, Type ID
    	local player = Players[ playerID ]
    	local unit = player:GetUnitByID( unitID )
    
    	-- get position before killing the unit !
    	local x = unit:GetX()
    	local y = unit:GetY()
    
    	-- kill old unit
    	unit:SetDamage( unit:GetMaxHitPoints() )
        print( "  Unit destroyed: " .. tostring( unitID ) )
    
    	-- create the new unit from the old one
    	local newUnit = player:InitUnit(unitType, x, y)
    	newUnit:SetExperience ( unit:GetExperience() )
    	newUnit:SetLevel ( unit:GetLevel() )
    	-- should be ok to give existing promotions, we're creating UU from standard units, not the other way...
    	for unitPromotion in GameInfo.UnitPromotions() do
    		local unitPromotionID = unitPromotion.ID
    		if( unit:IsHasPromotion( unitPromotionID ) ) then
    			newUnit:SetHasPromotion( unitPromotionID )
    		end
    	end
        print( "  Replaced by: " .. tostring( newUnit:GetID() ) )
    end
    


    edit: you need to swap them when conducting the mission ?
     
  17. rhammer640

    rhammer640 Russian Monk

    Joined:
    Aug 9, 2010
    Messages:
    386
    if its possible to swap units like that i think maybe if you sent the caravan units to a city state it should be replaced by a unit that either adds something different based on the type of city state. For example a caravan goes to a cultural city state taht you are friends with or ally's with (maybe a bonus based on relationship) and then gets turned into new unit and returns to city to complete mission. Military might add a set xp to unit currently fortified in that city. Cultural might drop a certain amount of culture to that city and maritime might add a certain amount of food.

    I think that you should have to have diplomatic relations with the CS before conducting missions.
    Also i think you should use the same units you just added and not add more to reduce complexity. Therefore the caravan could add hammers if it just goes directly to the other city or it could add xp, culture or food if it goes on a diplomatic mission to a friendly city state.

    Could be quite fun and add a lot of needed desision making to the game!
     
  18. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    Yeah, I think that might work (edit: referencing Gedemon's code posted above– sorry about the vagueness). Or we could have it be a great person that randomly spawns (perhaps replacing the Great Person spawn mechanic with caravans that boost production?)

    Also, with regards to the caravan unit/supply mod concept, it is possible to have units require luxury resources, correct? What I'm thinking is as follows:

    Rather than having one generic 'merchant' unit that boosts production in cities, why not have one unit per resource type? The units themselves could be cheap (50-60 hammer) but have resource requirements like military units.

    Grain Merchant (Wheat)
    Horse Trader (Horses)
    Iron Monger (Iron)
    Pearl Trader (Pearls)
    et. al.

    The idea is that perhaps each merchant could have a different efficiency % based on the resource being used (i.e. Grain Merchants could have a 30% conversion ratio because grain is generally cheap, whereas Pearl Merchants could be a 70% ratio because they are a rare, luxury item).

    This trade system would prioritize luxury item collection, and would tie up strategic resources in trade. It would make the game more interesting for peaceful players to boot.


    Edit: to elaborate on this, I wonder if it would be possible to use LUA to randomize +/- 5 the production generated by a unit when used? My LUA skills are terrible. Just...terrible.
     
  19. Thalassicus

    Thalassicus Bytes and Nibblers

    Joined:
    Nov 9, 2005
    Messages:
    11,057
    Location:
    Texas
    That actually makes a lot of sense because I did no testing with art assets. :)

    The reason I experimented was I wanted other mods to override my unofficial patch mod... but regardless of which order things were enabled in (or filenames, creation dates, etc) the xml/sql changes always overrode one another in the same order each time. The only way I could get it to act differently was reinstalling.

    So there's different systems between art and data, odd they set it up that way.

    In regards to supply caravans the only tricky part is using mechanics the AI is already familiar with. I think that basically limits it to production bonuses from the engineer's hurry mechanic?
     
  20. Gazebo

    Gazebo Lord of the Community Patch Supporter

    Joined:
    Sep 26, 2010
    Messages:
    18,003
    Gender:
    Male
    Location:
    Little Rock
    Yeah, pretty much. But, same with CSD- it is limited by the AI hooks that Firaxis has given us.
     

Share This Page