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

Add custom settings feature #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danielniccoli
Copy link

@Dadido3 this is the pull request for the settings feature. It just needs one more thing to properly work, which is that in capture.lua the CAPTURE_GRID_SIZE should be read from settings.jsonc if the file exists, otherwise read it from settings.default.jsonc.

@Dadido3
Copy link
Owner

Dadido3 commented Jul 20, 2022

While an easier setup would be nice to have there are a few notes:

  • I would prefer the mod to set up everything by itself. So you just have to enter the desired grid size and resolution into an ingame UI and the mod will modify all needed files. Redoing the setup part should actually simplify the setup process, no more editing of Lua/XML files or running any scripts. The cumbersome way everything has to be set up stems from the earlier Noita days, where you couldn't really create sophisticated UIs, there was only clickable text.
  • The default virtual resolution of 1280x720 was meant to be used with the non dev noita executable (the regular game), because that was one of the resolutions available from the settings menu, and it was neither too small or too large. If everything is set up automatically, i think 1024x1024 would be a better default, as it is a multiple of the chunk size.
  • A grid size of 1024 may not be a good value for everyone, at least for me it causes much less or none mobs to appear on the screenshots. Also, the chance of missing chunks and other artifacts seems to happen more. While you could delete any images with artifacts by hand and recapture them, i prefer an automatic process that may take twice as long but results in a good quality result.
  • It should be made more clear that running this script is optional, or the steps with the script should have their own section in the readme file (like "Automatic setup"). The README.md is a mess right now, and probably confuses a lot of people. I'll definitely rewrite and simplify it a lot once the whole process is reduced to install mod, activate mod, restart Noita, start capturing or something similar.

I will look into reading the grid size from the JSON file, but as i said above i'll probably rewrite the setup process sooner or later. That will result in the PowerShell script getting obsolete.

@danielniccoli
Copy link
Author

I would prefer the mod to set up everything by itself.

Ideally, yes. As long as it stays a manually triggered process, especially for files outside the mod folder.

I think 1024x1024 would be a better default.

I agree that it is the better resolution. But it shouldn't be the default, because most people probably still have 1080p monitors and 1024 won't fit on the screen.

A grid size of 1024

The grid size determines how the camera is moving, correct? So if a screen capture is taken at x, y the camera will move to x, y+grid_size for the next capture, correct? It is odd that in this case enemies and other entities don't fully load. I always thought a chunk is fully loaded only with the entities in it. Is there maybe a way to programmatically ensure the chunks are fully loaded, instead of relying on luck? Also, if grid_size works as I described before, then it takes four times as long with 512 compared to 1024. Not twice as long :)

@Dadido3
Copy link
Owner

Dadido3 commented Jul 22, 2022

I agree that it is the better resolution. But it shouldn't be the default, because most people probably still have 1080p monitors and 1024 won't fit on the screen.

1024x1024 including the border and title bar does fit on a full HD screen, as long as the window is moved to the topmost position. It doesn't matter if some part is covered by the taskbar.

So if a screen capture is taken at x, y the camera will move to x, y+grid_size for the next capture, correct? It is odd that in this case enemies and other entities don't fully load.

Exactly, but it seems that Noita distributes entity generation for a chunk over several frames. There is only a way to check if a chunk is loaded, i already do that and wait until all chunks are there and get rendered. But it can still happen that Noita takes its time to fill the chunk with entities and scenery. And if the grid size is smaller, the game has more time to load stuff in neighbor chunks (which may be already loaded outside of the viewport). A grid size of 512 is a good tradeoff for speed and correctness.

it takes four times as long with 512 compared to 1024

Well, 512 creates 4 times as much pixels (Due to overlap), but the chunks that are already generated will not slow down the capturing process much, and the speed mainly depends on how fast Noita can generate chunks. From my experience it's about twice as fast, maybe 2.5 times.

Anyways, i'm currently rewriting some logic (E.g. how coordinate systems are transformed) that would allow the mod to work with any window resolution and still be as pixel perfect as possible.

After that i'll look into adding a user interface so everything can be set up inside Noita itself.

Ideally, if everything works as expected, you just have to start the game with the mod enabled, change some stuff (maybe restart Noita) and start capturing. Additionally it should work well with the normal and dev version of the game, so you can also use the mod to capture progress while playing.

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

Successfully merging this pull request may close these issues.

None yet

2 participants