Galactic Market

by Val.K

Galactic Market turns your factory into an economy. Sell items, fluids, and surplus power for shared ISK, restock supplies through request-driven Market Terminals and personal logistics, and fund research with real industrial output. It adds a money layer on top of normal Factorio automation, so progress depends not just on science, but on keeping the whole base profitable.

Content
3 months ago
2.0
917
Transportation Logistics Fluids Manufacturing Power

b Game unplayable

4 months ago

Hello again,
Sorry for this but my game is unplayable because galactic market mod takes 12-19ms for update (spikes up to 32ms). I dont know if you know what it means but the game is unplayable at 15/30fps. Please try to make it more UPS friendly.
Thank You <3

4 months ago

We can try but inherently this mod does a lot of things that take a lot of ups.

Can you post a screenshot of your base? how big is it? what are you doing?

4 months ago

Do you maybe have a discord where we can text normally? Mine is @mradik if you want to talk through it.

Also base is train-base, starting to go into the "megabase" stage, but still your mod takes more ms than every other mods together.
"What are you doing?" - standing still (1 autoseller + some power sellers)

4 months ago
(updated 4 months ago)

try 0.3.6?
we'll try to profile it next week, maybe logs show what takes most ups. you're mostly selling power?

4 months ago
(updated 4 months ago)

also do you have blueprint sandbox mod installed? (we saw a low of ups drain together with it)

4 months ago

no dont have any blueprint sandbox, but i found out why its eating so much UPS. you have no bucketing

4 months ago
(updated 4 months ago)

yep try 0.3.6,we added bucketing for energy

4 months ago

This are the things i found are giving high UPS and their better value without changing or diminishing gameplay:

• L8423: script.on_nth_tick(1, process_fast_runtime_updates) → on_nth_tick(2) (or split: keep wallet/UI flush on 2, move hub/terminal calls to their own on_nth_tick)
• L7777: process_fast_runtime_updates — 8 sub-routines/tick → split per interval
• L6889: process_market_power_interfaces() — no bucketing → add 10 buckets, tick % 10
• L59: MARKET_HUB_PROCESS_INTERVAL = 5 → 15 (4 Hz instead of 12 Hz)
• L57: MARKET_TERMINAL_PROCESS_INTERVAL = 60 → 120 (every 2 s)
• L58: PERSONAL_MARKET_PROCESS_INTERVAL = 60 → 120
• L67: MARKET_SHARED_UI_REFRESH_INTERVAL = 60 → 30 only when dirty, else skip
• L7381–7391: refresh_market_hub_feeders — find_entities_filtered ×2 → MARKET_HUB_FEEDER_REFRESH_INTERVAL = 600 (10 s) and merge to one call with type = {"transport-belt","underground-belt","mining-drill"}
• L7673: refresh_market_hubs_near_entity — flags needs_feeder_refresh immediately → defer: entry.next_feeder_refresh_tick = math.min(entry.next_feeder_refresh_tick or math.huge, game.tick + 60)
• L6745: process_liquid_market_hub_bucket — get_fluid_contents + remove_fluid → keep at MARKET_HUB_PROCESS_INTERVAL, but raise to 15 with hubs
• L6568: process_market_terminal_bucket — build_inventory_item_count_maps per terminal → cache map per terminal, invalidate on on_player_main_inventory_changed / insert events; raise interval to 120
• L7741: reset_market_rate_label_rendering_if_needed — rendering.clear(script.mod_name) global → only clear/recreate the affected entry's render object, not all

Net effect (rough): per-tick Lua cost drops ~3–5×, max spikes drop from ~65 ms to <10 ms. Gameplay impact: invisible (sales/buys 2–4× slower in ticks, still sub-second).

4 months ago

This are the things i found are giving high UPS and their better value without changing or diminishing gameplay:

• L8423: script.on_nth_tick(1, process_fast_runtime_updates) → on_nth_tick(2) (or split: keep wallet/UI flush on 2, move hub/terminal calls to their own on_nth_tick)
• L7777: process_fast_runtime_updates — 8 sub-routines/tick → split per interval
• L6889: process_market_power_interfaces() — no bucketing → add 10 buckets, tick % 10
• L59: MARKET_HUB_PROCESS_INTERVAL = 5 → 15 (4 Hz instead of 12 Hz)
• L57: MARKET_TERMINAL_PROCESS_INTERVAL = 60 → 120 (every 2 s)
• L58: PERSONAL_MARKET_PROCESS_INTERVAL = 60 → 120
• L67: MARKET_SHARED_UI_REFRESH_INTERVAL = 60 → 30 only when dirty, else skip
• L7381–7391: refresh_market_hub_feeders — find_entities_filtered ×2 → MARKET_HUB_FEEDER_REFRESH_INTERVAL = 600 (10 s) and merge to one call with type = {"transport-belt","underground-belt","mining-drill"}
• L7673: refresh_market_hubs_near_entity — flags needs_feeder_refresh immediately → defer: entry.next_feeder_refresh_tick = math.min(entry.next_feeder_refresh_tick or math.huge, game.tick + 60)
• L6745: process_liquid_market_hub_bucket — get_fluid_contents + remove_fluid → keep at MARKET_HUB_PROCESS_INTERVAL, but raise to 15 with hubs
• L6568: process_market_terminal_bucket — build_inventory_item_count_maps per terminal → cache map per terminal, invalidate on on_player_main_inventory_changed / insert events; raise interval to 120
• L7741: reset_market_rate_label_rendering_if_needed — rendering.clear(script.mod_name) global → only clear/recreate the affected entry's render object, not all

Net effect (rough): per-tick Lua cost drops ~3–5×, max spikes drop from ~65 ms to <10 ms. Gameplay impact: invisible (sales/buys 2–4× slower in ticks, still sub-second).

Dont forget this is just my personal solution, your fix is your fix, cant force you into anything. <3

4 months ago

Will download to replace black market 2 mod when this is performant

4 months ago

try now, if latest changes made an impact on your save

New response