settlers-remake icon indicating copy to clipboard operation
settlers-remake copied to clipboard

Provide error message to user if original maps cannot be loaded and prevent a crash of the game.

Open andreas-eberle opened this issue 8 years ago • 5 comments

I received the following message via the settlers remake website

Tried to compile and run it via gradlew on Windows 7 64bit (+Java 8 64bit). Checked out a clone via GIT, set up development environment (Android Studio / Eclipse), configured PATH, JAVA_HOME and ANDROID_HOME accordingly … Swing builds fine … thought i was lucky and had the goal achieved … however this is what happens when i run “gradlew run”, i get:

:jsettlers.main.swing:run
No default command line options file found.
Options loaded: {}
Source: (file:/C:/Users/XYZ/Documents/Projekte/Java/jsettlers/jsettlers.main.swing/build/classes/main/ )
java.lang.ArrayIndexOutOfBoundsException: 232
at jsettlers.graphics.reader.AdvancedDatFileReader.getSettlerPointers(AdvancedDatFileReader.java:614)
at jsettlers.graphics.image.MultiImageMap.addSequences(MultiImageMap.java:104)
at jsettlers.graphics.reader.AdvancedDatFileReader.generateImageMap(AdvancedDatFileReader.java:646)
at jsettlers.graphics.map.draw.ImagePreloadTask.run(ImagePreloadTask.java:121)
at java.lang.Thread.run(Thread.java:745)
Exception in thread “main” java.lang.ExceptionInInitializerError
at jsettlers.main.swing.lookandfeel.JSettlersLookAndFeel.install(JSettlersLookAndFeel.java:69)
at jsettlers.main.swing.SwingManagedJSettlers.createJSettlersFrame(SwingManagedJSettlers.java:209)
at jsettlers.main.swing.SwingManagedJSettlers.main(SwingManagedJSettlers.java:65)
Caused by: java.awt.image.RasterFormatException: (x + width) is outside raster
at sun.awt.image.IntegerInterleavedRaster.createWritableChild(IntegerInterleavedRaster.java:467)
at java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1202)
at jsettlers.main.swing.lookandfeel.ui.SettlersLabelUi.(SettlersLabelUi.java:61)
at jsettlers.main.swing.lookandfeel.factory.LabelUiFactory.(LabelUiFactory.java:40)
… 3 more
:jsettlers.main.swing:run FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:jsettlers.main.swing:run’.
> Process ‘command ‘C:\Program Files\Java\jdk1.8.0_91\bin\java.exe” finished wi
th non-zero exit value 1

* Try:
Run with –stacktrace option to get the stack trace. Run with –info or –debug
option to get more log output.

BUILD FAILED

Total time: 5.541 secs

Strange thing though, it started once and i was able to choose the original Settlers3 Folder … however it instantly crashed afterwards … and now i cannot restart the game any longer. "git status" does not show any changed files in my local repository. Where do you store the selection of the Settlers3 folder, i've made?

andreas-eberle avatar May 16 '16 18:05 andreas-eberle

@codingberlin @tomsoftware: Do you have an idea what could cause this?

andreas-eberle avatar May 16 '16 18:05 andreas-eberle

It was me who posted that issue to your blog. However, the solution to this problem is kinda trivial: It turned out my Settlers3 Installation was corrupted. Once i've installed it again from my ancient original CD-Rom JSettlers was able to load successfully. The only reason for this ticket to stay open might be the fact that catching the exception and throwing a more meaningful exception in the future may profit the end-user to spot this problem more easy. For the final release i would definitely recommend to implement a crc32 (or whatever) hashsum check on the original Settlers3 files ... this way you can easily ensure a nice experience for the gamers, i guess :) You could then easily tell the gamers which files they are missing, which are corrupted and need to be replaced, etc. For now i'm totally aware you have completly different priorities ... so maybe you can move this idea to the backlog or something ;)

eLBart0-DTG avatar May 16 '16 20:05 eLBart0-DTG

@eLBart0-DTG: Thanks for your reply. I changed the topic of this issue.

andreas-eberle avatar May 19 '16 14:05 andreas-eberle

if the option disable-original-maps-checksum = true in config [options.prp] is not disabled (by default) the original-map loaded will (hopefully) stop loading if the map-file is corrupted so I don't know where this errer come from.

tomsoftware avatar Jun 01 '16 17:06 tomsoftware

Hey ! I'm trying to run the game in swing but I got a very similar error message :

Found default command line options file. Starting to read. Default command line options file successfully read. Options loaded: {} Source: (file:/C:/Users/Gordak/Documents/PROGRAMMATION/SETTLERS/settlers-remake/jsettlers.main.swing/build/classes/main/ ) java.lang.ArrayIndexOutOfBoundsException: 232 at jsettlers.graphics.reader.AdvancedDatFileReader.getSettlerPointers(AdvancedDatFileReader.java:614) at jsettlers.graphics.image.MultiImageMap.addSequences(MultiImageMap.java:104) at jsettlers.graphics.reader.AdvancedDatFileReader.generateImageMap(AdvancedDatFileReader.java:646) at jsettlers.graphics.map.draw.ImagePreloadTask.run(ImagePreloadTask.java:121) at java.lang.Thread.run(Thread.java:748) Exception in thread "main" java.lang.ExceptionInInitializerError at jsettlers.main.swing.lookandfeel.JSettlersLookAndFeel.install(JSettlersLookAndFeel.java:69) at jsettlers.main.swing.SwingManagedJSettlers.createJSettlersFrame(SwingManagedJSettlers.java:204) at jsettlers.main.swing.SwingManagedJSettlers.main(SwingManagedJSettlers.java:65) Caused by: java.awt.image.RasterFormatException: (x + width) is outside raster at sun.awt.image.IntegerInterleavedRaster.createWritableChild(IntegerInterleavedRaster.java:467) at java.awt.image.BufferedImage.getSubimage(BufferedImage.java:1202) at jsettlers.main.swing.lookandfeel.ui.SettlersLabelUi.(SettlersLabelUi.java:61) at jsettlers.main.swing.lookandfeel.factory.LabelUiFactory.(LabelUiFactory.java:40) ... 3 more :jsettlers.main.swing:run FAILED

It happened while trying to read file Settlers3\gfx\siedler3_11.f8007e01f.dat.

Has anyone a hash to share to verify integrity of gfx and snd files ?

EDIT

I downloaded the amazon demo and replaced 2 files to make it work.

Gordakan avatar Jul 28 '17 18:07 Gordakan