Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2
1  Games Center / Archived Projects / Re: Technopolies on: 2005-12-07 09:31:26
Have you tried deleting the game files localy and clicking on the web start again?
2  Java Game APIs & Engines / Java Sound & OpenAL / Re: how do you play MID files using Java? on: 2005-11-26 13:17:03
this is what i got:
--------------------------------------------------------------------------------
try
info.getName()
info.getDescription()

-------------------------------------------------------------------------------
You should get Java 1.5, as the midi sequencer gives good timing. Also
read :

http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html#js

Albert

--------------------------------------------------------------------------------
that's alright:
- earlier versions of the JDK did not support external MIDI ports or
hardware synthesizers
- if the internal Java Sound synthesizer cannot be initialized, you
will
not have a single MIDI device accessible from Java

The internal Java synth needs:
- a soundcard with CD quality capability
- an installed Java soundbank (check java.sun.com/sound or this mailing
list's archive how to install a soundbank)

Florian
3  Java Game APIs & Engines / Java Sound & OpenAL / Re: how do you play MID files using Java? on: 2005-11-25 13:18:27
Ok. I did it. Now i suppose wait for a response. I'll get back with it ASAP.
4  Java Game APIs & Engines / Java Sound & OpenAL / Re: how do you play MID files using Java? on: 2005-11-25 10:02:33
I also noticed a problem which might make my problem more clear to somebody...

1  
2  
3  
4  
5  
MidiDevice.Info[] info = MidiSystem.getMidiDeviceInfo();
         System.out.println("Info=" + info.length);
         for (int i = 0; i < info.length; i++) {
              System.out.println(info[i]);
         }


returns "0". Like i don't have a midi device on the system?

My friend with the same exact code gets:
Info=4
Java Sound Synthesizer
Java Sound Sequencer
Microsoft MIDI Mapper
Microsoft GS Wavetable SW Synth

I don't get it. I've been googling for a few days now and no luck. Here and there i find a comment saying it is not possible except by using Timidi or something like that. I looked that up to and i really don't understand where the problem is. My buddy uses the same code and it works for him. I can play the midi's using winamp.

the new error i get is:
java.lang.IllegalArgumentException: Requested device not installed: null
   at javax.sound.midi.MidiSystem.getGenericDevice(MidiSystem.java:1073)
   at javax.sound.midi.MidiSystem.getSynthesizer(MidiSystem.java:242)

I can't use the getSequencer(boolean) cause i don't have Java 1.5. At work we are using 1.4.

I can play wav's using java...
5  Java Game APIs & Engines / Java Sound & OpenAL / Re: how do you play MID files using Java? on: 2005-11-24 13:59:32
I am having problems with the following line of code:

1  
o = MidiSystem.getSequencer();


This is the error i get:

1  
2  
3  
4  
Exception in thread "main" java.lang.IllegalArgumentException: Requested device not installed: null
   at javax.sound.midi.MidiSystem.getGenericDevice(MidiSystem.java:1073)
   at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:277)
   at CroAsteroids1.lib.SimpleMidiPlayer.main(SimpleMidiPlayer.java:176)


Any ideas?
6  Java Game APIs & Engines / Java Sound & OpenAL / Re: Loading Sound Midi on: 2005-11-24 13:59:02
I am having problems with the following line of code:

1  
o = MidiSystem.getSequencer();


This is the error i get:

1  
2  
3  
4  
Exception in thread "main" java.lang.IllegalArgumentException: Requested device not installed: null
   at javax.sound.midi.MidiSystem.getGenericDevice(MidiSystem.java:1073)
   at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:277)
   at CroAsteroids1.lib.SimpleMidiPlayer.main(SimpleMidiPlayer.java:176)


Any ideas?
7  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-24 09:26:56
yes you did. I will look into that to see if it looks and feels better. Maybe a combination of that and something else would do too. I'l play around though. Thanks for the feedback! Appreciated! Smiley
8  Java Game APIs & Engines / Java Sound & OpenAL / how do you play MID files using Java? on: 2005-11-23 11:29:11
I tried this....Help please!?

