Easy Infinite Money Documentation

Easy Infinite Money 2.0.0
CelestiaDominance | Unreal Engine 5.7 and 5.8 | Windows 64-bit

PURPOSE
Manage large approximate game currencies in idle, clicker and incremental games. Use the Easy Infinite Money actor component for a wallet, or the BigNumber and utility libraries independently for calculations and UI. Bring your own UI, input, shops, rewards and save system; no Blueprint assets or demo maps are included.

QUICK WALLET EXAMPLE
Add an Easy Infinite Money component to your player, PlayerState or another appropriate actor. Configure Starting Money and Use Starting Money if you want a starting balance. Keep a reference to this component in your gameplay Blueprint.
From a reward event, call Add Money Int with 100. For a purchase costing 25, call Subtract Money Int and grant the item only if Return Value is true. Bind On Money Changed to update your widget using Get Money Display. Initialize the widget once when it binds, too; it may have missed an earlier change.
Each component is one wallet. For multiple currencies, add separate components and keep explicit references. Owning actors and their lifecycle determine when wallets exist; use your own SaveGame for persistence across travel or sessions.

BIG NUMBER REPRESENTATION AND LIMITS
FEIMBigNumber stores a double mantissa, an int64 decimal exponent and a sign. A normalized nonzero value has mantissa in [1,10) and exponent from -1,000,000 to +1,000,000. For example, Make BigNumber (Value + Magnitude) with 1.5 and 6 produces 1,500,000. Make BigNumber (String) also accepts decimal or scientific text such as 1.5e1000.
This is a bounded-range approximate number, not unlimited precision or exact accounting. It retains roughly 15-17 significant decimal digits. Small changes to a much larger balance can round away, and calculations performed in different orders can differ slightly. Integer conversion above the double's exact integer range is approximate. Do not use it for real-money accounting or a design requiring every last unit of an enormous balance to remain exact.
Arithmetic overflow saturates at the largest supported magnitude; underflow becomes zero. This applies to intermediate operations as well. Divide by zero returns zero for compatibility. NaN/infinite construction becomes zero. Double conversion saturates at the finite double limit and integer conversion clamps to int64 limits. Use Is Money Valid and the strict parsing functions for external data; do not use saturation as a business rule.
Operators normalize raw Blueprint struct fields. Prefer Make BigNumber nodes rather than manually editing the sign and mantissa. Equality compares the normalized representation exactly; it is not a nearly-equal comparison.

WALLET TRANSACTIONS
Set Money sets an absolute balance, constrained by Allow Negative Money and a positive enabled Max Money. It does not apply the earn multiplier.
Add Money accepts a nonnegative amount and applies Global Earn Multiplier. Zero multiplier disables additions. Its return is the resulting balance, not the amount added.
Subtract Money is an all-or-nothing spend unless Allow Negative Money is enabled. Negative/invalid amounts fail. Zero is a successful no-op.
Try Subtract Money can spend the remaining balance when insufficient: Return Value is false and Out Actual Amount reports the partial spend. Do not treat it like the all-or-nothing purchase node. With negative balances allowed, the full spend succeeds.
Multiply Money changes the existing balance directly. Add Percentage adds a positive percentage of the balance through the earn multiplier and returns the actual added amount after constraints.
Can Afford compares available funds to a nonnegative cost; it does not reserve funds. In multiplayer, validate and subtract together on the server when processing the purchase.
Reset Money returns to the configured starting value or zero and resets threshold tracking. It does not erase lifetime earned/spent totals. Use Load Full Save State with zero totals for an explicit new-economy reset.
Changes too small to affect the stored value cause no money-change event or history entry. Numerical precision and saturation still apply to transactions; stay comfortably inside the supported range for your economy.

PASSIVE INCOME
Set Passive Income Rate, Set Passive Income Multiplier and Set Passive Income Enabled control income. Effective rate is base rate x passive multiplier x global earn multiplier. Get Actual Passive Income Per Second reports this nominal rate when enabled.
Income accrues on the authoritative game instance after at least one second of component tick time, using the full accumulated interval. It follows game time, pause and time dilation; it does not provide offline or real-time earnings. Toggling income resets its fractional pending interval.
On Passive Income Tick reports the actual positive balance gain after the cap. A full wallet produces no income event. Get Time To Reach Target returns zero if reached, -1 without positive income or when a configured cap prevents reaching the goal, otherwise estimated game seconds. Rate estimates do not predict future changes or rounding losses.

EVENTS AND THRESHOLDS
On Money Changed supplies old value, new value and signed actual delta. On Money Gained fires when a nonpositive balance becomes positive. On Money Depleted fires when a nonzero balance becomes zero. On Max Money Reached fires when crossing to a positive enabled cap, including exact equality. On Insufficient Funds reports a failed full or partial spend.
Add Threshold creates a threshold with an optional ID. Reusing a nonempty ID replaces that entry. A threshold already satisfied when added is marked reached without firing immediately. Newly crossed thresholds fire once until reset. Configure unique IDs for save restoration. On Money Threshold Reached supplies the value; use Has Reached Threshold to query by ID.
Callbacks may remove or clear thresholds safely; already queued threshold events still complete. Financial changes attempted synchronously inside money, threshold, failure or passive-income callbacks are rejected to prevent recursive transactions and contradictory events. Schedule any follow-up reward/spend for the next game tick, or perform it outside the callback. Call these UObject APIs on the game thread.

