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

Seablock "Analysis Warning" #31

Open
smnkrs opened this issue May 26, 2020 · 23 comments
Open

Seablock "Analysis Warning" #31

smnkrs opened this issue May 26, 2020 · 23 comments

Comments

@smnkrs
Copy link

smnkrs commented May 26, 2020

When I open my project and mods I get the "Analysis Warning" that more than 50% of the objects are inaccessible. In fact, it appears that ALL recipes are inaccessible for me. I do believe this might be a mod-pack bug actually since I don't get mod-settings in-game, but for the sake of this post, it actually doesn't matter, since I haven't had a reason to find the bug, since the game is running fine for me. I will look into it now though, since I'm getting a bit worried that something is broken in late-game. There are a number of thoughts I have on this topic:

  1. Whenever I manually mark a recipe I get the "Analysis Warning" again. This feels like a bug. I think it's enough for the message to appear on every load-up of the project.

  2. I play Seablock, which adds a huge amount of items and ingredients. Going through a list of ALL items to manually mark them seems overly excessive. As far as I can tell, its purpose should be to add convenience through the fact, that it makes you aware of problems with recipes, or traps, where a mod does scripting which is not possible to support. That's actually great, but going through EVERY item to manually mark it seems excessive. It should be considered to add an option to "Manually mark ALL recipes as accessible". I'm sure there are recipes that wont work in game as they might show inside YAFC, but as someone that doesn't know the recipes of the mod I'm playing anyways, I will need to check each recipe in-game anyways. Might as well just enable all of them in one click to safe myself the 3 clicks for EVERY new recipe.

  3. The Wording of the message is a bit awkward. Here is my suggestion for a rewrite:
    More than 50% of all in-game objects appear to be inaccessible in this project with your current mod list. This can have a variety of reasons like objects being accessible via scripts, or it might be due to a bug inside a mod or YAFC. Check this link for known recipe issues. A lot of YAFC's systems rely on objects being accessible, so some features may not work as intended.
    (The known recipe issues link is just an idea. Not sure how this could look like ... Maybe a link to a forum post where ppl can discuss and curate known recipe issues that are out of the hands of YAFC. If the app becomes a default for recipe things, it might help mods fix incompatibilities faster/better. For me, seablock is unplayable without Helmod. If it didn't exist, I wouldn't play seablock. I spend hours planning all my setups before I build them. It's just how I play the game. So I need these planner mods to play nice with mods 😉)

@ShadowTheAge
Copy link
Owner

ShadowTheAge commented May 26, 2020

Well, you don't have to mark all objects as accessible, just some "roots" that are gained through Seablock script, and YAFC will just start from there

For seablock example, there are some "starting technologies" (wood processing, etc) that are unlocked through script. Mark those.

Then, mark water as accessible (I hope you have access to this on a seablock map! :D)

I may be missing something (maybe starting lab? Some starting buildings? Electricity?) - but those roots can be found through dependency explorer (Just select an object you know you have access to, and click on its dependency until you get to some sort of root that you mark as accessible)

After you mark a few dozen objects that can get iron and other basic resources automated - YAFC will iteratively unlock everything else.

Thats why you get warning again - it means you have not yet solved the problem.

I am changing the wording, English is not my mother tongue

I would like to find some idea that works better for seablock and similar mods, but i don't want to hardcode anything (like searching for "Seablock" mod)

One option may be "mark all (mod name) objects as accessible" but that will require 1) tracing which mods added which objects similar to Factorio and 2) may have false-positives, and having actually inaccessible recipe that is marked as accessible may lead to wrong choices, especially with more complex analyses and future planners like "auto-planner" of some sort.

Angel-bob is especially problematic here as Angel makes inaccessible a lot of bobs recipes. And some of them are actually broken in terms of angel-bobs balance.

@ShadowTheAge ShadowTheAge changed the title Thoughts on "Analysis Warning" Seablock "Analysis Warning" May 26, 2020
@ShadowTheAge ShadowTheAge pinned this issue May 26, 2020
@ShadowTheAge
Copy link
Owner

ShadowTheAge commented May 26, 2020