code:
public void playMidiFrom(String path) {
       try {
           Sequence midi = MidiSystem.getSequence(this.getClass().getClassLoader().getResource(path));
           Sequencer player = MidiSystem.getSequencer();
           player.open();
           player.setSequence(midi);
           player.start();
       } catch (IOException e) {
          System.out.println("else");
           e.printStackTrace();
       } catch (InvalidMidiDataException e) {
          System.out.println("Invalid MIDI data");
           e.printStackTrace();
       } catch (MidiUnavailableException e) {
          System.out.println("No midi");
           e.printStackTrace();
       }
  }

i get this error:
java.lang.IllegalArgumentException: Requested device not installed: null
   at javax.sound.midi.MidiSystem.getGenericDevice(MidiSystem.java:1073)
   at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:277)
   at CroAsteroids1.lib.sounds.Sounds.playMidiFrom(Sounds.java:89)
   at CroAsteroids1.lib.sounds.Sounds.<init>(Sounds.java:83)
   at CroAsteroids1.lib.Asteroids.init(Asteroids.java:283)
   at CroAsteroids1.lib.Asteroids.run(Asteroids.java:116)
   at CroAsteroids1.lib.Asteroids.main(Asteroids.java:110)

I can play mid's in Winamp. And i am not trying to play it in winamp at the same time while running the code. Using windows xp.
9  Game Development / Newbie & Debugging Questions / Re: MIDI: java.lang.IllegalArgumentException: Requested device not installed: null on: 2005-11-23 11:28:17
i can't believe it can be this complicated to play a MID file using Java....
10  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-22 23:15:33
Sorry...do you mean it should only rotate while you are holding down the turn keys? So if i turned for a half a sec it would rotate for lets say 30 degrees around itself and stay like that as soon as i release the turn button? I don't understand the 'maximum point of rotation'. Maybe you mean as soon as you press a turn button it turns for 360 around itself? If you catch some time please elaborate for my sake Wink


I think this game would be more nice to look at if the ship only rolled when it is turning (to a maximum point of rotation) rather than all the time.
11  Game Development / Newbie & Debugging Questions / Re: MIDI: java.lang.IllegalArgumentException: Requested device not installed: null on: 2005-11-22 17:59:40
thanks for the tip...i'll look into that.
12  Game Development / Newbie & Debugging Questions / MIDI: java.lang.IllegalArgumentException: Requested device not installed: null on: 2005-11-22 14:14:32
Help please!?

code:
public void playMidiFrom(String path) {
       try {
           Sequence midi = MidiSystem.getSequence(this.getClass().getClassLoader().getResource(path));
           Sequencer player = MidiSystem.getSequencer();
           player.open();
           player.setSequence(midi);
           player.start();
       } catch (IOException e) {
          System.out.println("else");
           e.printStackTrace();
       } catch (InvalidMidiDataException e) {
          System.out.println("Invalid MIDI data");
           e.printStackTrace();
       } catch (MidiUnavailableException e) {
          System.out.println("No midi");
           e.printStackTrace();
       }
  }

i get this error:

java.lang.IllegalArgumentException: Requested device not installed: null
   at javax.sound.midi.MidiSystem.getGenericDevice(MidiSystem.java:1073)
   at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:277)
   at CroAsteroids1.lib.sounds.Sounds.playMidiFrom(Sounds.java:89)
   at CroAsteroids1.lib.sounds.Sounds.<init>(Sounds.java:83)
   at CroAsteroids1.lib.Asteroids.init(Asteroids.java:283)
   at CroAsteroids1.lib.Asteroids.run(Asteroids.java:116)
   at CroAsteroids1.lib.Asteroids.main(Asteroids.java:110)

I can play mid's in Winamp. And i am not trying to play it in winamp at the same time while running the code. Using windows xp.
13  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-21 13:18:56
The new homepage of CroAsteroids where you can find the latest version is:

http://vedsta5.freeserverhost.com/
14  Games Center / Archived Projects / Re: Automated webstart-maker: need game authors on: 2005-11-16 13:31:24
There seems to be a problem when wanting the JAR with the main class to be on top of the list of included JARS in the JNLP file. I don't know what to do. I've played around with deleting and uploading but i'm only wasting the b/w and it's not helping so i cannot publish the new version of my game.... Cry
15  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-16 13:24:10
I've been trying to upload a new version on JGF but i am having problems. The automated JNLP creator is not working the way it should so the jar having the main class is not on top of the list of JARS and it has to be (one of the webestart rules). I've tried deleting and uploading everything again and again but it wont work. It's so frustrating.
16  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-14 18:45:37
will do...thanks boyz...poisoning our precious bodily fluids with extra bytes! Arrr....
17  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-14 15:08:53
Yes indeed...i see some of the games here are under 4 MB and are much more complex than mine. Technopolies and Monstrumo for example. I'll have to do that, i just hope the picture ends up looking just as nice. It's a big part of the game design...
18  Games Center / Archived Projects / Re: Technopolies on: 2005-11-14 14:32:37
If X-com is the UFO game then i have to correct myself...two best games ever. They bring tears to my eyes  Cry
19  Game Development / Newbie & Debugging Questions / Re: player movement on: 2005-11-14 09:35:36
beautiful explanation Wink
20  Games Center / Archived Projects / Re: Technopolies on: 2005-11-13 18:16:04
Fallout is the best game ever. Your game looks very promising! Especially for a one man band.
21  Games Center / Archived Projects / Re: Rimscape on: 2005-11-13 13:16:21
i'm gonna be honest with you. The menus look and work sweet but the zoom thing has to be implemented. You can see too little of the space. It's important that you keep it simple for a person starting for the first time so you don't loose a gamer. Or strongly suggest to take the tutorial because the movement is hard and "some" people skip tutorials out of impatience  Roll Eyes Also if your game is going to be strong on the story line, you might want to consider doing it in full 3d like the old school "elite"? It would be a big jump, but space games are i believe easier to implement in 3D than let's say a game such as doom. But it seems like a rounded up project. Good job!

22  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-13 12:00:25
The game looks neat but it has a rather serious memory leak.  It's eating 10-12 MB every second or so on my machine (viewed in Task manager between Mem Usage and VM Size).

I found the leak. Horrible...

i had this in a loop when drawing models:
ByteBuffer buffer = ByteBuffer.allocateDirect(16).order(ByteOrder.nativeOrder());

i placed it as a class variable so it is called once and then i buffer.clear(); it.
I wonder what th edifference is between allocate and allocateDirect?
23  Game Development / Newbie & Debugging Questions / Re: player movement on: 2005-11-13 11:05:35
If you use the built in sin() and cos() calls make sure you profile your app and take a good lookat their cost.

Many modern desktop processords have intrinsic trig functions but when you get into embedded processors this is generally not true and they can be very expensive to calculate.  The standard game solution to this has traditionally been a trig look-up table with linear interpolation between the data points.  You can get away with as little as a single table that goes from 0 -45 degrees and get all of your sin and cos out of it for a full 360 degrees if your a teensy bit clever.

even for todays computers?
What's an embedded processor?
How do you profile your application?
What is meant by linear "interpolation" in the context used here?
When you say a trig-lookup table do you mean some sort of an array of the values of sin, cos precalculated?
24  Game Development / Newbie & Debugging Questions / Re: Class loaders on: 2005-11-13 10:50:59
I'm sure you'll come back to read my response. After all you are human. Although when i read your explanations i start to wonder Smiley

If my english serves me well, Newless Clubies is for n00b's mostly? I think i also mentioned in my post on top that it is MY understanding of Class Loaders and it might not be correct (I used it for WebStart, jars...). I knew i had it somewhat wrong but i hoped people will correct me. As you did. With a little spice of "Um no". Smiley I hope we all learned something from this. I did. So as i see class loading is way out there for Java experts, complex applications, and i trust that, as you said jefe, i will really learn it once i really need it. At the moment i need it for Web Start as you probably figured out. I will update my first post and hope it helps someone.
25  Game Development / Newbie & Debugging Questions / Re: Class loaders on: 2005-11-13 03:33:32
i'll gladly modify my post if senor Jeff could support a down to earth explanation of Class loaders.
26  Game Development / Newbie & Debugging Questions / Re: Class loaders on: 2005-11-13 03:20:14
he can be whatever he wants all i know is when i read his explanation it was way above my understanding. And my post here was for peeps like me, who need simple hands on explanations. Am i being clear? I hope so...plus i'm a bit tipsy and arrogance always pissed me off. "Um no..."