DISPLAY AND CUSTOM UI
Get Money Display combines the component's default notation, decimal places, prefix and suffix. Get Money Formatted lets you choose Standard (K, M, B, T...), Scientific, Alphabetic (a..z, aa..), or Full Number. Full Number uses commas for smaller values and falls back to compact notation beyond exponent 15. Get Money Full Word uses magnitude words where known, otherwise scientific notation.
Decimal places are clamped to 0..6. Rounding can promote 999.999K to 1.00M. Tiny values fall back to scientific display rather than appearing as zero. Standard suffixes extend through known names and then alphabetic labels; Centillion is 10^303. Display labels are for presentation, not parsing or saving.
Format With Currency adds a preset prefix/suffix. These are cosmetic labels, not exchange rates or locale-aware accounting. Supply your own localized presentation if needed.
For a custom widget, expose a Money Component reference, read its current display text on initialization, and bind On Money Changed to refresh it. Unbind when replacing the wallet/widget. No fixed HUD is required.

SAVE AND RESTORE
Get Money Save String returns the balance as Mantissa|Exponent|Sign, using up to 17 significant digits for round-tripping the stored mantissa. Sign is 0 or 1. Store this string in your own SaveGame. Load Money From String validates first; malformed input returns false and leaves the wallet unchanged. A successful balance load applies current cap/negative-money rules, emits applicable change events, and does not count as earnings/spending or add a transaction history entry.
For fuller persistence, use Get Full Save State to obtain Money, Threshold IDs, Total Earned and Total Spent. Save all four values. After recreating/configuring the wallet and its threshold IDs, pass them to Load Full Save State. It validates all strings before changing anything, restores lifetime totals and reached IDs, clears transaction history, and applies the current wallet constraints. Unknown IDs are ignored; newly satisfied thresholds can fire. Restore after BeginPlay so Starting Money cannot overwrite the saved balance.
The snapshot does not include settings, passive-income timing, display configuration or transaction records. Store those separately if your design needs them. There is no automatic disk persistence, encryption, anti-tamper protection or offline reward system.
Try Parse Big Number accepts strict decimal/scientific text; Try Deserialize Big Number also accepts the pipe save format. Both return success and preserve their output value on failure. Formatted suffixes, thousands separators, junk, NaN, infinity and out-of-range exponents are rejected. Text is limited to 4,096 characters. Legacy Make BigNumber (String) and Deserialize Big Number return zero on failure; use the Try variants when zero and invalid input must be distinguished.
Valid legacy pipe saves remain readable. Old saves containing only a balance cannot reconstruct historical lifetime totals; initialize those explicitly when migrating.

HISTORY AND TOTALS
Transaction history is local and bounded to 0..1,000 entries by Max History Size. A nonpositive size keeps no entries. Reasons are capped at 1,024 characters and timestamps use world time. Get Last Transactions returns the most recent requested entries in chronological order.
Get Total Earned and Get Total Spent track actual balance increases/decreases since creation or full-state restoration, independently of history retention. Clear History does not clear totals. Set Money and Multiply Money count their actual deltas; configured starting funds and explicit save loads do not. These are economy statistics, not a financial audit ledger.

MULTIPLAYER
The component replicates by default, but its owning actor must also replicate. Keep Server Authority Only enabled. Execute rewards, spends, rate changes and restore operations on the server. This component does not turn an ordinary Blueprint call into a server RPC: route player requests through your own owned actor's validated server RPC, check the request and amount there, and call the wallet there.
Replicated data includes balance, lifetime totals, global/passive multipliers, passive rate/enabled state and max-cap configuration. Clients cannot spend or accrue authoritative funds through the component's mutation functions. Disabling Server Authority Only permits local changes that replication can later overwrite; this is unsuitable for an authoritative multiplayer economy.
Clients receive money-change-related events when a changed balance is replicated. Replication may combine multiple server changes; it is not a per-transaction event stream. Transaction history, threshold definitions/reached tracking and display settings are local. Configure matching thresholds where needed. Insufficient-funds and passive-income events originate where the operation executes; relay any additional client UI notification through your gameplay RPC/event system.
Replicated state is visible to clients for whom the owner is relevant. Use owner-only actor relevancy for private wallets when appropriate. The plugin is not a complete anti-cheat system; validation, ownership, relevancy and persistence belong to your game.

ECONOMY UTILITIES
Calculate Upgrade Cost uses Base Cost x Multiplier^Current Level. Calculate Total Upgrade Cost sums prices from Current Level up to, excluding, Target Level. Calculate Affordable Upgrades returns a count, bounded by the remaining int32 level range. Negative starting levels are treated as zero. Invalid/negative base costs or nonpositive/nonfinite multipliers return zero; the affordability helper also returns zero for a zero base cost. Bulk calculations use logarithmic-time composition/search, so they do not loop once per upgrade. Results remain approximate and bounded by the number range.
Calculate Compound Interest takes a fractional rate (0.1 means 10%) and nonnegative periods; negative periods behave as zero. Rates below -1 or nonfinite rates return zero. Calculate Income Per Second combines base income, generator count and multiplier.
Progress helpers produce normalized progress, a color or a time-to-goal label. They are estimates for UI and do not reserve funds or perform purchases.

C++ AND DEPENDENCIES
Include EIMBigNumber.h, EIMMoneyComponent.h or EIMUtilities.h as needed, and add EasyInfiniteMoney to your module dependencies. Use FEIMBigNumber arithmetic or the same component methods exposed to Blueprint. The descriptor is EasyInfiniteMoney.uplugin. No additional Unreal plugins or third-party SDKs are required; native dependencies are Core, CoreUObject and Engine.

Support: https://discord.gg/9Zc4wbwqG9