I am pinning the issue as it contains useful info
There are no current one-click solutions, but I know about it!

@smnkrs
Copy link
Author

smnkrs commented May 26, 2020

Ahh!!! Now I understand what the "Dependency Explorer" is trying to help me do! I like it a lot actually! Its a lovely solution to the issue of mods, recipes, scripting, etc.!
Your response actually kinda answers the "one-click" solution. What I was talking about was more like a "cheat" in terms of "just dont bother me with marking everything manually, just unlock everything with one click", but that is because I didnt know that YAFC will attempt to unlock everything itself as long as you get going on some of the early recipes.

As you mentioned, I would be careful with this "one-button" solution, since its more a workaround to get going quickly, but I would never suggest this to someone seriously planning their heavily modded game like this. All the bobs/angels hidden/disable stuff is quite tricky actually. I would assume Helmod hardcodes that stuff. Eventually you might consider hardcoding for the top5-10 modpacks or something OR, you make it easy for mods to add some "metainfo" in some way that Factory Planners can use. (This is some serious community cooperation needed ... maybe not feasible ... but if there is some energy here, this could happen eventually)

But ... as you can tell, the functionality of this amazing feature kinda wasn't clear to me. I would suggest in addition to add some more text to what I suggested above to the "analysis warning":
For this reason YAFC has a Dependency Explorer that allows you to manually enable some of the core recipes. YAFC will iteratively try to unlock all the dependencies after each recipe you manually enabled. For most modpacks it's enough to unlock a dozen early recipes like any special recipes for plates that everything in the mod is based on.

In addition I would suggest to change the Dependency Explorer. When I entered the Dependency Explorer through the main menu and I click to manually mark a recipe as accessible and exit that window, right now the whole dependency explorer closes and ... I get the analysis warning again. Instead I should be put back to the Dependency Explorer to be able to unlock additional recipes right away.

(Don't worry about the English! It's not bad, but it felt a bit awkward. Focus on the code and let plebeians like me handle the language stuff. Also, this is what things like github are for, so the community can help you with these secondary aspects. The dependency explorer is an amazing feature ... the text that promotes it is necessary, but honestly, it comes AFTER you make the feature great.)
(Also, btw. I updated from 0.18.20 to 0.18.24 and updated all the mods to their latest version and now I have ingame mod settings which makes me happy 😃 )

@ShadowTheAge
Copy link
Owner

ShadowTheAge commented May 26, 2020

For future searchers, I have loaded Seablock and I have to enable just 5 things:

  • 4 starting researches:
    • Crush stiratite
    • Basic circuit board
    • Wood processing
    • Sacrificial electromagnet
  • And one item - Basic circuit board (as you have starting batch of it)

Also, for most of the mods you don't need to unlock anything :)

Also, if you click on the item you are inspecting in the Dependency Explorer, you can change it. I guess it is not very clear too and I should add explicit button

@smnkrs
Copy link
Author

smnkrs commented May 26, 2020

I think I broke something. To be fully honest, I dont know exactly how this happened, but apart from the typo, when I click on "Clear maek", nothing happens, so it seems like the mineral sludge recipe is actually locked right now.

https://imgur.com/a/xES4n5I

@ShadowTheAge
Copy link
Owner

Well, in addition to marking items as accessible, you can mark them as inaccessible
But as I see, unmerking it back is bugged, sorry, I am going to fix it now

@ShadowTheAge
Copy link
Owner

ShadowTheAge commented May 26, 2020

Published a pre-release for 0.4.4. with this plus other minor bug fixes and small features
https://github.com/ShadowTheAge/yafc/releases

@ShadowTheAge
Copy link
Owner

ShadowTheAge commented May 26, 2020

All the bobs/angels hidden/disable stuff is quite tricky actually

This is the reason why accessibility analysis exists, so no hardcoding required here
It starts from nothing, founds stone (entity) (that is generated on the map, so marked as accessible root) -> stone(item) -> Stone furnace -> Copper plate -> Copper wire -> Electronic circuit -> Offshore pump -> Water -> Electricity -> Laboratory -> ... -> Rocket launch! -> Space science -> ...
But it just needs a small kick for items acquired through scripting