You do know that Jeff is one of the developers of Java and he works for Sun right?  -- might want to find a way to extract your foot.
27  Game Development / Newbie & Debugging Questions / Re: Class loaders on: 2005-11-13 03:10:57
on another note sometimes people need simple explanations...i read your answer again and I can wipe my *** with it. I'm sure there are experts here that can use it for other things too but simple english works better for newbies. People that understood what you wrote already know what you tried to say.
28  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-12 20:53:51
Shiiiiznit...thank you for the info. I've never dealt with these kinds of errors...i'm getting all excited...Grin
The game is not complicated so i shouldn't have problems discovering the leak....right... Undecided

it's really nice to get some response!
Thanks again Vorax  Smiley
29  Games Center / Archived Projects / Re: CroAsteroids on www.javagamesfactory.org on: 2005-11-12 19:24:11
I am still having problems with textures. Locally it runs ok, and the asteroids have ok textures. But when i upload it they get loaded without an error, however they are blak. On the other hand the cursor pointing at the position and operators have a little red going accross them which is a part of the texture. The texture is sphere mapped, but the white is not showing. I am going crazy here...
30  Game Development / Newbie & Debugging Questions / Class loaders on: 2005-11-12 16:39:19
I've had some trouble understanding the class loader stuff. I sort of figured it out, and now i wish to post the following as a resource to people new to Class loaders:

Actually I haven't figured it out whatsoever and this below is related only to WebStart. When you use webstart you access things through JAR's which are placed locally on your machine without you knowing how the computer will rename them. I think, because of that, i used Class Loaders, but they have other very important uses.

To get a brief correct explanation of the main purpose of Class Loaders read few posts below (Jeff).

Using relative or absulte paths is not enough if you want your application to work on other computers/systems. When making an application it is a very good if not necessary practice to use Class loaders. You use them so that your application (code) can locate outside resources such as images, text files and so on whether it is run on Linux, Windows or using WebStart. So whenever you have a part of your code accessing an outside file (for example, a texture JPG somewhere in you package) you need to replace it with something like the following:

       
1  
2  
3  
4  
5  
6  
7  
String file = "package/dir/dir/space.JPG";
        URL url = this.getClass().getClassLoader().getResource(file);
        URLConnection conn = url.openConnection();
        InputStream i = conn.getInputStream();
              Image image = BitmapImage.loadImage(i, file); //for images...with Input stream you can read bytes
//OR
             BufferedReader reader = new BufferedReader(new InputStreamReader(i);//for txt files


*BitmapImage is a not a standard class so ignore it here. It reads the bytes out of an InputStream

So what you have to pay attention to is the following 
1  
this.getClass().getClassLoader().getResource(file);


I've used other ways of getting a hold of the resources but this one worked the best for me. As i understand it, whatever is in the classpath of the class calling this line can be retrived as an URL.

So there it is. I am also beginning to understand this, but i wanted to share the information i gathered with anyone who might need it. Also this is my understanding of ClassLoaders and even though it is very shallow it helped me get my game up using WebStart.
Pages: [1] 2
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (22 views)
2014-04-15 18:08:23

BurntPizza (17 views)
2014-04-15 03:46:01

UprightPath (31 views)
2014-04-14 17:39:50

UprightPath (15 views)
2014-04-14 17:35:47

Porlus (31 views)
2014-04-14 15:48:38

tom_mai78101 (57 views)
2014-04-10 04:04:31

BurntPizza (114 views)
2014-04-08 23:06:04

tom_mai78101 (214 views)
2014-04-05 13:34:39

trollwarrior1 (182 views)
2014-04-04 12:06:45

CJLetsGame (189 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!