jeheydorn / nortantis

Nortantis is a fantasy map generator. It uses a simple tectonic plate simulation to create islands and continents with trees, rivers, and mountains. The result has the appearance of an old-fashioned hand-drawn map.
GNU Affero General Public License v3.0
70 stars 19 forks source link

Error message with no map #7

Closed 123mind123 closed 2 years ago

123mind123 commented 4 years ago

Error message says "unable to read word dictionary file" after pressing Generate.

123mind123 commented 4 years ago

If I turn off text it says "no awt in java.library.path"

jeheydorn commented 4 years ago

This probably means you're trying to run the map generator without first unzipping the zip file. If you did unzip it, try redownloading it and unzipping it again.

On Sat, May 9, 2020, 2:54 AM 123mind123 notifications@github.com wrote:

If I turn off text it says "no awt in java.library.path"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jeheydorn/nortantis/issues/7#issuecomment-626124600, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY34KNXVLSRTTCNMRZFA6LRQUDZ5ANCNFSM4M4V7LPA .

jbylicki commented 2 years ago

It might be an encoding issue. It is set in the source to use Charset.defaultCharset() as the default character set, probably assuming it is going to be UTF-8. And for me it was in fact, this test code's output is: The default charset of the machine is :UTF-8

The test code:

import java.nio.charset.Charset;
public class test {

    public static void main(String[] args)
    {
        Charset cs = Charset.defaultCharset();
        System.out.println("The default charset of the machine is :" + cs.displayName());
    }
}

However I still got an error like this:

Starting
java.lang.RuntimeException: Unable to read word dictionary file.
    at nortantis.NameCompiler.<init>(NameCompiler.java:52)
    at nortantis.TextDrawer.<init>(TextDrawer.java:112)
    at nortantis.MapCreator.createMap(MapCreator.java:102)
    at nortantis.RunSwing$3$1.doInBackground(RunSwing.java:380)
    at nortantis.RunSwing$3$1.doInBackground(RunSwing.java:1)
    at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.nio.charset.MalformedInputException: Input length = 1
    at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
    at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
    at java.base/java.io.InputStreamReader.read(InputStreamReader.java:177)
    at java.base/java.io.BufferedReader.fill(BufferedReader.java:162)
    at java.base/java.io.BufferedReader.readLine(BufferedReader.java:329)
    at java.base/java.io.BufferedReader.readLine(BufferedReader.java:396)
    at java.base/java.nio.file.Files.readAllLines(Files.java:3415)
    at nortantis.NameCompiler.<init>(NameCompiler.java:49)
    ... 10 more

After adding -Dfile.encoding=UTF-8 to java's arguments, it has worked flawlessly. The final command is: java -XX:MaxRAMPercentage=50.0 -Dfile.encoding=UTF-8 -jar nortantis_map_generator.jar I'd suggest adding it if it causes no external problems, or at least leave that message in the issue in case someone stumbles in here with the same problem. Cheers and thanks for the awesome work with this generator

jeheydorn commented 2 years ago

Thanks for investigating this. I went ahead and made the changes you suggested in the run files for Windows and Linux.