HelloOO7 / BounceTales

Decompilation of Rovio's Bounce Tales (2008) video game for Nokia mobile devices.
28 stars 1 forks source link

possibly a bug with level resource names #7

Closed SuperPou1 closed 1 year ago

SuperPou1 commented 1 year ago

i tried to rename the first chapter file (level_campaign01.rlef) to level_test.rlef, then i recomposed resources, edited LEVEL_RESIDS in bouncegame to reflect the new level name, and that caused the game to not load the level at all and this error appears:

java.lang.IndexOutOfBoundsException 
    at com.sun.cldc.io.ResourceInputStream.read(ResourceInputStream.java:201)
    at java.io.DataInputStream.read(DataInputStream.java:149)
    at bouncetales.GameRuntime.readInputStreamToBytes(GameRuntime.java:1520)
    at bouncetales.GameRuntime.readResource(GameRuntime.java:1709)
    at bouncetales.GameRuntime.processResourceLoad(GameRuntime.java:1441)
    at bouncetales.GameRuntime.updateGameLoad(+79)
    at bouncetales.GameRuntime.run(+391)
java.lang.ArrayIndexOutOfBoundsException    
    at bouncetales.BounceGame.loadLevel(BounceGame.java:2251)
    at bouncetales.BounceGame.loadScene(+753)
    at bouncetales.GameRuntime.updateGameLoad(+101)
    at bouncetales.GameRuntime.run(+391)

after that error, this error is constantly repeating:

java.lang.NullPointerException  
    at bouncetales.BounceGame.getPlayerState(BounceGame.java:613)
    at bouncetales.BounceGame.update(BounceGame.java:1724)
    at bouncetales.GameRuntime.gameUpdate(+134)
    at bouncetales.GameRuntime.run(+556)

any idea why this is happening? do these level names really have a meaning?

HelloOO7 commented 1 year ago

Are you using the updated ResourceID mapping generated by BounceComposer?

SuperPou1 commented 1 year ago

yeah, it's automatically updated

HelloOO7 commented 1 year ago

I just tried doing what you described and everything works as expected so it must've been something wrong on your end.

SuperPou1 commented 1 year ago

another thing i observed, when i change the level name to for example level_campaign001.rlef the game works as intended so that's kinda weird

SuperPou1 commented 1 year ago

wierd, i tried to do it again and now it works every time, even tho i didn't really change anything in what i did

SuperPou1 commented 1 year ago

okay, i tried to revert the original name and recomposed with bouncetools, and now i'm getting the same errors as i did in the beginning, so this must be some bug with bouncetools or maybe even netbeans. try for yourself.

HelloOO7 commented 1 year ago

I did that as well and all is in order. The process is the same every time so there isn't a possibility of BounceTools being the culprit. If I had to guess you probably didn't rebuild the project properly or have something out or sync between the IDE and Composer.

SuperPou1 commented 1 year ago

i figured it out. using "clean and build" fixes the issue!