Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Progress with RRE (Raytrace Rendering Engine)  (Read 9258 times)
0 Members and 1 Guest are viewing this topic.
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Posted 2007-07-31 04:09:44 »

This week i have resurrected my old Real time Ray Tracer for the 4k competition and have spent time bringing it to an inital working state.



This is the first version which is real-time and allows for user interaction.

As it is a first version is has some flaws:

-It is obviously larger than 4096 bytes at the moment Smiley
-not a game yet (I plan to make a poor clone of Decsent by Parallax Software )
-only primitive are spheres (will only consist of Cylinders, Spheres and Triangles )
-not heavily optimised (there is a large slow down when large portions of the screen are covered with spheres)
-makes use of many short lived objects which makes it slow ( I will be converting it to procedual)
-no textures (will be procedual eventually and if i can fit it in 4k)
-only one directional light + ambient (will have localised lighting)


You can try it out:

320x240
512x384
640x480

Directions:

up arrow: move forward
back arrow: move backward
left arrow: roll left
right arrow: roll right
Esc: quit

Use the mouse to change look direction.

The FPS are limited to ~33
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #1 - Posted 2007-07-31 12:17:36 »

Looks very cool and sort of fun to play around with already. FPS was close to 33 on low res version unless I drove into a sphere. Then it would drop to ~15. Hi res 10-20fps. Still felt very smooth and responsive. Only complaint: seems like left arrow really rolled right and vice versa (it probably rolls the world left, but I would imagine it should roll the ship left?)

Don't you want to make this a full game instead? It would still be an impressive feat and I donĀ“t think there are many java games around with realtime raytracing, so it would sort of be groundbreaking anyway, maybe even more so than a 4K version of it.

Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #2 - Posted 2007-07-31 15:04:38 »

Thanks, yeah it is kinda fun to zoom around Smiley

re: rolling, eventually the view will be a third person perspective behind and above your craft, similar to Freelancer (from which i have stolen the mouse control from Smiley )

Well I would love to make a "proper" game, but with work commitments and organising a wedding i doubt i will have enough time do so. I am aiming for the 4k as I have proven to myself i can create a game ( I have entered the last two years) as i would hate for it to languish like oh so many other of my project due to lack of time Sad
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #3 - Posted 2007-09-06 14:44:11 »

well i had put the development of this project on hold but have recently got back into it.

I have decided to scrap the original version of the render in favour of a new clean build from scratch but with all the knowledge from the first version.

In doing so i have found two very interesting facts which are related:

1. Upgrading to java 6 has doubled the performance of the current version of the engine  Shocked i am amazed and pleased!
2. Upgrading to java 6 had meant that my embedded pack200 in a jar trick does not currently work Sad so instead of the new engine being 2.24k it is 2.43k. (this is due to java 6 being more strict on the binary class structure, i have some ideas to fix this however)

I would like to know if this performance boost is universal and just not a quirk of my system, please download the jar and test it on different versions of java if you have two or more installed on your system. Also i would love to know how long it takes to render the image on different hardware. Currently on a core T5500 1.66Ghz it renders in 2.344 seconds on java 6 compared to 4.391 on java 5.

The current version is a naive raytracer in that it does not currently have the optimisations of the old version. It renders a scene with 256 spheres, and displays the image. I am attempting to optimise (in both speed and size) this naive raytracer using algorithmic, flow and java language optimisations first before adding in the optimisations and tricks i learnt in the first version.

It will be tricky, but i hope to fit the final optimisations such that the engine is 3k or less allowing 1k for game code... probably too ambitious i think.

Note: the jar is bigger than 2.43k as it is a executable jar for convenience.
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #4 - Posted 2007-09-08 00:23:06 »

I am very pleased and a little surprised with the performance of the latest version  Grin



The same scene rendered with the earlier "new" version now is not measured in seconds, rather 100ths of seconds! I have now put a frames per second counter on the frame tile replacing the time taken to render.

I have brought across most of the optimisations from the original version. This has brought about the significant increase in speed seen. There are another two more optimisation code blocks i can bring across from the original version, but I may not need to do so as I am already achieving the desired fps.

At the moment the rtrt engine is coming in at 3.45k which is very good considering i have directly ported the optimisation code from the original version and have not sought yet to optimise these code blocks for space yet.

