Level Up! (Rewamped)

by kudziak

Get experience for in-game actions while you play, and pick from a randomized selection of perks on level up, roguelike-style. [fork of Level Up!]

Tweaks
8 days ago
2.0
424
Combat Character Enemies Mining Manufacturing Power Storage

Changelog

Version: 1.0.20
Date: 12. 04. 2026
  Bugfixes:
    - Fixed crash on existing saves after the 1.0.19 performance fix. storage.sem_levelup_beacon_queue was only initialized in on_init (new games) and on_configuration_changed, but entity placement events could fire before migration on some save states, causing "attempt to index field 'sem_levelup_beacon_queue' (a nil value)". Both entity handlers and the tick drain now self-initialize the queue if nil.
Version: 1.0.19
Date: 12. 04. 2026
  Bugfixes:
    - Fixed severe performance drop when placing large blueprints. Entity placement events (on_robot_built_entity, on_player_built_entity) previously called ensureGlobalBeaconAt synchronously for every entity, causing thousands of Factorio API calls per tick when placing blueprints with many objects. Beacon grid cell checks are now deferred into a queue and drained once per tick, so N entities placed in the same 128x128 grid cell cost one beacon check instead of N. Also reduced the per-call cost of the fast path in ensureGridBeacon by replacing slot-by-slot module iteration with a single inv.is_empty() check.
Version: 1.0.18
Date: 31. 03. 2026
  Bugfixes:
    - Fixed multiplayer desync triggered when enemies attack and destroy buildings. All uses of force.connected_players in game-state mutation contexts (on_entity_died kill-heal, time XP, roaming beacons, grid beacon coverage, heal_comfort/combat_robots/stand_still on-tick handlers) have been replaced with force.players. connected_players is a network concept that returns different player lists on the server and each client, causing CRC divergence whenever it drives health, XP, or entity mutations. force.players is fully deterministic; the existing player.character validity guards already skip offline players.
Version: 1.0.17
Date: 31. 03. 2026
  Bugfixes:
    - Fixed crash introduced in 1.0.16: LuaInventory.locked does not exist in Factorio 2.0. Replaced the script-side inv.locked approach with the prototype flag flags={"no-automated-item-removal"} on all six hidden beacon entities in data.lua, which prevents inserters and logistic bots from extracting modules without any runtime overhead.
Version: 1.0.16
Date: 30. 03. 2026
  Bugfixes:
    - Fixed inserters being able to extract internal perk modules (e.g. sem-levelup-overclock-module) from hidden beacon entities. All beacon module inventories are now locked immediately after modules are inserted, preventing any inserter or player interaction while still allowing script-side reads and writes.
Version: 1.0.15
Date: 27. 03. 2026
  Bugfixes:
    - Fixed perk selection menu closing after picking a perk when multiple level-ups are pending. After a pick, offers for the next pending level are now rolled immediately so updatePerkSelectionGUI finds them and keeps the menu open, allowing the player to pick perks for all accumulated levels in one session.
Version: 1.0.14
Date: 27. 03. 2026
  Bugfixes:
    - Fixed multiplayer desync when a player reconnects while another player has the perk selection screen open or picks a perk. perk_offers was moved to storage.sem_levelup_offers so Factorio properly synchronizes it to reconnecting clients during map transfer. Previously, the session-only global current_perk_offers was empty on the rejoining client but populated on the server, causing divergent perk pick outcomes and an immediate desync.
Version: 1.0.13
Date: 24. 03. 2026
  Bugfixes:
    - Fixed picked perks being lost when loading a saved game. perk_selections (which tracks which levels have been used and drives the level counter display) was being cleared in on_configuration_changed, allowing all levels to be re-picked and causing perk effects to double-stack.
  Changes:
    - perk_offers moved out of persistent storage into a session-local table. Offers are now generated on demand when the level-up screen is opened and discarded after picking. This removes all coupling between perk_offers and perk_selections.
    - perk_selections now stores the chosen perk name instead of a choice index. Selection records are fully self-contained and independent of which offers were rolled, surviving mod updates without any data loss.
