Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(gameengine): ai income rises when falling behind
Olcay Seygan74e0a41ce250
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f69e0fe2c..6c65baf8e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -25,9 +25,10 @@ found and fixed, EA's own, not port damage.**- You pick for your own seat and the host picks for the computer seats, the way colour and team already work. The pick is in the replay and the saved game, and a room that leaves the column at 100% plays and replays as it did.- Promotions and armour research still come on top, at the seat's share: an Elite Paladin with Composite Armor reads 364 at 50% against 728 at 100%. A vehicle stolen from a handicapped player moves to its new owner's column and keeps its share of health, so a Humvee at 80 of 120 becomes 160 of 240 with no damage dealt and no repair given.-## Computer players earn half as much again+## Computer players earn half as much again, and more when they fall behind- A computer player in a skirmish or a network match earns half as much again as you would, on every difficulty, where it used to earn double. A truckload worth 75 banks 112, and the 1000 for capturing an oil derrick is 1500. It counts everything the computer makes by playing: supply docks, oil derricks and other tech buildings, black markets, drop zones, hackers, bounties, crates, salvage and stolen cash.+- A computer that falls behind earns more. Every thirty seconds it weighs what it owns, its army, its base and its bank at their prices, against the strongest enemy still in the match. Level or ahead, it stays at half again. Behind, it gains up to 25 points of income at each weighing, toward double at three quarters of the enemy's worth and triple at a quarter and below, so a computer that is being crushed reaches triple in three minutes. It gives the points back the same way as it catches up.- The score screen and its charts show what the computer would have earned without the bonus, so its money earned reads against yours on the same terms.- Money it gets back stays what it was. Selling a building or cancelling a queue returns the same sum as yours does, or a computer could queue and cancel its way to a fortune, and cash from a map's script or from an ally gets no bonus either. The money figure floating over a computer's truck or building shows what it really banked.- Your own income does not change, and your cut of a computer ally's income under Share Income is the plain cut. Campaign missions and Generals' Challenge opponents earn what they always did.@@ -255,7 +256,7 @@ found and fixed, EA's own, not port damage.**- Seven computers against one strong player now count each other. Each used to weigh its own army against all of yours, decide it was outmatched and go on the defensive. When a computer now decides whether to defend, it adds its allies' armies, Hard all of them, Medium three quarters and Easy half, and counts your allies against it the same way. Replays recorded before this change play out differently.- You can call them too. A beacon you place asks your computer allies to attack there, and typing `help`, `attack` or `money` in chat (`yardim`, `saldir`, `para` in Turkish) asks for help where you are looking, an attack there, or cash.- Or without typing a word. Alt+Z asks your allies to attack the spot under the pointer, Alt+X to come and defend it, Alt+V for money, and Alt+C only marks a spot to look at. The pointer can be on the radar as well. People on your team see the smoke, the radar ping and a line in the chat; computer allies with a personality act on it, in a skirmish against the computer too, where the keys used to do nothing. The keys come from the launcher and move on its Hotkeys page like any other.-- A personality is a preference, never a bonus: every computer earns the same half-again income, and no personality adds money, faster building or tougher units to it.+- A personality is a preference, never a bonus: every computer earns the same half-again income and the same catch-up bonus, and no personality adds money, faster building or tougher units to it.- Computer players with a personality now and then say something in chat, in their own voice, at most once every two and a half minutes. Normal ones stay quiet.- An Infantry computer player no longer crashes the game while one of its factories researches an upgrade. Shopping for a troop carrier, it read the upgrade in the queue as if it were a vehicle.- The choice travels with the game to every player in a LAN or online match and into the replay. Replays and saves from earlier versions load with every computer player on Normal; a save made with this version does not load in an earlier one.@@ -766,7 +767,7 @@ found and fixed, EA's own, not port damage.**## Three difficulty levels, and one open advantage- Easy, Medium, Hard, the three the game has always had. There were six for a while, with a rung either side of Medium and one above the top; they are gone again, and nothing above the top went with them - Hard now plays what the top of that six-rung ladder played. For a while the top rung was called Brutal on the seat list; it is Hard again, the name the box always printed.-- Every computer player earns half as much again as its trucks, derricks and other income would pay you, on all three levels, and that is the only rule bent for it. No level gets cheaper units, faster building, longer vision or tougher units. What changes between levels is what the computer is allowed to decide: how often it looks at the map, how long it takes to react, whether it counters what you field, whether it masses before attacking, whether it pulls damaged units out.+- Every computer player earns half as much again as its trucks, derricks and other income would pay you, on all three levels, and up to triple while it falls behind, and that is the only rule bent for it. No level gets cheaper units, faster building, longer vision or tougher units. What changes between levels is what the computer is allowed to decide: how often it looks at the map, how long it takes to react, whether it counters what you field, whether it masses before attacking, whether it pulls damaged units out.- Hard used to break that promise without saying so. EA's skirmish scripts handed a Hard computer four free cash drops as the match went on, 10,000 early (5,000 for the GLA), another 10,000, then 15,000 and 20,000 late: up to 55,000 a game that no truck ever hauled. Every general had them. They are switched off, so Hard's bank is what its trucks and oil derricks bring in, doubled like every computer's. The other grants in those scripts, the ones that pay for its first buildings, are untouched.- A computer that is losing keeps its base. EA's scripts had every general sell off every building it owned the moment its bank fell under 2,000 with no truck, supply building or oil derrick left, or once its last dozer, command centre and factory were gone. Ten seconds later the whole base turned into cash and the match ended on an empty field instead of a fight. That is switched off for all twelve generals at every level, so you finish a beaten opponent by knocking its buildings down.- Easy looks around and answers late, a little sooner than it used to, and it sends its supply trucks to fit the piles. It never pulls a unit out, never builds against what you field, and stops once the opening base is up. Normal reacts a bit sooner, starts spending once the bank passes 6,000, where it used to wait for 10,000, and answers about half of what you field. A unit that is personally finished still leaves, and it still goes out for a second supply pile. Factories past the opening list stay a Hard behaviour. Hard is the opponent with nothing held back: no reaction delay at all, it builds against what it can see you fielding, it gathers an army before it commits it, and it takes a losing team off the field. Replays recorded before this change play out differently.diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Player.h b/GeneralsMD/Code/GameEngine/Include/Common/Player.hindex efe278fbe..c80ff707b 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/Player.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/Player.h@@ -189,6 +189,13 @@ UnsignedInt IncomeAllyShare( UnsignedInt amount, Int sharers );// a bonus on a refund is a queue and cancel money loop. The score keeper counts the plain amount.UnsignedInt EarnedAmount( UnsignedInt amount, Int percent );+// The falling-behind bonus a skirmish computer is owed over its rung's percent, in points, with its own+// strength against its strongest living enemy's: 0 while it holds level, rising in a line to+// AI_INCOME_BONUS_MAX at a quarter of it and below. Integers only.+Int IncomeBonusTarget( Int ownStrength, Int strongestEnemyStrength );+// One weighing's move from the bonus it has toward that target, at most AI_INCOME_BONUS_STEP.+Int IncomeBonusStep( Int bonus, Int target );+// Pro Rules, PRO-RULES.md: what every skirmish and network match refuses whoever plays it.// GameLogic::isProRules() says whether a match is under them; these say what they cover, by name// or by type, so a test can ask them without a match.@@ -413,7 +420,7 @@ public:UnsignedInt earnIncome( UnsignedInt amount, Bool fromTechBuilding );/// money made by playing that nobody shares - a capture bonus, a crate, a bounty, stolen cash - banked and scored. Returns what it came toUnsignedInt earnMoney( UnsignedInt amount );- /// what this player banks of what it earns by playing, in percent: its rung's IncomePercent for a skirmish AI, 100 for anyone else+ /// what this player banks of what it earns by playing, in percent: its rung's IncomePercent plus its falling-behind bonus for a skirmish AI, 100 for anyone elseInt incomePercent( void );UnsignedInt getSupplyBoxValue();///< Many things can affect the alue of a crate, but at heart it is a GlobalData ratio.diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.hindex 33552e922..6b1e27ead 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h@@ -146,7 +146,8 @@ public:* every shipped map and .scb, into the campaign's stat bonus tables and into network messages.* This one answers "how well does it play". No rung has a build-rate, vision or stat handicap, in* either direction. Income is the one bonus: a skirmish AI banks its rung's IncomePercent of what it- * earns by playing (Player::earnMoney), 150 on every rung. Keeping it a separate enum is what lets a rung be+ * earns by playing (Player::earnMoney), 150 on every rung and up to 300 while it falls behind its+ * strongest enemy (AIPlayer::stepIncomeBonus). Keeping it a separate enum is what lets a rung be* tuned in AI.ini without touching what a map's scripts do.* See AI-ROADMAP.md sections D6, D7 and D10.*/@@ -304,7 +305,7 @@ struct AIDifficultyProfileReal m_expansionReach; ///< how far from home, or from one of those bases, a supply center of its own choosing may go// Income: the one bonus on the ladder (Player::incomePercent)- Int m_incomePercent; ///< what a skirmish AI banks of what it earns by playing, in percent; the score screen counts the 100+ Int m_incomePercent; ///< what a skirmish AI banks of what it earns by playing, in percent, before the falling-behind bonus; the score screen counts the 100};//-------------------------------------------------------------------------------------------------@@ -903,6 +904,12 @@ const UnsignedInt AI_PURCHASE_HOLD_FRAMES = 40 * LOGICFRAMES_PER_SECOND;/** How long a stretch of income is measured over before the rate is taken again. */const UnsignedInt AI_INCOME_WINDOW_FRAMES = 30 * LOGICFRAMES_PER_SECOND;+/** The falling-behind income bonus (AIPlayer::stepIncomeBonus): how often it is weighed again, how far+ * it moves at one weighing, and its ceiling over the rung's IncomePercent, in percentage points. */+const UnsignedInt AI_INCOME_BONUS_FRAMES = 30 * LOGICFRAMES_PER_SECOND;+const Int AI_INCOME_BONUS_STEP = 25;+const Int AI_INCOME_BONUS_MAX = 150;+/** The bank a computer player keeps: seconds of its income, and never under the floor. */Int aiBankTarget( Real incomePerSecond, Real seconds, Int floor );diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/AIPlayer.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/AIPlayer.hindex 7cbf5fb42..20a01dc41 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/AIPlayer.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/AIPlayer.h@@ -265,6 +265,7 @@ public:* independent axes: the rung says how well, the role says what. See AI-ROADMAP.md D6/D8. */AISkillLevel getAISkillLevel(void) const {return m_skillLevel;}void setAISkillLevel(AISkillLevel level) {m_skillLevel = level;}+ Int getIncomeBonus(void) const {return m_incomeBonus;} ///< points over the rung's IncomePercent while it falls behind (stepIncomeBonus)AIRole getAIRole(void) const {return m_role;}/** The third axis, how it plays: set once from the seat at the start of the match, after the role is@@ -396,6 +397,8 @@ protected:void trainFavoured(void); ///< a personality's favoured units, below the bank target as wellvoid buyPersonaTransports(void); ///< an Infantry AI's ground transports, a few by rungvoid sendPersonaTransports(AIGroup *wave); ///< ... driven loaded to a wave's front, riders put down there+ void stepIncomeBonus(void); ///< weigh its strength against its strongest enemy and move m_incomeBonus a step toward what that is owed+ Int m_incomeBonus; ///< points over the rung's IncomePercent, 0 to AI_INCOME_BONUS_MAXInt m_incomeMark; ///< money earned in all, when the income was last measured ...UnsignedInt m_incomeMarkFrame; ///< ... and the frame, 0 for neverInt m_bankMark; ///< ... and the bank thendiff --git a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cppindex e3a067635..e84ecfab4 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/RTS/Player.cpp@@ -3596,9 +3596,26 @@ UnsignedInt EarnedAmount( UnsignedInt amount, Int percent )return amount * (UnsignedInt)percent / 100;}+Int IncomeBonusTarget( Int ownStrength, Int strongestEnemyStrength )+{+ if( strongestEnemyStrength <= 0 || ownStrength >= strongestEnemyStrength )+ return 0;+ const Int bonus = (Int)( (Int64)4 * AI_INCOME_BONUS_MAX * ( strongestEnemyStrength - ownStrength ) / ( (Int64)3 * strongestEnemyStrength ) );+ return bonus < AI_INCOME_BONUS_MAX ? bonus : AI_INCOME_BONUS_MAX;+}++Int IncomeBonusStep( Int bonus, Int target )+{+ if( target > bonus + AI_INCOME_BONUS_STEP )+ return bonus + AI_INCOME_BONUS_STEP;+ if( target < bonus - AI_INCOME_BONUS_STEP )+ return bonus - AI_INCOME_BONUS_STEP;+ return target;+}+Int Player::incomePercent( void ){- return isSkirmishAIPlayer() ? TheAI->getDifficultyProfile( getAISkillLevel() )->m_incomePercent : 100;+ return isSkirmishAIPlayer() ? TheAI->getDifficultyProfile( getAISkillLevel() )->m_incomePercent + m_ai->getIncomeBonus() : 100;}UnsignedInt Player::earnMoney( UnsignedInt amount )diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cppindex cdde08d82..8dd0d5221 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp@@ -1392,7 +1392,8 @@ Real AI::getAdjustedVisionRangeForObject(const Object *object, Int factorsToCons* late, at twenty minutes, so it is rare; Medium two from twelve; Hard every empty start from seven.** inc%, 2026-11-02. The owner: 1.5x on everything a skirmish AI earns by playing, the same on every- * rung, in place of the flat double it had. Player::earnMoney and earnIncome bank it; the score+ * rung, in place of the flat double it had, and up to 150 points more while it falls behind its+ * strongest enemy (AIPlayer::stepIncomeBonus). Player::earnMoney and earnIncome bank it; the score* screen and its charts count the money before the bonus.** scoutS maxSc decis cntr mass ttk indiv team infl focus save harv expand guard hoard econ micro gate answer massU bankS floor payoff upgr nonc share backlog push minPow siege beam strikeE strikeT swDef stall lost retry stage spot arty inflS fireLook word odds fireMem watch watchOdds dodge 2ndS 2nd reach inc% */diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cppindex 5cf7a0369..3f97055c3 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp@@ -399,6 +399,7 @@ m_role(AIROLE_AGGRESSIVE)}m_ambulanceLost = 0;m_ambulancesBought = 0;+ m_incomeBonus = 0;m_incomeMark = 0;m_incomeMarkFrame = 0;m_bankMark = 0;@@ -5731,6 +5732,8 @@ void AIPlayer::update( void )AI_PHASE( AIP_TEAM, doTeamBuilding() ); // See if it's time to start another team.AI_PHASE( AIP_UPGRADE, doUpgradesAndSkills() ); // See if it's time to build an upgrade or buy a skill.AI_PHASE( AIP_BRIDGE, updateBridgeRepair() ); // Handle any bridge repairs.+ if( isSkirmishAI() && TheGameLogic->getFrame() % AI_INCOME_BONUS_FRAMES == 0 )+ stepIncomeBonus(); // Earn more while it falls behind.// Everything below is the skirmish AI's own. A Challenge or mission opponent is handed its money,// its base, its attacks and its superweapon by the map script, which is the whole of its difficulty:// run on top of that, Kwai's $30000 stood three nuclear silos a minute into the match. So is a@@ -8429,6 +8432,51 @@ Bool AIPlayer::purchaseQueueOn( void )return runsOwnAI() && getSkillProfile()->m_bankTargetSeconds > 0.0f;}+static void addStandingValue( Object *obj, void *userData )+{+ if( !obj->isEffectivelyDead() )+ *(Int *)userData += obj->getTemplate()->calcCostToBuild( obj->getControllingPlayer() );+}++/** What a player is worth to the income bonus: everything of its own still standing at its price, and+ * the bank. Logic state only, so every machine weighs the same. */+static Int incomeStrength( Player *player )+{+ Int strength = (Int)player->getMoney()->countMoney();+ player->iterateObjects( addStandingValue, &strength );+ return strength;+}++//----------------------------------------------------------------------------------------------------------+/** The owner, 2026-11-02: a computer that starts losing earns more. Every AI_INCOME_BONUS_FRAMES it weighs+ * itself against the strongest enemy still in the match and moves the bonus a step toward what+ * IncomeBonusTarget says that is owed, so the percent climbs and falls by at most AI_INCOME_BONUS_STEP+ * points at a time. The score screen still counts the plain amount. */+//----------------------------------------------------------------------------------------------------------+void AIPlayer::stepIncomeBonus( void )+{+ Int strongest = 0;+ for( Int i = 0; i < ThePlayerList->getPlayerCount(); ++i )+ {+ Player *other = ThePlayerList->getNthPlayer( i );+ if( other != m_player && other->isPlayableSide() && other->isPlayerActive()+ && m_player->getRelationship( other->getDefaultTeam() ) == ENEMIES )+ {+ const Int strength = incomeStrength( other );+ if( strength > strongest )+ strongest = strength;+ }+ }+ const Int own = incomeStrength( m_player );+ const Int bonus = IncomeBonusStep( m_incomeBonus, IncomeBonusTarget( own, strongest ) );+ if( bonus == m_incomeBonus )+ return;+ DEBUG_LOG(( "AI INCOME frame %d player %d worth %d against %d, income %d%% -> %d%%\n",+ TheGameLogic->getFrame(), m_player->getPlayerIndex(), own, strongest,+ m_player->incomePercent(), m_player->incomePercent() - m_incomeBonus + bonus ));+ m_incomeBonus = bonus;+}+Int AIPlayer::bankTarget( void ){const AIDifficultyProfile *profile = getSkillProfile();@@ -9936,13 +9984,15 @@ void AIPlayer::doSpending( void )}m_producedSincePass.clear();- // the income, off what the score screen counts as earned (gathered, hacked, captured and given) with- // the rung's income bonus put back on, so it plans on what it banks+ // the income, off what the score screen counts as earned (gathered, hacked, captured and given), with+ // the income bonus it has now put back on the window so it plans on what it banks; the bonus moves+ // once every 30 seconds, so a window rarely spans two of themconst Int bank = (Int)m_player->getMoney()->countMoney();- const Int earned = (Int)( (Int64)m_player->getScoreKeeper()->getTotalMoneyEarned() * m_player->incomePercent() / 100 );+ const Int earned = m_player->getScoreKeeper()->getTotalMoneyEarned();if( now - m_incomeMarkFrame >= AI_INCOME_WINDOW_FRAMES ){- const Real window = INT_TO_REAL( earned - m_incomeMark ) * LOGICFRAMES_PER_SECOND / INT_TO_REAL( now - m_incomeMarkFrame );+ const Real window = INT_TO_REAL( earned - m_incomeMark ) * INT_TO_REAL( m_player->incomePercent() ) / 100.0f+ * LOGICFRAMES_PER_SECOND / INT_TO_REAL( now - m_incomeMarkFrame );const Int bankWindowAgo = m_bankMark;m_incomePerSecond = m_incomeMarkFrame == 0 ? window : 0.5f * (m_incomePerSecond + window);m_incomeMark = earned;@@ -19099,7 +19149,7 @@ void AIPlayer::xfer( Xfer *xfer ){// version- XferVersion currentVersion = 34; // 34: the word of a launch not yet acted on 2: scout 3: rung and role 4: scouting stamps 5: the capturer 6: parked waves 7: superweapon aims 8: the hijacker 9: tactical steps 10: the ferry and dropped riders 11: the outward placement ring 12: the pressure level 13: falling back 14: gunship Chinooks and the boarding wait 15: transport Chinooks and the lent one 16: healer and raider Helixes 17: the seen-enemy ledger 18: the fist 19: the Ambulances 20: the last Ambulance lost 21: the purchase queue's reservation 22: the measured income 23: the Ambulances bought 24: the starting fortune 25: the factory backlog clocks 26: the personality 27: the team request inbox 28: the last aircraft refused for parking 29: the watched sites and the cooled spots 30: the factory backlog as a window of passes 31: the factories that let a unit out since the last pass 32: the guns known by their shells, the answers to fire 33: the influence map being stamped+ XferVersion currentVersion = 35; // 35: the falling-behind income bonus 34: the word of a launch not yet acted on 2: scout 3: rung and role 4: scouting stamps 5: the capturer 6: parked waves 7: superweapon aims 8: the hijacker 9: tactical steps 10: the ferry and dropped riders 11: the outward placement ring 12: the pressure level 13: falling back 14: gunship Chinooks and the boarding wait 15: transport Chinooks and the lent one 16: healer and raider Helixes 17: the seen-enemy ledger 18: the fist 19: the Ambulances 20: the last Ambulance lost 21: the purchase queue's reservation 22: the measured income 23: the Ambulances bought 24: the starting fortune 25: the factory backlog clocks 26: the personality 27: the team request inbox 28: the last aircraft refused for parking 29: the watched sites and the cooled spots 30: the factory backlog as a window of passes 31: the factories that let a unit out since the last pass 32: the guns known by their shells, the answers to fire 33: the influence map being stampedXferVersion version = currentVersion;xfer->xferVersion( &version, currentVersion );@@ -19640,6 +19690,9 @@ void AIPlayer::xfer( Xfer *xfer )if( version >= 34 )xfer->xferUnsignedInt( &m_strikeNoticeFrame );+ if( version >= 35 )+ xfer->xferInt( &m_incomeBonus );+} // end xfer// ------------------------------------------------------------------------------------------------diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex f7cc0d6c8..4eb902a85 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -2404,6 +2404,26 @@ TEST(skirmish_ai_earnings_by_rung_percent)CHECK_EQ( EarnedAmount( 75, 150 ), 112u );}+/* Player.cpp: the falling-behind bonus, points over the rung's percent, and its step at one weighing. */+TEST(skirmish_ai_earnings_bonus_when_behind)+{+ /* level or ahead, or no enemy left: none */+ CHECK_EQ( IncomeBonusTarget( 1000, 1000 ), 0 );+ CHECK_EQ( IncomeBonusTarget( 3000, 1000 ), 0 );+ CHECK_EQ( IncomeBonusTarget( 1000, 0 ), 0 );+ /* three quarters of the enemy: 200 percent on a 150 rung; half of it: 250 */+ CHECK_EQ( IncomeBonusTarget( 750, 1000 ), 50 );+ CHECK_EQ( IncomeBonusTarget( 500, 1000 ), 100 );+ /* a quarter of it and below: the ceiling, 300 percent */+ CHECK_EQ( IncomeBonusTarget( 250, 1000 ), 150 );+ CHECK_EQ( IncomeBonusTarget( 0, 1000 ), 150 );+ /* 25 points a weighing, either way, and straight onto a target that close */+ CHECK_EQ( IncomeBonusStep( 0, 150 ), 25 );+ CHECK_EQ( IncomeBonusStep( 140, 150 ), 150 );+ CHECK_EQ( IncomeBonusStep( 150, 0 ), 125 );+ CHECK_EQ( IncomeBonusStep( 5, 0 ), 0 );+}+/* ExperienceTracker.cpp: a kill's experience split by the damage each attacker dealt. */TEST(kill_xp_splits_by_damage_and_the_killing_blow_keeps_the_remainder){diff --git a/README.md b/README.mdindex ab0787b27..59078ad87 100644--- a/README.md+++ b/README.md@@ -2,7 +2,7 @@EA published the source of Command & Conquer: Generals and Zero Hour in February 2025. Zero HourReforged is that source worked on as a game: around sixty bugs EA shipped in 2003 fixed, a computer-opponent that builds a base (1.5x income, no other edge), a Direct3D 11 renderer, a new interface and+opponent that builds a base (1.5x income, more when it falls behind, no other edge), a Direct3D 11 renderer, a new interface andmods that load side by side. Windows x64 players install it through a free launcher; macOS and Linuxbuild it from this repository.