tobspr-games / shapez.io

shapez is an open source base building game on Steam inspired by factorio!
https://get.shapez.io/gh
GNU General Public License v3.0
6.38k stars 1.23k forks source link

Production waves, causing visible gaps on a fully saturated belt #63

Closed mvolfik closed 4 years ago

mvolfik commented 4 years ago

I'm playing the web version. Here is my savefile (it's zipped because GitHub otherwise doesn't allow uploading it): bug.zip It happens around 6 chunks north-north-east from the hub (I haven't bought the game yet so I can't place marker).

My series of stackers produces in kind of waves - the number of items in the storage on output of the stacker array increases for some time, and then a gap in belt appears, and the storage returns back to the number of items it started at. But it originally made me think that it wasn't producing a full belt of shapez.

Screenshot with the gap: Screenshot from 2020-06-02 17-28-55

The storage on input is stable on 167 items.

tobspr commented 4 years ago

Can you reproduce it on the latest version? (1.1.5) There was a bug regarding this

mvolfik commented 4 years ago

Yes, I still do (tested now on the online version in Chromium).

mvolfik commented 4 years ago

Hmm, I did some more testing and the issue seems to be related to "corner" belt directly next to a splitter/merger Screenshot from 2020-06-03 14-50-56 In the above picture, the left storage contents noticeably increases over time, while the right stays on the same value.

mvolfik commented 4 years ago

savegame-f3ba4790809a8a890bd073c42c02236c1abc46f8.zip (zipped because github otherwise doesn't allow uploading)

tobspr commented 4 years ago

It seems to be a tick-rate issue, are you running on low fps? It works much better with a simulation target of 165 hz

mvolfik commented 4 years ago

Yeah, that's definitely possible, I'm on quite old laptop just with increased RAM. I'm running on: Tickrate: 30-45 FPS: 40-50 Tick Duration: 11-13 ms

mvolfik commented 4 years ago

But apart from the visual gaps, the merger--> corner belt is definitely broken, the left storage is now at 730 items, the right one still at 25

tobspr commented 4 years ago

Yeah thats the issue then :) The game sacrifices some precision to make sure you get better FPS at some point, I guess I could add a "high precision" mode to make it always simulate at full precision but then you'd have much lower fps :)

tobspr commented 4 years ago

But apart from the visual gaps, the merger--> corner belt is definitely broken, the left storage is now at 730 items, the right one still at 25

I'll check - Is this with re-importing your savegame to the latest version? Since this smells like the bug which was fixed

mvolfik commented 4 years ago

Yes, it was the same base, just loaded in the new version (I didn't import it manually, I just left the base yesterday and continued today)

tobspr commented 4 years ago

I'll have to take a closer look

Riimu commented 4 years ago

Probably related to this issue, I noticed that a corner belt directly following an extractor puts more items in the belt than a straight belt following an extractor.

With Tier IV belt and extractors, I'm getting (according to statistics):

Just a pure guess, but perhaps there is some kind of issue with corner belt travel distance. E.g. if an item exits into a corner, it's puts it further towards the end of the section than if it exits to a straight belt (therefore, it can put items faster on the belt, because the item moves quicker away from the section).

(Playing the Steam version, if that is relevant)

Edit: Here's a screenshot that illustrates the issue, notice that the density of the items on the belt is different depending on whether the items exited to a corner from a extractor/joiner (look at the red highlighter belts):

density

tobspr commented 4 years ago

So, this is an issue I can not fix, since either the game will run too slow or you get precision issues. I just added a new 500hz high precision mode though, so you have the choice what you prefer