Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (755)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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]
1  Games Center / Archived Projects / Re: Raycaster on: 2011-05-02 12:35:50
OK, maybe my last post wasn't that interesting. But as I'm working on the documentation for the next release of the naalaa programming language, I've written some example programs. Here you can find an actual GAME using the raycasting library: (Programming, graphics, music and sfx by Marcus, copyright naalaa etc.)

Shoot the badbots and pick all the golden crosses to finish a level.

2  Games Center / Archived Projects / Re: Raycaster on: 2011-04-19 12:29:30

I have just tested it, it works fine. I will test it at home on a worse machine to check if it is still fast  Wink

There is a similar raycasting solution there (the ancestor of my game):

Do you plan to use hardware acceleration? What is the license of your editer?

Naalaa is a freeware basic like language. It's meant for native games for windows (and linux), but I added the compile to java-thing because I can't stand using java or flash myself, and I really want to be able to create browser games. Native naalaa programs don't use hardware acceleration, so I don't think I'll let the applet version do so either.

Here's some other examples written in naalaa: - shoot other tanks with your tank ... - breakout - mario kart/mode7 test - platform game

All these things use libraries that isn't available in the current version of naalaa, but the next one will be released real soon. There are some more examples at

(sorry for all the links)

I tried your raycaster and TUER. Very nice stuff Smiley
3  Games Center / Archived Projects / Raycaster on: 2011-04-19 08:47:24

I just wanted to show this raycasting example. It's not actually written in java but in naalaa, but naalaa can compile your programs to java applets.

Normal version:

Using the 2x mode for larger view:

4  Java Game APIs & Engines / Java Sound & OpenAL / Re: Are audioclips that slow? on: 2010-04-01 16:18:46
I would say that 15 ms is still ok with this technic, no?
 (still > 60fps : anyway note that also with the above code they will be no execution of the sleep(1) statement if more FPS is requiered)

Aaah! Me so stupid. You're right, that works much better :-) Thanks a bundle!
5  Java Game APIs & Engines / Java Sound & OpenAL / Re: Are audioclips that slow? on: 2010-03-31 16:09:53
other running program/thread may increase the inacuracy of thread.sleep so I suppose that when the audioclip thread is running it change your sleep lenght and you get the felling of a lower FPS.

once again becarefull that having System.currentTimeMillis working on your computer does not means they will do the same everywhere & same for sleep : always consider that they are working weird when using them in a program.
I would use a Thread.sleep(1) in the main loop (to avoid eating all cpu) and control/manage the FPS with the timer (not Sleep) something like :
 while(true){while(getCurrentTimeMs()<nextFrameTimeMs) Thread.sleep(1);drawOneFrame();nextFrameTime+=40;} (for 25 FPS)

Sorry for the late reply. But when an audioclip is playing, sleep(1) makes the thread sleep for 15ms, so I can't use that technique either. Isn't it kind of hopeless that you can't trust sleep or timers?
6  Java Game APIs & Engines / Java Sound & OpenAL / Re: Are audioclips that slow? on: 2010-03-06 10:02:21
Hi again!

The cpu usage without sound bumps between 3 and 4% on my computer (single processor) under Windows 7. With sound its around 5%. So I don't think that the audioclips are the direct cause of the problem.

I've made some prints to test the accuracy of the timer and the sleep. The accuracy of the timer actually seems to be 1 ms. But telling the thread to sleep for 1, 5 or 10 ms all seem to actually make it sleep for 15 ms. So I'm assuming that thread.sleep is the burglar. Are there any options when you want to pause your thread that doesn't eat up a lot of cpu?

I too prefer to use timer based multiplications in the logic to maintain a constant speed. But I'm not trying to make a game here (I only make games at my job, this naalaa-thing, a programming language for beginners, is just something I do at my spare time). For simple 2D games with very low amounts of blittings, such as this example, I believe sleeping is a very simple and reliable way of keeping a constant speed. There's actually no performance difference between running the applet on an old 400Mhz computer and this multigigahertz-thingie that I'm using now. And if I still had my good old 14Mhz Amiga-computer, I bet it would run fine there too ... if could only make it sleep for the number of ms that I want Smiley

7  Java Game APIs & Engines / Java Sound & OpenAL / Re: Are audioclips that slow? on: 2010-03-06 00:41:52
There are many ways to maintain constant speed in a game Smiley In the examples for this programming language I use the sleep-technique because it's simple and clean.

Those of you who've tested the applets and replied to my post claim that there's no difference in fps between the two versions (with and without sound). And that makes me happy, of course Smiley  But on my computer, and as good as on every other computer (new or really old) that I've tested the example applet on, there's a nasty difference.  The only difference in the code generated by my programming language is that play is called for some audioclips in the version that runs slow. That's all I can say for sure. The cpu usage is about 4% for both examples.

My memory is bad, but I believe the applet versions ran fine when I used high quality wav files instead of badly compressed au files.
8  Java Game APIs & Engines / Java Sound & OpenAL / Are audioclips that slow? on: 2010-03-05 17:54:00

This is my first post, and I'm a total beginner when it comes to Java. But I'm working on a basic-style programming language for Windows ( I recently made it possible for the compiler to generate java code (applets) instead of standalone executable files. There are some problems regarding sound though.

As soon as play is called for an Audioclip, the applets slow down a lot. I know that the audio isn't loaded until it's played for the first time, but that's not the problem in this case. As long as any audioclip is playing the applets run slowly. If no clip has been played for a while, the speed returns to normal. I've tested the applets on several computers, and the only one that managed not to slow down had four really fast processors. Playing an audioclip shouldn't really require that, right?

This is an example applet with sound:

And this is the same applet but without sound:

Are audioclips slow, or could it be something else? For example, the code uses System.currentTimeMillis() in combination with Thread.sleep(...) to maintain a constant fps. Are those reliable, or can they be affected by the sound playback (which I assume is performed in another thread somewhere)?

Would it help to use the java  sound api instead?

Pages: [1]
DesertCoockie (36 views)
2018-05-13 18:23:11

nelsongames (81 views)
2018-04-24 18:15:36

nelsongames (73 views)
2018-04-24 18:14:32

ivj94 (755 views)
2018-03-24 14:47:39

ivj94 (85 views)
2018-03-24 14:46:31

ivj94 (626 views)
2018-03-24 14:43:53

Solater (101 views)
2018-03-17 05:04:08

nelsongames (182 views)
2018-03-05 17:56:34

Gornova (408 views)
2018-03-02 22:15:33

buddyBro (1068 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!