tonihele / OpenKeeper

Dungeon Keeper II remake
GNU General Public License v3.0
437 stars 41 forks source link

NPE in RoomConstructor #434

Closed ForNeVeR closed 1 year ago

ForNeVeR commented 1 year ago

Hi! I am excited about this project, but, unfortunately, I wasn't able to make it work, yet.

Is it already in the state when ./gradlew run is supposed to work correctly?

I have started it using JDK 17, imported data from GOG release of DK2, and then I'm getting a lot of "Cannot locate resource" warnings (in fact, 655 of them), and then an exception on startup:

java.lang.NullPointerException: Cannot invoke "com.jme3.scene.VertexBuffer.getData()" because "inBuf" is null
    at com.jme3.scene.BatchNode.mergeGeometries(BatchNode.java:512)
    at com.jme3.scene.BatchNode.doBatch(BatchNode.java:223)
    at com.jme3.scene.BatchNode.batch(BatchNode.java:179)
    at toniarts.openkeeper.view.map.construction.RoomConstructor.construct(RoomConstructor.java:59)
    at toniarts.openkeeper.view.map.MapViewController.handleRoom(MapViewController.java:828)
    at toniarts.openkeeper.view.map.MapViewController.handleRoom(MapViewController.java:577)
    at toniarts.openkeeper.view.map.MapViewController.load(MapViewController.java:134)
    at toniarts.openkeeper.game.state.MainMenuState.loadMenuScene(MainMenuState.java:165)
    at toniarts.openkeeper.game.state.MainMenuState.<init>(MainMenuState.java:123)
    at toniarts.openkeeper.Main$5.onLoad(Main.java:400)
    at toniarts.openkeeper.game.state.loading.LoadingState$LoadingThread.run(LoadingState.java:192)

After that, the process gets terminated.

tonihele commented 1 year ago

Thanks for reporting this. This is a very recent regression from https://github.com/tonihele/OpenKeeper/pull/431.

In the meanwhile to get things working, you can https://github.com/tonihele/OpenKeeper/tree/e0d29ff32e81bed49c034df85b2c9d444eff0f57 and download this revision instead.

ForNeVeR commented 1 year ago

I can confirm that the issue was fixed by the following sequence of actions:

  1. Switch to said commit, e0d29ff32e81bed49c034df85b2c9d444eff0f57.
  2. Remove openkeeper.properties to re-import the game data.
  3. Start the game again.

Thanks!

I guess let's keep the issue open until we've got a proper fix in master?

tonihele commented 1 year ago

Ah yes, good catch the property file removal. Yes, let's keep this open until a proper fix.