It is also paired with milestone analysis that is determining which objects are locked behind milestones (usually science packs, but you can add your own!)
It is basically the same algorithm - start with one item and go further (but this time marking everything as "locked behind this item")

@PhoenixMage
Copy link

For future searchers, I have loaded Seablock and I have to enable just 5 things:

  • 4 starting researches:

    • Crush stiratite
    • Basic circuit board
    • Wood processing
    • Sacrificial electromagnet
  • And one item - Basic circuit board (as you have starting batch of it)

Also, for most of the mods you don't need to unlock anything :)

Also, if you click on the item you are inspecting in the Dependency Explorer, you can change it. I guess it is not very clear too and I should add explicit button

I think this list has changed in Seablock 0.4.10 as I enable all of these things in the DE but most things still dont show as craftable.

The items I enabled have the following headings:

  • crush stiratite (technology)
  • wood processing (technology)
  • Sacrificial electromagnet (technology)
  • basic circuit board (technology)

basic circuit board - The tool tip said "This item cannot be fully automated" so I am assuming that is the item? I did try the others but none resolved my issue.

@ShadowTheAge
Copy link
Owner

ShadowTheAge commented Nov 2, 2020

Hi
Here are some possible things to try enabling (basically things that you get unlocked through your starting chest):
Electrolyser, crystalizer, liquifier, wood processing tech, iron and copper plate, circuit board, hydro plant, lab, offshore pump,

You can use "dependency explorer" to investigate which objects are "blocking" the progression.
Tell me if you were able to "unlock" the full modpack. If not I'll download it and see.

@PhoenixMage
Copy link

Should I be unlocking the items themselves that at are in the chest or the recipes for those items?

@ShadowTheAge
Copy link
Owner

Both should work, but you are getting items in the chest so go for items.
You need to enable just enough things for the basic plates loop, and all the starting technologies that you don't actually research (that are unlocked through script).
This is nessesary because yafc need to know which objects (items, tech, recipes) are reachable, because mods and modpacks often disable some of those, and even vanilla has some disabled (that was used in the previous NPE campaign or, for example, loaders)

@KiwiHawk
Copy link

I'm a developer on Sea Block. Is there something I can do to make it easier for YAFC?

@Black-Noise
Copy link

There seems to be a change between version 0.5.1 and 0.5.3.1 that causes the dependency explorer to incorrectly identify certain recipes and items that should be disabled as available/unlockable instead.

Example blank .yafc project: https://pastebin.com/btzsdzv5, running seablock 1.1, and has e.g:

  • sour gas (fluid) unlocked by oil processing (technology)
  • air compressors 1 (technology) unlocked by electronics (technology)

@ShadowTheAge
Copy link
Owner

ShadowTheAge commented Dec 22, 2020

@KiwiHawk Hi, the simplest thing to do you can detect yafc on data stage and just "enable" some things
There are no specific things to detect but for for example data["Entity types"] would be not nil.
I can add something else, for example data.data_crawler = "yafc 0.5.4" next version

@Black-Noise I will create an issue

@KiwiHawk
Copy link

KiwiHawk commented Feb 18, 2021

@ShadowTheAge : Sorry for the delay in looking at this!

Can you elaborate a bit more please. What do you mean by "enable" some things? I tried setting the starting techs to require no ingredients but they were still inaccessible in YAFC (no lab available).

Configuring YAFC manually, I needed to mark these as accessible:

Technologies:

  • sb-startup1
  • landfill
  • sb-startup2
  • bio-paper-1
  • bio-wood-processing
  • sb-startup3
  • sb-startup4
  • sct-lab-t1
  • sct-automation-science-pack

Items:

  • stone
  • iron-plate
  • basic-circuit-board
  • copper-pipe

I suggest that in data-updates stage, if I detect data.data_crawler, I then populate a table of starting tech and items. You can read these in and mark as accessible. Simplified example:

if data.data_crawler then
  data.script_enabled = {
    {type = "technology", name = "sb-startup1"},
    {type = "item", name = "stone"}
  }
end

@ShadowTheAge
Copy link
Owner

I can do that and that will be relatively simple, but too "yafc-specific"
I am okay with that solution. It is not generic but is simple to do for me and you.

