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

Feedback and Suggestions

Discussion in 'Civ4Col - Medieval: Conquests' started by Kailric, Aug 11, 2013.

  1. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Yes, it would work best if a domestic system was part of the current system. As much as I have worked with the code it doesn't seem like to difficult of a task to merge it in. Goods consumed locally would just be a another modifier that takes away maximum output or goods stored.

    I very much like your proposition, orlanth. I feel this could be used with the PlotGroups feature I added to my Forts mod. If two cities are connected by roads then they can auto trade between each other. We already have Import, Export, and Minimum Goods Stored (MGS). MGS could be set up to be used for the Local or Domestic Market. Say, CityA Exports Ale and sells Ale Locally and CityB Imports Ale and also sells Ale Locally. You would set CityA to Export Ale and set a MGS to satisfy the Domestic Market. Then any extra left at CityA would be auto shipped to CityB through the PlotGroup trade route system. If CityB is deficient in Ale it will cycle through all the Cities in it's Plotgroup and if it finds any excess it will remove it and add it automatically. In my Forts Mod I made it so that Forts require food from Cities so a system similar to that can could be used here to supply local markets.
     
  2. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    Wow, that sounds like it could be great :king: That would also solve the issue Nightingale mentioned about transport systems sometimes ignoring nearby sources and taking unnecessarily distant routes. Also, with the small amounts of different yields demanded by domestic markets, using lots of individual units to move them around locally gets difficult to justify. With this you could use your transport/Pedler units and routes for stuff a ruler would actually focus on like trading and long-distance transport, and not need to tie up lots of units in shuttling small amounts of yields back & forth between local settlements.:cool:

    It seems like your system might take some processing time, but considering the savings compared to doing the same thing through loading, moving/pathfinding, and unloading of lots of units locally, I'm betting it could actually end up being a lot faster.

    How exactly do the PlotGroups work? If it gets too computationally expensive to iterate through all cities in the PlotGroup, it could also be possible to do a single calculation per PlotGroup similar to below. I'd guess most games would end up with only 1 to 3 PlotGroups per player, and cities that aren't connected wouldn't need to use the system at all.
     
  3. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I also forgot to add that this could be set up to add a new Diplomacy Trade Item, where just like in Civ4 you can trade Resources per turn. I mentioned a system like this in posts before. So, just working out the code on paper... When making Diplomacy deals the code would cycle through a Civs cities and find ones that have excess goods of value to the other player. It would produce a list of Cities and Goods then say set up a items so you could trade 4 Ale from York for 4 Wine from Constantinople (or the amount could be effected by their value in gold perhaps). Then to save CPU cycles there could be a new attribute added to Cities that would count Trade Cities that are connected. Then when CityB needs Ale it will Cycle all its Trade Cities. Trade Cities would be recalculated each time a PlotGroup change happened or a new Diplomatic trade takes place.
     
  4. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Code:
    * For each PlotGroup and Yield, calculate a total Excess Supply, being the sum of (local supply - local demand - MGS) for all local cities which are set to sell that Yield.
    * For each city in a PlotGroup, if it doesn't have enough Yield to satisfy local demand, it can consume some to be subtracted from the PlotGroup's Excess Supply, charging a slight percentage for transport.
    * At the end of the phase, the total amount consumed from Excess Supply is subtracted proportionally from the cities that had excess supply and are set to sell. 
    
    Just now seen this addition. Plotgroups adds a new attribute to plots with a Plotgroup ID and works much like Area does. All Connected water plots and their coastal plots are all automatically in the same Plotgroup. When you build a road not connected to an above Ocean plotgroup it creates a new Plotgroup with Cities being automatically considered having a road. Then each road built adds to this new Plotgroup. If this new Plotgroup connects with another Plotgroup the biggest one takes over. If a road is destroyed a Plotgroup check is made to see if that plot is still connected to its Plotgroup. (Note: all of this I am "trying" to recall form memory from working on the Forts mod)

    I think the faster way to code it would be like I mentioned in previous post to add a new TradeCities attribute to Cities. That way you would not have to cycle through all plots in a Plotgroup (which could be extensive) or all Cities in the game. All coastal Cities would be connected automatically and then new ones added when a road is built connecting them. We could ask Nightinggale on his thoughts for coding this. Oh, Nightinggale...:wavey:
     
  5. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    ah, genius! :cool::king: It's like bringing back the best of Civ4.
    Sounds impressive. :king: Did you reuse any of the standard code from base Civ4BtS for cities having trade links with the capital? That was made for roughly the same purposes & it may be possible to adapt parts of it if there's anything else you needed. For instance you can allow Rivers to act as roads for traderoute purposes via a tech; and through other techs you can unlock the ability to have any Terrain type act as such. (For instance could have an early tech enabling trade on Coast, and later Caravans enabling trade across Desert.) It may even have some TradeCities function like the one you mentioned, since it does check if trade from the capital can reach other cities during diplomacy.
    lol I'm sure nightingale is dazed from overwork at this point :crazyeye: but hopefully it may be possible to bring most of the functionality from your Forts modcomp if you think it'll work.
     
  6. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Just a quick reply, yes, I used most of the code from Civ4 and I do believe rivers are included in plotgroups already, not sure about activated by tech though as that would require a seperate plotgroup for each Civ. Good suggestions though.
     
  7. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    As a thankyou for the help of M:C DLL to modmodding in 2071, I've put together that custom Monk SoundScape you'd been wanting for the Monastery cityscreen!

    :please::please::jesus::please::please::band:

    To use it, just add the following to the <CitySoundscapes> in gameinfo/civ4erainfos.xml :

    <CitySoundscape>
    <CitySizeType>CITYSIZE_SMALL</CitySizeType>
    <SoundscapeScript>ASSS_CITY_MONASTERY_SMALL_SELECT_AMB</SoundscapeScript>
    </CitySoundscape>

    yeesh it can get kind of tedious making these AudioSoundscapes, since Firaxis dangled everything across five XML files! well its taught me the saintly virtue of patience :p Patientia virtus est :please::jesus:
     
  8. mastrude

    mastrude Paraclete of Kaborka

    Joined:
    Oct 9, 2006
    Messages:
    333
    Gender:
    Male
    Location:
    Santa Cruz, ca
    I've set up couple of lists to track things for the MC Development Version. They're on the web at:

    Code:
    https://drive.google.com/folderview?id=0B8-M7ICqmnkddFdTblA1b3ZuWlU&usp=sharing
    They are M/S Office 2007 documents. They are public and can be downloaded. I would appreciate comments.
     
  9. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    @orlanth

    Thanks so much brother! I bet this is going to be awesome :)
    @mastrude
    I checked out your document. They are all good points. I'll make a reply to them soon.
     
  10. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    Sure, no problem Teddy Mac! ;):king:
    BTW for any monk-music fans out there I wanted to give a quick shout out to this kickstarter by a friendofafriendofafriend.
    Their sample tracks actually sound really good :rockon::jesus::band:
    (though not quite good enough to make me want to take Holy Orders..):mischief:
     
  11. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    I looked though the source code for that one and it appears surprisingly simple to implement. However I started thinking if it's good enough.

    First of all I want to link it to the marked on/off sales. I would also argue that at least a simple marked should be available from the start as income is really tricky in the beginning.

    I also came up with the idea that citizens can use yields. Not just the units, but the city counts the number of units working in buildings and the number working in plots. It will then create an extra demand based on those. This shouldn't be linear with the number of units. Instead it should encourage building huge cities, which intentionally clashes with max population restrictions.

    Some amount of randomness. The modcomp adds all demands for yield X, then it divides it with 100 and the actual demand is there. I would like it to subtract 0-50% randomly in order to make the domestic marked more unpredictable.

    Store leftover points. If a demand is 20, then it would demand one of those yields every 5th turn (or every 5-10 turns with random demand). If you don't sell on the turn where the demand is, then tough luck. It's gone.

    Some amount of randomness in units. Say a UnitType is set to demand 50 of 4 different yields, but have a max demand of 100. Whenever a new unit is created of that type, 100 points is distributed randomly between those 4. It should take the amount for each into account as it should be more likely to demand more of a yield, if it's set to 100 than the 3 set to 50. This mean two units of the same type might demand noteworthy differently from each other. You can then have good and bad units based on what you produce on your land.... now which one do you want to make a scout and which one do you want to stay in the city? ;)

    I think this would be the most ideal solution as it would provide the ability to have a fair amount of domestic trade while at the same time it's unpredictable enough and it will not be the same in two games even if you do the very same thing twice.
     
  12. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    Yeah, I agree the consumption should be able to be turned on/off by the Market mechanism, and it works well to have it act like a regular use of yields as you said earlier rather than a totally separate system like in the original modcomp. The <AutoSellsYield> used by buildings like Market could be repurposed to mean that the building enables local consumption of that yield (which can be set on/off after having that building). The basic town buildings in M:C could allow trading in some basic goods, while fancier ones like Wine need a Tavern, etc. I'm not sure what the MODER_CODE_TRADING_POST currently does in addition to that though.

    I guess it would be good to add some element of randomness to demand, but it could eventually get a bit fiddly for players to cope with tracking idiosyncratic demand values that remain fixed and different for many dozens of individual units. (Also, in the timeframe of Civ4Col mods the units don't represent a specific individual person with unique preferences that stay fixed forever, rather a group or class of local people many of whom continuously die and are born etc during the course of a game). But like you suggested, in addition to the base demand from units/buildings there could be some random fluctuations in local demand across time, like there are in any market. That plus the existing randomness in what emigrants you get and what yields are obtainable in local terrains should make things play interestingly different in each game.
    (edit: it might eventually be interesting to add some random Events using the xml Event system that could add extra demand temporarily to a city due to a temporary shortage or disaster. i.e. "Shortage of Barley in Paris! Demand +5 for 10 turns.")

    What do you guys think re this earlier proposal to let local prices vary somewhat based on supply/demand balance? It would probably take quite some doing to have local prices, but letting prices respond gradually to supply/demand imbalances could make the interplay of supply/demand and trade opportunities a lot more interesting.
     
  13. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    Maybe it would be best to start simple. First step would be to add demands for buildings, get it working and then commit. After that add demands from units, commit and then we will figure out what to do from there. A great plan for a goal is useless unless you know how to get there. Just adding demands for buildings without any randomness or anything to it appears to be strait forward. Units shouldn't be too hard either.

    I will postpone the whole pricing scheme until later as well. No use for price on something you can't sell anyway.
     
  14. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    Ok, sounds good :cool: BTW once Buildings can generate demand, I think it should already become possible to implement moddable XML Events boosting local demand temporarily without need for DLL changes. (XML Events could create an invisible "Building" with that demand effect, which could be destroyed after x turns.) :king:
     
  15. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I moved the conversation on the economy to its own thread. Ill make a reply there(from my iphone)
     
  16. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    I did a bit of research on plotgroups.

    Column 1 Column 2 Column 3
    M:C BTS
    Lines with PlotGroup mentioned 1 396
    Files with PlotGroup mentioned 1 26

    The one place it's mentioned in M:C is even commented out.

    We should keep this simple. I wondered about the ultra simple solution, which is to copy CvPlotGroup.[cpp|h] from BTS, but looking though it makes me wonder if that is that wise. At least a lot of civ concepts will have to be deleted. On the other hand having a PlotGroup class, which is included in savegames provides interesting possibilities. It can also be used to cache combined demands from all cities in the plotgroup and similar data.

    The basic plotgroup should contain
    1. PlotGroup ID in plot class
    2. PlotGroup::add()
    3. PlotGroup::remove()
    #1 is easy, #2 is also fairly easy unless you merge two groups. #3 is tricky as it can split a group into two or more groups. I looked at how BTS does this. Looks like the plotgroup is defined by the first plot in its list of plots. Whenever a plot is removed from the list, it will loop though all other plots in the group and remove those without access to the first plot. Sounds like a pathfinding intensive solution to me, but then again how often is road removed?

    Another question is if a plotgroup should be cut in two if enemy unit(s) blocks every single route between two cities? This would really encourage having multiple routes between your cities, specially if wild animals are able to appear out of nowhere and block your road.

    I'm thinking of letting PlotGroups spread on player owned plots, which has something from Misc\CIV4RouteInfos.xml built on them.

    When this is working, the player and city classes can cache PlotGroups. We could also make PlotGroups cache pointers to cities.

    This is all the work, which is needed to set up at least minimal PlotGroup Functionality. After that we will have to code the stuff, which does something with cities, which shares PlotGroup. Seems like a lot of work just to get a shared domestic market. Can we think of anything else where it could be useful? The AI could be made a bit more clever when moving yields around, but apart from that, what else can it do?
     
  17. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    The Civ4BtS trade system includes this, and also allows options to let trade access spread via Rivers and via Terrain types which can each be unlocked by Tech (eg discovering Sailing enables trade to spread along Coast).

    I think Kailric said he had implemented many of PlotGroups features in the Forts modcomp; so that might be able to be merged over but not sure if it would help much versus adapting the code from Civ4Bts itself. If implementing Plotgroups turns out to be more arduous than expected, I think it could be almost as good to have one domestic trade group per civ, at least to start with. Several local plotgroups per civ would be more realistic (esp for 2071 Planets :scan:), but OTOH in most games of M:C players would end up with a max of 2 or even one plotgroup, which would work quite similarly to a single civ-based group for domestic trade.
     
  18. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Yes, It is in the Forts modcomp and as far as I know it works great but I have never had that code reviewed by a real programmer. I would probably be easier to merge Forts with M:C and that has actually been one of my goals.
     
  19. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    I guess I better just copy paste all the changes into M:C then. There are quite a lot of them and I can't make heads or tails of it with a brief look. Making a commit and then review the changed line appears to be way easier. It will also force me to read all lines while copying.

    In semi related news I fixed a bug in RaR where automated transports could unload in cities belonging to other players, though I think they have to be on the same team. I haven't checked yet, but I think M:C inherited the same vanilla issue, which mean I will end up copying the fix. Figuring out how to fix the issue uncovered something, which for sure is useful for M:C. It turns out that all transports, be it human or AI, are controlled by CvSelectionGroupAI::AI_tradeRoutes(). The only exception is human owned transports, which aren't assigned to any traderoutes at all. This mean this is the function to look into if we need to restrict a transport to only transport between a select group of cities. In other words this appears to be a key in making a solution to make feeder service scale better to large empires.
     
  20. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I am excited about this. This is one of the main additions I wanted to add to this mod. It will enable all types of possiblities. In my economic studies we have been learning about "Determinants of Growth". Its funny that while I am studing I notice the similarities to Col's economy. For instance the Determinants of Economic Growth are:


    Supply Factors
    • Increases in the quantity and quality of natural resources
    • Increases in the quantity and quality of human resources
      • Increases in hours worked
      • Increases in labor productivity
      • Education and Training
    • Increases in the supply or stock or capital goods (equipment and transports)
    • Improvements in technology
    Demand Factor
    • supply must be purchased or sold

    Efficiency Factor
    • full employment and production efficiency

    All these things are almost common sense and they are all found in M:C :) Edit: Well most of them are found in M:C

    I've also learned that improving ones public infrastructure with roads and bridges has the added effect of increasing production in the private sector. So, by adding plot groups we can finally set it up so that cities can be connected by trade routes. I am thinking one benefit to being connected to a trade route is +Hammer so that a city receives two free production.
     

Share This Page