Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Lode Runner remake  (Read 8714 times)
0 Members and 1 Guest are viewing this topic.
Offline m_waddams
« Posted 2011-05-30 13:32:48 »

Hi everyone,

My first try at some java game programming. Only 55 levels yet, more coming. Press F1 for Help.

Website
Webstart
Linux 32
Linux 64
Windows 32
Windows 64
Solaris 32
Solaris 64
Mac OSX
Applet

Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2011-05-30 15:01:08 »

Vista64, JDK7 32bit:

java.lang.NoSuchMethodError: checkAndLoadMain
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"

(Didn't run)

Cas Smiley

Offline m_waddams
« Reply #2 - Posted 2011-05-30 15:10:07 »

Vista64, JDK7 32bit:

java.lang.NoSuchMethodError: checkAndLoadMain
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
Thanks for testing!

You probably need the 64 bits native lwjgl libraries.
Download the latest lwjgl (lwjgl.org) and copy the native/windows/*64.dll to LodeRunner/native/

I'll put the native libs on my website too, hopefully lwjgl releases for Android and iOS too, that would be cool.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline teletubo
« League of Dukes »

JGO Ninja


Medals: 48
Projects: 4
Exp: 8 years



« Reply #3 - Posted 2011-05-30 16:14:50 »

Vista64, JDK7 32bit:

java.lang.NoSuchMethodError: checkAndLoadMain
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
Thanks for testing!

You probably need the 64 bits native lwjgl libraries.
Download the latest lwjgl (lwjgl.org) and copy the native/windows/*64.dll to LodeRunner/native/

I'll put the native libs on my website too, hopefully lwjgl releases for Android and iOS too, that would be cool.


why not using the fantasitc AppletLoader ? it works really well .

Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #4 - Posted 2011-05-30 17:20:40 »

Vista64, JDK7 32bit:

java.lang.NoSuchMethodError: checkAndLoadMain
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"
Thanks for testing!

You probably need the 64 bits native lwjgl libraries.
Download the latest lwjgl (lwjgl.org) and copy the native/windows/*64.dll to LodeRunner/native/

I'll put the native libs on my website too, hopefully lwjgl releases for Android and iOS too, that would be cool.
Why don't you just include the 64 bit natives?
Also, princec is the one who started LWJGL Wink

And for Android and iOS, there's libGDX Cheesy

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #5 - Posted 2011-05-30 20:42:29 »

Win7 64-bit.
java.lang.UnsatisfiedLinkError: C:\Users\Mads Horndrup\Downloads\loderunner\LodeRunner\native\lwjgl.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(Unknown Source)
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:73)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:82)
   at org.lwjgl.Sys.<clinit>(Sys.java:99)
   at Game.<clinit>(Game.java:70)
Could not find the main class: Game.  Program will exit.
Exception in thread "main"

Did not run.

Offline m_waddams
« Reply #6 - Posted 2011-05-31 11:12:45 »

Why don't you just include the 64 bit natives?
Filesize Smiley Would be around 6 MB. The actual java classes are only 92 KB, feels wrong to have such a large file for such a small game.
I'll create downloads for all different platforms, like puppy does.
Offline m_waddams
« Reply #7 - Posted 2011-05-31 11:29:50 »

why not using the fantasitc AppletLoader ? it works really well .
Does it then only run in a browser? Does it reload the natives each time?
What about sound? Does that play in a browser?
Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #8 - Posted 2011-05-31 20:14:41 »

why not using the fantasitc AppletLoader ? it works really well .
Does it then only run in a browser? Does it reload the natives each time?
What about sound? Does that play in a browser?
It's called an Applet for a reason.
And of course sound is played Tongue

Offline m_waddams
« Reply #9 - Posted 2011-06-01 09:13:09 »

It's called an Applet for a reason.
And of course sound is played Tongue

I'll give it a go. For now I've just created a lot of links Smiley

Linux 32
Linux 64
Windows 32
Windows 64
Solaris 32
Solaris 64
Mac OSX
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2011-06-01 10:25:17 »

Hm get the same problem with both 32/64 bit zips. My machine may not be as sane as it should be though.

Cas Smiley

Offline m_waddams
« Reply #11 - Posted 2011-06-01 11:17:50 »

Hm get the same problem with both 32/64 bit zips. My machine may not be as sane as it should be though.
Hmm, something can't find the LodeRunner 'main' maybe?

I used a copy of the spaceinvaders tutorial by Kevin Glass ( public static void main(String argv[])  ).
I've now changed it to 'public static void main(String[] args)'.

Could you try it again?
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #12 - Posted 2011-06-01 11:31:06 »

the reason why it fails for princec above is because you've split the 32bit and 64bit natives, LWJGL tries to load the 32bit natives first, if that fails, it then loads the 64bit natives. Since it doesn't find the 32bit natives at all on windows64 it assumes that all natives are missing and fails.

What would be a better idea is to bundle 32 and 64 bit natives together and just have a bundle for each platform (windows, linux, mac and solaris). Its such a small overhead that it hardly matters on today's computers and internet speeds.
Offline m_waddams
« Reply #13 - Posted 2011-06-01 11:41:08 »

the reason why it fails for princec above is because you've split the 32bit and 64bit natives, LWJGL tries to load the 32bit natives first, if that fails it then loads the 64bit natives. Since it doesn't find the 32bit natives at all on windows64 it assumes they are missing and fails.
Ah, that makes sense Smiley I'll fix my downloads. Maybe LWJGL should try for the 64bit natives at least  Huh
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #14 - Posted 2011-06-01 11:45:31 »

Ah, that makes sense Smiley I'll fix my downloads. Maybe LWJGL should try for the 64bit natives at least  Huh

Yeh, LWJGL shouldn't really require the 64bit natives and 32bit natives to function on 64bit systems. However there is a patch on the LWJGL forums that could potentially change this in future releases.
Offline m_waddams
« Reply #15 - Posted 2011-06-01 13:49:25 »

why not using the fantasitc AppletLoader ? it works really well .
Does it then only run in a browser? Does it reload the natives each time?
What about sound? Does that play in a browser?
It's called an Applet for a reason.
And of course sound is played Tongue
I'm trying to make it work, but all I end up with is a blank screen.

Lode Runner Retro applet

Is there any way to debug what is happening?
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #16 - Posted 2011-06-01 14:04:02 »

I'm trying to make it work, but all I end up with is a blank screen.

Lode Runner Retro applet

Is there any way to debug what is happening?

Yes, enable the Java Console from the Java Control Panel (this will then show while the applet runs in the browser).

The problem however seems to be with your main Game class's initialising method, just make sure its in the form

1  
2  
3  
public Game() {
....
}


and not something like public Game(String blah, int blah) {} this is because a newInstance() of your main class is needed.
Offline m_waddams
« Reply #17 - Posted 2011-06-01 15:36:50 »

The problem however seems to be with your main Game class's initialising method, just make sure its in the form

1  
2  
3  
public Game() {
....
}

Well that helped a bit Smiley

Now I get a whole lot of stacktrace, the only thing I can make out is:

    at Game.<clinit>(Game.java:70)

which is     private static long timerTicksPerSecond = Sys.getTimerResolution();
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #18 - Posted 2011-06-01 15:44:42 »

Now I get a whole lot of stacktrace, the only thing I can make out is:

    at Game.<clinit>(Game.java:70)

which is     private static long timerTicksPerSecond = Sys.getTimerResolution();

The above uploaded applet still shows the old error, so I guess its not updated yet, can you please paste more of the java console output of the error or update the above uploaded applet.

thx
Offline m_waddams
« Reply #19 - Posted 2011-06-01 15:55:25 »

Now I get a whole lot of stacktrace, the only thing I can make out is:

    at Game.<clinit>(Game.java:70)

which is     private static long timerTicksPerSecond = Sys.getTimerResolution();

The above uploaded applet still shows the old error, so I guess its not updated yet, can you please paste more of the java console output of the error or update the above uploaded applet.
Uploaded the new one. Thanks for helping.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #20 - Posted 2011-06-01 16:10:08 »

oh, I see the issue, your main class needs to be an Applet. Currently its an Application and that is why its failing.

You need to refactor your main class into an Applet or create a new Applet class along side your Application class.

Have look at the LWJGL Wiki for an example of a what a Basic LWJGL Applet should look like. Its not very different or difficult to convert a LWJGL Application into a LWJGL Applet.
Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #21 - Posted 2011-06-01 17:31:58 »

You 64bit zip plays fine. What a fun game! What are they keys? I could only find the arrows, space, and Q for quit.

However I get this in the console when I run your applet:
1  
java.lang.ClassCastException: Game cannot be cast to java.applet.Applet

As kappa said, your Game class needs to extend Applet.

Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #22 - Posted 2011-06-02 16:06:16 »

The Win64 version ran fine on my machine. I had forgotten how much fun and how hard loadrunner is. Great remake.

Attempting to switch out of fullscreen didn't work and I was just stuck with a black screen.

Offline m_waddams
« Reply #23 - Posted 2011-06-03 11:16:41 »

You 64bit zip plays fine. What a fun game! What are they keys? I could only find the arrows, space, and Q for quit.
What more keys would you like? See the README, or F1 for Help.
There's a new version, with better AI and joystick handling. Try my favorite levels, 6 and 14 (select through left/right on the title screen).

Quote
However I get this in the console when I run your applet:
1  
java.lang.ClassCastException: Game cannot be cast to java.applet.Applet

As kappa said, your Game class needs to extend Applet.
I'll fix this later, thanks.
Offline m_waddams
« Reply #24 - Posted 2011-06-03 11:19:53 »

The Win64 version ran fine on my machine. I had forgotten how much fun and how hard loadrunner is. Great remake.
Thanks Smiley

Quote
Attempting to switch out of fullscreen didn't work and I was just stuck with a black screen.
It should at least have written to the cfg file, so the next startup would start windowed?
Offline m_waddams
« Reply #25 - Posted 2011-06-04 08:33:43 »

Quote
1  
java.lang.ClassCastException: Game cannot be cast to java.applet.Applet

As kappa said, your Game class needs to extend Applet.

I got my applet working, pretty smooth when fullscreen. But the initialization takes close to a minute,
 after the LWJGL progressbar has finished that is. When I run the applet in Eclipse there is no waiting, like when running as an application.

The problem seems to be:

1  
InputStream is = Sprite.class.getClassLoader().getResourceAsStream("tiles/" + ref);


It does this for every tile in the background, which is 16 x 28...
Tiles are only 20 by 22 and about 1KB per tile (PNG). Why is this so slow?

Update: I now just generate them from 1 big getResourceAsStream, saves 45 seconds! I would still like to know why getResourceAsStream is so slow though. I'll have to rewrite getting the other sprites and levels within 1 read too, that should save another 10 seconds or so. Bit of a hassle since it is not really an option for the application version, where you can make your own levels, so I have to keep the old code too...
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #26 - Posted 2011-06-04 10:57:52 »

It should at least have written to the cfg file, so the next startup would start windowed?
Yep it did, but alt-tab didn't even work to get out of the game when it black-screened. Had to ctrl-alt-del -> task-manager to get out of it, so it might not be the way for general population to switch Smiley

Tested the applet version as well. It sort of worked, but the up key was "stuck", so that made a challenging game even more challenging Wink Quite interesting to find ways to solve it... Tested on both FF and chrome, Win7

Offline m_waddams
« Reply #27 - Posted 2011-06-04 11:11:53 »

Yep it did, but alt-tab didn't even work to get out of the game when it black-screened. Had to ctrl-alt-del -> task-manager to get out of it, so it might not be the way for general population to switch Smiley
The applet version starts windowed (within the browser that is). What happens if you go fullscreen (guess that works) and then back again?

Quote
Tested the applet version as well. It sort of worked, but the up key was "stuck", so that made a challenging game even more challenging Wink Quite interesting to find ways to solve it... Tested on both FF and chrome, Win7
Hmm, I have that with a wrongly calibrated joystick sometimes, otherwise this is new to me...
Just found out I had I wrong link in the opening post, guess you knew where to find it?
Could you test the latest version, see if the loading time has improved for you? (you can browse java-expert.nl/games/ to see modification times, to see if you're testing a newer version : )
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #28 - Posted 2011-06-04 15:17:58 »

The applet version starts windowed (within the browser that is). What happens if you go fullscreen (guess that works) and then back again?
Never thought of testing that... Went to fullscreen OK, but black screen again in the way back, but this time I could at least alt-tab away from it. This could naturally have something to do with it:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
java.io.FileNotFoundException: LodeRunner.cfg (Access is denied)
   at java.io.FileOutputStream.open(Native Method)
   at java.io.FileOutputStream.<init>(Unknown Source)
   at java.io.FileOutputStream.<init>(Unknown Source)
   at loderunner.Config.write(Config.java:40)
   at loderunner.Game.getInput(Game.java:842)
   at loderunner.Game.renderFrame(Game.java:457)
   at loderunner.Game.gameLoop(Game.java:442)
   at loderunner.Game.access$0(Game.java:435)
   at loderunner.Game$1.run(Game.java:67)


Hmm, I have that with a wrongly calibrated joystick sometimes, otherwise this is new to me...
Could be. Tried to control it with wheel, but no luck

Just found out I had I wrong link in the opening post, guess you knew where to find it?
Ye, hacker I am Smiley

Could you test the latest version, see if the loading time has improved for you? (you can browse java-expert.nl/games/ to see modification times, to see if you're testing a newer version : )
Didn't think about loading time first time around, so was probably not too bad then, but really fast now at least.

Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #29 - Posted 2011-06-04 16:16:26 »

Applet version worked fine, though there were no sounds. How do you go to full screen in the applet?

Pages: [1] 2
  ignore  |  Print  
 
 

 
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!