@KiwiHawk
Copy link

I've committed my changes. Feel free to test against my this. Or wait until I release next. Over to you.

modded-factorio/SeaBlock#44

@ShadowTheAge
Copy link
Owner

I unpacked seablock from "main" branch and getting the following error
image

@KiwiHawk
Copy link

It should be fixed now. Can you try it again?

I'm very sorry! I've done more thorough testing this time, checking various mod / setting combinations.

@ShadowTheAge
Copy link
Owner

Support for script_enabled should be added in the latest 0.5.5 pre-release
https://github.com/ShadowTheAge/yafc/releases

@KiwiHawk
Copy link

KiwiHawk commented Mar 6, 2021

Sea Block 0.5.3 has been released

@Pezzawinkle
Copy link

I was pointed in this direction from Angels Discord.
The latest version of angels "should" fix the hidden/disabled problems (99% of things have been patched correctly now, it was a library issue).
Back to the point of this issue though:
With bobclasses, we have added a few extra start-up items to enable progression, and these are added to the crash-site (should be accessible via control stage tables?)
Also for angelsindustries component mode or tech mode, the "extra" starting items are not being accounted for, these items are given either in the crash site (as a burner lab as an entity), some extra items in the crash site body, and some to the player directly at the control stage. Theoretically it should be possible to read any on_init tables, in particular those vanilla inventory insertion tables?
The tables for reference: from factorio\data\base\scenarios\freeplay\freeplay.lua:208-212 the control file for freeplay...

freeplay.on_init = function()
  global.created_items = created_items() --added to player inventory on start
  global.respawn_items = respawn_items() --what to respawn with
  global.crashed_ship_items = ship_items() --stuff in crashed ship
  global.crashed_debris_items = debris_items() --stuff in other debris

craig-johnston pushed a commit to craig-johnston/yafc that referenced this issue Feb 28, 2024
It is a collection of changes I made for
ShadowTheAge#145 to fix various things.
In order to make this (big) PR adding the summary view smaller, I moved
this (and some other changed) to their own PR, before submitting the PR
to add the summary view.

List of improvements/fixes:
* _Don't use 'weird' output of `EncapsulateRect()` as 'lastRect', but
the actual rect of the (old) state_
`EncapsulateRect()` changes the returned rectangle while processing it,
causing rendering issues (I forgot the details, it is ages ago)
* _Improve ScrollArea class names to reflect horizontal scrolling as
well, including a constructor parameter to enable horizontal scrolling_
The ScrollArea is capable of having both vertical and horizontal
scrollbars. The horizontal scrollbar is never used, and was not exposed.
But the summary view needs it for larger factories or the user needs an
ultra, mega, super wide screen 😛
* _Renamed some variables_
  For clarification
* Typos and some formatting
craig-johnston pushed a commit to craig-johnston/yafc that referenced this issue Feb 28, 2024
ShadowTheAge#34)

ShadowTheAge#31 was missing an additional fix for the scroll area and their
scrollbars.
With this I did not see any glitches anymore, and the ScrollArea size is
set correctly now (showing scrollbars if needed).(hard to see/test, as
it was visible for the Summary tab which will be my next PR)

Adding a lastContentRect which contains the (correct/out-of-window)
size, fixes the contentSize calculation in BuildGui().
DaleStan referenced this issue in DaleStan/yafc May 9, 2024
I tried to reuse the existing UI of YAFC, so I based the whole thing on
a `ProjectPageContents` and a `ProjectPageView`, so it would be
recognized and fit into the `MainScreen` (tabs) and serialization.

The UI of the new 'Summary' tab is ugly, I tried making it nicer, but I
found it hard to understand the `ImGui` and its features and how to use
them... So I propose this could be further improved om in separate PRs
to get the basic functionality/feature into YAFC already and make it
available for everyone (I used it a lot and cannot live without this
anymore).

I also fixed some issues I found while implementing the Summary tab,
moved to shpaass#31 and shpaass#34, except for:
* calculating `DatGrid` width when header is not used (I found the
header useless here)

The original idea is from
ShadowTheAge#123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants