1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Population, City growth and Social Stratification

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

  1. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    6,988
    Location:
    France
    I'd like to be able to set multiple citizen on improved tiles, it would also help to determine a more detailed city social stratification, but I don't think it's possible for improvements, adding citizen to a district for example seems to be hardcoded to buildings, it's not a modifier AFAIK.

    I really need to come back on some of the post about designing the research, the unit tree and social stratification BTW, but I'm still coding the background for integrating multiple equipment types/classes for units.

    While doing that, I had a possible idea, related to equipment and standing armies (or lack of) for early game.

    What about temporary units ?

    You could have an (initially) very small standing army limit at the beginning (say 2-3 units)

    But you'll have some stocks of equipment and (of course) some population in your cities.

    Barbarian (or neutral) units approaching your territory could unlock a one-turn project in a city for conscription.

    Next turn, some units (number and type based on equipment and population) spawn around the city for your civilization, with a counter before disbanding.

    When the counter is down, the remaining personnel and equipment is sent back to the city.

    We could have (longer) projects to plan for an invasion or cleaning that barbarian camp you've scouted, with a bigger counter for units, depending of the project.

    thoughts ?
     
  2. Teiwaz93

    Teiwaz93 Chieftain

    Joined:
    May 16, 2016
    Messages:
    11
    hello everyone
    dont want to confuse anybody but i had an idea that might work (might not) regarding multiple POPs per tile
    i mostly programm object orientated and have no experinces with modding any civ so this might not be doable
    my idea was to construct some sort of class around the POPs and let them have certain bonuses if a POP is to be considered a certain number of population
    this would mean you start with one POP with the starting amount of people in it but as time goes on it grows and may unlock bonuses to production/gold/food and in time it will spawn a new POP once it has gotten big enough

    just wanted to throw this in here so you can think about it ... maybe you like maybe you can change and improve it or maybe it cant be done at all
     
  3. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    6,988
    Location:
    France
    @Knasp

    Thanks, a lot of good suggestions, I like them.

    The idea of conscription using the stocked equipment and the city population has made redondant the ability to buy units that I wanted to reimplement (with units construction representing the standing army in all cases, yes), and mercenaries are the perfect replacement.

    As that ability (buying unit) would be a "project" represented by a "fake" building made available on context (like what will be used for conscription), so this doesn't require particular AI coding (but I still need to code the conditions of course...)

    Saving units is possible, yes, to a point. I mean the mode already save extra data for units (composition in personnel - materiel - equipment - food - etc..., and a few other things, including turn created and HP), so the code is already here, it's just a matter of adding new entries in the table saved (conscription/contract turn, disbanded at turn, experience & promotions)

    But on the technical side I've already tried to lower the data in that table because its serialization (done 2-3 times each turn before "save game" events) in end game on large map could take a few seconds, as it was generating a string of more than a million caracters... In the current code, I'm cleaning it from dead units to prevent this, still there is a limit to what can be kept in it, but eventually I could use an archive table less accessed for disbanded units (and another one for dead units in case we want to access stats - I know some people love end-game stats like which unit had made the more kills, best in offense, defense, etc... Yep, I'm one of them)

    So short answer: yes, saving units is possible, part of their attributes are already saved by the mod.

    I also like the idea of a "pool of mercenaries", if I had to expand it a bit I'll consider mercenary armies, ie not just single unit (well, initially single units in early eras, then hiring "armies" of 2-5 units until the era where standing armies become the standard)

    Barbarian units could also somehow be linked to mercenaries (roaming and looting the map when not under contract), if we can make less agressive barbarian units (ie non-suicidal)

    Quick summary, please correct me if I've forgotten something:

    Standing Army : unit construction in city, from "personnel" reserve and equipment stock - medium upkeep cost, no auto-disbanding (I need to think about the opportunity to create an "officer" reserve, something I'm pondering since R.E.D. WWII)
    Conscription: construction of a one-turn "building-project" spawning unit(s), mostly from "lower class" population, unit type dependant of population classes and available equipment, % from each classes could change with policies, low upkeep, (low) turn limit before disbanding
    Mercenaries: buying a "building-project" spawning unit(s), unit type dependant of nearby civilizations context (or/and the mercenary group history), no resources required, high upkeep cost, (medium) turn limit before disbanding

    Now, do you think that you could try to include that information somehow in the units table ? Eventually with an estimation/guess of the number of "personnel" required in an "unit" ?

    For reference, we'll use division-sized units in latest eras, (ie 5,000 to 10,000 personnel in an "Infantry Divison" units), but lower values for the first units (50-100 for example in a "Hunting Party" ?)

    We'll need some kind of progression on which the general balance of the mod will be based (production, growth, ...)

    And propositions for unit's "organization" names (could/should change based on the civilization ethnicity ?) are welcome :)

    @Teiwaz93

    You mean unstack the population from cities to tiles ?

    @qadams

    Thanks for the feedback.

    1/ We need to make them relevant to the mod mechanisms, so they'll come last, and I'm not sure yet of the way we'll implement them. For example, with a dynamic history, we could have 20 ancient civs to chose from at the beginning of the game, and we may end the game with 40 modern civs, none of them being one of the original 20, but the results of some revolution/civil wars or spawned from colonies...

    2/ Temporary, some of the bonuses were breaking the mod completely. They'll be part of a rework of the barbarian/exploration mechanism, and will provide resources/personnel/equipment. They may respawn when under FoW (or in "forgotten" area when revealing terrain will not be made permanent at the beginning of the game)

    3/ See the discussion above about mercenaries, you'll also lost gold when producing something in cities (from resources used), which is not activated yet.

    4/ Nothing changed at all yet, but that will change (a lot)

    5/ I'd like to add a kind of combat log to consult. No ETA

    6/ I'll have to check, the notification for housing is not supposed to happen

    6/7/ I'll need everyone help on the UI. I'll think I'll add a small bar under the city name with 4-5 icons showing info on mouse over. About production time it's difficult to ask the UI to make fine predictions without lagging because of the amount of parameters involved. Or maybe someone more talented than me can come with some solution. I mean, I'm not a programmer by formation, I'm trying to keep things optimized, and Lua is relatively fast (seems to be faster on civ6 than civ5 BTW), but it's not as fast as C++ may allow.

    8/9/ Thanks, that's the continuity of a project that was started with civ5.
     
  4. Teiwaz93

    Teiwaz93 Chieftain

    Joined:
    May 16, 2016
    Messages:
    11
    well yes ... each worked tile would could have a certain amount of population and the city itself would do so both giving different modifiers or other bonuses based on their size

    vanilla civ always sort of gave the impression all citizens were living in the city center and then go out into city vicinity to work which isnt accurate ... there was citiyfolk and there was rural populace and if we could implement something to represent that i think it would be great and might even open up a lot of different other opportunities
     
  5. Knasp

    Knasp Chieftain

    Joined:
    Sep 10, 2011
    Messages:
    84
    I agree for the most part. Above all it never made much sense to me that your Builders/Workers would build improvements on tiles, before you have population (workers) to assign to the tiles Then the improvements deliver a standard/fixed yield irregardless of how much or little it has been used previously. Actually, the Civ 4 improvement of "Cottages" was interesting for this reason. You could develop it into a Hamlet/Village/Town, simply by working the same tile for many turns. Of course a mine doesn't necessarily collapse just because operations have ceased for some time, but on the other hand you need to invest time and effort to start digging those tunnels and find minerals.

    Another idea for tile improvements
    It would be really interesting for example to replace the Vanilla system of improvements with a more dynamic system. All tiles could be improved the longer/more intense you work them. If you assign "citizens" to a tile, that tile will improve over time. If the tile has a resource like Iron then your mining operations would expand over time, and yields would increase due to workers becoming more skilled and mining techniques would improve (spreading to adjacent tiles) or to other mines in the same city. One way to speed up the development process could be to assign more citizens to the same tile, or you could work a project in the city, for example: "Expand mining industry". Additional ways to speed up development could be:
    • working more tiles of the same type/resource
    • simply having neighboring cities and/or Civilizations with more advanced tile-developments
    • researching beneficial technology
    The biggest problem I see with this system, is how you would control what the tiles are actually producing. Would you still use the Builder unit to build an initial improvement (lay the ground work)? Or would you be able to choose some other way? Otherwise tile development could be determined automatically by city needs or by the resources on the tile in question. Example: if the city needs food then all tiles will develop their farming. Maybe you could even have several improvements on the same tile, but the share of labour for each improvement is determined by City needs.

    Also, if you could implement population being distributed to tiles, then each tile could have their own demands for food, needing to met in order to increase extraction of resources/development of other yields.
     
  6. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    6,988
    Location:
    France
    With one of heinous_hat's posts that had made me curious about the potential of urban/rural population, and now Teiwaz93's post, I've put some more thoughts using your suggestions about unstacking population from cities, so here is a possible design (including cultural diffusion rework):

    • Cultural diffusion as it is currently implemented (ethnicity strength on a tile, assuming there is an undefined number of rural population on each non-city tile, with diffusion rules based on terrain/road/rivers and culture "build" in cities) is completely removed
    • Instead of a "culture map" with strength value for each "culture group" (aka "ethnicity" in most case, including "dead" civs, but also separatists) on a tile, we have 4 values (upper, middle, lower, slave classes) for each culture group
    • Instead of "culture diffusion", we have "migration/colonization/settling" happening each turn from one tile to all adjacent (non water) tiles
    • This automated settling will follow the basic diffusion rules (faster along roads/rivers, slower over/through mountain, hills, jungle, forest, ...), with new factor like tile's Appeal
    • Define a "global" culture value for a civilization, then use it to calculate "conversion rate" from culture groups with lowest values to those with higher values (also using policies, tile's ownership as factor) on each tile (with special rules in cities/districts based on buildings)
    • "Separatists" would be a culture group to which a part of all other culture groups that are far from their capitals (distance modified by eras/policies) will be "converted"
    • Same as current cities, tiles will have "size" value, using the same formula, currently it's population = math.pow(size, 2.8) * 1000
    • The current tile's base output values (yields, resources collected) will define the "size 1" output value. The real output is based on the % of required population already on the tile to reach size 1
    • "Size x" tiles would provide (size 1 output * x) + a % of size 1 output based on the percentage of required population already on the tile to reach size x+1 from size x
    • A population threshold (and under size 1 I think) will be required for a tile to be owned outside a city range
    • Ownership is defined by the culture group with the higher total % of population (pondered by population classes)
    • No threshold required for ownership in range of cities, but the 2 outer rings will be unlocked either by era, tech or building (or the population threshold if it happens first)
    • A city "size" would include the urban population and all the rural population of the tiles owned by that city (which may include tiles farther than the third ring)
    • The reason being that city size determine the available "citizen" to place on slots, and it's actually hardcoded in the game
    • The placement of citizen on the map's slots (using the current UI) will raise a tile's appeal related to population movement, which in turn will raise its output faster. It will also be a way to control a bit your border's expansion direction
    • Output of a tile with an assigned citizen slot will be higher, but (opposite to the current mod's code) the resources collect/extraction cost will also be higher (you're "demanding")

    What I still need to define:
    • population growth formule on tiles without ownership ? (using owning city stocks/formule for the other)
    • housing values (population limit) based on terrain/feature/improvment for each classes ?
    • employment values on tiles (improvements) or buildings being a factor for tile's appeal ? how to correlate that value with tiles/cities size ?


    And what did I forgot ?

    The biggest problem with the above design (outside coding time), is the risk of introducing major lag in late game, the cultural diffusion mod was causing some in end game for civ5 until I've converted the code to C++ after the DLL source was released.

    The Lua scripts in civ6 seem to run faster than 5 as I said, but we're introducing 4 more variables for each tiles on the map (cf the serialization problem I've mentioned for units data) and someonewhoknowhismathmayknowexactlyhowmuch more calculations per turn.


    Moderator Action: All posts above and on the previous pages, this one included, have been copied and some may have been edited to fit the topic, but the original (unedited) posts are still available in the main thread - Gedemon
     
    Last edited: Oct 27, 2017
  7. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    6,988
    Location:
    France
    So, I think we're going to add the separation between Urban and Rural population to the project, based on all the previous posts in that thread.

    After some tests involving using sheets and a lot of numbers, I may have managed to get something that could work at the scale of the game:

    • City Size = Urban + Rural Population

    ATM the "City Size" is used to determine the number of people in the city, the mod is using the Civ5 formule, which is:
    Code:
    math.pow(size, 2.8) * 1000
    Which translates into this:
    City Size Civ5 Population Population Range in the Mod
    1 1,000 1 - 6,963
    2 6,964 6,964 - 21,673
    3 21,674 21,674 - 48,502
    4 48,503 48,503 - 90,596
    5 90,597 90,597 - 150,946
    6 150,947 150,947 - 232,420
    7 232,421 232,421 - 337,793
    8 337,794 337,794 - 469,762
    9 469,763 469,763 - 630,956
    10 630,957 630,957 - 823,946


    That population range would now represent the sum of Urban + Rural population administered by this city, IE people living in the city and the tiles it owns (up to the max working plot distance)

    For a "City" of size 6, that could mean, before industrial revolution:
    Urban : 10,000 pop (5%)
    Rural : 190,000 pop (95%)

    Or, shortly after the industrial revolution:
    Urban : 60,000 pop (30%)
    Rural : 140,000 pop (70%)

    And today:
    Urban : 120,000 pop (60%)
    Rural : 80,000 pop (40%)

    • Population Migration from available activities

    I'm not going to set those values using fixed limiters, I'd like to use some kind of evolution based on the availability of urban/rural "activities" for your population

    Population Migration will occurs each turn from two adjacent tiles in multiple ways, but activities availability will be one of the major cause.

    The base "activities value" for a city and the plots around it will be calculated using the same kind of formule than for it's population, using size :
    Code:
    math.pow(size, activityPOW) * activityFactor
    activityPOW and activityFactor will have different values for Rural and Urban activities, changing with Eras/Techs/Civics/Policies, and set in a way that will provide more Rural activities than Urban Activities at the start of the game, the value going up for Urban (and down for Rural) during the length of the game.

    For example, our pre-industrial revolution city would be the result of an activities value of 10,000 for the city center and 31,600 for each of the six worked rural tiles (6 "citizen" available at size 6) in it's owned plots.

    • City Center Activities and Production output in relation to City Size, Urban Population and Buildings
    Some Buildings will provide one (or more) "Worker Slots" that I plan to combine with the activity value to determine the city production output and "employment rate", depending of the city size.

    If you don't have enough Worker Slots in relation to the size of the city, then the activities value is lowered.

    If you have too much Worker Slots in relation to the size of the city, then the production output is lowered (buildings are undermanned)

    If the Urban Population value is above the activities value, then you'll have unemployment (leading to migration/unhappiness)

    If the Urban Population value is under the activities value, then the production output is lowered (buildings are also undermanned in that case)

    The production output will define how much yields a buildings, in relation to the city size.

    For example, using a simple 1:1 ratio between city size and worker slots in a size-6 city with 10 worker slots, the production ratio from worker slots would be = 6/10 = 60%

    And if the activities value was 10,000 but the Urban Population was 5,000 pop, then the production ratio from Population would be =5000/1000 = 50%

    The production output for that Size 6 city would then be = 6 * 60% * 50% = 1.8

    That would means that a Building with a base yield of 2 gold would produce (2*1.8) = 3.6 gold each turn.

    • Tiles Activities and Production output in relation to City Size, Rural Population and improvements
    The production output for a tile will be based on the Rural activities value in relation to the Population on that tile, and if the tile is assigned to a Citizen in the city management screen.

    Still using the same size-6 city as an example, if a plot is worked then its activities value will be the 36,000 calculated above, and the production output (assuming there is 36,000 or more Population on that tile) would be = 6

    Which means that a grassland tile (without improvement) would provide 6*2 = 12 food in that case.

    With 2,000 population on the same plot (for example we've just assigned the tile to a Citizen, or it has just been pillaged and it will take a few turn with the migration mechanism to raise the Population here), then the production output would be = 6 * 2000 / 36000 = 0.33 and the Grassland would provide 0.33*2 = 0.66 food (I may cap this to the base 2 food for worked plot)

    If it's not worked but improved we could apply a penalty ratio of 1/2 and the activities value would be 18,000 and the production output would be = 3 (Grassland -> 2*3 = 6 food)

    If it's not worked neither improved we could apply a penalty ratio of 1/10 and the activities value could be 3,600 and the production output would be = 0.6 (Grassland -> 2*0.6 = 1.2 food)

    • Activity Types to determine Social Stratification
    Once we have something set, we could then use some kind of simplified activities table to determine the Social Class.

    Something like that for example (number to be defined, and changing with Eras, Techs, Policies):

    Food (95% lower, 4% middle, 1% upper)
    - Fishers (sea food resource) (urban population)
    - Cattle Farmers (cattle, sheep with/without Pasture) (City Stables, Stables)
    - Crop Farmers (grass/plain/vegetals with Farm/Plantation)
    - Gatherers (grass/plain/vegetals without farm)
    - Hunters (deers without camps)
    - Trappers (deers with camps)
    - Butcher (Butchery)
    - Miller (Granary, Treadmill, Windmill, Water Mill, ...)

    Collecting resources (95% lower, 4% middle, 1% upper)
    - Miners (hills/mineral/metal with/without Mines/Quarry)
    - Wood cutters (Woods, Rain forest with/without Lumber)

    Craftmanship (25% lower, 70% middle, 5% upper)
    - Blacksmith
    - Carpenter
    - Stonemason
    - Armorer
    ...

    Health (25% lower, 74% middle, 1% upper)
    - Healers (Herbalist)

    Commerce (15% lower, 85% middle, 10% upper)
    - Merchant (Fish Market, Fruits Market, Market, ...)

    Knowledge (25% lower, 74% middle, 1% upper)
    - Scribes (Library)

    Culture (25% lower, 74% middle, 1% upper)
    - Writers (Library)
     
    Knasp likes this.
  8. Knasp

    Knasp Chieftain

    Joined:
    Sep 10, 2011
    Messages:
    84
    Cool, that sounds like a reasonable way to do it, although I have some questions regarding limitations and what the underlying design is. I know that City-size is hardcoded and connected to how many plots that can be "worked" by the City, and also that it's possible to acquire Resources from non-worked tiles, but I do have some questions about yields:

    1. Is working a tile within City-borders the only way to get the City to acquire that yield?
    2. Is it possible to add a cost to working a tile, meaning that for example you can get minus(-) to gold yield for selecting a certain tile?
    3. Is it possible to acquire tile yields from the tiles adjacent to the one being worked by a citizen? And if so, can you only get the yields from adjacent tiles within City-borders?
    The reason I ask is because I'm interested to know what the limitations are, and which concept/design that explains the mechanic.

    First things first, I've compiled some data on Civilizations through history, based on a timeline I saw about the largest armies through history. I used those numbers, and tried to find estimates on those Civ's population in order to calculate their army's share (% of pop), and also the Civs urban/rural population (%), capital population (% of rural), and finally the world population (including urban share). It's not perfect data and I bet some estimates are way off, but it might be useful when weighing how much people should be living in rural tiles, city tiles, how much agriculture (farming population) you need to support an army. The max size or population share of an army. Army size compared to urban population etc. Link: https://docs.google.com/spreadsheets/d/1zIfcz1emopykHk5rzYidjkoNPDnigfJxavvwqS_2EWU/edit?usp=sharing

    The first question is: How to represent rural/urban population? How many people can live in one tile, how about migration etc? Until industrialization started, most people needed to work in agriculture in order to produce enough food. So a tile's maximum population cap is tied to how much food can be produced in that tile. If we ignore scale for the moment and the possibility to have several activities on the same tile, we can conclude that if you have a City or a non-food improvement (quarry, mine etc.), then the population on that tile needs to get their food from somewhere else. Basically, urban population is limited by the food surplus that can be produced. If you want to have a large city, say 1,000,000 people before industrialization you either need to have 20,000,000 farmers within your City's borders, or you need to import food from other Cities/Neighboring Civs (increasing urbanization in that City). Representing rural population will in a sense nullify the widely debated question of balancing tall vs. wide.

    So what does working a tile (placing a citizen)/choosing a tile actually represent, when we have rural population on that tile regardless? What can the City size (number) represent? I see 4+ possibilities:

    A) City size is a combination of urban + rural
    B) City size is only urban population
    C) City size is only rural population
    D) City number represents the size of the City-region's total Economy or Productivity
    E) Other?
    Depending on what's possible to mod (answers to questions 1-3), and which design option above (A-E), there are several design possibilities:

    Either you take the positive approach: Chosen tiles only get positive effects. As a consequence, the tiles that aren't being worked will face economic hardships/unemployment/low-growth and emigration.
    Or you take the neutral approach: Chosen tiles can get a mix of postive and negative effects or they are completely unaffected (vanilla design). This method will require the least micro-management, but your choices could feel a lot less interesting (since you can't really make a bad choice).
    Or finally you can go for the negative approach: Chosen tiles gets negative effects (to that tile) meaning for example taxation/procurement/emigration to tiles that aren't chosen (worked). Non-chosen tiles will instead have positive effects, letting them grow and develop their yields more, increasing immigration.

    Personally I would prefer the Positive or Negative approach, just because it would be more different than vanilla Civ, and possibly force you to make tougher (interesting) choices.

    Choosing a tile within a City could represent one or possibly several of the actions below:
    • Tiles that the rural population are working on (all surplus yields are sent to City).
    • Tiles that the City sends labourers to/buys resources from (gaining non-food yield/resources = more growth in that tile, higher immigration).
    • Tiles that the City "steals"/procures all surplus yields from (gaining food/gold = no growth/unrest in that tile and more emigration from that tile)
    • Tiles that the City taxes to a greater degree (gaining food/gold = less growth/unrest in that tile and more emigration from that tile)
    • Tiles that the City buys surplus yields from (gain food/production/resources in exchange for gold)
    • Tiles that the City establishes local authorities/administrators in (increasing city yields, taxation similar to suggestions above)
    • Tiles that the City favours, meaning say lower taxation/other privileges in order to gain their loyalty (increasing cultural/state control) which will benefit the tiles overall production (a surplus that the City's pop can buy).

    Regardless of the chosen approach, until you can intensify your food production and reduce the required manpower in agriculture, most of the population will be tied to those tiles that produce food. The food yield of each tile (including surplus) could increase the more people that populate that tile. Though, there should probably be a limit to how many people that can populate a tile, and all land area within a tile won't be fit for agriculture (so even though you'd have more population working on farms in a tile, you won't see a linear/exponential increase in output. I guess you call it diminishing returns.

    If each tile grows its own population, then you could have situations where you run out of land to farm in a tile, meaning that excess population will have to emigrate to adjacent tiles or (more likely) go to the city looking for work. Turns of exceptional harvests (randomized events) could increase population growth, and then turns of bad harvests (famines/droughts etc) could force "excess" (those that can't be fed) to move into adjacent tiles (if there's room), or into the City (if there's food stocks). If neither the City nor the tiles within its borders have food, then the migrating people could go to another of your cities, maybe even an overseas colony (with low rural population) if there's no suitable place to work or farm. If there's no suitable place in your Civilizations borders, they would migrate to neighboring Civs cities and rural tiles.
     
    Last edited: Nov 11, 2017
    Gedemon likes this.
  9. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    6,988
    Location:
    France
    1) ATM, yes, but I will have to change that if I want to have yields scaling with city size. Like for some other mechanisms already in the mod, I'm going to try to find a way to neutralize the current yields then code my own, while still keeping some values in the background, so the AI still know how to choose a tile (you also get an immediate answer to one of your following questions: no negative selection)

    2) yes, but in the mod's design you buy something when you use it, you're not buying something for the city, it's the city population that acquire resources from a plot, then you may buy their product when you construct something

    3) yes, easier than 1), but still require some coding.

    Yes, thanks, I'm already using it for reference.

    So, from what you describe, my previous post is A+

    I'm so proud of it now :D

    Just a note from the guy that has to code all that without causing too many CPU melting for the mod's users: we need to keep calculation (and saved data) to a minimum.
     
    Knasp likes this.
  10. Knasp

    Knasp Chieftain

    Joined:
    Sep 10, 2011
    Messages:
    84
    Ok, so positive selection approach then, and chosing tiles means that the City is buying stuff from those tiles. "Working" a tile will increase rural activities in that tile? Food activities or non-food depending on the improvement?

    Glad to hear that, I just thought I'd bring it up, just in case you hadn't noticed and were interested.

    I apologize if I have come across as arrogant/disrespectful. I realise that much (if not most) have been written previously by you and others in the thread, but at the same time I wanted to put my own thoughts into words (even the basic things that was already obvious).
    Actually I have had some difficulties trying to understand the formulas and parts of the "machinery" that you've previously outlined (I'm terrible at reading technical descriptions).
    I simply wanted to understand the underlying concepts by writing my thoughts and questions, and you're right that I don't know how difficult (and time consuming) it is to code it all. It's very impressive to see all that you've been able to accomplish this far!

    So do I understand you correctly that Activities are influenced largely by citizen placement/buildings?

    So workers can be placed either inside City buildings or working tiles? And working of tiles would mean the City's buying stuff/extracting resources from that tile.

    Should be 5000/10000 right?
    So the more jobs the City has, the less work will be done by those who are actually working? Ineffeciency is spread out evenly? Does that mean that food production isn't prioritized, even by a starving/rationing city?
    And this output would be the surplus bought by the City? Or the food that the whole tile's population has to eat, minus exports to City?

    So not working a tile means the whole tile's production output is lowered? Then production output = surplus that can be exported/taken by City? Just want to get on the same page.

    This penalty only applies to the City center getting less yields, while the tile itself has a greater growth?

    I guess you're referring to a Fishery building by (urban population), but you're also a planning a fishing activity from rural population on tiles adjacent to coasts/lakes, right?

    I believe a lot of philosophers and writers/poets/learned men/priests in the early eras were upper class because 1. They could afford education and 2. They were wealthy enough to avoid physical
    labour and pursue other things. Of course the upper class also owned slaves who they used as scribes/assistants. So maybe a greater percentage of Upper class? Like 30, 30, 40?
     
    Last edited: Nov 12, 2017
  11. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    6,988
    Location:
    France
    No need for apologies, I was trying to make a joke...

    My concern about the number of calculation is more about processing time between turn when playing the game than about development time (even if this is also a concern, but not for that part, whatever we chose it will be relatively big)

    Not exactly, the "Citizen" slots is what we use to place people on the map tile. District also allows the use of "Citizen" slots, Buildings can add "Citizen" slots to a District (for a specific yield), but we can't add "Citizen" slots to the City Center buildings. Hardcoding.

    Which means that we can't chose where to place our "workers". The "Worker" slots in my design is a way to represent what type (and how much) employment is available in a city.

    yes.

    Good point about that. We can't chose directly where to put our workers in the city center as said above, but we could use some kind of (fixed for now) priorities, and/or hook on the yield selection checkbox on the city screen to determine those priorities.

    That's where i'd like to keep things relatively simple, in the proposed design, the tiles you own are tiles you administer, the population on all those tiles being dependant of their city (at least in the working range) for food and health.

    Which means I use globals value, the city collect all yield/resources and feed all population on those tiles, including the City Center.

    We can change the "activities value" for a tile independantly, based on policies for example, or per tile fertility depending on policies, but we do need to keep the scaling with city size and a way to say "I want more people working on that tile" as we've discussed previously to control the direction where you want to expand (and the only way I can think of is the Citizen slots, which are controlled by the city size)

    ATM it's only Sea Resources connected to the city by a coastal/sea "route" that are collected.

    But yes, I should add fishing on adjacent tiles to rural population (and the corresponding activity types on the adjacent land tiles)


    Yes, number are just for the example, and I need to think of representing activities that may not influence Social Stratification but still need to be filled by a specific classe..
     
    Knasp likes this.
  12. Knasp

    Knasp Chieftain

    Joined:
    Sep 10, 2011
    Messages:
    84
    I see your point, maybe some systems can be simplified? I would suppose that it's possible to simplify the design of things, or ways to cut down calculations, but I'm not sure how you could go about doing so. Any guesses which parts are most demanding right now?
    If including a priority/hierarchy in the automated City administration, it should probably be something like:
    1. Produce food
    2. City projects
    3. Trade/wealth
    4. Luxuries

    Excuse my ignorance about performance when it comes to calculations, but maybe a slightly altered resource/economic system could reduce performance issues by simplifying the mechanics? Which could also have the benefit of being slightly less difficult for new players.
    Instead of having buildings produce a fixed amount per turn of Secondary (converted) Resources, from the Primary (gathered) resources. Instead you could have the production of resources (and Acitivity of the City) be decided more by the current City needs and production, improvements and chosen "Citizen" tiles . For example: The City wouldn't produce any Bows until it OR a connected City started recruiting Archers. Possibly it could also produce Bows because another (friendly) nation has a trade route and are in desperate demand of bows (rich exports).

    In this model, resources wouldn't constantly be gathered to fill the City stocks, and buildings wouldn't constantly work on producing/converting all kinds of resources every turn. Rather the buildings will only be used when there's a direct need OR the City has a high/excess productivity and there's Gold to be made by exporting. Having the City stock up on resources and waiting for the Ruler to build X,Y and Z is a bit strange anyhow. Why not let the City's merchants just sell their excess goods? Basically if you have unused resources, you could have the excess/stock being sold off automatically for Gold. The City government should get revenue for taxing all transactions/trade anyway. Of course, the trading of weapons could still be restricted, to allow the player greater control of shaping their army.

    If Citizens placed on city tiles are to indicate the need for certain resources (by the city) then you could determine the specific production rate according to the tiles chosen, specifically their improvements and current population. These values would be combined with relevant City buildings (and urban activity/productivity/employment rate) to determine the actual rate of producing/converting these secondary Resources. If you want to produce Swords/Iron tools for export (to other cities or Civs) then you'd keep a Citizen working on a mine (preferably iron).
    For example: A City building a Swordsmen unit, would first use captured swords in stock, but then the recruitment would require Swords to be produced. If the City has food, then it will prioritize the available work force to increase the rate of smithing and recruitment. The production rate of Swords wouldn't be determined by the building directly. Instead you'd have a basic rate that is modified by every tile that has a mine, every tile that has an iron mine, the blacksmith building (and its automatically assigned workforce) and finally the population and acitivity (productivity) of all those tiles. The conversion producing Weapons and armor would get a boost for every Citizen assigned to a mine (more metals being extracted). While the production of Horses would be boosted by putting Citizens on Horse pastures, and also importing horses from abroad.

    I guess another way to possibly reduce the demand on performance (more speculation), could perhaps be to cut down the total amount of resources used and handled (especially intermediary resources). You could very well combine food resources into e.g. Crops, Meat, Fruits. A stocking of some resources would make sense, you don't want to starve of course. Or at least when you're doing a City project to prepare for a siege, they could add Food stocks, that will later be depleted for each turn the City is cut off (by the siege). I'm not sure any of these ideas or suggestions would actually save any performance but to me it seems doable to reduce these intermediary steps. Just some loose thoughts and speculation into the economics side of things.

    It is a bit unclear to me how everything is supposed to merge, but I guess that it's a common feeling when you're trying out new features. If the chosen tiles are all dependent on the City, then why have a maximum roof on the Stocks of resources? Is that demanding?
     
    Last edited: Nov 15, 2017
  13. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    6,988
    Location:
    France
    ATM a city stop producing/importing when its stock is full and there is no demand for a resources.

    Conditional production on more parameters would actually increase the code's complexity and the calculations per turn.

    Max stock is used to know when to stop producing/importing, when we can export, and how much the cost per unit will change.
     
    Knasp likes this.

Share This Page