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

Military, Standing Armies, Etc.

Discussion in 'Civ4Col - Medieval: Conquests' started by Kailric, Feb 19, 2014.

  1. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I moved this topic to here, on the question of Maintenance and Standing Armies...

     
  2. Trade Winds

    Trade Winds Warlord

    Joined:
    Nov 21, 2013
    Messages:
    235
    Units in cities should require several basic or advanced goods according to qualification and/or profession (RaR feature). Goods can be acquired for a price from storehouses in hamlets, or in larger cities from marketplaces or if goods are stored elsewhere in the plotgroup. If your society fails to give the unit the goods they consume, this unit may grow angriness.

    To stop adding angry citizens within your cities, you may expel this unit to the map, where now it will cost money, (and if AI friendly and codeable these units could also continue to consume food, gunpowder, tools for workers or whatever). There could be upkeep for citizens (according to qualification), workers, explorers and then soldiers. So it can be very costly to have idle overqualified citizens or unnecessary soldiers on the map.

    If you fail to feed units on the map, they may die; but if you fail to give them their money, units could get demoted, to adapt to the poor income, or even turn into marauders stealing productivity from farms for self survival. Army units may follow this demoting process or directly end up as highway robbers in medieval times or even armored terrorists.

    Ever wondered where all this dangerous roads in M:C come from? Rejected citizens.

    May a civ create a lot of rejected citizens to bother you? Well, this civ is the first one to be bothered, but you can also lure these rejected foreign people to plough your fields or work for you as spies (as it was previously mentioned).

    May it be an overwhelming amount of rejected citizens? Well, if they continue needing to be fed, they may starve, or your classic or medieval cruel warlords may enslave them and reintroduce them in society working for nothing, being badly fed until… well.

    The world history mod will eventually repair this unfairness with civics.
     
  3. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,707
    Location:
    UK
    wow that is a lot of features packed into one post! :D

    I would be satisfied with a far less elaborate scheme :D
     
  4. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    They already do, at least in the DLL. Nobody filled out the XML to enable this meaning each turn all citizens are looped, checked for demands of each yield, which turns out to be 0 and the combined demand is then 0, which mean nothing else happens. Actually I don't think it loops all yields for each unit as it uses the shortcut to detect all values being 0.


    All this talk about different kind of units in cities made me think of a feature I planned for RaRE even before I announced RaRE, but I never got around to actually do it.

    The idea is a domestic advisor screen counting the number of units of each kind in the cities. I wrote it now and it turned out to be really easy to do. I wonder why I never coded it before. I do have a problem with column header. Yield and buildings use getChar() to get the column header icon. However that one doesn't exist for units. Maybe we should write one. For now I just used the description string, which as you can see in the screenshot is too long. It becomes even worse with all those starting with "expert" because you only know it's an expert, now what it is an expert in :crazyeye:
    I added this to github for all of you to try (providing you can figure out how to pull :lol:)

    The changed files: https://github.com/Nightinggale/Medieval_Tech/commit/92a15bcda117eff5f56764dafaf2c7d67a4a7fe2
    Notice how few python lines is needed to make a brand new screen. Half of them can be reused if we make another unit screen. The DLL change is just to figure out if current player can use a unit in question, which relies on the cache, which is based on inventions. As a result only invented units will appear and the number of pages will increase as you invent more and more units.
     

    Attached Files:

  5. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,707
    Location:
    UK
    Is there a way to increase the column width?

    It makes me want to double click it like excel! :D
     
  6. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    Yes there is. In python :p
    It takes the available space and divides it into equally sized columns. It scales with resolution meaning it looks better on higher resolution. However I always use a small resolution when uploading screenshots due to file size and bandwidth.

    That will sort by the column in question :p
     
  7. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    I made a new page. It's doing the very same as the last one, except it only counts units without a production bonus. This mean if you have say a farmer, then it will count if he isn't working a land plot for food. This should help figuring out if you can optimize production by moving the units around.
     
  8. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,707
    Location:
    UK
  9. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    I made a new page to tell known units to the schools in each city. However once it was done I realised we don't actually need a page for that. We can add hundreds of pages and nobody will use them as it gets confusing. Instead I came up with text coloring in the existing unit pages.

    To make this easier to use it no longer make empty places when there aren't any units. However writing 0 killed the overview and I decided on "---", which will not take focus away from the actual numbers while there is text to display the colour.

    I also made mouseover popup text to give unit info (and name!). Clicking the numbers will open pedia for that unit.
     

    Attached Files:

  10. Trade Winds

    Trade Winds Warlord

    Joined:
    Nov 21, 2013
    Messages:
    235
    So if I understand it right, you will only get yellow with "---"; and I find it better as profession is known or not known (not unit), don't I?
     
  11. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,707
    Location:
    UK
    cool! still ned to figure out a solution to those headers, although accesing the pedia info is a ood start, but is a bit long winded for getting the overview info of what each column is.

    With this addition though, having the 'optimised' units back in the overview would be helpful because you may want to put them into a school, perhaps those units in an 'optimised' position could be another colour.

    Actually wait that doesn't work does it because it is only one entry per profession per town... never mind!
     
  12. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    First of all this is units, not professions. The only profession related is the count of units with professions where they do not gain a production bonus.

    Each "block" consist of two things: colour and number.
    The number 0 is written as "---" to make the screen more readable.

    The colour is independent from number. The only real connection is that if the number is yellow, then it is presumably yellow as any unit would make it go green. However it turns green at new turn event meaning units added the same turn could be yellow.

    I added code to create the popup to provide the name. The pedia link came as a bonus as they are both results of the widget type.

    I thought about joining everything in one page, but then sorting would be screwed. Maybe the colour code interfere with sorting as well.
     
  13. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    I pushed another change for the Domestic Advisor. It is behaving a whole lot differently now.

    Buildings, units and yields are now turned of if the player can't use them. Each of them have been been made into a group meaning when adding a new state (button), you can write a short line telling that this one too should have the columns in question.

    We no longer sets the number of columns. Instead we specify a minimum column width. The code will then figure out how many pages to use and spread the columns evenly across those pages. On each page the columns will be stretched to fill out the entire table. All pages will now fill the entire table (except second general page and the two far right).

    As the code is only given a minimum width in pixels, it will be able to fill in more columns on high resolution monitors. As a result higher resolution will result in less pages, but more columns on each page.

    General pages have been updated. They will now merge into one if the resolution is high enough. Adding more columns and/or changing current order is also a whole lot easier now.

    The spacing between the buttons is now dynamic. It tries to make it as wide as possible, but will not make it wider than the previously hardcoded distance. However it will decrease the distance to ensure the far right button will not reach the exit button (or even get drawn off screen to the right). This code isn't possible to trigger currently. However it will trigger on 1024x768 when the next button is added.

    I think I'm done with the domestic advisor for now. The only thing I can think of is a building page telling the number of vacant unit slots. However this isn't the next thing I will code.
     
  14. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Good deal! Excited to see what's coming next:goodjob:
     
  15. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,707
    Location:
    UK
  16. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,354
    Use git to pull again. It's just one click away :p
     
  17. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Talking with Lib about Nobles and should they be trained got me to thinking more about an idea I have.

    We can introduce a new yield called YIELD_TRAINING, with the basic buildings being the Guard House, Barracks, and Military Academy. It takes Gold to produce training. Troops in training gain experience of course, that they can spend on certain Promotions but not all. You will be given the options when the Unit promotes. There is a limit to this training based on Civics and Techs.

    Most always Leaders trained their troops before battle. So, this will represent that. Besides, it is kind of odd that soldiers gain Promotions like Drill from actual combat, when this is learned from training. You can invest the time, gold, and effort or not, but Green troops going up against well Drilled soldiers could be detrimental. This should be pretty simple for the AI to learn as well.

    Some Promotions will require the unit to be Seasoned, meaning they have survived thier first battle. Perhaps there could be Seasoned units that aid training or even a Master Drill Seargent.

    Also, there will be a new improvement called a Military Camps that when connectted by road to a City add new Promotions to training. Units will be assumed to be traveling to these bases during their training. The new promotions will be based on the terrain of the encampment. Such as Ranger promotions if encamped in the Forests.

    These additions seem pretty straight forward to code and would greatly add to the realism of military endeavors.
     
  18. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,707
    Location:
    UK
    I like it! Now I want to make a bunch of camps connected to all my cities and make super soldiers!!

    I also like the idea of the terrain specific training, I have been making a lot of ranger units to patrol my lands!

    another thing I was thinking about (not exactly standing armies but it connects to hunters) is a 'game reserve' improvement, that would intermittently spawn animals for you to hunt, so that hunters can get a more reliable source of luxury food, as I often find I am waiting ages for new animals to show up in my lands. or instead of spawning animals it jsut gives X Lux. food to a hunter that is fortified on it, or working it in a city..

    It would represent the idea of the king's land, I got the idea from the poaching text. It could maybe be unlocked by particular civics.
     
  19. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    mm, those sound like some good ideas. :king: someone's been hard at work in the Inventor's House! :science::p I like the concept of being able to choose to trade off some gold and foregone production for Experience, and spend this flexibly on Promotions you pick. If this uses XML Promotions system it should be very moddable as well. (Ie you could mod it so certain specialized promotions could only be chosen after you've met certain prereqs in promotions xml, such as having a Noble Title promotion, being of a certain unitclass, or having a certain Tech or Civic in effect).

    Be careful not to let any one unit stack up so many equipments/promos that it becomes effectively invincible. It's a nice balance if even elite units take a little damage during most combats, then get more vulnerable the more damaged they are, meaning that elite super-soldiers can have a big initial advantage but may still be eventually worn down by invading hordes :viking:
     
  20. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Yes, the AI would really need to be able to use this or they would be at a great disadvantage. The REF would need to be beefed up as well, but I feel like they need to anyway as they were really push overs my last conquest. If we create the right balance this part of the mod could not be neglected as your units would not be trained enough to withstand the invasion.

    Its like most games with a climatic ending, you need these Super Troopers in order to survive, take the new X-Com for example, I love that game.
     

Share This Page