Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with values of sub block in parent block. Last block determine what parent block requests #536

Closed
Paraplegix opened this issue Jun 16, 2024 · 12 comments
Labels

Comments

@Paraplegix
Copy link

Paraplegix commented Jun 16, 2024

Reproduced in Factorio 1.1.107 and helmod 1.0.11 (pulled from this repo)

I'm sure it's a weird edge case, but might point to another issue with the compute of blocks. I found this while trying to debug for the loop bug (#534) but with pyanodon recipes and managed to reproduce it with base factorio.

When having several blocks providing the same resource (for example several blocks doing solid fuel), there is a weird behavior on when blocks will (or not) show their output.

So based on this configuration :
image

Line string

The line used for the demo

eNrtmltvqzgQgP/KEc8k4n4SVbzsw76ttOrr0Qo54LRsDUZcehpF/Pe1sQ22uZw0Sbs9EnkpHszYHs/M56Ek+BvCMUDfovAcI1BVofEXTiAyzDQJjYxeRnvDxD9zWIbG36AEBYJP6ZthHshzLxHpteOXJcZ1r+QPKmJK2F2bNPIEvoWWmYMMhkaFUZpsjg1Em2OJs00B6xIj2GSbJ1BNjhjjJq9D2yzwT3Ir8G2L/ojapxImKczrKjz/MFQ9/4RnNpymvj4VRHhETZoYJsg6zQFRVtWghqHTmj+MZwheTxucokHJIJpU4KgKUPr0XKsKBtGkAtuWNLRmUeKkidmyBnMN2iQZV5fWMBu0+UKZTZTFzylKSpiHZ7Yh7vxeue/cKzZ2CeO0gBfsnO1azsft3M1mc+nEiqa7mDLfo9Nb7pEvmZru0bnJarEYm88+xTkx2BHENS5P/YB/srbBR4ifYZaS6N0UCOS1UEnsmdanwStNSDbk6RQ69ndq9aqAMCG6UZqlNZksCfIGQWKt1oTHI+wMx/oMk3klCkkzxnnVZEU3OXITI9Swa2IfUFzzWPdEVOMaoM4/+ltbK9B+Nl8H7+25Hl1N/wgXW1vb1X7ctoHFLiK28L6ZQFiQVmseIKAzDc99YHQCYewDb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U

EDIT: it seems broken. The product are not set on each individual sub block and all sub block are linked...

Each block is just one recipe inside, one of the block is in "ingredient mode", but this doesn't affect things.

Now onto the weird part :

What ammount on each line will be shown on the lines seem to depend on what ammount of item the last block provides.

For example if the last row i reduce it from 90 to 60, the last block will show 60 even if showing the block is indeed 60

image
image

If I put back 61 in the last block it will show again 61.

image

If I put 30 in the last block, only the first row will show something

image

The order seem to be important, if I move the first block (with 30) down two rows so the first two rows have 10 SF as product, still with 30 in the last block, then the first 3 rows will show products with a total of 50

image

If I toggle a sub block as "linked", The parent block will act like last block "amount" is the request for the parent block

The 2nd block is configured for 10 output but show as 20 in 2 blocks.
image

Adding a different recipe or block in the middle of the Solid Fuel block doesn't seem to affect the behavior.

Seems like 2 issue are at play :

  1. Parent block act like the last block providing an item is the amount the parent block "need".
  2. Unlinked block should show their "product/ingredient" as is, with no effect whatsoever from parent block "request" and/or other blocks requests.
@Paraplegix Paraplegix changed the title Issue with values of sub block in parent block. Issue with values of sub block in parent block. Last block determine what parent block requests Jun 16, 2024
@Helfima
Copy link
Owner

Helfima commented Jun 19, 2024

hello if you can try dev branch from this repository on your pyanodon game
https://github.com/Helfima/helmod/tree/dev

@Helfima Helfima added the bug label Jun 19, 2024
@Paraplegix
Copy link
Author

Paraplegix commented Jun 19, 2024

It seems much better now! And also seem to fix some issue with other stuff

I tested in my test vanilla game (the one where i took the screenshot and managed to show all block products).

I tested it by replicating (from scratch) the recipes from my current factorio pyanodon save and now the block seem to behave as expected.

I loaded the worlds on both factorio 1.0.9 with helmod available on the mod portal and on the "test" factorio 1.0.7 (a manualy downloaded version) with the helmod coming from the dev branch.
And things really seem much much better : Left is dev branch after clicking "reset to 100%", and right is "master" branch after click "reset to 100%. Some where partialy fine before.
image
image

However, some production line seem broken by missing value: (I do not know since when)
image
I don't know why the failing block is empty.
I do not exclude the possibility that the recipe used was removed/changed in the pyanodon mod. but considering all block below the sooth (the one with the green bar) are empty. And they all produce an error of "count_limit" or "matrix" (a nil value)
Also for more context, most of the items in those productions line are inherited from helmod versions 0.XX, so maybe they were always broke. I doubt those errors are pertinent to investigate.

Here are the different message I got while navigating the different panels. from the dev branch
image

Minus the "bugs" wich might not be helmod fault, I do belive that this version is already much closer to being exploitable for me !

@Paraplegix
Copy link
Author

The dev branch also fixes #511 and #534 I guess

@Helfima
Copy link
Owner

Helfima commented Jun 20, 2024

you have missing recipe but normaly It must display row with error
I fixed the error with nil value you can retry the last commit

@Paraplegix
Copy link
Author

Stuff is different now, I guess the recipe I was using was removed.
The rows do display now.
image

Clicking reset to 100% in the line provoque an error : __helmod__/data/ModelCompute.lua:264: attempt to perform arithmetic on field 'amount' (a nil value)

The name of the recipe point to a recipe that isn't available anymore niobium plate with hot air.

The block itself show this :
image

The log message clearly say ERROR: Recipe hotair-niobium-plate" not exist in game when opening the sub block.

Trying to delete the row by clicking the cross/delete button doesn't visualy change anything, with the same error ModelCompute.lua:264. However just clicking on the block again will show the block correctly with the row deleted. I guess the error prevent the interface from refreshing althoug the row/element is deleted.

I had two other sub blocks with missing recipes (so 3 in total). Deleting missing recipe on 2nd did the same thing (no visual change, but ok when click on block). On the third one the recipe updated correctly, the interface changed and removed the row correctly.
What was deleted didn't matter as only the last one of the block didn't throw an error.

Other weird behavior is that block above the one with missing recipe where correctly displayed:
image

But after the first block where all with missing icon and infos:
image

Deleting the missing recipe between the two block shown allowed the block to be displayed correctly
image

@Helfima
Copy link
Owner

Helfima commented Jun 21, 2024

if you can share your save with the error I can try work on the missing recipe, is not easy to reproduce

@Paraplegix
Copy link
Author

Paraplegix commented Jun 21, 2024

Sure, but as I said, I don't think that's a must solve problem, it would only happen when recipe are deleted, and at least like this it's quite visible.

If you just hide the stuff missing it make just make it more confusing

Here is the file, works with factorio 1.1.7 and up i guess.
https://drive.google.com/file/d/1CuWqZRsjbMHpPvyZuw5ZEg-Kfpr2pISD/view?usp=sharing

(just pull all pyanodon mods and helmod, the other mods are mostly qol and not necessary to reproduce the bug)

@Helfima
Copy link
Owner

Helfima commented Jun 21, 2024

je ne vais pas supprimer les recettes, juste améliorer la fiabilité et éventuellement l'affichage dans ce cas

@Helfima
Copy link
Owner

Helfima commented Jul 1, 2024

it's better :)
image

@Paraplegix
Copy link
Author

Paraplegix commented Jul 3, 2024

@Helfima Any ETA of the current dev change into main branch/mod portal ?
I'd like to play with it a bit more extensively on my main save, but I'm a bit apprehensive to use pulled repository on my steam save.

Edit :

Well I ended up making the jump, because I want to finish my pyanodon run before the extension release date (Yeah I'm stupid).

I'm gonna play for a bit and already noticed some little errors there and there, I'll try to bring up issues for them once I find a good way to replicate them, or am confident that it's indeed an error.

One of the problem that i don't think is an error is with my Iron plate (2nd in the screenshot) block, where all iron plate comes from one recipe instead of being produce from two recipes, removing the last row in the table fixes it, idk why.

Edit2: For the iron plate thing, it seems to be something with the matrix resolver, removing a step made it use correctly the 2 recipes correctly

@Helfima
Copy link
Owner

Helfima commented Jul 28, 2024

v1.012 commited

@Paraplegix
Copy link
Author

I've been playing with the main branch for a while. I'm pleased with it's current state. I'm not sure i've encountered bugs with it yet.

The problems displayed in this issue are all resolved AFAIK.

@Helfima Helfima closed this as completed Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants