Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (702)
Games in Android Showcase (203)
games submitted by our members
Games in WIP (774)
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 3 ... 13
1  Java Game APIs & Engines / Engines, Libraries and Tools / Re: GWT-AL - OpenAL implementation for the GWT platform on: 2016-11-05 00:30:04
No problem at all.  Good luck with your exams!

Yes, you are correct, I don't need a panner or any 3D sound.

I'm finding out that there is a lot of stuff happening in the background.  Eg:  GWT converts DataResources into inline data URLs if the sound byte is small enough (around 50K), so, when you call getSafeUri(), you will either get a base64 data url, or an http url, depending on the size.  Then, the XMLHttpRequest request will fail on the iPhone if it is a base64 data url, however, if it is a http url, then you need the XMLHttpRequest call.

So, the code I posted above will only work on small sound bytes that have been converted to base64 data urls.

Right now, I have all my sound effects small enough so they all get converted into base64 urls, and have written my own hooks into JS to play them, setting their volume, pitch, etc.  And for the music, I'm using GWTs default Audio.createIfSupported().  I noticed there was a bug in that code when listening for the end of a music track, so I wrote a new JS method:

1  
2  
3  
4  
5  
private static native final void listenForEnd(AudioElement aud, Command onComplete) /*-{
   aud.onended = function() {
      onComplete.@com.google.gwt.user.client.Command::execute(*)();
   };
}-*/
;


Anyway, I seem to have everything now working on all supported platforms.  Let me know if you have any problems with your framework, maybe I can help out.

Cheers.
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: GWT-AL - OpenAL implementation for the GWT platform on: 2016-10-20 22:51:07
I've been trying to get sounds working in Chrome on the iPhone.  First it was failing with the XMLHttpRequest, so I wrote a method that converted the DataResource to a ArrayBuffer without using XMLHttpRequest (as the DataResource was already loaded by GWT):

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
/**
 * Convert a base64 URL into an array buffer.  Ref: http://stackoverflow.com/questions/21797299
 */

private static native ArrayBuffer arrayBufferFromBase64Url(String base64Url) /*-{
   var base64Value = base64Url.split(',')[1];
   var binaryStr = $wnd.atob(base64Value);
   var len = binaryStr.length;
   var bytes = new Uint8Array(len);

   for (var i=0; i<len; i++) {
      bytes[i] = binaryStr.charCodeAt(i);
   }

   return bytes.buffer;
}-*/
;

/**
 * Create the sound Array Buffer from the data resource.
 */

public static ArrayBuffer createSoundArrayBuffer(DataResource soundData) {
   String url = soundData.getSafeUri().asString();

   return arrayBufferFromBase64Url(url);
}


However, now it hangs on the decodeAudioData call.  It doesn't seem to call the success or failed function:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public class AudioContext extends JavaScriptObject {
   public native final void decodeAudioData(ArrayBuffer audioData, Loaded<AudioBuffer> success, Loaded<String> failed) /*-{
      this.decodeAudioData(
         audioData,
         function (decodedData) {
            success.@team.drift.client.common.model.Loaded::data(*)(decodedData);
         },
         function (e) {
            failed.@team.drift.client.common.model.Loaded::data(*)(e.err);
         }
      );
   }-*/
;
}


It works fine in Chrome on PC, Mac, and Android.  Just the iPhone is failing.  Any ideas would be great!

EDIT:  Finally got it working on iPhone.  Turns out, iPhone does not support OGG files.  Angry  Switching to MP3 made the sounds work.
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: GWT-AL - OpenAL implementation for the GWT platform on: 2016-10-09 08:27:06
Firefox seems to work fine.  Although the looping of a sound is a little glitchy.  There is no problem with playing multiple sounds at the same time.  I just deployed a new version, so you can hear it running with direct calls to AudioContext, and coming through both speakers http://drift.team/.

I think Chrome has a bug in it with the OscillatorNode, as other people's examples also only come through the right speaker.  Eg: http://www.javascripture.com/OscillatorNode Edit: I was wrong, Chrome works fine.

Also, AudioContext seems to work fine on Android, but I haven't been able to get it to work on an iPhone.

Cheers.
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: GWT-AL - OpenAL implementation for the GWT platform on: 2016-10-09 05:25:04
Update:  I created a bare bones AudioContext, I didn't do anything fancy like in your AudioContext.java when you decodeAudioData, you do some sort of slicing, instead I just passed the ArrayBuffer straight into the decodeAudioData.  Basically, I implemented https://www.html5rocks.com/en/tutorials/webaudio/intro/ in GWT.

I also called createStereoPanner, and I could move my sounds between the speakers.

However, when I called createOscillator, the sound from that only came out the right speaker, and completely ignored my connected Stereo Panner.
5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: GWT-AL - OpenAL implementation for the GWT platform on: 2016-10-05 03:15:57
Thanks SHC.  It appears your Lost-Orion game has the same problem as I am having (sound only comes out of the right speaker in Chrome).

I'll look into doing direct JS calls to the Web Audio API, to see if I can work out what is going on.

Cheers.
6  Java Game APIs & Engines / Engines, Libraries and Tools / Re: GWT-AL - OpenAL implementation for the GWT platform on: 2016-10-03 05:46:12
Hi SHC,

Just playing around with your library.  The Web Audio API example works perfectly, however, the Open AL example only comes through the right speaker.

Any ideas?  I'm using Chrome on Windows 10.

Thanks.

EDIT:  Looks like it's only Chrome that the sound comes out only through the right speaker.  Firefox works with both speakers, while IE and Edge don't work at all.  You can see it happening in http://drift.team/, just click on the "Sounds" button.  Do you know if these browsers should be working with GWT-AL?
7  Games Center / WIP games, tools & toy projects / Re: Drift Team on: 2016-06-20 05:39:56
Cool game, controls and camera are nice.
Would be cool if you could bump the AI players. I couldn't seem to affect them at all when I tried to fish tail them or bump them off course.

Thanks CommanderKeith!  There actually aren't any AI players, only replays.  Thus they can't be bumped off course.

I was thinking of adding AI traffic that you can bump out of the way.  Maybe in a future version.  Smiley
8  Games Center / WIP games, tools & toy projects / Re: Drift Team on: 2016-06-20 03:22:14
I'm so happy that you made a real game using WebGL4J. Your game is pretty awesome. Though I felt the controls were a bit hard, it is really fun. Congratulations.

Why not add sound to it using GWT-AL now?

Awesome!  I didn't see your GWT-AL library.  This is exactly what I was after!  Thank you again!!!
9  Games Center / WIP games, tools & toy projects / Re: Drift Team on: 2016-06-19 06:44:48
Awesome game. Some sounds would be nice though.

Thanks trollwarrior1!

Adding music and bump noises when cars collide should be easy.  However, car sounds will be a little tricky.  Might see if I can copy what these people did: Racer Sound.
10  Games Center / WIP games, tools & toy projects / Re: Drift Team on: 2016-06-19 01:53:10
Just added high score tables (once you log in), with replays.



Would be great to see how other people drive.  Greatly appreciate anyone taking the time to give it a try.

http://drift.team/?DriftSchool

Thanks!
11  Games Center / WIP games, tools & toy projects / Re: Drift Team on: 2016-05-29 14:28:39
That's weird.  The game runs on Google App Engine, so one would hope they have their internet all sorted.
12  Games Center / WIP games, tools & toy projects / Drift Team on: 2016-05-29 10:27:29
Hi all,

After about 2 years of part time development, I finally have something to show.

http://drift.team/



It's written in using GWT and WebGL4J, it should run in all modern browsers, on all modern devices (desktop and smartphone).

Currently, only the "Drift School" part of the game is done.  However, I'm keen to hear what people think of it.  Does everything make sense?  Is it too easy/hard?  Is it fun?  Any bugs?

So, head on over to http://drift.team/ and give it a play!   Smiley

Thanks all!

PS:  Please also post any cool replays you make.  Just copy the URL.  Eg:  http://drift.team/#DriftSchoolReplay:5668600916475904/5737979670691840
13  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2016-01-31 20:49:04
Thank you again!  That worked perfectly!

I actually had to explicitly set the canvas to black canvas.getElement().getStyle().setBackgroundColor("black"); otherwise, the white from it would bleed through.

While I'm a beginner at WebGL, I've been working with GWT for about 6 years now, so if you have any issues with the GWT side of things, I'd be more than happy to lend a hand.
14  Java Game APIs & Engines / Engines, Libraries and Tools / Re: WebGL4J - Simple GWT based WebGL wrapper for Java on: 2016-01-31 05:41:47
Just wanted to say... Thank you!!!  gwt-g3d was so painful, because it hid WebGL too much.

So far, I'm finding your library so much cleaner and easier to use!

I have one question regarding textures with alphas.  In the texture example:
https://github.com/sriharshachilakapati/WebGL4J/blob/master/examples/src/main/java/com/shc/webgl4j/examples/client/TextureExample.java.

If switch the image to be an image that contains some alpha values, and I set the background colour of the canvas to a colour, say blue:
canvas.getElement().getStyle().setBackgroundColor("blue");

I would have thought the image would bleed nicely into the blue.  However, it does bleed, but it seems to get a white tinge to it, as if there is some white in the background somewhere.

I'm wondering if the vertex shader, or fragment shader need to be modified?  Or if I need to do something else?

Any help would be much appreciated.  And a huge thank you again for the brilliant library!
15  Games Center / 4K Game Competition - 2013 / Re: Demolition Derby 4K on: 2012-12-12 11:10:23
Okay, your car now has a "bull bar" attached to the front of it.  Use it to smash up the other cars while protecting your own car.

Also, damage now only occurs with larger collisions, the bigger the smash, the more damage.

http://www.java4k.com/index.php?action=games&method=view&gid=431

Other changes include:
- A handbrake (Shift key).
- Screen flashes red when you take damage.
16  Games Center / 4K Game Competition - 2013 / Re: Demolition Derby 4K on: 2012-12-09 04:56:42
The only effective strategy is to flee, wait until every car but one breaks down after running into each other at the same time, and then keep away from the last remaining car into it crashes into something. Without that strategy, it's too hard and with that strategy it's unchallenging and depends entirely on luck or patience. Sad Is it meant to be that type of game?

Yes.  Wink

....well, you can't just wait, as they come after you.  And I would have thought it's not entirely luck, as you need to dodge the other cars.  It was supposed to be a case of position your car so the opponents crash into each other.  However, it didn't quite work as well as I had hoped.

Thought about going down the route of your car is stronger on the front then the back, so if you hit someone, you do more damage or get points, but I wanted to keep it as simple as possible.

Any ideas on how to spice up the game play strategy would be greatly appreciated.
17  Games Center / 4K Game Competition - 2013 / Re: Pack200 Verify Error on: 2012-12-09 04:33:52
Hmm.  I just went into the Windows 7 Control Panel -> Java -> Temporary Internet Files -> Settings -> Delete Files.  And trashed all the cached files.  Now it works fine on this computer.

I have a feeling something odd happened when I was switching from Java 7 then back to Java 6 (I upgraded to 7, then realised 7 made a larger compile, so I switched back to 6, and all the time I was testing in the browser).
18  Games Center / 4K Game Competition - 2013 / Re: Pack200 Verify Error on: 2012-12-09 04:27:05
I am running it through proguard.  I'm using the 4KJO tool.

Weird thing is I use the same 4KJO tool on my previous years entries, and they all run fine on this computer.
19  Games Center / 4K Game Competition - 2013 / Re: Demolition Derby 4K on: 2012-12-09 04:23:42
Yay, a driving game Cheesy
Nice work on AI and tire tracks. My only complaints are (1) that there's a "game over" notification or something, instead of the game just ending, and (2) a health bar instead of a damage taken bar, although that's probably just preference.
The main trick I used to win was letting the other cars crash into each other by escaping like a ninja. Fun game!


Excellent ideas ninja driver!   Cool
1. The game actually never ends, you just get more and more cars, so I've now added a "Level x" message.
2. I agree, health bar makes more sense.  Now changed the damage bar to a health bar.
20  Games Center / 4K Game Competition - 2013 / Demolition Derby 4K on: 2012-12-09 04:02:53
Survive the mayhem and be the last car standing in this gruelling destruction derby game.

Make it through and you're in for more mayhem with with more cars.

Use the bull bar on the front of your car, to smash up the other cars and protect your car.

...oh, did I forget to mention that all the other drivers are out to get you!

Controls:
- Arrow keys or WSAD for car control.
- Shift for hand brake.
- Esc to retry.



http://www.java4k.com/index.php?action=games&method=view&gid=431


Feedback / comments / praise / flames all welcome.  ...well, maybe not the flames.   Smiley
21  Games Center / 4K Game Competition - 2013 / Re: Pack200 Verify Error on: 2012-12-09 03:58:00
Thanks Jimmt.  I just tried it on my other computer, and you're right, it works fine.  Must be something odd with the Java install on this computer.   Roll Eyes

Cheers.
22  Games Center / 4K Game Competition - 2013 / Pack200 Verify Error on: 2012-12-09 03:44:03
Hi all,

I completed my 2013 entry.  The jar file works great: http://brasurf.com.au/DemolitionDerby4K/

However, I then ran Pack200 on it: pack200 xxx.pack.gz xxx.jar and uploaded it to the Java4K site: http://www.java4k.com/index.php?action=games&method=view&gid=431  And when trying to run it, it now throws an error:



I can't figure out what I've done wrong?  Any ideas would be greatly appreciated!

Thanks.
23  Games Center / 4K Game Competition - 2012 / Re: Judging panel results! on: 2012-03-23 22:50:53
Indeed I felt like The Little Scientist might be a good start for a real game... If I find the time maybe I'll start making a mobile app out of it, who knows Smiley
If you go through all the winning games in the past java4k contests, then you'll realize all of them have one thing in common, the potential of being a full game. 4k is great for prototyping games, and as a judge what I love the most is seeing potential, my imagination takes off and I have all sorts of ideas for the game.

That's exactly what I use the Java4k for.  Apologies to the judges for boring them with car games every year!  Cheesy  Their reviews along with the community results are invaluable information.  So a big thanks to all!   Smiley

A combination of my first few game went on to become https://play.google.com/store/apps/details?id=com.craigsrace.headtoheadracing

I'm still trying to nail down what my second game will be (looks like I now have the physics, just need the game play)  Smiley

Congratulations on The Little Scientist.  Such a fun game!  I look forward to seeing it as a mobile app!   Cool
24  Games Center / 4K Game Competition - 2012 / Re: Community voting results on: 2012-03-17 04:01:12
Commanding win zeroone!  Well done and well deserved!  ...if you're going to win, you might as well smash the competition!  Grin
25  Games Center / 4K Game Competition - 2012 / Re: Laser Pinball on: 2012-01-06 23:28:53
Awesome fun!  20,000,000 and balls going everywhere!  Cool
26  Games Center / 4K Game Competition - 2012 / Re: Drift Driver 4K on: 2011-12-27 06:57:03
Great game as always from you.

Really nice feel, pretty much like last years contribution, but much more fun gameplay!
Unfortunately I can not start level 4 because of this:

Exception in thread "Thread-16" java.lang.OutOfMemoryError: Java heap space
   at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
   at java.awt.image.Raster.createPackedRaster(Raster.java:458)
   at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
   at java.awt.image.BufferedImage.<init>(BufferedImage.java:315)
   at A.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:680)



This is on OS X Lion, Java 1.6   Cry

Couldn't use handbreak either on OS X. HTML5 seems to work fine though.

Will play that now!  Cheesy

Mac OutOfMemoryError should now be fixed.  I now make my buffered images global and reuse them - no clue why the Mac Java garbage collector didn't reclaim the memory.  Roll Eyes

http://www.java4k.com/index.php?action=games&method=view&gid=354

Cheers.
27  Games Center / 4K Game Competition - 2012 / Re: Pitfall 4K on: 2011-12-16 21:11:35
Very cool!  Even has the scrolling "Activision" logo, brilliant!

You might want to use a url shortner on http://meatfighter.com/java4k2012/pitfall4k/map.html to stop the Java4K site from expanding too far across.   Smiley
28  Games Center / 4K Game Competition - 2012 / Re: Snake on a Plane on: 2011-12-04 09:39:22
Fun and addictive!  Only one very small point, I would make the snake fall a bit faster.  Found myself thinking "hurry up an fall to the bottom already".  Smiley
29  Games Center / 4K Game Competition - 2012 / Re: Drift Driver 4K on: 2011-12-04 09:24:28
I made levels 9 and 10 a little easier.  Game is now submitted!

http://www.java4k.com/index.php?action=games&method=view&gid=354

Thank you all so much for the excellent feedback.  Smiley  And good luck everyone in the competition!  I always really enjoy programming for the Java4K comp.  Cool
30  Games Center / 4K Game Competition - 2012 / Re: Drift Driver 4K on: 2011-12-04 09:19:07
Great game as always from you.

Really nice feel, pretty much like last years contribution, but much more fun gameplay!
Unfortunately I can not start level 4 because of this:

Exception in thread "Thread-16" java.lang.OutOfMemoryError: Java heap space
   at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
   at java.awt.image.Raster.createPackedRaster(Raster.java:458)
   at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
   at java.awt.image.BufferedImage.<init>(BufferedImage.java:315)
   at A.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:680)



This is on OS X Lion, Java 1.6   Cry

The game does use a lot of memory (I create 2 2200x2200 RGB BufferedImages), however, it creates them on every level and throws away the old ones, so I'm at a loss as to why it would make it all the way to level 4 and then crash.  Might look at putting in some memory flags on the Java4K sites applet code if needed.

Couldn't use handbreak either on OS X. HTML5 seems to work fine though.

Now changed the handbreak to use the Shift key.
Pages: [1] 2 3 ... 13
 
Lunch (33 views)
2016-12-06 16:01:40

ral0r2 (259 views)
2016-11-23 16:08:26

ClaasJG (394 views)
2016-11-10 17:36:32

CoffeeChemist (489 views)
2016-11-05 00:46:53

jay4842 (536 views)
2016-11-01 19:04:52

theagentd (548 views)
2016-10-24 17:51:53

theagentd (542 views)
2016-10-24 17:50:08

theagentd (493 views)
2016-10-24 17:43:15

CommanderKeith (489 views)
2016-10-22 15:22:05

Roquen (456 views)
2016-10-22 01:57:43
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21
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!