Coder Social home page Coder Social logo

dadido3 / noita-mapcap Goto Github PK

View Code? Open in Web Editor NEW
65.0 3.0 8.0 5.33 MB

A tool to capture a Noita world as a huge image

License: MIT License

Lua 77.94% Go 19.97% PureBasic 1.52% Batchfile 0.02% C 0.54%
noita screenshot map capture-screenshots cartography image-stitching mapping noita-mod noitagame stitching

noita-mapcap's People

Contributors

dadido3 avatar dependabot[bot] avatar wuote avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

noita-mapcap's Issues

Worms are not frozen

It seems like Worms are the only enemy not to be frozen and they like to eat to the ground and ruin the map capture.

image-capture (1)
image-capture (2)

I'm not sure if mods are able to do something about that but I thought I better address this.

stitch ignores output flag

Stitch completely ignores the output flag

stitch -output asdf.png

still outputs a output.png

Just using

stitch

and entering the filename there doesn't work either.

stitch.exe -cleanup fails with 'not enough pixel data'

PS C:\Games\Noita\mods\noita-mapcap> .\bin\stitch\stitch.exe -cleanup 0.999 -input output
2022/07/16 14:54:46 Starting to read tile information at "output"
2022/07/16 14:54:47 Got 2592 tiles
2022/07/16 14:54:47 Total size of the possible output space is (-18816,-32128)-(18304,41856)
2022/07/16 14:54:47 Cleaning up 2592 tiles at (-18816,-32128)-(18304,41856)
10546 / 10585 [----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->] 99.63% 192 p/s ETA 0s2022/07/16 14:55:40 Couldn't get image: png: invalid format: not enough pixel data
panic: Couldn't get image: png: invalid format: not enough pixel data

goroutine 1 [running]:
log.Panic(0xc0001cbc38, 0x1, 0x1)
        C:/Users/travis/.gimme/versions/go1.15.3.windows.amd64/src/log/log.go:351 +0xb7
main.main()
        C:/Users/travis/gopath/src/github.com/Dadido3/noita-mapcap/bin/stitch/stitch.go:185 +0x77d
PS C:\Games\Noita\mods\noita-mapcap>

Utilize DoesWorldExistAt()

I haven't looked at the source code, but it might be possible to use the new Noita lua API function DoesWorldExistAt( min_x, min_y, max_x, max_y ) to detect when an area is ready for capture.

Getting error when starting new game

Hey there, I just downloaded MapCap 2.2.0 and I am getting those errors:

Noita (Apr 23 2021) - 20220827-222431
-------------------------------------------
Error loading lua script - file doesn't exist: mods/noita-mapcap/files/libraries/mod_settings.lua
Error loading lua script - file doesn't exist: mods/noita-mapcap/files/libraries/mod_settings/init.lua
Error loading lua script - file doesn't exist: mods/noita-mapcap/files/libraries/coroutines/init.lua
Error loading lua script - file doesn't exist: mods/noita-mapcap/files/libraries/noita-api/camera/init.lua
Error loading lua script - file doesn't exist: data/scripts/lib/noita-api/camera.lua

Any idea how to fix this?

Keeps going on the loop now

When I was looking to capture map in noita dev build, this goes into an infinite loop:

Lua error: [string "mods/noita-mapcap-master/init.lua"]:10: attempt to call global 'wake_up_waiting_threads' (a nil value).

Running on the last update. I launch this program no problem a couple days ago.

Setting optimization for high resolution monitors.

I wanted to share some settings that significantly sped up the map capture process for me. Works best on a 1440p display, or higher.

The settings show only values I modified after applying the recommendations in the README.md. They extend or override them.

Magic Numbers

  • WORLD_SEED="119984861": Make sure that a new game always starts the same world. Very convenient due to the many crashes that happen during map capture.
  • VIRTUAL_RESOLUTION_X="1280": Improve capture speed on a 1440p monitor.
  • VIRTUAL_RESOLUTION_Y="1280": Improve capture speed on a 1440p monitor.
  • AUDIO_MUSIC_VOLUME_DEFAULT="0": Keeps Noita quiet during map capture.
  • STREAMING_CHUNK_TARGET="24": Seemed to give better performance, although I did not measure it.
<MagicNumbers
	WORLD_SEED="119984861"
	VIRTUAL_RESOLUTION_X="1280"
	VIRTUAL_RESOLUTION_Y="1280"
	AUDIO_MUSIC_VOLUME_DEFAULT="0"
	STREAMING_CHUNK_TARGET="24"
	...
	>
</MagicNumbers>

Config

  • window_h="1280": Must be same as VIRTUAL_RESOLUTION_Y.
  • window_w="1280": Must be same as VIRTUAL_RESOLUTION_X.
  • internal_size_h="1280": Must be same as VIRTUAL_RESOLUTION_Y.
  • internal_size_w="1280": Must be same as VIRTUAL_RESOLUTION_X.
  • backbuffer_height="1280": Must be same as VIRTUAL_RESOLUTION_Y.
  • backbuffer_width="1280": Must be same as VIRTUAL_RESOLUTION_X.
  • rendering_filmgrain="0": No noise in image for improved stitching.
  • rendering_low_quality="0": Ensure high quality rendering.
  • rendering_low_resolution="0": Ensure high quality rendering.
  • rendering_pixel_art_antialiasing="0": Not needed because we take pixel pefect images.
  • screenshake_intensity="0": Just in case.
  • audio_effects_volume="0.3": Reduce audio effects volume for quieter map capture.
<Config
	window_h="1280"
	window_w="1280"
	internal_size_h="1280"
	internal_size_w="1280"
	backbuffer_height="1280"
	backbuffer_width="1280"
	rendering_filmgrain="0"
	rendering_low_quality="0"
	rendering_low_resolution="0"
	rendering_pixel_art_antialiasing="0"
	screenshake_intensity="0"
	audio_effects_volume="0.3"
	...
	>
</Config>

Suggestions welcome.

Not fully loaded area resulting in broken map

While the mod overall worked fine, Noita was a bit slow loading the map fully before the screenshot was made. This results in some faulty chunks on the stitched image.

Is there a way around it (like waiting for the screen portion to fully load or speeding up the map generation/loading on Noitas side)? I was using the the settings on noita-dev.exe given in README.md.
My image looks like shit in comparison to the example one.

The broken image.

My PC specs are pretty beefy (on the CPU side at least):

  • CPU AMD Ryzen 7 3700X
  • RAM 32 GB TridentZ 3200 MHz
  • GPU Nvidia GTX 1060 6GB

I don't think my specs are an issue.

NG+ map capure not working properly

It seems that only already visited chunks are captured properly, otherwise the chunks seem to be the ones from the main world resulting in a partly corrupt map output. I wanted to capture the aftermath of my current NG++ map.

Tested on the latest version of Noita (Dev Build Dec 1 2020). No other mods beside mapcap were active.

Mod doesn't work on Nightmare Mode (New Game +)

I set custom_activation="0" in Noita/mods/nightmare/mod.xml, to make the Nightmare mode available in the mod menu. Starting a new (normal) game then actually starts the Nightmare mode.
But the mapcap mod is not working if the Nightmare mod is active.

(When I click Start capturing full map or Start capturing map around view, the Mod-UI just hides and nothing happens.

nightmare1
nightmare2
nightmare3

I can fly around freely but the mod is not doing its thing.

Disable shaders, GUI and AI

This does disable shaders, GUI and AI. Because it writes to the processes memory, it works only on builds where we know the exact memory address. It also only works on the dev build, because the release build is missing the code that disables the AI.

This effectively replaces pressing F5, F8 and F12.
It also helps with getting a better screen cap, because it stops entities from moving, if the motion is caused by AI.

function OnWorldInitialized() -- This is called once the game world is initialized. Doesn't ensure any world chunks actually exist. Use OnPlayerSpawned to ensure the chunks around player have been loaded or created.
	--[[
		The following code disables shaders, GUI and AI.
	
		While shaders and GUI can be disabled in the release build as well, only the dev build has the debugging feature to disable the AI.
	
		Due to direct memory address write operations, only known builds on known operating systems are supported.
		Adding new builds or operating systems is easy, if someone supports us with the research.
	]] --
	local ffi = require("ffi")
	if DebugGetIsDevBuild() == false then
		GamePrint("This mod cannot be run in the release build. You must run the dev build (noita_dev.exe) to capture a map!")
		GamePrint("If you like to capture the world of your current run, read the README for instructions on how to copy the savegame to the dev build.")
		-- exit mod init somehow?
	else
		if ffi.os == "Windows" then
			if ffi.string(ffi.cast("char*", 0x00F77B0C)) == "Build Apr 23 2021 18:36:55" then -- GOG build
				ffi.cast("char*", 0x010E3B6C)[0] = 1 -- disable shaders (Debug: mPostFxDisabled)
				ffi.cast("char*", 0x010E3B6D)[0] = 1 -- disable GUI     (Debug: mGuiDisabled)
				ffi.cast("char*", 0x010E3B73)[0] = 1 -- freeze AI       (Debug: mFreezeAI)
			elseif ffi.string(ffi.cast("char*", 0x00F80384)) == "Build Apr 23 2021 18:40:40" then -- Steam build
				ffi.cast("char*", 0x010EDEBC)[0] = 1 -- disable shaders (Debug: mPostFxDisabled)
				ffi.cast("char*", 0x010EDEBD)[0] = 1 -- disable GUI     (Debug: mGuiDisabled)
				ffi.cast("char*", 0x010EDEC3)[0] = 1 -- freeze AI       (Debug: mFreezeAI)
			else
				GamePrint("You are running a currently unsupported Noita build.")
				GamePrint("We would appreciate your help to add support for this build. Please open a ticket at https://github.com/Dadido3/noita-mapcap.")
			end
		else
			GamePrint("You are running a currently unsupported OS.")
			GamePrint("We would appreciate your help to add support for this OS. Please open a ticket at https://github.com/Dadido3/noita-mapcap.")
		end
	end
end

Missing luanxml library in release zip file causes failure to load Noita MapCap v2.0.0

Description

I tried out the new version of this mod on a clean install of Noita today and encountered the following errors when starting a new game with the dev build:

error

Steps to reproduce

  1. Install the latest GOG version of Noita (file: setup_noita_20210423-1929_(46552).exe, ingame: Apr 23 2021 - 18:36:55) .
  2. Download and extract noita-mapcap-windows-amd64.zip in the mods folder.
  3. Launch the game with noita_dev.exe.
  4. Activate the mod.
  5. Adjust the mod settings like this:

modsettings

  1. Start a new game.

Additional info

I believe the root cause of this issue is that the luanxml library is not included in the release file, probably because it is imported as a Git submodule. I was only able to use the new version of this mod after manually downloading the nxml.lua file here and placing it in C:\Games\Noita\mods\noita-mapcap\files\libraries\luanxml\.

Map capturing process is frequently interrupted by crashes and "ASSERT FAILED!" error messages

Bug description

The map capturing process proceeds smoothly until around 4,627/14,400, at which point the game starts crashing and spitting out error messages at seemingly arbitrary intervals.

Steps to reproduce

  • Install Noita 1.0 from Steam on Windows 10.
  • Set up Noita MapCapture and start the extended map capturing process as outlined in these instructions.
  • Wait for Noita to crash and/or to start displaying error messages.

Environment

  • OS: Windows 10
  • Platform: Steam
  • Noita version: 1.0
  • Mods: Noita MapCapture
  • Resolution: 1024x1024

Hardware

  • GPU: RTX 2080 (8GB VRAM)
  • CPU: i9 9900k (8c/16t)
  • RAM: 16GB DDR4
  • Storage: NVMe SSD

Screenshots

  • Error message displayed when loading a save to start/resume the map capturing process:
    start

  • Error message displayed after the game crashes at 4,627, 7,841, 11,028 and 14,220:
    crash

  • Error messages displayed at 10,220, 10,225, 10,288, 10,575, 11,099:
    563
    987
    1701

Could we get a list of item coordinates?

Would it be possible to capture coordinates of items like wands during map capture?

Perhaps EntityGetInRadius could be used to output coordinates and item type (wand, spell, chest, etc.) to a file, before or after each screen capture?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.