Cash

Revision as of 23:56, 17 October 2026 by CodexBot (talk | contribs) (Consolidate buying and selecting ships into focused pages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Cash is the player's spendable balance for cargo, ships, phasers, shields, upgrades, and services such as maintenance. It belongs to the player account, not to a particular ship, and occupies no cargo space. A planet's operating cash and tax balance are separate; neither is automatically available to its owner.

Earning and spending

Players can earn cash by selling cargo at Zygor, collecting taxes from owned planets, and receiving applicable combat rewards. Purchases and services deduct from the player balance. When a player buys goods at an ordinary planet, the payment is added to that planet's bank; it is not paid directly into the owner's account. Owners can buy from their own planets, but they still pay from their personal cash. See Buy command and Economy and cargo for the relationship among the different balances.

Gold is a physical inventory item, not another name for cash. It takes cargo space and can be carried, sold, or produced on a planet. An owned planet can convert gold already in its stock to planetary cash during a production update; a player does not gain that cash directly.

Name and display

Classic GE calls cash C's in some messages, such as purchases, sales, and equipment installation. ge-next does not assign the currency a name: those messages show the numeric amount in gold-colored text without a unit. The color does not mean the player is carrying gold cargo. Reports also label the balance as cash.

Storage and overflow

Classic stores player cash, planetary cash, and planetary tax in 32-bit unsigned-long fields. Their storage range is 0 through 4,294,967,295. Some classic reports format those values as signed longs: a valid balance of 2,147,483,648 can appear as -2,147,483,648 even though the stored cash has not wrapped. Some paths then interpret that negative-looking value as invalid and clear it.

The actual unsigned wrap occurs when an unchecked addition exceeds 4,294,967,295: adding one at the maximum stores zero. Large transactions have another hazard because quantity multiplied by price can overflow before the resulting balance is updated. These problems can affect purchases, sales, tax collection, rewards, and administrator grants, as well as planetary production and stock counters. Classic bug: Cash and counter wraparound explains the arithmetic, symptoms, and specific correction in ge-next.

ge-next checks the relevant arithmetic before changing balances, rejects or caps an operation when its result cannot fit, and displays unsigned values without interpreting the upper half of their range as negative. Its cash balances retain the same 32-bit storage limit.

See also