Version: 1.0.12
Date: 23. 03. 2026
  Bugfixes:
    - Fixed perk picks being reset when changing settings of other mods. on_configuration_changed now only clears perk offers and selections when this mod itself is updated.
Version: 1.0.11
Date: 22. 03. 2026
  Bugfixes:
    - Fixed character getting stuck while running. Four roaming beacon prototypes (sem-levelup-stand-still-beacon, sem-levelup-speed-aura-beacon, sem-levelup-efficiency-aura-beacon, sem-levelup-overclock-beacon) were missing collision_mask, inheriting Factorio's default beacon collision which includes the player layer. Since roaming beacons are placed directly at the player's position every 3 ticks, this caused constant micro-collisions. Fixed by adding collision_mask={layers={}} to all four prototypes.
Version: 1.0.10
Date: 22. 03. 2026
  Bugfixes:
    - Fixed crash on_init: unlockExtraTrack was declared local in perks.lua and was invisible to events.lua, causing "attempt to call global 'unlockExtraTrack' (a nil value)" when checkAndUnlockTracks ran on game load. Changed to a global function.
Version: 1.0.9
Date: 22. 03. 2026
  Changes:
    - XP tracks (Logistics, Construction, Production, Defense) now unlock automatically when their prerequisite technology is researched (logistic-robotics, construction-robotics, automation-3, gun-turret respectively), instead of requiring a legendary perk pick. Existing saves retroactively unlock any already-researched tracks on load.
    - Removed the four Ascension track perks from the perk pool (chance set to 0).
    - Legendary perks now only appear at levels that are multiples of 25 (level 25, 50, 75, ...). At all other levels only common, uncommon, rare, and epic perks are offered.
Version: 1.0.8
Date: 22. 03. 2026
  Bugfixes:
    - All tradeoff perks (Dead Eye, Sharpshooter, Spray and Pray, Hair Trigger, Siege Platform, Suppression Fire, Boom or Bust, Rocket Specialist, Brute Force, Patient Scholar, Rushed Research, Deep Study, Machine Mind) had locale descriptions that used "increased by __1__" templates where __1__ contained a compound string like "+12% dmg / -7% rate", producing broken text. Rewrote all descriptions to "X vs Y — __1__." format.
    - Overclock aura description awkwardly embedded the power penalty inside "run __1__ faster". Fixed to "Nearby machines speed up at a power cost — __1__".
    - Omega Arsenal (all_weapon_damage) description claimed "Doubles all current weapon damage bonuses" — it adds a flat +20% per pick. Fixed.
    - Refinery Baron / Metallurgy Master (angel_productivity_epic, bob_productivity_epic) descriptions hardcoded "20% productivity" instead of showing the per-pick value via __1__. Fixed.
    - Omega Workshop (bob_recipe_efficiency) locale description claimed "+40% productivity" — actual value is +15%. Fixed.
    - Bio-Symbiosis (angel_bio_symbiosis) locale description claimed "+100% productivity" — actual value is +40%. Fixed.
Version: 1.0.7
Date: 22. 03. 2026
  Bugfixes:
    - bob_recipe_efficiency: effect text claimed "-30% ingredients" but the perk applies +15% productivity bonus. Corrected to "+15% productivity".
    - angel_bio_symbiosis: effect text claimed "x2 output" (implying +100% productivity) but the perk applies +40% productivity. Corrected to "+40% output".
Version: 1.0.6
Date: 22. 03. 2026
  Bugfixes:
    - Extra Pick and More Rerolls perks had no effect on the next level's options. perk_offers[level+1] was pre-rolled when the previous level was picked, so by the time Extra Pick or More Rerolls was chosen the next level's roll was already locked in. Fixed by always re-rolling level+1 after every pick so it reflects the current perk state.
Version: 1.0.5
Date: 22. 03. 2026
  Bugfixes:
    - Fixed crash when picking Turbo Factory or Overclock Grid after the other was already active. In Factorio 2.0, accessing .name on an empty LuaItemStack slot throws an error. The beacon module inventory check now uses valid_for_read instead of valid before accessing slot contents.
