Java Game- Game can't find it's graphics jar file

B

BlackHawke

My name is Nick Soutter, I own a small game development company
(www.aepoxgames.net) making our first game (www.andromedaonline.net) in
java.



I am writing because we are having a very serious problem, and I was hoping
someone might have thoughts.



Our game has 2 main programs- one is an updater, the other is the game
client. The updater (AndromedaOnline.jar) checks for updates to the
graphics, sound, client, and of course itself. After applying any updates,
the updater runs the client (AndromedaClient.jar) for people to play with.



When players install this program on their systems with pre-existing
versions of JAVA, it runs fine. When they try to install it after installing
a fresh, new Java JRE, however, it fails.



I am running Java 1.4.1_05 on my system. This runs fine. After some Alpha
testers reported client problems, we brought up a test computer, installed a
fresh Windows XP, installed Java 1.4.1_05 on the system, then installed the
game. The updater ran fine, but the client failed to run. It threw null
pointer exceptions when it tried to load the graphics from the graphics jar
file (AndromedaGFX.jar)



Strange as this may sound, this problem SEEMS to only to occur on newly
installed JRE's.



The problem appears to be that the client is not reading graphics from the
associated graphics jar. The updater is small, so we were able to include
its graphics with the updater, instead of in a separate jar, which is
probably why the updater works fine.



If we take the bad Andromeda game folder, copy it to another computer with
Java on it, the game works fine. But copy the folder back to the freshly
installed computer, and it won't work.



We suspected a classpath issue, but there's a classpath info in the client
jar which should prevent this. Further, we've updated all the classpath
information on the new installation, aswel as path, and JAVA_HOME
environmental variables. None of it worked (it is interesting to note that
classpath isn't set on the working machine, it gets that from the client
manifest).



We've had this problem reported on three windows machines and have been
unable to fix it. On at least 5 machines it appears to runs fine. We haven't
a clue what is causing this problem. It does not appear to be the game or
the code, as copying the game folder from a "bad" machine to a "good" one
allows the client within the folder to work.



It's very strange, and ALL of us here are stumped. We go to beta soon, and
obviously this is a serious problem. Again, as strange as it sounds, the
only common thread is new installs of java where none existed. Install java
on your machine (any 1.4.1 or higher), and the client can't load it's own
graphics files (copy of client manifest below).



If you'd like to see the basic files, they can be found at
http://www.aepox.net/andromeda/Downloads/AndromedaBasic.zip. This includes
the updater and client, as well as the libraries. If you run the updater
(AndromedaOnline.jar) it will attempt to download the graphics package
(AndromedaGFX.jar). If you want to download the entire package (graphics and
everything) it's at
http://www.aepox.net/andromeda/Downloads/AndromedaOnline.zip



Thank you for your time. Any thoughts as to the cause of this troublesome
problem would be MUCH appreciated.



Nick Soutter

Aepox Games



Manifest-Version: Version 1.0

Specification-Title: Andromeda GameClient Classes

Class-Path: lib/jmf.jar;AndromedaGFX.jar;AndromedaSFX.jar;

Main-Class: com.andromeda.gameclient.PreGameClient

Implementation-Title: com.andromeda.gameclient

Specification-Vendor: Aepox Games

Specification-Version: 1.0

Implementation-Version: 40119

Name: com/andromeda/gameclient

Implementation-Vendor: Aepox Games
 
B

BlackHawke

Ohhhhhhhh....

You're right!!

I gave it a shot, and unfortunately that didn't work.... I'd think that
would have been it... Thank you for the suggestion though, nice catch!!!

So unfortunately, despite fixing that problem, this still doesn't work... :(

any other thoughts?

Nick
 
J

Jim Sculley

BlackHawke said:
Ohhhhhhhh....

You're right!!

I gave it a shot, and unfortunately that didn't work.... I'd think that
would have been it... Thank you for the suggestion though, nice catch!!!

So unfortunately, despite fixing that problem, this still doesn't work... :(

any other thoughts?

Have you done any bare bones testing? Make the snallest working piece
of code that uses the same mechanisms to load graphics and see if the
problem persists. Keep things as close to real as possible. In other
words, keep graphics file names the same, keep overall directory
structures the same, and so on. If after this the problem goes away,
you can be fairly certain there is something in your code that is
causing the problem.
 
M

Michael Mangeng

Hi

How does the updater start the game after the update is finished?
Runtime.exec()? direct class-instantiation ?, ... ?

greets,
mike

inexess technology
Software-Development


Jim said:
BlackHawke said:
Ohhhhhhhh....

You're right!!

I gave it a shot, and unfortunately that didn't work.... I'd think that
would have been it... Thank you for the suggestion though, nice catch!!!

So unfortunately, despite fixing that problem, this still doesn't
work... :(

any other thoughts?


Have you done any bare bones testing? Make the snallest working piece
of code that uses the same mechanisms to load graphics and see if the
problem persists. Keep things as close to real as possible. In other
words, keep graphics file names the same, keep overall directory
structures the same, and so on. If after this the problem goes away,
you can be fairly certain there is something in your code that is
causing the problem.
 
B

BlackHawke

This is it:

public static void main(String args[]) {
UpdateFrame uf = new UpdateFrame();

try {Process p =
Runtime.getRuntime().exec("java -Xmx64M -Xms64M -jar AndromedaClient.jar");}
catch(Exception exc) {exc.printStackTrace(System.out);}

uf.removeNotify();
uf.dispose();

Nick
 
B

BlackHawke

You are the best!!!!!

I went over the code, and I FOUND THE PROBLEM.... Thank you!!!!! We had a
different directory for 600x800 resolution which we no longer use. That's
the problem. On 600x800 resolution, the graphics couldn't be found

NIck
 
B

BlackHawke

Thank you all!

Based on a suggestion made her, I looked over the code and found the
problem. In 600x800 settings, a different folder was used to store the
graphics. We disabled 600x800 support, but that line was never commented
out.

Thank's all for helping. It's so incredible that there is the resource of
people like you taking this kind of time. Thank you, thank you, thank you.

Sincerely

Nick Soutter
Aepox Games
 
P

PerfectDayToChaseTornados

|
| That's not worth posting on a public forum because you have
| not shown the relevant code.

I disagree, I think it is good manners to say thanks for the help which you
have received :)
 
B

BlackHawke

Well PerfectDay, I think perhaps hiwa meant the problem was not worth
posting, not the "Thanks" (though I appreciate your defense).

I do disagree with hiwa, however.

I thought the issue would be a classpath issue or something else someone
might have seen before. I didn't post the relative code because, well, I
didn't know what the relevant code might be. The errors were in multiple
class files. I had no way of knowing it was the loader. If I did, I'd have
posted the loader code, but I'd also have known what the problem was, so I
wouldn't have had to post.

When someone requested a segment (the runtime.exe code), I happily posted
it.

And I would not have found the problem had I not seen the post (which I
can't seem to find now) which recommended checking the loader code. That
post lead directly to us finding the problem, and was a huge help (all the
suggestions were great, and one was right!)

So I will respectfully have to disagree with hiwa.

Nick Soutter
 
A

Andrew Thompson

"BlackHawke"
.....
| ....If I did, I'd have
| posted the loader code, but I'd also
| have known what the problem was, so I
| wouldn't have had to post.

Helpful hints..
http://www.physci.org/codes/sscce.jsp

[ invalid groups alt.comp.lang.java-games
dropped, as well as comp.lang.java,
and comp.lang.java.misc ]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top