Announcement

Collapse
No announcement yet.

Gold problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gold problems

    Hi,

    I've been having some problems figuring out the commerce numbers in the empire manager...

    I always thought all commerce income from your cities are added, then wages, crime and maintenance costs are deducted. The remainder is divided between science and treasury. The situation on the picture proves this wrong however. I have enough income to pay for crime, wages and maintenance, but if I were to click on 'End Turn' now, I get the warning that I don't have enough money for maintenance and that city improvements will be sold. In addition, the amount that goes to science doesn't make sense. It's BIGGER than the income itself. Can science related city improvements be responsible? Or specialists? The discrepancy is pretty big.

    So, how does it all work.

    1) is the number for 'Collected' in the empire manager the amount of commerce collected the previous turn? If I switch some cities' production to capitalization, the number doesn't change, this is why I suspect the number does not reflect the current turn.

    2) when a turn is being processed, in what order do things occurr. Are all incomes first added up (with the exception of income from outposts, cartels etc, which are calculated separately and added to treasyry directly) after which the costs for crime, wages and maintenance are deducted? Are these three deducted from the the income of that turn, or from the - bigger - nationale treasury? Answers to these questions can be very important when in a tight spot (i.e. with not much gold in treasury).

    3) What's up with that strange science number? Is science deducted from each turn's income minus wages, crime and maintenance, and are any extra's from specialists, wonders, city imps added immediately after that?

    Thanks for any info on this.

    Tellius
    Attached Files
    Only tyrants need worry about tyrant-killers

  • #2
    I faced this problem as well. I'll dig up and post the code so we can track this thing down.

    The other thing is that I really think we beed to add more info on the window you posted. It would be great to see how many shields you get from franchising, gold from conversions etc. something for the future
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • #3
      Originally posted by E
      The other thing is that I really think we beed to add more info on the window you posted. It would be great to see how many shields you get from franchising, gold from conversions etc. something for the future
      Actually a window from the playtest version would be much more helpful, since Activision's version show at some windows gross values instead of net values.

      -Martin
      Civ2 military advisor: "No complaints, Sir!"

      Comment


      • #4
        going through my city and unit gold stuff I've had to revisit this problem. Here's the interface ccode:

        Code:
        void CauseAndEffectTab::UpdateCommerceValues()
        {
        	
        	sint32 totalCommerce = 0, totalCommerceCrime = 0,
        		totalCommerceWages = 0, totalCommerceBuildingUpkeep = 0,
        		totalCommerceScience = 0, totalCommerceSavings = 0;
        
        	
        	Player *player = g_player[g_selected_item->GetVisiblePlayer()];
        
        	
        	
        	
        	UnitDynamicArray *cityList = player->GetAllCitiesList();
        	for(int cityIndex = 0; cityIndex < cityList->Num(); cityIndex++) {
        		
        		CityData *cityData = (*cityList)[cityIndex].GetData()->GetCityData();
        
        		
        		sint32 commerce = static_cast(cityData->GetGrossCityGold()); //why is this citydata and not player?
        
        		
        		sint32 commerceCrime = cityData->GetTradeCrime();
        
        		
        		sint32 commerceWages = cityData->CalcWages(
        			static_cast(player->GetWagesPerPerson()));
        
        		
        		sint32 commerceBuildingUpkeep = buildingutil_GetTotalUpkeep(
        			cityData->GetImprovements(),
        			wonderutil_GetDecreaseMaintenance(player->m_builtWonders), player->GetOwner());
        
        		
        		commerceWages += player->CalcUnitSupportGold();  //calculates Unit GoldHunger
        		commerceBuildingUpkeep += player->CalcCitySupportGold();  //calculates city maintenance
        		
        		sint32 commerceScience = cityData->GetScience();
        
        		
        		sint32 commerceSavings = cityData->GetNetCityGold();
        
        		commerce += player->CalcWonderGold();
        		commerce += player->CommodityMarket(); 
        
        		//totalCommerceSavings += player->CalcWonderGold();
        		//totalCommerceSavings += player->CommodityMarket();  
        
        		
        		totalCommerce += commerce;
        		totalCommerceCrime += commerceCrime;
        		totalCommerceWages += commerceWages;
        		totalCommerceBuildingUpkeep += commerceBuildingUpkeep;
        		totalCommerceScience += commerceScience;
        		totalCommerceSavings += commerceSavings;
        	}
        
        	
        //	sint32 subTotal = totalCommerceCrime + totalCommerceWages +
        //		totalCommerceBuildingUpkeep;
        
        	
        
         
        	
        	static char stringBuffer[16];
        	static char formatBuffer[64];
        
        	
        	sprintf(stringBuffer, "%d", totalCommerce);
        	m_detailsCommerceTotal->SetText(stringBuffer);
        	m_summaryCommerceTotal->SetText(stringBuffer);
        	sprintf(stringBuffer, "%d", totalCommerceCrime);
        	m_detailsCommerceCrime->SetText(stringBuffer);
        	sprintf(stringBuffer, "%d", totalCommerceWages);
        	m_detailsCommerceWages->SetText(stringBuffer);
        	sprintf(stringBuffer, "%d", totalCommerceBuildingUpkeep);
        	m_detailsCommerceBuildingUpkeep->SetText(stringBuffer);
        	sprintf(stringBuffer, "%d", totalCommerceScience);
        	m_detailsCommerceScience->SetText(stringBuffer);
        	m_summaryCommerceScience->SetText(stringBuffer);
        	sprintf(stringBuffer, "%d", totalCommerceSavings);
        	m_detailsCommerceSavings->SetText(stringBuffer);
        	m_summaryCommerceSavings->SetText(stringBuffer);
        
        	
        	sint32 happiness = static_cast(
        		Happy::CalcCityIndependentWages(player));
        	sprintf(stringBuffer, "%d", happiness);
        	m_commerceHappinessValue->SetText(stringBuffer);
        	SetHappinessIcon(m_commerceHappinessIcon, happiness);
        
        	sprintf(formatBuffer, "EMPIRE_COMMERCE_AMOUNT_%i",
        		(int) player->GetUnitlessWages()+k_ZERO_FOUR__NEG_TWO_TWO_CONVERSION);
        	sprintf(stringBuffer, "%s%s", g_theStringDB->GetNameStr(formatBuffer),
        		g_theStringDB->GetNameStr("EMPIRE_COMMERCE_AMOUNT_UNIT"));
        	m_commerceCurValue->SetText(stringBuffer);
        }

        things just don't match up. I may have to do some tweaking and maybe add some more text like what kind of wonder gold your getting
        Formerly known as "E" on Apolyton

        See me at Civfanatics.com

        Comment

        Working...
        X