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

C2C SVN Changelog

Discussion in 'Civ4 - Caveman 2 Cosmos' started by Dancing Hoskuld, Jul 4, 2011.

  1. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,563
    Gender:
    Male
    Location:
    MN
    Changed a few techs around: Almost all based on Vokarya's in-put, thx.

    Classical Era
    - Ancient Ballistics = Construction AND Oil Lamps AND Ship Building
    - Ancient Medicine = Code of Laws AND Gardening
    - Construction = Mathematics AND Monarchy
    - Democracy = Alphabet AND Code of Laws AND Currency AND Mathematics
    - Insurance = Code of Laws AND Currency
    - Iron Working = Lead Working AND Monarchy
    - Monarchy = Bronze Working AND Monotheism
    - Spice Trade = Calendar AND Salt Processing
    - Weather Lore = Cloud Patterns AND Philosophy


    Medieval Era
    - Acoustics = Education AND Music
    - Agricultural Tools = Feudalism AND Floristry AND Machinery
    - Armored Cavalry = Armor Crafting AND Elephant Riding AND Invention AND Stirrup
    - Civil Service = Feudalism AND Mathematics
    - Compass = Sailing AND Clockworks AND Education
    - Crop Rotation = Calendar AND Feudalism AND Floristry
     
  2. Vokarya

    Vokarya Deity

    Joined:
    Mar 25, 2011
    Messages:
    6,175
    Thanks. Just out of curiosity, Compass was Education OR Clockworks (+ Sailing). Is this a deliberate change?
     
  3. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    I think I may have found the cause of the trained-dog explosion (at least in part), and possibly also a contributary factor towards over-production of military generally.

    The smoking gun is this little beauty of a routine (which can be politely described as "a load of dingo's kidneys"):

    Code:
    bool CvCityAI::AI_chooseLeastRepresentedUnit(UnitTypeWeightArray &allowedTypes, int iOdds)
    {
    	int iValue;
    
    	UnitTypeWeightArray::iterator it;
    	
     	std::multimap<int, UnitAITypes, std::greater<int> > bestTypes;
     	std::multimap<int, UnitAITypes, std::greater<int> >::iterator best_it;
     	
     	
    	for (it = allowedTypes.begin(); it != allowedTypes.end(); it++)
    	{
    		iValue = it->second;
    		iValue *= 750 + GC.getGameINLINE().getSorenRandNum(250, "AI choose least represented unit");
    		iValue /= 1 + GET_PLAYER(getOwnerINLINE()).AI_totalAreaUnitAIs(area(), it->first);
    		bestTypes.insert(std::make_pair(iValue, it->first));
    	}
     	
     	for (best_it = bestTypes.begin(); best_it != bestTypes.end(); best_it++)
     	{
    		if (AI_chooseUnit(best_it->second, iOdds))
    		{
    			return true;
    		}
     	}
    	return false;
    }
    The input array 'allowedTypes' is a set of (UNITAI type, weight) tuples, which are the UINTAIs this function can choose from together with a base weight for each. The routine goes through these and produces an internal ordering which take account of how many of that UNITAI the player already has. It then goes through this second (sorted) array in weight order and attempts to build each in turn with a probability of 'iOdds'.


    Two major things wrong with this code:
    1. The iOdds should be a global probability of it building anything (and the city build relies on that to build things after this call when the odds are not met), but it has multiple bites at the cherry (the size of the allowable array), so the actual odds are more like (iOdds * <num allowable types>) for small values of iOdds.
    2. If iOdds is small the chances of any specific build is also small which effectively means that independent of the weights used to sort the array (i.e. - how many of the unit type the player already has mostly) all types are almost equally likely to be built

    A spectacularly failing call to this has iOdds at 10% less than half way down the city build priorities. This means that about half the time cities without really high priority builds will decide to build a more-or-less random unit type from the types concerned, instead of this only happening 10% of the time, abn then weighted heavilt towards the least populated type.

    In the case of UNITAI_COUNTER the trained dogs are basically the only unit it has to choose from for a long time (until war dogs which then become the problem build), so it ends up buildins a LOT of them (and neglecting things like non-priority workers, lesser economic, buildings etc.).

    I'll be pushing a fix to SVN later this afternoon. I don't think this is the WHOLE story behind the dog explosion, but I think it'll help quite a bit (and help with the over-militarisation also)
     
  4. DRJ

    DRJ Hedonist

    Joined:
    Dec 1, 2005
    Messages:
    1,514
    Location:
    Hamburg, Germany
    It was a fascinating story so far! :goodjob:

    I think you're a new sort of Archeaologist - called 'Codeologist' maybe.
    Where others see ("%&"); you find the fu.cking mistake^^
     
  5. Aevum

    Aevum Warlord

    Joined:
    Aug 27, 2009
    Messages:
    176
    Location:
    Wisconsin
    Koshling does WAY to much work around here. Don't think we don't notice either.
     
  6. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,563
    Gender:
    Male
    Location:
    MN
    Yes that a great find:goodjob:

    Yes great explanation.

    Yes "we" do notice, alot.;)
     
  7. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Yes. Just so you know our process. You post the stuff you want changed. I go review it and send the list posted above. Then SO goes and makes it happen. Once and awhile SO will report back problems but for the most part any problems that are found are reported back by you guys in which either SO goes and fixes or I report back to him to ask to fix.

    In short double or even triple reviewing of new stuff has reduced errors.

    Note that the techs that had 2 requirements and then you suggest it have only one were left alone, so it would avoid the tech tree errors. having redundancy doesn't seem to bother anything, but making those with a ton of tech requirements reduce to between 2 to 4 tech requirements is much better.

    So thank you Vokarya. In the future as more techs get added we may need you to do a review of them again. I suspect that's how many of these got to have so many tech requirements. Also shuffling around techs too.

    If you do things right, people won't be sure you've done anything at all. -God (Futurama)
     
  8. Azurian

    Azurian The Azurian

    Joined:
    Apr 10, 2012
    Messages:
    2,092
    Location:
    Florida, USA
    @Strategy Only

    I took pictures of the Caveman2Cosmos Tech Tree in .jpg format so it is easier for you guys to brainstorm any new Tech Tree edits without having to keep opening up the game to see. I uploaded a .zip with all the pictures for your convenience .

    [Pictures are of Revision 2268 April 11th 2012, approximately 1 hour ago],
    [Used Microsoft Paint with Civilization iV in Windowed Mode, 1366x768 . jpg]
     
  9. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,563
    Gender:
    Male
    Location:
    MN
    That is absolutely correct, LOOK at the top right corner of each, thats a ANDPreq, not a PreReq, meaning it has to have that tech before getting the NEW tech, i hope that explains it better??
     
  10. Azurian

    Azurian The Azurian

    Joined:
    Apr 10, 2012
    Messages:
    2,092
    Location:
    Florida, USA
    I actually now understand ANDPreq perfectly, (a different Tech that is not the prerequisite is also required) . I made these pics for myself to look at on the road, but I hope these pics of the Tech Tree help you out for future en devours :).

    I I love the new tech changes to the Classical and Medieval area especially..

    Democracy = Alphabet AND Code of Laws AND Currency AND Mathematics
    Compass = Sailing AND Clockworks AND Education
     
  11. ls612

    ls612 Deity Moderator

    Joined:
    Mar 10, 2008
    Messages:
    8,072
    Location:
    America
    Updates:

    -Added 6 New Promotions
    -Modified the Guerilla promotion line based on Thunderbird's suggestions.
     
  12. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,563
    Gender:
    Male
    Location:
    MN
    More tech changes: Almost all based on Vokarya's in-put, thx.


    Renaissance Era and tweaks

    - Gunpowder = Education AND Invention
    - Humanism = Music AND Political Philosophy AND Printing Press
    - Mercantilism = Divine Right AND Drug Trade AND Navigation
    - Navigation = Astrolabe AND Cartography
    - Photography = Chemistry AND Physics AND Printing Press
    - Printing Press = Invention AND Paper AND Education
    - Realism = Liberalism AND Photography AND Romanticism
    - Scientific Method = Chemistry AND Printing Press AND Physics


    Industrial Era and tweaks

    - Antibiotics = Medicine AND Steam Power
    - Artillery = Explosives AND Semi-Automatic Weapons
    - Automatic Weapons = Industrialism AND Trench Warfare)
    - Flight = Balloon Warfare AND Combustion
    - Mass Transit = Communism AND Motorized Transportation
    - Motorized Transportation = Advanced Metallurgy AND Bicycles
    - Steam Power = Physics AND Replaceable Parts AND Scientific Method
    - Submarine Warfare = Advanced Metallurgy AND Automatic Weapons
    - Thermodynamics = Weather Forecasting AND Steam Power
     
  13. Vokarya

    Vokarya Deity

    Joined:
    Mar 25, 2011
    Messages:
    6,175
    OK. I understand now. My apologies. Maybe we can add some other technologies that would serve as additional prerequisites. I will keep updating my tree with your changes and see if anything else jumps out.
     
  14. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Updates
    - Luba Culture moved to Trade tech.
    - Polish Culture moved to Heraldry tech.
     
  15. Azurian

    Azurian The Azurian

    Joined:
    Apr 10, 2012
    Messages:
    2,092
    Location:
    Florida, USA
    Revision 2271

    Was playing a Custom Game and Robert Menzies (Australian Leader) shows up as a Pink Leaderhead in Sevopedia and Trade Screen.

    Updated to Revison 2275 (- Luba Culture moved to Trade tech.
    - Polish Culture moved to Heraldry tech.)

    Robert Menzies (Australian Leader) still shows up as a Pink Leaderhead in Sevopedia and Trade Screen..
     
  16. ls612

    ls612 Deity Moderator

    Joined:
    Mar 10, 2008
    Messages:
    8,072
    Location:
    America
    Post this in the Bugs/Crashes thread, not here. Thanks.
     
  17. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,563
    Gender:
    Male
    Location:
    MN
    Added Apache Civ, and new MLF
     
  18. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Just pushed:
    • Fixed crash when a unit gets -100% to city attack
    • Made changes to enemy pwer evaluation to alleviate the start-as-minors issues (hopefully)
     
  19. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Couple more changes:
    • Tweaked AI civic evaluation (see AI suggestions thread)
    • Fixed bug with recalculating modifiers when one of more cities are running processes (research etc.)
     
  20. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,563
    Gender:
    Male
    Location:
    MN
    First Group:

    Modern Era tweaks

    - Climate Models = 3D Modeling AND Ecology AND Long-Range Forecasting
    - Ecology = Agricultural Engineering AND (Nuclear Power OR Solar Power)
    - Gene Manipulation = Genetics AND Globalization
    - Genetics = Superconductors AND (Modern Health Care OR Paleontology)
    - Naval Aviation = Amphibious Warfare AND Aviation AND Radar
    - Recycling = Ecology AND Globalization
    - Unmanned Air Vehicles = Communication Networks AND Modern Warfare
    - Virtual Reality = 3D Modeling AND Extreme Sports

    2nd Group:


    Trans-Human Era Tweaks

    - Automated Traffic = Knowledge Management AND Neural Networks
    - Metamaterials = Nanotechnology AND Stealth
    - Quantum Teleportation = Fiber Optics AND Superstring Theory
    - Skyroads = Artificial Intelligence AND Automated Traffic AND Unmanned Air Vehicles
     

Share This Page