It is looking quite positive at the moment Smiley i am getting ~30 fps on an athlonXP2100 so newer machines should get marked improvements. I would love to know what fps you get.

Here is the latest version. (again it is larger due to the manifest)
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2


Make it work; make it better.


« Reply #5 - Posted 2007-09-08 01:00:15 »

33 FPS

Windows XP
Java 1.6.0_01
512MB RAM
AMD64 3000+
ASUS Radeon 9600 PRO 128MB

Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #6 - Posted 2007-09-12 10:23:44 »

cheers for that Smiley

hmm that is quite odd.. i would have thought a more pronounced increase in avg fps compared to my result considering the significant difference in CPU speed.
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2


Make it work; make it better.


« Reply #7 - Posted 2007-09-12 14:00:35 »

My actual CPU speed is 1.8GHz.  The 3000 is the equivalent to speed(I'm sure you know that).  Not sure if that makes a difference.  Is your Athlon rated the same way?  I can't remember when they started rating it that way.  Also I am not using a 64bit OS.

Offline irreversible_kev

Junior Member





« Reply #8 - Posted 2007-09-12 15:25:13 »

25.5fps on Athlon XP2500+  Sad
Offline erikd

JGO Ninja


Medals: 15
Projects: 4
Exp: 14 years


Maximumisness


« Reply #9 - Posted 2007-09-12 15:40:15 »

My actual CPU speed is 1.8GHz.  The 3000 is the equivalent to speed(I'm sure you know that).  Not sure if that makes a difference.  Is your Athlon rated the same way?  I can't remember when they started rating it that way.  Also I am not using a 64bit OS.

AthlonXP CPUs are also rated that way, if a little bit more modestly (IIRC my Athlon XP 2200+ is actually clocked at 1.8GHz)

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #10 - Posted 2007-09-13 00:18:31 »

irreversible_kev: what version of java are you using? v1.5 and earlier seem to be quite a bit slower. Did you have any other processes running in the background?

CaptainJester: i believe my athlon is running at ~1.6 Ghz... perhaps my optimisation has been "optimal" for my cpu only?


I just tried it on a Core T5500 @1.66ghz and it seems like the java VM does not fully utilise more than one core... i am seeing max 50% utilisation... Bugger... i did not want to have to put in threading as it will be a large byte code cost.  on the Core T5500 i am getting 33 fps.
Offline irreversible_kev

Junior Member





« Reply #11 - Posted 2007-09-13 04:59:11 »

irreversible_kev: what version of java are you using? v1.5 and earlier seem to be quite a bit slower. Did you have any other processes running in the background?


Java1.6
I closed down every program except firefox and got 29.5fps  Grin
Online cylab

JGO Knight


Medals: 34



« Reply #12 - Posted 2007-09-13 13:39:21 »

I just tried it on a Core T5500 @1.66ghz and it seems like the java VM does not fully utilise more than one core...
Without multiple threads, there will not be much change for the JVM to utilize the second core...

Mathias - I Know What [you] Did Last Summer!
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #13 - Posted 2007-09-13 13:40:41 »

Slightly off topic, but moogie, do you happen to have a newer version of  your compression utility (4kjo, is it?)?

It ran fine on my old computer but seems not to run properly on my new one (shuts down half way through and increases size instead of decreasing it).

Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #14 - Posted 2007-09-13 15:27:09 »

@ Morre: sorry not really. I have noticed that the JOGA optimiser/obfuscator does not want to work well with java 1.6 You may want to restrict the optimisers it uses to only Proguard, Jarg and Jode. Also, the pack200 embedding tool does not work for 1.6 due to more strict compliance checking. I do plan to re-vist and provide an updated tool closer to the launch of the 4k competition.

If there is any error logs please do send it to me as well as the settings used. (you might need to increase the level of verbosity). If at all possible the JAR with causes the error too so i can attempt to replicate the problem.
Offline moogie

JGO Knight


Medals: 11
Projects: 5
Exp: 10 years


Java games rock!


« Reply #15 - Posted 2007-09-13 15:28:55 »

Without multiple threads, there will not be much change for the JVM to utilize the second core...

twas what i feared...

I will attempt to make it multithreaded to see how much impact in both space (byte code) and speed.
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #16 - Posted 2007-09-13 18:40:03 »

Detalis sent by way of PM.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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 (55 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (211 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

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
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!