Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Split steps.lua #348

Open
theis999 opened this issue Sep 24, 2023 · 11 comments
Open

Split steps.lua #348

theis999 opened this issue Sep 24, 2023 · 11 comments
Labels
enhancement New feature or request

Comments

@theis999
Copy link
Collaborator

Split the generated steps into multiple files

This has 2 advantages:
Performance: It could make generation of the step files faster, if we only need to generate the last fraction of the steps.
Debugger: At least in my setup, the Factorio mod debugger has trouble with Lua files in excess of 10k lines.

This idea is fairly simple, though implementation could still be a bit tricky.

I am imaginen having 1 steps.lua file, this file then have references to several files with the actual steps.
We would split these lesser steps files with about 5k steps in each.
The Lua generator, would have to keep a state of which files have to be updated.

@theis999 theis999 added the enhancement New feature or request label Sep 24, 2023
@theis999 theis999 assigned theis999 and unassigned theis999 Sep 24, 2023
@MortenTobiasNielsen
Copy link
Owner

I am not entirely sold on the idea of introducing this type of complexity unless there is a very tangible benefit to doing it. Have you investigated what causes the debugger to have problems when the file is larger than 10k steps - does it need to keep track of all the steps?

@theis999
Copy link
Collaborator Author

I have received confirmation that it is in fact a bug in the debugger, that it can't handle large files.

I think there is still value in a faster script generation step. Whether it is enough value for the trouble, perhaps not.

@MortenTobiasNielsen
Copy link
Owner

Have the generation time degregated? When I last generated the script for my run it was so fast it almost didn't make sense to show the progress bar.

@CasparPetch
Copy link

FWIW, my script with ~30k tasks takes about 2 seconds to generate. Because it is not clear when the generation is finished this sometimes means I launch from the save point before generation is finished and so I get the "old" version of the script playing instead of new, which is confusing as it's not clear if the change I made had no effect or if the change didn't happen at all.

@MortenTobiasNielsen
Copy link
Owner

Aren't there being shown a progress bar when you generate the script?

I don't remember it as taking anywhere near that amount for my run which was more than 30k if I remember correctly. This could be due to hardware, but the tool isn't multi-threaded so it shouldn't be possible for it to be crazy much faster on high- vs low-end gear.

@CasparPetch
Copy link

CasparPetch commented Sep 27, 2023

Yes I have the progress bar which appears in a new window that is underneath the main window, so I don't get to see it. Maybe the progress bar should be integrated into the main window?

@MortenTobiasNielsen
Copy link
Owner

Why have you dragged the progress bar where you cannot see it? 😅

It would be pretty neat if the progress bar was integrated in the main window. I am though not aware if the framework supports it.

@CasparPetch
Copy link

I use the same screen for everything so it naturally goes behind all other windows. Infact, sometimes it messes with my alt-tab when it quickly appears and disappears

@MortenTobiasNielsen
Copy link
Owner

I see, that way "goes underneath". 🙂

@theis999
Copy link
Collaborator Author

Keep in mind that Zaspar usually streams his development, which steals significant resources too.

It should be possible to integrate the progress bar on the main window, using basically the same elements. Though that should probably be raised as it's own issue.

@MortenTobiasNielsen
Copy link
Owner

Ahh Yeah, that could cause performance issues of there isn't a thread available. I would though guess the vast majority of the load from streaming would be taken by the GPU, but none the less it could be the reason.

Agreed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants