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

Misleading error message on empty world #84

Open
xynydev opened this issue Mar 18, 2022 · 5 comments
Open

Misleading error message on empty world #84

xynydev opened this issue Mar 18, 2022 · 5 comments
Assignees

Comments

@xynydev
Copy link

xynydev commented Mar 18, 2022

I've tried with both the latest releases and a new build using the commands in Readme.md.
Anything in #64 didn't help.

Here's the command I'm running:
[path-to-mcmap-executable] -from -2006464 -1995968 -to -2006337 -1995841 -vv [path-to-world]

And here's the output of the command:

[Debug] Parsing [path-to-world]/level.dat
[Debug] Processed boundaries: 2147483647.2147483647.-64 ~> -2147483648.-2147483648.319 (North-West)
[Error] Nothing to render: -from X Z has to be <= -to X Z
Usage: [path-to-mcmap-executable] <options> WORLDPATH
...

I've also tried swapping -from and -to.
As you can see, -from X Z <= -to X Z.

@spoutn1k
Copy link
Owner

When you input boundaries, mcmap will intersect your boundaries with the available map and render that.

This line: [Debug] Processed boundaries: 2147483647.2147483647.-64 ~> -2147483648.-2147483648.319 (North-West) means that the intersected coordinates are undefined; maybe your world is empty, maybe you put the wrong dimension; either way, it did not find terrain to render.

The whole argument parsing needs to be remade. This is confusing and misleading.

To make sure, look at the output of ls [path-to-world]/region (for the overworld).

@xynydev
Copy link
Author

xynydev commented Mar 20, 2022

Thanks for this, turns out it was my fault and I was just executing the command with the wrong world directory...

@xynydev xynydev closed this as completed Mar 20, 2022
@spoutn1k spoutn1k self-assigned this Mar 21, 2022
@spoutn1k spoutn1k changed the title [Error] Nothing to render: -from X Z has to be <= -to X Z: Error on Linux 64bit with large negative -from and -to. Misleading error message on empty world Mar 21, 2022
@spoutn1k spoutn1k reopened this Mar 21, 2022
@deltreey
Copy link

I cannot figure out how you managed to do this. I was trying to create a fix, but I cannot reproduce this issue. When you generate a new world, it automatically generates some spawn chunks. If you close minecraft too early, or something else weird, it doesn't create and level.dat files, and there are logical error messages already built in for this.

[2022-06-16 20:34:02.053] [mcmap_cli] [error] Error opening file '/home/deltreey/.local/share/multimc/instances/1.18.2/.minecraft/saves/New/level.dat': No such file or directory
[2022-06-16 20:34:02.053] [mcmap_cli] [error] Error opening file 'World/level.dat': No such file or directory
[2022-06-16 20:34:02.053] [mcmap_cli] [error] Given folder does not seem to be a save file

Can you give some instructions on how to reproduce this error?

@spoutn1k
Copy link
Owner

This error arises when the requested area does not overlap with the available terrain. Try rendering a new world with the -from -5000 -5000 -to -4990 -4990 options (the values do not really matter).

mcmap calculates the intersection of what is requested and what is available. When this is an empty area, the area has its coordinates set to special values, and this is not checked in the argument parsing code. Those values are the integer boundaries (minX/Z to the maximum possible value, maxX/Z to the minimum). This triggers the error that you see.

The whole argument parsing code is legacy from the start of the project. One needs to take it all down and use a modern c++ library to parse the command line.

@deltreey
Copy link

probably too far out of my comfort zone then. I'll leave this for someone better with C++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants