Gridtorio


Distributes the Gridtorio scenario by sOvr9000. You start in a single chunk with iron [item=iron-ore], coal [item=coal], stone [item=stone], and a market [entity=market]. You must sell some basic items for coins [item=coin], and then use those coins to expand to other chunks. Automate trading with markets, capture ruins of enemy bases, and discover how the world changes as you venture farther out.

Scenarios
4 months ago
1.1
2.75K
Environment

b Game lag while placing belts

2 months ago
(updated 2 months ago)

Started to notice lagging of the game (UPS) while placing/removing belts by hand on my save.

Fresh map with scenario does not generate such lag.

---Most of time comes from "Game update > Entity update" (idle 0.2ms, placing belts 1.0ms, removing belts 0.5ms) and "Script update > level" (idle 0.03ms to 0.1ms, placing belts 0.9ms, removing belts 0.5ms) entries.--- "GUI update" during building process jumps from 0.1ms to 18ms.

I've about 5.8k belts for the coin generator and about 9k belts total.

UPD: Lag also present in the editor.

UPD2: On new map with scenario (after cleaning up space around spawn using editor) time increases also observable, but not to this degree ("entity update" from 0.03 to 0.05ms, "level" from 0.1 to 0.3ms). In sandbox "level" is below 0.01ms.

UPD3: removing processing of on_built_entity, on_player_mined_entity, on_robot_built_entity and on_robot_mined_entity fixes the issue. Also, it's not "Update" times that caused issues, but "GUI update".

2 months ago

Fix as I see it: for functions upgrades.decrementBuiltEntityCount and upgrades.incrementBuiltEntityCount move the loops inside the conditions (checked on my save: it also solves the issue, independent from UPD3).

New response