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

Mining, trapping, prospecting, and depleting resources

Discussion in 'Civ4Col - Medieval: Conquests' started by Kailric, Aug 16, 2014.

  1. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I'm not sure about this one. That maybe too precious of a skill for Expert Prospectors, makeing their aquisition extremely important, leaving your empire gimp without them.

    This is somewhat how it works now. When a Map is generated and after a Bonus Iron is placed, that Bonus Iron plot acts like a Mining Epicenter. Ore is then added around the Bonus for several plots. This Ore is then already on the map and your Prospectors can find it. The amount of Ore Grows larger the closer you get to the Epicenter so when Prospecting you may can tell what direction the Bonus is. Bonuses are not hidden at the moment so you can find it once the plot is revealed. There is also a random chance to find Ore in any viable plot, but the Epicenters guarantee Ore.

    Yeah, good idea. The Type of Terrain can have a bonus to the Amount of Ore Revealed.


    I made some additions to the Prospecting code. When you deplete an Ore source you will get a message and a plot Icon, also the unit working the plot will be auto reassigned to another plot so you want keep producing nothing. I plan to add Silver and Stone to this system next.

    I am still waiting to here from Night about the mentioned bug before I make another upload.
     
  2. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    Could we have it that workers can find deeper seems of ore or other mineable yields like silver, but only a prospector can find a bonus resource such as iron, tin, copper, whatever. So that becomes their specialist benefit.
    I'm not sure about this one. That maybe too precious of a skill for Expert Prospectors, makeing their aquisition extremely important, leaving your empire gimp without them.

    They will only need to be bought as a matter of course at the immigration screen, so it would not be that bad, also it would make them a prime target for banditry! :D

    Kings learn quickly to guard their Court Prospectors! :D

    But like I said, it would only be to reveal 'new bonuses' like what mines do in civ, there would already be some 'premade' bonuses lying around.
     
  3. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    So, what your basically saying is Prospectors have a chance to reveal Bonuses. That is an option. Right now Prospecting works off the Goodie system when there are no existing resources. There are several Empty prospecting Goodies that reveal nothing. Like Scouts that reveal no bad goodies, Prospectors could have no Empty Mining Goodies as a talent. That was what I was thinking perhaps. That would be quite powerful and they would be worth their wait in gold.
     
  4. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    yeah, my thinking was if a nation is in an area without any bonus metals, they could hire a prospector and it would be a good chance that he would find them SOMETHING to use if they have some hills and peaks around.
     
  5. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I am actually excited about the change to gathering Luxury Food from Woods. It was really too difficult to gain Noble units through the Baker/Butcher Spice combo. So, to differentiate between the current Hunter Profession and the new City Profession should we do a name change? Or, I am thinking that we should perhaps augment the Trapper Profession to gather Luxury Food as well. Since, basically the two go hand in hand killing the animal, getting the meat and skins. Expert Trappers could gain a 50% bonus to Luxury Food and Expert Huntsman could gain a 50% bonus to Skins, just to keep them different. This would also work well with the planned addition of Killing outdoor Animal Units gives you Food and Furs.

    There is now 3 new attribute to Yields: bLimited, bLimitedProspect, and iReplenishTurns. If you select bLimitedProspect the Yield will work with the Layer System as with Ore now. Techs, Bulidings, etc can unlock new Layers thus adding additional Yields. bLimited sets the Yield up to deplete but there are no means to manually replenish. However, if you set a iReplenishTurns the Yield will Replenish after that many turns.

    In studying History of late I have noticed a trend. Man will build a huge Civilization, deplete resources, and the Civilization will collapse. This depletion happened because of several reasons; one man chopped down all the woods around an area, causing mass erosion over time and climate change, thus the land becomes barren. Also, man has over populated Cattle and other herd animals to the point where the terrain is decimated and can no longer support animals.

    I think these consequences should be added to the Mod, especially for World History. If a player cuts down too much forest around his cities the land could start to lose its Yield potential. Also, if too many Animals are grazing an area, the Yield amount could be decreased. What’s everyone’s take on this?
     
  6. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    Oooph that depeleting yields would hurt! :D

    The replenish is good though, I think if we went for the 'eco-system degradation' idea, there would have to be a way to restore or 'heal' it.
    Something like if you change yield production (lets say cattle to food for example) for X turns then the cattle yieldification will come back. (like your replenish tag)
    This would work a bit like what crop rotation does where you cultivate say wheat for 1 cycle, then something that is high in nutrients for the soil the next to restore quality to the soil.
    Or perhaps it could be a 'tend the land' profession, so if you 'wound the output' you assign a citizen to 'tend the land' for X turns and the yield output is restored.
    Something along those lines.

    With the luxury food, I agree with how dificult it could be to get a noble. It is still good to have the baker/butcher system, because if you put the effort in you can get a major increase to your lux. output.
    But having something that 'trickles in' luxury food without having to do anything is also a helpful step to take.

    The professional could be a forest ranger or game keeper something like that. Or a forrester.

    I am sure there was a medieval name, I can't think if it was one of these or something else..

    Or 'Master of the Hunt' hehe.
     
  7. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Some ideas on this in response to Lib's posts on limited resources. Prospecting could be retooled in that finding nothing is rare and also you discover different levels of Ore present in that say, some plots only give 1 per turn while others can give up to 6 or what ever is balanced. They could still deplete but say, it would take on average 1/3 of the game time in order to deplete a Mine. That way you don't run out early on.
     
  8. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    Yes that all sounds great!

    Even discovering just 1 ore is useful.

    I am not comepletely against the idea of not always discovering ore, but I think it would be made better with an automation feature, that way I don't have to keep faffing with failure, I can just let the worker go for 30 turns, then see what he has turned up where.

    With depleting, (I don't know how it actually works) but if it is done by randomly assigning a total yield amount, we could then start working it out by how many units it could potentially produce. So it could be a 5, 10, 20 unit mine. so the 20 mine would be 50 or 100 x 20 so 2000 total ore.

    When the Pope has something in the region of 50-60 units, there would have been no way in my current game that I could have competed with the depleting mines. About 95% of my army had their resources brought in from trade screens..

    Perhaps another way of doing things, might be to change the 'recipe' of tools and weapons, so that say 1 wood + 1 ore make 2 weapons. So that you get much more out of ore. Currently it is the rarest material, and is required to make the most important things, weapons(tools) and armour, and you need vast quantities of these to be able to equip an army capable of facing off against the Pope.
     
  9. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    I agree that it would be best to have some sort of automation to handle this. Not only will it avoid repetitive tasks, it will also give the AI a chance to catch up on this feature. The question is how should it work? I don't mean how to code it (though that could be an issue). For a start we should define in human readable terms what it is supposed to do before we can even think about moving on to coding.

    Say we have a unit, which is set to prospecting. We can presumably simplify that to
    1. pick best plot
    2. goto plot
    3. prospect
    4. goto 1
    The only non-trivial task seems to be #1. How do we make rules telling which plot to prospect? What criteria should we use? I might have a few ideas, but in the interest of getting the best result, I will not pollute your minds with my ideas before you present brainstorming results ;)

    I'm open for ideas regarding automation for more or less any part of the game, not just prospecting.
     
  10. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    Well only certain plots are available for prospecting, I believe desert, swamp, hill and mountain.

    I would say best plot is just nearest one to the unit. A bit like auto exploring, it just moves to each 'yellow' marked tile, starting with the closest one.

    I am still waiting on your automate plot group trade route button as well :D So that a land unit will only trade between cities with roads. I missed that in my latest play through :D
     
  11. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Yeah, the reason I say with auto Prospecting we should have a separate profession is so the commands don't become overwhelming. Say you could have three commands. One to prospect current plot, one to Prospect in borders, one to Prospect all tiles.

    The current Explore code could easily be modified for this. I believe it gives a score to all visible plots and the one with the highest score gets to be the target. All we would need to do is enter our own criteria for that score. Such things as, visible Bonuses, and proximity to plots with existing ore as you would hope to find a group of such plots as well as in the current code the Ore Bonus produces ore around its tile.

    Is this something you are interested in coding Night, if so then have at it:)
     
  12. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    yeah those 3 automations for the prospector unit sound really good to me!
     
  13. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    It was actually something like this I was aiming at, though the idea would be to make it somewhat more detailed than that. The concept of just going to the nearest yellow plot is easy to code, but very inefficient from a gameplay point of view.
     
  14. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I've added in the first test version of the auto Prospecting command, and my little Prospector started making his rounds. As mentioned above there could be three commands.. Prospect this spot, Prospect within borders, Explore and Prospect. With these commands I am thinking we can go ahead with a new Prospecting Profession that uses these commands. Expert Prospectors could give a bonus to the amount found, or speed of prospecting, or fewer or no empty mines perhaps.

    I already made adjustments where there are fewer chances you get a dud when prospecting. For example...

    Code:
    <ProspectGoodies>
    	<GoodyType>PROSPECT_GOODY_ABANDONED_MINE_ORE</GoodyType>
    	<GoodyType>PROSPECT_GOODY_MOTHER_LOAD_MINE_ORE</GoodyType>
    	<GoodyType>PROSPECT_GOODY_MOTHER_LOAD_ORE</GoodyType>
    	<GoodyType>PROSPECT_GOODY_ORE_YIELD_300</GoodyType>
    	<GoodyType>PROSPECT_GOODY_ORE_YIELD_150</GoodyType>
    	<GoodyType>PROSPECT_GOODY_ORE_YIELD_150</GoodyType>
    	<GoodyType>PROSPECT_GOODY_ORE_YIELD_150</GoodyType>
    	<GoodyType>PROSPECT_GOODY_ORE_YIELD_50</GoodyType>
    	<GoodyType>PROSPECT_GOODY_ORE_YIELD_50</GoodyType>
    	<GoodyType>PROSPECT_GOODY_ORE_YIELD_50</GoodyType>
    	<GoodyType>PROSPECT_GOODY_ORE_YIELD_50</GoodyType>
    	<GoodyType>PROSPECT_GOODY_EMPTY</GoodyType>
    	<GoodyType>PROSPECT_GOODY_EMPTY</GoodyType>
    </ProspectGoodies>
    In the above Explorer difficulty in Civ4HandicapInfo.xml there is a 2 in 13 chance that you will get an "empty". You can add more or take away from any of the goody types for Prospecting goodies. The Prospecting Goodies are defined in the GoodyInfo.xml. Also note that where it says YIELD_300 it meant the amount was around 300, but I have increased this to 1000 and so on.
     
  15. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I've worked out a means to balance the Bonuses. As Lib pointed out Bison were taking over the plots, I adjusted them lower but then Deer where dominating, somewhere around 25 or so more than the other Bonuses. The problem is vanilla was never set up for this many Bonuses, so the plot bonuses filled up quickly and others had fewer and fewer chances to appear. I am not sure what others have done to manage the bonuses, but I have added two new attributes.

    One is in BonusInfos.xml, iMaxLandPercent, this is actually only used for water Bonuses at the moment, Fish and Crab, and is set to -1 (which skips them from being modified) as should all water bonuses be set as they are less effected by the additions.

    And in WorldInfos.xml there is a new iMaxBonusCount (note to self, should make this iMaxLandBonusCount as it only effects land bonuses) where you set the max count of Bonuses that can appear. For Large I have this set to 12, so that no Bonus can have over 12 appearences. This makes it so that on Large maps now, Furs, Deer, Bison, and Boar have roughly the same count.

    I should make the iMaxLandPercent actually be a percent of the iMaxBonusCount, so that say, if you wanted Bison to be of lower counts than the rest you can set this to say 50% and the max would be 6 instead of 12 on large maps, or increase it to 200% for 24 count.
     
  16. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    I don't know how bonuses are placed right now and I decided to not read it right now. That way I may come up with something brand new :)

    Just for the record, I think of land bonuses only in the following. Water bonuses are not counted and such even if I skip telling.

    First we make an array of length numBonuses and zero it (plotNumArray). We then loop all plots and count number of plots each bonus can be in (yes one plot can be counted multiple times). At the same time the number of land plots is counted (if we haven't got that count already).

    We set how many bonuses we want based on XML data, map size and some randomness and store the result in a new array (numArray). We count the number of wanted bonuses and compare it to land plots. We then have a cap of how dense bonuses can be on the map, which is set in XML.

    Example:
    We have 405 land plots and a 25% cap, which gives 101 placed bonuses. We have 124 bonuses in numArray we want to place. We then multiply each number in the array with 101/124. Doing that will ensure that we will not get more than 101 bonuses, while the bonus type distribution is more or less as requested by XML.


    Once this is found, we place that type of bonus on random plots. If a randomly picked plot has a bonus already, we ignore the plot and search again. When a bonus is placed, all bonus types are looped and numPlotArray is decreased by 1 for each bonus type, which can be on the plot. Each time a bonus is placed, the num in numArray is lowered by 1. Once

    Actual placement
    1. loop numPlotArray and find the index of number and numArray is > 0 for the same index
      (stop placing if numArray only contain 0s)
    2. Start placing the bonus of the found index (active bonus)
    3. Find a random plot
    4. Goto 3 if plot has a bonus or active bonus can't be placed on plot
    5. Loop plotNumArray reduce each number by 1 if bonus type can be set on the plot in question
    6. numArray is decreased 1 for active bonus
    7. Goto 3 if numArray > 0 and plotNumArray > 0 for active bonus
    8. Goto 1
    I think that should place bonuses without having dominating bonuses. Also by placing the bonuses with fewest possible plots first, we can place 3 gold mines on the only 3 plots allowing gold mines and not waste any of those on common bonuses.

    There are a few things to consider, like what to do when numArray > numPlotArray and such.

    Another thing to consider is instead of picking a random plot on the map, we loop the map and make a list of possible plots. We then pick a random index in that list, place the bonus and then remove the index from the list. That will be much faster when numArray and numPlotArray have numbers close to each other. Or rather, having 1 valid plot and locating that one by picking random plots is dead slow.

    If I were to code this, I would likely do it in C++ due to knowledge of the language as well as performance. However by placing it inside the DLL, it mean it will be the same for all mapscripts and for all mods. That's something to consider as well. Maybe it would be a good place to gain more experience with python arrays.
     
  17. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I actually had such ideas brewing in the back of my mind but I went with a simpler approach to save coding time. I'm not sure how the bonus code works either. All I adjusted was the code that gets the amount of allowed bonus, then the code does what ever it does to place them. Your idea would possible lead to a more realistic placement. I'll pin your post to the blackboard so it doesn't get lost, and perhaps a note on sourceforge.
     
  18. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    I have decided this is what I will look into next. We talked about making this feature a game option. Seeing that it isn't working well, I decided to actually make it a game option. In the interest in getting to a release as soon as possible (mainly because col2071 is on hold until we release), we can save time here and simply force the release to disable this feature. I suspect it could take a while to get this working properly.
     
  19. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    That sounds good. In its current state it seems a whole lot better already and just needs play tested which I am currently doing. By game option do you mean in game option, or XML option? This should be XML option as the code is setup when the map is created and makes little sense to change the map mid game if you decide to use this option. Or, it could be a world option but I have never added such.

    Anyway, I've noticed one issue I need to address that is when a plot gains a new level of Prospecting you gain the ability to Prospect it again, even if you have already done so and it currently isn't depleted. So, this needs adjusted so that you can only prospect again when the current amount is depleted, should be simple fix.

    This is a huge game changer actually and it does need play tested quite well before it becomes an official feature so yeah, good idea.
     
  20. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    Game option as a bool in CvGame. It is picked when the game starts, just like victory conditions and other stuff like that. Once you get to turn 1, the setting becomes hardcoded and if you want to change it, you start a new game on a new map.
     

Share This Page