Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (482)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (550)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Ferrari3D: java3d racing game/simulation/tech demo  (Read 14912 times)
0 Members and 1 Guest are viewing this topic.
Offline Mr. Gol

Senior Member


Medals: 1



« Posted 2006-05-08 18:01:51 »

Hi all,

I have been using Java3D for quite a while now, and as a result of this I've made this racing game to see if it was any good for making games. It's not actually a game since there is only one car on the track. The collision detection is dodgy, and the physics still need work but overal I'm pretty happy with the result.

I'm very interested in your feedback, although it's far from completed I'm curious how it rates among Java game design experts. If anyone wants to know how I did certain features just ask.

Download: http://www.freewebtown.com/dennisbijlsma/files/ferrari3d/ferrari3d_150.zip



Offline Breakfast

Senior Member




for great justice!


« Reply #1 - Posted 2006-05-09 15:49:04 »

This looks very interesting- I haven't had time to get it downloaded yet, but the screenshots look great!
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #2 - Posted 2006-05-10 08:58:46 »

Great stuff, works fine here out of the box.

I'm always interested in the simple things: how did you implement text output?


HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #3 - Posted 2006-05-10 09:19:23 »

Great stuff, works fine here out of the box.

I'm always interested in the simple things: how did you implement text output?

I don't really understand what you mean by 'text output'. If you mean the HUD, I override the postRender method of Canvas3D. I read everywhere that it's supposed to be very slow, but I didn't see any major differences in performance.

There is one bug that I find really annoying, after loading, when the Canvas3D is created, you have to click it before the keylistener works (I partly solved it by warning on the loading screen). I'm thinking it may have something to do with the lightweight menu and the heavyweight Canvas3D transition. Has anyone else had this problem?
Offline noblemaster

JGO Ninja


Medals: 20
Projects: 10


Age of Conquest makes your day!


« Reply #4 - Posted 2006-05-10 10:38:40 »

Looking good  Grin. Worked without problems. I like the interface graphics! The controls/smoothness of motion needs some work though!

Offline otelo

Junior Member





« Reply #5 - Posted 2006-05-10 12:09:17 »

The wheels don't turn Sad

You've put a lot of effort into this though, so ignore the complaining. I wonder what is slowing it down so much on my computer.
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #6 - Posted 2006-05-12 09:01:12 »

The wheels don't turn Sad

Erm...they do...at least on my computer  Huh About the motion, I get a framerate of 22, dropping to about 17 in the 'busier' parts of the track, but since my graphics card is terrible I thought it would be the same or faster on other computers.
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #7 - Posted 2006-05-12 19:22:19 »

Did he mean "steering" turn or "spinning" turn?

Offline Mr. Gol

Senior Member


Medals: 1



« Reply #8 - Posted 2006-05-13 09:46:33 »

Did he mean "steering" turn or "spinning" turn?

They are supposed to turn in both lateral (turning) as well as longitudinal (rolling) direction Wink
Offline NewbTon

Junior Member




Odejava games rock!


« Reply #9 - Posted 2006-05-18 12:06:29 »

Wow great job. Did you model everything yourself  ?(very impressive I think)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cylab

JGO Ninja


Medals: 43



« Reply #10 - Posted 2006-05-18 13:19:31 »

Quote
There is one bug that I find really annoying, after loading, when the Canvas3D is created, you have to click it before the keylistener works (I partly solved it by warning on the loading screen). I'm thinking it may have something to do with the lightweight menu and the heavyweight Canvas3D transition. Has anyone else had this problem?

Maybe the Frame has focus at first. Either call requestFocus on the canvas in it's addNotify()-method or add the Listener to the Frame instead (you might have to set focusable to false on the canvas then).

Mathias - I Know What [you] Did Last Summer!
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #11 - Posted 2006-05-18 14:38:10 »

Wow great job. Did you model everything yourself  ?(very impressive I think)

