Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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:

http://www.naalaa.com/rc_example4/raycasting4.html (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
Hi

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):
http://stahlworks.com/games/aa1/index.html

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:

http://www.naalaa.com/tm_test/tanks.html - shoot other tanks with your tank ...
http://www.naalaa.com/tm_tests/BrickBonker.html - breakout
http://www.naalaa.com/raster640x480/rastertest.html - mario kart/mode7 test
http://www.naalaa.com/tm_tests/tm_platformer.html - 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 http://www.naalaa.com.

(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
Hi,

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: http://www.naalaa.com/rcapplet/test.html

Using the 2x mode for larger view: http://www.naalaa.com/rcapplet/test2x.html


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 :
1  
 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
Hi,

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 (http://www.naalaa.com). 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: http://www.naalaa.com/applets/Blastemroids.html

And this is the same applet but without sound: http://www.naalaa.com/applets/BlastemroidsNS.html

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?

/Marcus
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (32 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!