Version: 1.0.4
Date: 22. 03. 2026
  Bugfixes:
    - Global efficiency and speed beacons had no collision_mask set, causing them to inherit default beacon collision (including player layer). Players would freeze/get stuck walking through grid-center positions where beacons are placed. Fixed by setting collision_mask={layers={}} on both global beacon prototypes.
Version: 1.0.3
Date: 22. 03. 2026
  Balancing:
    - Level curve multiplier increased from 1.4x to 2.5x per level. XP requirements scale much steeper: Level 5 ~1.5k, Level 10 ~57k, Level 15 ~2.2M, Level 20 ~87M.
Version: 1.0.2
Date: 22. 03. 2026
  Bugfixes:
    - Fixed crash on load: global beacon supply_area_distance (5000) exceeded Factorio 2.0 maximum of 64; clamped to 64.
  Changes:
    - Global efficiency beacon (Power Grid) and global speed beacons (Turbo Factory, Overclock Grid) now tile the entire base on a 128x128 grid instead of placing a single beacon at spawn.
    - On perk pick: existing base is scanned via electric poles for immediate full coverage.
    - Coverage expands continuously as players move around their base (3x3 cell radius around each player, updated every 3 ticks).
    - Any entity placed by a player or construction robot instantly triggers coverage of that location.
Version: 1.0.1
Date: 22. 03. 2026
  Bugfixes:
    - Removed unnecessary dependency.
Version: 1.0.0
Date: 22. 03. 2026
  Features:
    - Added Extended Reach (common) — replaces 6 individual reach perks; each pick adds +1 tile to all reach stats simultaneously.
    - Added three Mining Drill productivity perks: Efficient Drills (common), Master Driller (uncommon, cap 8), Ore Baron (rare, cap 5).
    - Added Power Grid (legendary) — places a hidden global beacon that permanently reduces all machine energy consumption by 10%.
    - Added Overclock (rare, cap 5) — roaming aura that boosts nearby machine speed at the cost of increased power draw.
    - Added Turbo Factory (epic) — permanently increases all machine speed by 12% globally, but machines consume 36% more energy.
    - Added Overclock Grid (legendary) — stacks with Turbo Factory for an additional +20% global speed / +60% energy cost.
    - Added 4 weapon damage vs fire rate tradeoff perks: Sharpshooter, Spray and Pray (uncommon), Dead Eye, Hair Trigger (rare).
    - Added 2 turret tradeoff perks: Siege Platform, Suppression Fire (uncommon) — trade turret damage against attack speed.
    - Added 2 weapon-type tradeoff perks: Boom or Bust, Rocket Specialist (uncommon) — artillery vs rocket damage.
    - Added 4 research tradeoff perks: Brute Force, Patient Scholar (uncommon), Rushed Research, Deep Study (rare) — lab speed vs productivity.
    - Added Machine Mind (uncommon, cap 5) — boosts mining drill productivity but reduces manual mining speed.
  Balancing:
    - Removed iron, copper and stone smelting productivity perks (too narrow; redundant at higher levels).
    - Merged 6 individual reach perks into Extended Reach.
    - Nerfed rocket_damage: +20%/lv to +10%/lv.
    - Nerfed cannon, flame, uranium damage: +15%/lv to +8%/lv.
    - Nerfed turret_fire_rate, laser_turret_damage: +10%/lv to +5%/lv.
    - Nerfed turret_damage_all: +8%/lv to +5%/lv.
    - Nerfed logistic_trash_slots: +4/lv to +2/lv.
    - Nerfed research_modules, research_speed_rare: +15%/lv to +8%/lv.
    - Nerfed lab_productivity_rare: +8%/lv to +5%/lv.
    - Nerfed worker_robot_speed_rare: +20%/lv to +10%/lv.
    - Stand Still beacon speed module: 100% to 25% per module slot.
    - Speed Aura beacon speed module: 6% to 4% per module slot.
    - all_weapon_damage reworked: max level 1 to 4, additive +20%/pick (no more snapshot doubling).
    - angel_productivity_epic, bob_productivity_epic: max level 1 to 4, +20% to +5%/pick.
    - bob_recipe_efficiency: +40% to +15%.
    - angel_bio_symbiosis: +100% to +40%.