• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Original Post
  • LordPeter

    Marjoram
    49 Badges
    Mar 5, 2012
    2.249
    382
    • Cities: Skylines - After Dark
    • Europa Universalis IV: Cossacks
    • Cities: Skylines - Snowfall
    • Europa Universalis IV: Mare Nostrum
    • Crusader Kings II: Monks and Mystics
    • Crusader Kings II: Conclave
    • Stellaris Sign-up
    • Hearts of Iron IV: Cadet
    • Crusader Kings II: Reapers Due
    • Europa Universalis IV: Rights of Man
    • Stellaris: Digital Anniversary Edition
    • Stellaris: Leviathans Story Pack
    • Prison Architect
    • Stellaris - Path to Destruction bundle
    • Cities: Skylines - Mass Transit
    • Europa Universalis IV: Mandate of Heaven
    • Stellaris: Synthetic Dawn
    • Stellaris: Humanoids Species Pack
    • Stellaris: Apocalypse
    • Stellaris: Distant Stars
    • Stellaris: Megacorp
    • Crusader Kings II: Holy Fury
    • Imperator: Rome
    • Europa Universalis IV: Common Sense
    • Crusader Kings II: Way of Life
    • Crusader Kings II: Horse Lords
    • Europa Universalis IV: El Dorado
    • 500k Club
    • Europa Universalis IV: Res Publica
    • Europa Universalis IV: Call to arms event
    • Crusader Kings II
    • Crusader Kings II: Charlemagne
    • Crusader Kings II: Legacy of Rome
    • Crusader Kings II: The Old Gods
    • Crusader Kings II: Rajas of India
    • Crusader Kings II: The Republic
    • Crusader Kings II: Sons of Abraham
    • Crusader Kings II: Sunset Invasion
    • Europa Universalis IV: Wealth of Nations
    • Europa Universalis IV: Conquest of Paradise
    • Europa Universalis IV: Art of War
    • Europa Universalis IV
    • Crusader Kings II: Sword of Islam
    • Stellaris
    • Europa Universalis IV: Third Rome
    • Cities: Skylines
    • Crusader Kings II: Jade Dragon
    • Europa Universalis IV: Cradle of Civilization
    EDIT:
    The mod is currently undergoing a total reconstruction, and this info is outdated. Please read the latest DEV DIARY if you are looking for new info.



    CTD
    - "Cutthroat Trade Development" -
    A submod for CK2+ of the FPS family


    DOWNLOAD currently not available.
    Checksum (with India): -
    Checksum (without India): -
    Idea
    I always felt that while CK2 was a brilliant "grand strategy" game, it lacked a real economic part. Everything is overly simplified to just use "gold" as a universal currency, and trade is hardly existent, and not more than a money-making machine.
    After playing around with the idea of an economic "system" for a while, and after learning how to mod by making compatibility patches for other mods, I finally decided to make my first own mod. So here it is: A mod that aims to bring the economic gameplay of games like the Anno series to Crusader Kings 2!

    Features

    Resource system
    Every province on the map is assigned 1-3 "Natural Resources". They are assigned based on climate, region and terrain, and split into three base categories:

    Plants (20 total) - e.g. Grain, Grapes & Spices
    Animals (10 total) - e.g. Cattle, Apiculture & Fishing
    Mining (13 total) - e.g. Gold Ore, Stone & Salt

    Each "Animals" resource also spawn an "Animalproduct", which is more important than the animal itself later on. Different animals can spawn different products, e.g. Cattle could produce Raw Meat, Milk or Animal Fat, while Sericulture can only produce Silkthread:

    Animalproducts (13 total) - e.g. Raw Meat, Wool & Ivory

    These resources are randomly distributed in a (hopefully) sensible way upon gamestart, which will cause some lag each time you start a new campaign. Mountains etc. are obviously more likely to get Mining resources and Farmlands more Plant resources, while the Steppe will be full of Animals. Additionally, the following rules apply:
    - Desert provinces only get one resource unless they are near a major freshwater basin (Lake/Major River - there is currently no way to check for minor rivers)
    - Arctic provinces only get one resource
    - Swamps/Deep Woods block the second resource slot
    - Volcanoes allow for a thrid resource slot, which can only be of Plants type​
    More on these "Natural Barriers" later.

    All resources are - like most things in CTD - applied via province modifiers that give bonuses to tax income, tradevalue and potentially other things as well.
    20170402153526_1.jpg

    If you have the corresponding game rule selected, Natural Resources can also dynamically change over the course of the game.


    Manufactured Tradegoods
    After a short time into the game, all rulers with a demesne will be asked to chose a secondary or "Refined" tradegood to be produced in each demesne province - for the payment of a small one-time fee. You (and the AI) can then navigate through a number of events that give you certain options, depending on which Natural Resources your province has. This offer can also be declined in case there is no valid option, or you don't want to spend the fee required, which will cause the prompt to re-appear later.

    Refined Goods (28 total) - e.g. Flour, Bronze & Wine

    These tradegoods can also have additional requirements, such as another Refined Good, a certain Holding type or a Technology level. If a certain option can not be chosen because you are missing a prerequisite, the event option will display that missing item via a tooltip.
    20170402140536_1.jpg


    Similarly, the third level of tradegoods called "Finalized" tradegoods can also chosen via event, which fires some time after the ruler has chosen to produce at least one Refined Good. These are not used as ingredients in other tradegoods and give rather big bonuses, but often require multiple other tradegoods or higher tech levels to be produced.

    Finalized Goods (28 total) - e.g. Bread, Books & Jewelry

    Whether you have access to certain other tradegoods is determined by the Trade Network, which I'll talk about next.
    Also, Refined and Finalized Goods are not static, but are dynamically revisited roughly every decade. If the prerequisites are still available, you will be given the option to change nothing - if they are not, you will have to chose again or drop the tradegood type altogether.


    Trade Network
    Thankfully, CK2+ has extended the trade route system to cover the entire map, and these extensive trade routes are the backbone of the trade system.
    Every tradegood has a "Traderange" applied to it, which is shown in the modifier's tooltip. These ranges are short, normal or long, which mostly define how far away another province can be from the current province to still give the latter one access to its tradegoods. Generally, a tradegood is available if
    a) It is available in the province itself, or in a neighbouring province (regardless of realm - trade passes even trough hostile borders)
    b) It is available in the ruler's top realm (exception: Short range tradegoods do not follow this rule)
    c) The province is lying on a traderoute and another province that is also on a traderoute is in range
    d) The ruler's capital is lying on a traderoute and another province is also on a traderoute and is in range (exception: Short range tradegoods have additional restrictions here)
    e) One of the ruler's trade posts is lying on a traderoute and another province is also on a traderoute and is in range (exception: Short range tradegoods have additional restrictions here)
    f) It is available in one of the ruler's tributaries realm (exception: Short range tradegoods do not follow this rule)​

    Thus, to gain access to more tradegoods you can build tradeposts, conquer provinces etc.
    Keep in mind that since tradegood access is determined on a per-province basis, there might be difference between your demsne provinces - plan carefully what to produce where!
    In general, there are lots of strategic possibilities. I have tried to teach the AI to make sensible choices, but the player will of course be able to plan further ahead.

    There is also a decision to show all tradegoods which are available in your own realm or the top realm (and also in your "World Region, if you have the Buisness Focus).
    20170402153551_1.jpg



    Natural Barriers
    If the corresponding game rules are enabled, up to three different "Natural Barriers" can spawn on the map:
    - Volcanoes allow an additional third resource "slot", which can only be of Plants type. They also apply a bonus to tax income in the province. In future versions, however, they will have a chance to explode and devastate the province.
    - Swamps block the second resource slot. They also cause more attrition and apply a tax income malus.
    - Deep Woods block the second resource slot. They also cause more attrition and apply a tax income malus.​

    Swamps and Deep Woods are much more likely to spawn in early start dates and in "low development" provinces, such as tribal realms. These barriers are non-persistent and can be removed via a special decision.
    These clearance decisions cost a lot of money or prestige, however, and have a chance to fail. In general, this should simulate the economic development of formerly wild provinces over the course of the game.
    20170402153635_1.jpg


    Also, winters now apply a tax reduction based on their severity:
    -10% for Mild Winters
    -20% for Normal Winters
    -30% for Severe Winters​
    Thus, it might be even more important to keep an eye on the current season!


    Final Thoughts
    This is my first "real" mod, and so far I have invested more time into it that I could keep track of.
    Sadly, from the outside it still overs realtively little gameplay, because I had to first write the entire framework for the tradegood system.
    In total, there are now 50.000+ lines of code in the mod, but many are fairly repetitive and only for maintenance. However, I have plans to greatly expand on it in the future - there will be other submods in the FPS family :D
    Anyway, I hope you enjoy the mod, and let me know if there are any bugs or problems with it.


    Installation Instructions
    IMPORTANT: Most FPS mods are part of a "Generation", which is necessary because they share some files. Generation shows up in the launcher as *G1* etc.

    Don't mix different generations!

    1) Download and install CK2Plus if you haven't already.
    2) Download and install FPS_CTD.
    3) Activate both mods (+India if you want) in the launcher and start the game.


    Credit
    - included in the download. will follow here soon...


    FAQ
    - coming soon...
     
    Last edited:
    1st Dev Diary
  • Hello and welcome to the first dev diary for
    CTD V2.0

    Seeing how even CK2+ lately adopted the trend of releasing dev diaries I have decided to also try it, even though I will still try to keep most of the stuff secret (kinda like vanilla does). These dev diaries will not be a very regular thing, given that I am still right in the middle of coding, and actually am still fleshing out the design for the new tradegoods. Also, with my holidays ending shortly (now you know I don't live in Sweden), development will probably slow down again soon.
    But I feel confident that this time around the mod will actually be in a nice condition when it relaunches, and I think I have some glimpses to share already :)

    "Fake" Mapmodes
    Anyone that has played Stellaris will agree how useful custom mapmodes can be - however, we most likely won't see them coming to the older engine of CK2. But less than a week ago I had an idea: What if one could emulate a "fake" mapmode, that would display some other information in one of the vanilla mapmodes?
    I actually had done something similar back when I needed a visual feedback on the resource placement in the "old" CTD mod, but it wasn't really fleshed out, and only usable from console. Now it is a proper decision, and might prove very useful once you play with the new features in CTD V2.0 - here's how it looks:
    20170819153354_1.jpg


    Once you have chosen which type of "fake mapmode" to display, an event will fire in the background that changes all provinces in the game to have a neutral revolt risk. the calculations behind this were actually a bit tricky because you can't see negative revolt risk, but I managed to get it to work. Then, some more invisible modifiers will be applied to the provinces depending on whether they fulfill the conditions of the things to display.
    Right now there's only one working mapmode, and what it displays I can't tell you yet. Also, since this method only really works with the revolt risk vanilla mapmode, I can onyl display boolean or gradual things at a certain time, and not all the different tradegoods colour-coded like e.g. in EU4 (but since I have over 200 of them now, it wouldn't be practical anyway...).

    This is how this "fake" mapmode looks in my example game:
    20170819153426_1.jpg

    As it says, the revolt risk obviousely needs to be reset before you can unpause the game, lest the world goes up in flames immediately ^^
    However, you can still see the mapmode as it was at that moment, as long as you don't click on another mapmode - it won't update its information of course, but it will allow you to take a look without the eventwindow in the way:
    20170819153442_1.jpg
    And lastly, this is how it looks when taken as a mapmode-screenshot directly from the game:
    directly_game.jpg
    That'll be all for this time! Hope you have found this interesting, and next time there will be probably something more directly related to the mod. Oh and btw, I have found a new name to better go with the acronym. But I also can't tell you yet :p
     
    2nd Dev Diary
  • Welcome to the second dev diary! It's called
    "Going that extra mile"

    Since I am busy with real-life stuff currently, I didn't have time to integrate resources back in to the mod, about which I wanted to talk. But I think I can share something else, which will be useful and necessary to understand when you want to play with the mod later on. So for the next few diaries we'll dive a bit "behind the scenes" and see how the mod will work now. I'll explain fundamental ideas and concepts, and show a bit of code. Hope it won't be too boring ^^

    Trade Range
    As you know, the old mod version also had "trade ranges" that differ depending on the tradegood. The idea is that this value represents how far away a good a) could and b) would be traded in the Middle Ages. I assign the values based on my own research and my own discretion, because it is an abstract concept and there are no actual real-world restrictions on distances for trade. But I check a few things when deciding traderange, and these are:

    1. "Shelf Life"
    Some goods tend to spoil fast, especially if you consider that in medieval times there was no refrigeration or canning technology. If you take milk for example: Today, you can import fresh milk from the Alps all the way up to Scandinavia, or even into the USA (if that is sensible is another question altogether). But in the Middle Ages, without refrigeration milk would have spoilt after a few days, and even transporting it from say Berlin to Munich would have been impossible without it spoiling. That's why people invented cheese (probably): Cheese stays fresh for a long time, and you can even transport it to other cities. That's also why the Hansa (and people in general) needed INSANE amounts of salt for salting herrings or meat. Salted meat/fish stays fresh for a long time, and this need for salt for preservation was a major factor contributing to the demand for salt, which eventually lead to it being called the "white gold".
    So in the game, "Milk" and "Raw Fish" will have a very short trade range, while "Cheese" and "Preserved Meat" will have a longer one.

    2. Value
    There is a reason the Silk Road is called Silk Road: Silk is a fabric that is sought after everywhere, expensive and lightweight. It could easily be transported in rather small quantities and still be worth the trip for the merchants, in contrast to e.g. salt which would only be profitable as a bulk good (as contrary to some common myths, salt was not worth its weight in gold). So "Silk" as a tradegood would have an even larger traderange than say "Cheese".*

    3. Weight
    As said above, silk is both valuable and lightweight. Now take gold for example: It is also valuable, and was transported around a lot both in the form of coins and in the metal itself (you might not know, but especially in the early Middle Ages it was common to pay in "weight" of gold, because local people in Scotland wouldn't know the exact value of a Byzantine coin, nor that of an Arabic or the other hundreds different coins that got minted). But gold is seldomly found as perfect nuggets, and the "Gold Ore" tradegood that represents the form gold is found means a big chunk of stone with a little bit of gold in it. Now theoretically this is also valuable already, as the gold is in there. But if a merchant were to buy that rock and sell it a few hundred kilometers away, he'd have to transport the entire rock all the way, which would significantly boost his transportation costs and possibly make the thing unprofitable. It really comes down to common sense, so "Gold Ore" will have a traderange comparable to "Milk", even though it does not spoil: Because transporting it far away simply is stupid - it'll have to be smelted to "Gold" near the mine.

    That being said, here are some pictures to illustrate how far different traderanges are on the map:
    50 Range Münster-Jülich.jpg 100 Range Münster-Hamburg.jpg 200 Range Münster-Middlesex.jpg 400 Range Münster-Rome.jpg 800 Range Münster-Marrakech.jpg 1600 Range Münster-Dhofar.jpg
    All take Münster as the arbitrary starting point, and are increasing in size: Minimal (<50), Short (<100), Normal (<200), Long (<400), Very Long (<800), Extreme (<1600).

    Traderange will actually increase over the course of the game, based on a few different things:

    1. Technology
    New ideas and concepts regarding trade were developed during the Middle Ages, including but not limited to the Double-entry bookkeeping system. This technological progress allowed the economy and especialyl trade to grow quite a bit, laying the groundwork for the later developments (which tend to incorrectly be attributed only to the Renaissance and EU4's timeframe). Therefore, traderange will increase by 5% for every step of "Trade Practices" technology the importing province has. So a Venice with high trading tech can import things from further away than say a tribe in Scandinavia.

    2. "Trade Fair" Modifier
    There are some new concepts in the mod about which we'll talk about at later point. For now you should know that there is a possible "Trade Fair" modifier which certain provinces can have, that boosts income a bit and also gives an additional one-time 5% increase to that province's traderange (meaning products it wants to import can be further away than usually possible).

    Thus, the total traderange for "short" at Trade Practices 8 and with a Trade Fair would be 145 instead of 100 - a potential 45% increase! Another reason to invest into Trade Practices, even as a feudal ruler...


    Well, that's it for today!
    Why traderange is now more important than ever, and how exactly tradegoods are imported we'll talk about in a later dev diary. As a bonus, here is a sniplet of code that shows how the traderange triggers look (it actually hasn't changed much since V1, but I guess few people comb through the files):
    code sniplet traderange.jpg


    And in case you missed it: Here is the link to the last dev diary



    *click! - Nice smile!
     
    Last edited:
    3rd Dev Diary
  • Welcome to the third FPS dev diary:
    "A dance with dragon... blood trees"

    Yet another "filler" one sadly. But really this is a good chance to explain how the mod will work, so I won't have to post every piece of info later, and instead will be able to refer to the dev diaries. Today we'll take a look at what has changed in comparison to the old mod regarding to tradegood types. Oh and also I will include some random info on dragon blood trees, because I needed it for the name pun.
    Btw, I have thought of some fun little game: I will post a teaser picture if someone can name the reference in the dev diary name.
    I know today it's pretty easy, but this thing will continue, and I guarantee it'll get harder :)

    Tradegood Types
    Previously, there were six different types of tradegoods: "Mining", "Plants", "Animals", "Animalproducts", "Refined" and "Finalized". This is still similar, but just recently the types have been changed a bit, and frankly there is no guarantee that it will 100% stay this way. Anyway, that's how it is planned right now:

    Resources
    These are all the basic types from which all other things are derived. Initially, every province will have exactly three resource slots.
    Yes that's right, it's one more for every province than before, but volcanoes don't get an extra one anymore (they'll get something else). Not all slots need to be filled at all times though; if one slot does not have an associated resource, it will show as an "empty" placeholder modifier on the province interface. It will also do nothing, so it'll be a good idea to chose a new resource via a province decision.
    Resources are split into several types, and every province can only have two slots of the same resource type.
    That means it'll be impossible to completely specialize a province, and alongside heavy mining you'll need to grow something to eat, which is both realistic and desirable from a balance perspective. Let's now see what these types are:

    1. Minerals
    Basically, "Mining" has been renamed to "Minerals", which is a bit more fitting since mining is the act, not the product. It encompasses such things as Gold Ore, Alum, Limestone and Salt, and will be more easily found in mountainous regions, though not exclusively. It's associated modifier colour is Grey.

    2. Plants (Crops)
    This is the old "Plants" category, or better: A part of it. It encompasses such things as Vegetables, Mushrooms, Grapes and Cotton. Crops that are grown on a field, basically, with one exception. They will thrive better in plains or farmlands obviously. The associated modifier colour is Green.

    3. Plants (Cereal Fields)
    Though technically still crops, "Cereals" get to be in their own category now. This has several reasons: First, they should (mostly) always give two distinct resources, that being grain AND straw. In the old system, I'd have to make two different refined products and allow the player to "refine" the plant into grain OR straw, or both if two slots are used. Instead, they will now spawn two "Plantproducts" similar to the way animals work. To stress the difference from a usable resource, I have named them "Cereal Fields", so their spawn can be the cereals. Also, this limits it to a maximum of two cereals per province, as the category now encompasses several distinct types of cereals, such as Wheat, Rye or Rice. Their modifier colour is Light Green.

    4. Plants (Trees)
    Similar to cereals, "Trees" will also spawn (up to two each) different plantproducts. This makes it possible to simulate the diverse use of trees, e.g. for both timber and fruit. To compensate this neat feature, trees will probably have some sort of "growing time", that will cause the modifiers to only appear after a delay. The category encompasses Oaks, Fruit Trees, Olive Trees and the already mentioned Dragon's Blood Tree - more on that one below. Their associated modifier colour is a Brownish Green.

    5. Animals (Wildlife)
    Animals that occur naturally in the wild are in this category. As before, animals spawn animalproducts, though just as trees, they -can- spawn up to two! Why this is split form domesticated animals I can not really explain for now ^^. This category encompasses only four resources, that being Hunting, Fishing, Whaling and Diving. Their associated modifier colour is Yellow.

    6. Animals (Livestock)
    These are animals that have been domesticated. Again, they can now spawn up to two products, which will e.g. bees much more realistic and useful. On the other hand, they need not, so silkworms will still only produce one, albeit one very valuable resource. The category encompasses among others Cattle, Poultry, Horses and Sericulture. Their associated modifier colour is a different shade of Yellow, not sure which one excactly.

    -Products
    As stated above, certain resources will spawn up to two products each. I'll get into more detail about how this will be restricted for balance reasons in a later dev diary, but for now, lets just remember that actually the products are much more important than their origin: You can make a sweater out of wool, but not out of a sheep. Thus any refined good will only require products as an ingredient, and never the producing host.

    7. Animals (Animalproducts)
    Spawned by both "Wildife" and "Livestock" resources. The category encompasses such things as Milk, Eggs, Pelts and Beeswax. Their associated modifier colour is a shade of Red or Orange.

    8. Plants (Plantproducts)
    Spawned by both Trees and Cereals Fields. Encompasses Wheat, Nuts, Olives and Frankincense, among others. The associated modifier colour is yet another shade of Green.

    Refined Tradegoods
    These category has only a single type, Refined Goods. I am actually not super happy with the name, but I don't have a better one so it stays for now. As before, these are man-made products, and require different resources to be imported beforehand. Of these, there can also be up to three per province now, and they are chosen via a province decision. If you can't produce anything, don't worry - a placeholder modifier will appear, and you won't get annoying popups (though also no boni).

    9. Refined Goods
    Requires input to be produced, and has to import several ingredients it might require. Encompasses Bricks, Bronze, Flour and Beer, among others. The modifier is Blueish.

    Finalized Tradegoods
    Similar to Refined Goods, these also work mostly like they did before, except for how they are chosen. The only difference is really that they can not be used as ingredients in any other tradegood. However, they tend to give pretty big boni in comparison. Of these, every province can produce another batch of three.

    10. Finalized Goods
    The top tier of tradegoods - slightly less useless than before. Encompasses Cured Meat, Books, Jewelry and Candles, among others. The modifier is a Purple hue.

    Special Goods
    Mostly secret for now, as I am not entirely sure how they will work yet. So yeah this is hardly more than a teaser, but for completeness sake it has to be here ^^

    11. Special
    ???. The modifier is -probably- a Turquoise hue.


    So, that makes a whopping eleven types now. I am aware that this might make things a bit more complicated or confusing, which this dev diary aims to to prevent a bit. But in the end, it'll make for a more interesting gameplay I am sure, you'll just need to spend more thoughs on your economy than before. And this is, after all, realistic if you want to thrive in the Middle Ages. Sure not everyone did it, but Charlemagne was not only a competent ruler because he fared well in battle, but also because he cared for the economy! Just check out Capitulare de villis. He also even attempted to dig a canal (and sadly failed), which this mod can and will not represent though ^^


    The Dragon Blood Tree
    320px-Socotra_dragon_tree.JPG

    As promised, here is a little more in-depth look at an example tradegood. At first I just wanted to include it to justify the pun; but actually I think it makes sense to give an example of the mod's current scope for tradegoods.

    The Dragon Blood Tree is a tree that grows almost exclusively in (and around) the island of Socotra. You know, that tiny island south of Yemen. Finally another reason to play there, eh? ;)
    It produces a blood-red resin called "Dragon's Blood" for its striking colour and its percieved mythological origin - from European perspective, that is. But heck, Arab traders sold the Europeans as only obtainable by stealing from the nests of birds that collect it, so...
    Nowadays, the resin is collected also from other tree species, but that development is outside the game timeline and thus Socotra will be the only possible origin ingame. Gameplay wise, it can currently be used as/in a Pigment, Medicine or Incense, and to compensate for its narrow growth horizon, it will have a "very long" traderange.

    So as you can see, the list of represented tradegoods has grown -a lot-, and this mod now aims less to give an abstraction (e.g. "Grain" for everything, including rice), and instead simulate a relatively realistic Medieval Economy.
    I am sure this will not be to everyone's liking; but it is to my own :D. And thankfully, there are several alternatives out there.
    Rest assured though that I have learned my lesson, and the new system will be more interactive than before. More diversity, but less hassle, so to say.


    Well, that's it for today! Thanks for reading through this if you did, and if you didn't, you can always come back if you want some info while playing the mod (once it releases, which is still far away).
    Remember to name the (easy) reference if you want a teaser picture :p


    And in case you missed it: Here is the link to the last dev diary.
     
    4th Dev Diary
  • Welcome to the fourth FPS dev diary:
    "She needs to sort out her priorities..."

    Today I'll talk a bit about the rather technical problem of Import/Export of tradegoods I asked for opinions about a while ago, from which point there spun a vivid discussion about possible solutions. Now I am at the point where I have implemented the design I deemed best, and can explain a bit about how it'll work. Mind that there still isn't a single tradegood in the game (they're still stuck in design anyway), and this is just the framework on which the actual gameplay will be run.
    As before, the "guess the dev diary title reference to get a teaser" game goes on. It's not even a pun today, just a quote, and shouldn't be to hard to know. Silly thing I know, but I like it :p
    Hopefully the teaser will be better than last time, but alas it's still not super exiting.

    Regular Interval Imports
    To recapitulate, I decided to go with the -potentially performance intense - approach of imports that are repeated at regular intervals. There were other ideas which were better in certain aspects, but worse in others, so I decided to go with this one.
    How it'll work is this:
    1. A province, let's say Bremen, produces Fish (which makes sense because it is located at the coast). But the Fish would spoil pretty soon (anyone knows the Asterix comics?), so it can't be exported unless it is cured. For that reason, it would be nice if Bremen could obtain some Salt, as that could be used to cure the Fishes.
    2. Thus, the owner of Bremen decides to order the province to produce Cured Fish as a finalized good, via a province decision (not yet implemented). This Cured Fish tradegood is not immediately produced, however, as the province must first look for a way to obtain Salt, the second ingredient.
    3. This "Import" of Salt happens during a maintenance event. At a certain point of the year (currently during the first days of October, but that may change) the province will fire an event that handles the Import of ingredients. It works as follows:
    4. First, the maintenance event resets all previously imported ingredients. That means even if Bremen has previously already found a source of Salt, it will now have forgotten about it. At the same time, all previously "exported" tradegoods will be reset as well, so the province is aware that it now in any case has a nice stock of Fish it could use to produce Cured Fish.
    5. Second, the event will try to import the ingredients it is missing for the production of the secondary or tertiary tradegood - in this case, Salt. Let's say that by coincidence, the Westfalen province has a nice store of Salt (which it will have because that's what made Soest rich). Luckily, Westfalen is well into traderange for Salt, and so Bremen can import that from there.
    6. Indeed it will then do just that: Import Salt from Westfalen, which sets the amount produced there to "used" (i.e. it can't be exported again, as all of it is used up by Bremen), and in Bremen there will be a code-thingy set that declares that there is Salt available for use there (albeit not for further trading). Now, the event has checked that there is both Fish and salt available in Bremen, so the Cured Fish can be produced. Great!
    7. Now Bremen has an instance of Cured Fish, which will give a bigger bonus to trade income (or direct income, not final) than the individual ingredients used. Because it is a finalized, tertiary product, it can not be imported by other provinces to be refined further, and thus this trade chain has come to an end in Bremen. Too bad, but the financial bonus is worth it (the Hansa became rich partly due to its trade in salted fish).
    Obviously these "trade chains" will become more complex for other products: Imagine Jewelry, where you first need a province that produces Charcoal from Wood, the one that produces Gold from Gold Ore and Charcoal, and finally one that produces Jewelry from Gold and Gems. It's a lot like the old "Anno" games, of which I am a big fan and from which I drew lots of inspiration.

    Province Import Priority Variables
    The above mechanic leaves us with one problem though: How do the maintenance events decide which province is to import first?
    Because theoretically, in the above example it could also have been the case that Westfalen imports the Fish from Bremen, and makes the Cured Fish there, to get the income bonus. Or,
    Ostfriesland could have imported the Salt from Westfalen to cure its own local Fish, leaving Bremen with nothing left. Or it could even have imported both the Fish from Bremen and the Salt from Westfalen, to make a product entirely out of imported products (Medieval capitalism yaay). The possibilities are endless, so how to bring this randomness into order?

    The general idea here is common sense, and historical reality: In reality, Bremen would have imported the Salt from Westfalen to cure its locally produced Fish, and not any of the other possibilities. Why? Because Bremen was a rich province with big cities, great infrastructure and a good natural location at the sea, many powerful merchants and consumers as well (because big city = lots of people). Westfalen, on the other hand, had a few powerful cities as well, but not at Bremen's level, and it also wasn't located at the sea. (In this example, of course it is also much more logical to move the Salt of course because the Fish would spoil more easily, and thus the traderange of Fish might actually forbid the transportation to Westfalen.) Just the same reasoning applies to Ostfriesland: Nice location at the sea, but totally backwater province with no real cities, and no merchants powerful enough to rival Bremen.
    This is in fact a generalization, as in the very early Middle Ages, both Ostfriesland and Westfalen (Soest) might have been more powerful than Bremen!

    Thus was born the concept of "Import Priority".
    A number to automatically and dynamically determine the order in which provinces are allowed to import.
    It is a variable assigned to the province, and its value gets determined by various factors, such as
    • Number of Holdings
    • Province Location (e.g. at a major river)
    • "Province Special Features" (teased before, remain secret)
    • a few other, currently secret things :p
    This value is regenerated in regular intervals to reflect changes over time (such as newly constructed holdings). Problem is, that variable could be just about anything, and the idea was to sort provinces into certain groups, so that some provinces (e.g. Bremen) could import first, and others later.
    Thus, all the province's "Import Priority" get compared globally to determine the very highest number in the entire world. That part was rather difficult to get right actually from a technical perspective, and it's not really performance friendly now (while loop to check all provinces); a friend of mine suggested I use an array for easier sorting, but such a thing does not exist in CK2 scripting language ^^
    In most of the start dates, the current algorithm ends up assigning the highest global value to Constantinople, mostly because it has the most constructed holdings for most of the time. It's a pretty good outcome imo.

    Import Priority Levels
    The newly determined "highest world value" is then divided by 10, and all provinces in the world get assigned a flag that corresponds to in which interval their local priority variable value lies. For example, Constantinople will be assigned "level 10", because its value (total world maximum) lies within the highest possible interval between 90% and 100% (at 100% exactly). Similarly, most of the time both Paris, Venice, Cairo and a few other huge population centres will be in the same category, because their variable value lies somewhere around 90%+ of that of Constantinople.
    For comparison, a semi-major province like Cologne or Bremen might end up at level 8 maybe, Westfalen at 6 or so, Ostfriesland at 4 and Orkney at 2 (just estimates).

    The provinces then import in order of priority, with Constantinople, Paris, Venice and Cairo simultaneously competing for the best resources first (maybe on the 1st of October), and each subsequent levels following during the next days, with backwater provinces like Orkney having to settle for the scraps left over by the others. This should result in a situation where there is a reasonable trend for trade to lean towards heavy population centers or trading hubs, and far away provinces left with little choice but to produce what they can locally, such as Salt, Pelts, Charcoal etc., which are less profitable and thus less desirable.

    The leveled system should also help to avoid performance drops, as the potentially heavy event calculations are spread out over several days. I have also failed to mention that the Imports for "Refined" and "Finalized" tradegoods while be calculated after each other, which allows provinces to produce the secondary products (e.g. Gold, Charcoal) needed for the tertiary products (e.g. Jewelry) first; and also the calculations will be spread over an even larger interval.

    Finally, to bring some visualization to this theoretical dev diary, here's how the "Import Priority" information looks ingame:
    westfalen_trade_var2.jpg
    Never mind the Otter, that modifier is from testing. The tradegood ones are also just placeholders to test the interface. And the blacked out parts are redacted for now :p
    As you can see there's info called "Trade", under which the Import Priority Level is listed (the yellow "5"), as well as the raw variable value (the "4" in brackets).

    So, that's it for today! Hope you found it insightful, if maybe not entertaining. But I'll get to the point where I can show the fun parts eventually ;) (just need to implement them first...)

    Remember to name the (obvious) reference in the dev diary title to win a semi-interesting teaser as a holiday gift!
     
    5th Dev Diary
  • Welcome to the fifth FPS dev diary:
    "A Change of Plants"

    This one wasn't planned originally, so I won't show any new/exciting stuff (on which I have been working on ^^). Instead, I will present to you a first glimpse at my tradegood lineup. The reason is that I have decided that I want the tradegood design to be at least 99% done before I start implementing them. I'm still several steps away from that, and thus I thought it'd be helpful to get feedback already on it, so that I have time to adjust design before I start implementing stuff. I'm especially looking for stuff I might have been missing, even though it's unlikely - maybe an obscure but important tradegood that simply isn't listed on Wikipedia yet. And of course you may give general feedback as well.
    (Needless to say that the title this time is simply a pun and no quotation, so no need to search for it, there will be no special teaser.)

    Plants
    Today's tradegood type will be plants - or plantproducts, if you want. I won't go into any detail or give explanations, as that'll be done later when the design is finished. For now, I'll just post the complete (and unsorted) list, and leave you to google yourself if you don't know something. You'll note that the list has grown quite a bit compared to the first version of the mod, and that is intentional - to compensate for the increased diversity, I have already stated before that every province can by default now produce 3 different resources.
    Plants unchanged from the original version are marked with (O), while ones that I currently consider to scrap are marked with (?).
    • Cotton (O)
    • Flax (O)
    • Hemp (O)
    • Ramie
    • Kenaf
    • Jute
    • Roselle
    • Sugar Cane (O)
    • Black Pepper
    • Ginger
    • Saffron
    • Anise
    • Cumin (?)
    • Mustard Seeds
    • Tanner's Sumac
    • Tea (O)
    • Dyer's Woad
    • Indigo
    • Henna
    • Madder
    • Weld
    • Safflower
    • Turnsole
    • Spikenard
    • Poppy (O)
    • Sesame (O)
    • Hops
    • Saltwort
    • Straw
    • Wheat
    • Barley
    • Rye
    • Oat
    • Millet
    • Buckwheat
    • Rice
    • Timber
    • Firewood
    • Flexible Twigs
    • Sandalwood
    • Ebony
    • Agarwood
    • Sappanwood
    • Cedarwood
    • Teak
    • Tanbark
    • Cork
    • Birch Bark
    • Palm Leaves
    • Cinnamon
    • Oak Galls
    • Tamarind
    • Almonds (O)
    • Nuts
    • Tree Fruit
    • Dates
    • Citrus Fruit
    • Grapes
    • Exotic Fruit
    • Olives (O)
    • Juniper Berries
    • Resin
    • Frankincense
    • Myrrh
    • Mastic
    • Dragon's Blood
    • Natural Gum
    • Birch Sap
    • Mushrooms
    • Peat
    • Seaweed
    • Reed
    • Bracken Fern
    • Herbs (O)
    • Berries
    • Vegetables (O)
    • Legumes
    • Nettles
    • Flowers (O)
    • Papyrus Sedge (O)
    • Khat
    • Betel Leaves
    • Areca Nuts
    • Argan Seeds
    • Palm Pulp
    • Moringa Kernels
    Whew. That's was a lot. Some of these are a bit obscure, some are generic "collective" goods for various similar items (such as "Nuts" or "Tree Fruit"), but again I really don't have nerve to explain them all in detail yet.

    It might have become obvious that I am trying to actually "simulate" a medieval economy, and not just having a playable "game" feature. For those who are looking for a simpler design, I say look elsewhere - Maal's Trade League for example is another design path that is much more accessible. Of course my submod will still be playable, and hopefully fun - just not simple.
    But if you are excited for obscure and half-forgotten detail like I am, then this mod is for you. Also needless to say that with all these options, player choice will be much more seldom and not regularly enforced as with the old mod version.

    I hope this list hasn't scared too many people away, but yeah, feel free to comment if you have any questions/suggestions.
    Oh and if you have questions about one or two individual plants, then I can give you a short explanation - I just didn't want to give them for all of them at once.