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

Guide to The C2C Alternative Improvement Upgrade Mechanism

Discussion in 'Civ4 - Caveman 2 Cosmos' started by Thunderbrd, May 17, 2014.

  1. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    I'm sure your system is fine. I'll take a look to see what's happening.

    RED: Ok, so a crash spot needs fixing. Fair 'nuff.
    Orange: Not sure what you mean by skips through multiple instances of the upgrade? If you're getting a long string of these then it's probably differing plots all coming good to upgrade at once and you're telling it not to upgrade on each one.
    Blue: Right - I think I can fix that too.

    This report is MUCH appreciated!
     
  2. Elisianthus

    Elisianthus Chieftain

    Joined:
    Aug 26, 2013
    Messages:
    22
    I'm having the same problem, so I'll post up my save in case it helps narrow it down. Just hitting End Turn should cause it.
     

    Attached Files:

  3. Lyrrix

    Lyrrix Chieftain

    Joined:
    Dec 6, 2012
    Messages:
    54
    Yeah, about the orange, that's what I meant... don't know why I phrased it that way.

    Not a problem. I just hope you get it fixed soon, because I have a whole lot of lumbermills sitting around waiting for me to research Wildlife Conservation... :lol::cool::D
     
  4. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    I've narrowed in on the problem pretty well but the fix is something I've gotta test around a bit to find. I can solve the immediate issue but there's more afoot. The basics of the problem amounts to the fact that you have multiple upgrades that want to send a popup coming up at once and that was an untested situation. I had a bad feeling about it in the first place and had asked for some guidance on the matter in the main site help thread and got no answer. So I'm having to test a few things to see if it helps, looking at an example of the types of popups that exhibit the behavior I need it to and taking guesses as to which parts setup that behavior.

    Unfortunately it takes a bit of time to run each test... urgh.

    EDIT: Ok, looks like I've figured it out... running what I think will be the last test here.

    I've got some improved AI for Ranged Assault coming with this one too.
     
  5. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    Ok, fix is on the SVN.

    This report was particularly appreciated as it really forced the issue I was concerned might be one, caught it before it became a huge problem once the extended xml was added (which was going to be part of my goals today) and gave me the kick to look in the right directions to get the popup to behave far more in the manner in which I'd wished to be able to implement it in the first place. Thanks for your patience and I'm sorry to mess up your playing time today...
     
  6. Elisianthus

    Elisianthus Chieftain

    Joined:
    Aug 26, 2013
    Messages:
    22
    That was a wonderfully quick fix. Thanks. <3
     
  7. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    You're welcome - I try to stay vigilant for problems in new work, particularly nearing release!
     
  8. Lyrrix

    Lyrrix Chieftain

    Joined:
    Dec 6, 2012
    Messages:
    54
    Wonderful... and before I got around to playing some more so I get my lumbermills upgraded. SCIENCE!!
     
  9. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    Ok, 0100010, I've reviewed your layout and I think it's about 90% complete... some more ideas pending but I'm working on the tree structure here. So you can review what I have in mind.

    One thing I'm wondering... About the Mountain Mine... I can work with the code for this
    but should the Mountain Mine also upgrade to any other types of mines? Or are we thinking of adding more Mountain Mine types later?
     
  10. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,549
    Gender:
    Male
    Location:
    Canberra, Australia
    Currently workers can be lead into mountains by a unit with a mountaineering promotion. Once there they can build trails and other routes.

    Personally I don't think that they should be able to build any route except trail. With road perhaps at Mountaineering but nothing else until Explosives. Once a trail is there then units should be able to move without a mountaineering leader and mines or quarries of some sort should be available. I expect we may need a new line for those mines and quarries and maybe new routes.

    You have to be careful with defining routes. They each have a unique number and those with a higher number replace those with a lower number. This is why you can't have two routs on the same plot. For example we may have to define two trails "Mountain Trail" with a lower number than "Trail" the only difference is that the first requires Peak. The downside of this is that automated workers will replace "Mountain Trail" with "Trail" as soon as possible unless there is a better route that they can use. this assumes we can have routes limited by Peak/not Peak.
     
  11. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    My wife and I were just discussing this. I'll have to tweak some things in the code to allow the passage for any unit if a route exists (which I totally agree with) but for now don't see a huge need to differentiate the path types. However, I COULD make a bNotOnPeaks tag to trump the ability of bonuses to enable the building of mines and quarries on peaks (I WAS just going to hardcode tweak the bonus prerequisite open enablement to not operate if the plot has a peak) and add the effect for routes here. At that point then peaks would need their own dedicated set of routes.

    (Also Llama workers should have the promo that the Pack Llamas have that allows themselves to go onto the peaks.)
     
  12. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,549
    Gender:
    Male
    Location:
    Canberra, Australia
    Bonuses don't trump the ability to build anything on peaks, that is the problem. The only thing your workers can do on a peak is build a route until way after the Mountaineering tech.
     
  13. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    They do make it possible to build a mind when a mine isn't set to be able to build on a peak, much like a barley resource in the middle of a plot without water access allows a farm to be built there. Resources providing abnormal access probably doesn't allow the inability to build a non-route improvement on a peak until mountaineering however.

    Are you wanting workers to be able to build something (like a stone gatherer perhaps) on peaks before mountaineering so that even though the city can't work the plot, the nation could still have earlier access to those resources?
     
  14. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,549
    Gender:
    Male
    Location:
    Canberra, Australia
    No, not seeing this at all. I have Mountaineering and stone and iron on the peaks. I have a route on the peaks but I can't build anything there until I have access to Mountain Mine and Mountain Quarry.

    Yes, especially for vicinity. It would also be useful for towers but maybe not forts.
     
  15. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    hmm... from what I could see of my wife's game she was able to build mines where there were resources... maybe it was another problem that's now been resolved.

    I'll have to get in and read the tags and codes to see how the Mountain Mine (and there's a quarry too?) is setup. I'd love to do what I can to enable Stone Gatherers on Peaks as well. (and have them upgradeable into Mountain Mine/Mountain Quarry as well!)

    I'm feeling VERY good about the upgrade paths I'm working on... I think it'll be really REALLY cool how it plays out! (A few more days on the xml and some more work on the dll proceedures for some added desired effects there and it should be ready to go for some testing among those on the SVN.) With any luck by the end of the weekend I may be able to put a stamp of approval on the release on my end.
     
  16. 0100010

    0100010 Prince

    Joined:
    Mar 31, 2008
    Messages:
    429

    The mountain mine was designed with the understanding that it would not upgrade. (If you add upgrades, you'll want to redo the tech bonuses, and split them up between the mountain mine and what it upgrades to based on when those tech are likely gained vs when the upgrade is unlocked.)

    The main purpose of the mountain mine, was because Modern and Core Mine look hideous on peak terrains. Normal mine graphics are not that great either though, because in all case the mine is literally balanced on top of the peak summit. Solving this aesthetic problem though will require new graphics, or at the very least figuring out how to alter the mine model to anchor its Z value at lower value, and maybe playing with the scale so that it clips the Peak but you can still see the mine entrance 'going inside the mountain'. Ask a graphics person how to do that. I don't know.

    As for your upgrade tree.
    Orchards don't remove features. (At least they are not suposed to, don't know if something has changed)

    Mountain Mine should enables access to bone 'metal' and 'stone' resources, so there was no need for a separate Mountain Quarry.
     
  17. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    Ok... cool by me then. Makes it easier for now anyhow.

    Good catch... I've restructured the plan there a bit.

    Another thing I wanted to propose... IMO ALL harvestables should eventually upgrade into the Farmscraper (erm... Vertical Farm) - of course if the Orchards don't destroy the feature then they might be wise to optionally deny when they try to. But more importantly... I was wondering about all those tech additions you did to balance out progressions (NICE job btw! I'm only now seeing the beauty of your designs here and I hope you won't feel I'm stepping on them at all to offer some interesting alternatives in the tree.) If Orchards, Wineries, Plantations, and a few others like Mushroom Gatherer etc... are made to upgrade to a Vertical Farm would that screw up any tech progressions on those and make the upgrade actually harmful to accept?

    More on future plans:
    Spoiler :

    I also want to make the Pasture upgrade to the Vertical Farm, however, I do think there's a step in between we should add that we haven't considered yet, the Livestock Factory Farm. I'm sure we've all seen stuff on how animals are currently being raised. We're before Vertical Farms but we've gone far beyond pastures for raising our livestock.

    I could use your help in defining that and someone would need to summon us up some applicable artwork (though the industrial factory with an 'outdoor' pen would work.)

    However, that would be next cycle I suppose.


    Ok cool.
     
  18. 0100010

    0100010 Prince

    Joined:
    Mar 31, 2008
    Messages:
    429
    That won't work very well.

    Doing that will cause tech bonus to improvements to all have the same values. This means you can't differentiate between a tech which should grant a bonus to plantation chain vs a tech that should grant a bonus to pasture chain or farm chain improvements, its all or nothing. (At least not without adding new xml tags) This is also why, even though it makes sense semantically, a future Cinnamon resource and the current Rubber resource is not going to be in Orchard chain, even though they are tree oriented. This is because the orchard chain has specific food bearing tech bonus which would make no sense being attached to an Rubber "orchard" and so on...


    Other examples:
    Plough doesn't make much sense to be added to Orchards
    Spice and Drug Trade doesn't make much sense to add to farms (well some farms, but those farms are really plantations which do support it) Spice and Drug trade doesn't make much sense being applied to a pumpkin/wheat/rice etc farm.

    you could do it with multiple versions of the Vertical farm, but you still need separate improvements for each, you can then custom tailer the yields and tech for those alternate chain improvements.


    EDIT:
    A more through analysis (based on the charts on page 7 and 9 in the Improvements discussion thread)


    Assuming a player has max techs a vertical farm will provide at the most: +21:food:, +0:hammers:, +6:commerce:

    Switch from an Orchard to a Vertical farm will trade a minimum of 1:commerce
    The best Orchard (dependent on underlying map resource) will give (+4 to +6):food:, +0:hammers:, (+7 to +9):commerce:

    This means giving up an orchard for a Vertical farms will result in a net loss of (-1 to -3):commerce: and a gain of (+15 to +17):food: and the loss of the underlying map resource.

    Changing a plantation to a vertical farm will result in a net loss of (-5 to -7):commerce and a gain of +21:food: and the loss of the underlying map resource.

    Changing a pasture to a vertical farm will result in a net loss of (0 to -2):hammers:, a net gain of (+17 to +20):food: and a net gain of (+4 to +6):commerce: and loss of the map resource

    Swapping a mushroom gatherer to a vertical farm will result in all gains apart form the loss of the resource.

    The loss of the resource in all the cases can be eliminated by making the resource valid for the vertical farm. The question is though, should they be? (For mushrooms, I'd say yes, as they don't do much else)

    It possible some other additional late game tech might help up the gains for orchards and plantations, to make it a more difficult choice.

    As for pastures..... We may want to do something completely different, make them all obsolete with a lab-grown meat tech. Then make them just upgrade into the wildlife sanctuary.
     
  19. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    28,556
    Gender:
    Male
    Location:
    Las Vegas
    Currently the only techs that manipulate the Farmscraper are:
    Code:
    			<TechYieldChanges>
    				<TechYieldChange>
    					<PrereqTech>TECH_ARTIFICIAL_EVOLUTION</PrereqTech>
    					<TechYields>
    						<iYield>3</iYield>
    						<iYield>0</iYield>
    						<iYield>1</iYield>
    					</TechYields>
    				</TechYieldChange>
    				<TechYieldChange>
    					<PrereqTech>TECH_ORGANIC_CITIES</PrereqTech>
    					<TechYields>
    						<iYield>3</iYield>
    						<iYield>0</iYield>
    						<iYield>1</iYield>
    					</TechYields>
    				</TechYieldChange>
    			</TechYieldChanges>
    We do differentiate the value of the bonuses independently. But what I DID see in this was a big problem with the resources you DON'T want having their improvement upgrade through to the Farmscraper.

    So I'm thinking if an improvement is on a plot with a bonus, make it NOT be able to upgrade to the next improvement IF that improvement DOESN'T have that bonus. I've gotta do a little coding work to support your suggested behavior on a few spots anyhow and this would be just as 'minor'.

    That alone should do it. I'd been looking at some of the bonuses supported by the Farmscraper and not all the bonuses supported by those improvements I'd like to have upgrade into a Farmscraper would be appropriate - as you point out. So by denying the upgrade because the current improvement is supporting the bonus while the next upgrade would not seems to be the applicable step to take to make this work.
     
  20. climat

    climat King

    Joined:
    Mar 29, 2009
    Messages:
    734
    The problem is that Orchard/Winery/Plantation can't be built in tiles without resources. If a Farmscraper makes resources unavailable, rational players would not choose to upgrade them.
     

Share This Page