Yes. Although everything consists of the car and the track (which isn't that good) Smiley
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #12 - Posted 2006-05-28 18:45:46 »

Yet another question Smiley Is it possible to make a material in Java3D look something like the car in this screenshot:



I'm guessing it uses a custom pixel shader, as the differences in color seem to be caused by the sky texture, so there must be some raytracing involved. This look probably isn't possible with Java3D's standard Appearance class, but there seems to be little to no information about how to use GLSL shaders, and I don't think I'm capable of writing one myself. Is there anyone who can point me to some sort of starting point for this?
Offline thijs

Junior Member




Lava games rock!


« Reply #13 - Posted 2006-05-28 20:40:40 »

Every time I download the file it's corrupt when I try to open it  Undecided

Quote
'm guessing it uses a custom pixel shader, as the differences in color seem to be caused by the sky texture, so there must be some raytracing involved. This look probably isn't possible with Java3D's standard Appearance class, but there seems to be little to no information about how to use GLSL shaders, and I don't think I'm capable of writing one myself. Is there anyone who can point me to some sort of starting point for this?

You don't (necesarily) need pixel shaders to pull that of, let alone raytracing Wink
Look up for the term "environment mapping" on google, it's a cheap way of achieving that effect.

Thijs

<a href="http://www.dzzd.net">3DzzD!</a>
<a href="http://www.arcazoid.com">Arcazoid!</a>
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #14 - Posted 2006-06-02 10:56:24 »

You don't (necesarily) need pixel shaders to pull that of, let alone raytracing Wink
Look up for the term "environment mapping" on google, it's a cheap way of achieving that effect.

Erm...yes, you are right. I thought it had something to do with pixel shaders because that's where I first saw it.

However, I couldn't find any actual example on how to use it in Java3D. I know that I must render an image taken from the car, combine it with the existing texture, and then use the TexCoordGeneration class to make it look spherical. Is there some actual example of this being done on the internet, and if so, where  Huh
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #15 - Posted 2006-06-02 11:19:25 »

However, I couldn't find any actual example on how to use it in Java3D. I know that I must render an image taken from the car, combine it with the existing texture, and then use the TexCoordGeneration class to make it look spherical. Is there some actual example of this being done on the internet, and if so, where  Huh

Most games don't bother having dynamic environment mapping, the cube maps are just calculated ahead of time somehow (either when the level is made or using a generic artist drawn texture).

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #16 - Posted 2006-06-02 13:19:50 »

Edit: Got it working now, the effect isn't that noticable, but those little graphical touches make a big difference.

Offline otelo

Junior Member





« Reply #17 - Posted 2006-06-09 08:16:29 »

Edit: Got it working now, the effect isn't that noticable, but those little graphical touches make a big difference.

I assume you used a TexCoordGeneration object in REFLECTION_MAP mode for the second 'gloss' texture?
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #18 - Posted 2006-06-19 12:06:09 »

OK, I've finally finished a stable version. You can download it at http://www.freewebtown.com/dennisbijlsma/files/ferrari3d/ferrari3d_150.zip. I also changed the link in the first post. Performance still isn't too great, but I can't think of any quick ways to improve it, and it's not too bad if you have a decent graphics card. Maybe I'll continue on this in the future, but for now thanks to all who have looked at and answered my questions!

@otelo: Yes Smiley
Offline skyuzo

Senior Newbie





« Reply #19 - Posted 2006-07-03 23:43:05 »

Quote
There is one bug that I find really annoying, after loading, when the Canvas3D is created, you have to click it before the keylistener works (I partly solved it by warning on the loading screen). I'm thinking it may have something to do with the lightweight menu and the heavyweight Canvas3D transition. Has anyone else had this problem?

Maybe the Frame has focus at first. Either call requestFocus on the canvas in it's addNotify()-method or add the Listener to the Frame instead (you might have to set focusable to false on the canvas then).

...or you can use the java.awt.Robot class to move the mouse to where you want, press and release a mouse button. (but I think it is a little slower)
Offline konieczny69

Senior Newbie





« Reply #20 - Posted 2007-01-02 21:11:35 »

good job

I am currently working on mu own racing game and but I am facing some problems with moving my car. I want it to look realistic (including acceleration for example) so decided to go with KeyNavigatorBehavior but still its not really what I want, could you tell me how did you implement the way to control the mobile ?

cheers, Lukasz
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #21 - Posted 2007-01-09 13:27:51 »

Hey man, I really think the HUD is gonna kill your frame rates.  I've tried painting on the Canvas before in my game and it was killer.  Now I'm painting on several small QuadArrarys for each major group in my HUD (this is for a space sim game). 

Ubuntu
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #22 - Posted 2007-01-09 13:40:49 »

And how do you fill your Quads? I found that painting with Java2D and creating a new texture each frame can be a performance drain as well.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #23 - Posted 2007-01-09 15:48:27 »

You paint with Java2D in both cases.  The difference is you DO NOT have to repaint every frame when using a QuadArray; however, you DO have to repaint every frame when painting on the Canvas.  This is where you can save performance.  I can't remember how often I update (every x milliseconds or something - I can check when I go home if you want). 

Make sense?

Ubuntu
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #24 - Posted 2007-01-09 18:09:29 »

makes sense

OTOH this would not make a smooth HUD (e.g. for a flightsim) possible, which needs to be updated each frame?

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #25 - Posted 2007-01-09 20:41:13 »

Not true.  You have to think about the information that is being convaied in the HUD.  For instance, console messages do not  need to be updated all that often (b/c people aren't typing and events aren't happening every frame).  Almost every peice of information in the HUD is static from frame to frame.  So you take some time slice to determine when the HUD needs to really be updated.  This can save you alot especially if you have transparency in your HUD.

BTW, what does OTOH mean?
Is it although?

Ubuntu
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #26 - Posted 2007-01-09 22:39:23 »

OTOH == on the other hand

Think of a HUD that you have in jet sims, current horizon, angle-of-attack and so on. These displays have to me smooth.

I'd not call console text to be a HUD, thats just a GUI. HUD is a defined term in avionics.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #27 - Posted 2007-01-10 14:45:13 »

Well, in video games a HUD is usually defined as the tertiary information that is displayed to the user. 
In FPS's, health, ammo, number of lives, and etc are common elements in the HUD.  And yes, text are very much an important function of the HUD.

I agree that HUD components need to be smooth.  But smooth != updating every frame.  Some HUD components might need to be updated more often then others, but still doesn't necessitate every frame.

Ubuntu
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #28 - Posted 2007-01-14 13:47:36 »

You paint with Java2D in both cases.  The difference is you DO NOT have to repaint every frame when using a QuadArray; however, you DO have to repaint every frame when painting on the Canvas.  This is where you can save performance.  I can't remember how often I update (every x milliseconds or something - I can check when I go home if you want). 

Make sense?

First of all, nice to see my thread bumped after six months. I actually did experiment with using Quads as a HUD, but the graphics looked fuzzt for some reason, and they were stuttering a bit. These problems seem to be standard for Java 3D users, just search on this forum for ´Java3D HUD´ and you´ll find multiple threads on this. I eventually decided that it wasn´t worth the haasle, and did my HUD the J3DGraphics2D way. The performance loss isn´t that bad, I still get a framerate between 25 and 35, which I think isn´t that bad.
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #29 - Posted 2007-01-17 20:51:55 »

yea, but try running the game on an older system.  I was shot, fired, and burned at the stake when my buddy couldn't run an alpha of my game b/c his 5 year old PC couldn't get more then a few frames a second (I was getting about 25 - 35 FPS on my system w/ a Geforce7800).  Once I changed to Quad Arrays, he can now play smoothly (not sure of his FPS but its playable for him).

As for the fuzzy problem, I know in the past I have had issue's with using Text3D and scaling.  You also might run into that using awt on a texture if  your image size isn't a power of two.  So you may want to try that.

Ubuntu
Pages: [1] 2
  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.

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

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

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

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

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

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

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

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38
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!