Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (540)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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 3
  ignore  |  Print  
  Mini 3D FPS in an Applet Update 9  (Read 19835 times)
0 Members and 1 Guest are viewing this topic.
Offline DzzD
« Posted 2008-07-21 05:22:39 »

this was intended to be a simple walkthrought sample to help someone that ask me to start something with 3DzzD... and I made a little too much, this have also give me a good idea on time constraints... (related to the 4 hours contest proposal), so the source code are available and are very messy as I have to go to work and wanted to bring out something before... (I will clean & optimise later in the week)

http://demo.dzzd.net/FPSSample/

Update 3
http://demo.dzzd.net/FPSSample3/

Update 4
http://demo.dzzd.net/FPSSample4/

Update 5
http://demo.dzzd.net/FPSSample5/

Update 7
http://demo.dzzd.net/FPSSample7/

Update 8
http://demo.dzzd.net/FPSSample8/



Update 9
http://demo.dzzd.net/FPSSample9/




EDIT2:
H and S key to switch hardware/Software rendering

Update 1:
slower control for mouse view + bigger landing area

Update 2:
better graphics and a little sound more

Update 3:
better control smoothness (no more fps dependant)
better 3d model for alien
auto-respawn after 5 seconds

Update 4:
new model

Update 5:
better impacts
try a "dead zone" at screen center : camera dont move when mouse inside

Update 7:
code review
sounds
first enemy unit

Update 9:
Added FPS like mouse control
Improve spiders AI/logic




Offline benny!

Senior Newbie




in this place forever!


« Reply #1 - Posted 2008-07-21 06:30:43 »

That's amazingly cool. Well done.

[ BLOG - LABS - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]
Offline zammbi

JGO Coder


Medals: 4



« Reply #2 - Posted 2008-07-21 07:00:48 »

Looks cool, though does seem a little hard to start off.

Current project - Rename and Sort
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online EgonOlsen
« Reply #3 - Posted 2008-07-21 09:51:08 »

It's unplayable IMHO. I'm always dead after a few seconds (plus F5 doesn't work for me). If i'm lucky, i'm seeing an alien in the sky, but it's impossible to aim and shoot at it. The controls are way too sluggish.

Offline DzzD
« Reply #4 - Posted 2008-07-21 10:45:53 »

Quote
It's unplayable IMHO. I'm always dead after a few seconds (plus F5 doesn't work for me). If i'm lucky, i'm seeing an alien in the sky, but it's impossible to aim and shoot at it. The controls are way too sluggish.
could you provide the console output please ? for now, I think about two reasons that could explain why it is unplayable, maybe your fps grow too high/too low or the applet eat too much cpu and mouse/keyboard dont work properly.

It is not that hard to control at 30fps when keyboard and mouse works, so does you really dislike the control or did you think that there is a problem (fps/cpu) when running the applet on your computer ?

Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #5 - Posted 2008-07-21 11:03:18 »

It starts up fine, the controls are horrible[1], and I die after a couple of seconds of not seeing anything, and not being able to even figure out how to move. F5 doesn't work unless I first click outside the applet area, so I guess there's no way of restarting the game from within the game. I never saw any aliens.
Other than that, it reminds me a lot of your 3dzzd tech demos, which are VERY impressive technically.

[1] I know there's really no good way of doing good mouse look without grabbing the cursor, but having the view constantly move around is very annoying and hard to control.

Play Minecraft!
Offline DzzD
« Reply #6 - Posted 2008-07-21 11:11:38 »

Quote
F5 doesn't work unless I first click outside the applet area
F5 refresh browser that's it  Smiley, no time to do a proper reload this night, on further updates.

Quote
It starts up fine, the controls are horrible[1], and I die after a couple of seconds of not seeing anything
Now, I really like to move gun differently from user, first it was because as you said there is no way to do a propere FPS like control, but now I really love this kind of control, truely.

Online EgonOlsen
« Reply #7 - Posted 2008-07-21 11:13:05 »

could you provide the console output please ? for now, I think about two reasons that could explain why it is unplayable, maybe your fps grow too high/too low or the applet eat too much cpu and mouse/keyboard dont work properly.

No problem:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
Init : Thread[thread applet-FPSSample.class,4,http://demo.dzzd.net/FPSSample/-threadGroup]
Start : Thread[thread applet-FPSSample.class,4,http://demo.dzzd.net/FPSSample/-threadGroup]
Load image http://demo.dzzd.net/FPSSample/FPSSample/LOAD.GIF
Load 3ds http://demo.dzzd.net/FPSSample/FPSSample/FPSSample.3DS
Start : Thread[Thread-18,4,http://demo.dzzd.net/FPSSample/-threadGroup]
0
4073
3920
3920
4019
3967
3920
4019
4019
Destroy : Thread[thread applet-FPSSample.class,4,http://demo.dzzd.net/FPSSample/-threadGroup]
Stop : Thread[Thread-18,4,http://demo.dzzd.net/FPSSample/-threadGroup]


I ran it on a Core2Duo @ 3Ghz, so slowness shouldn't be an issue. It's just that the controls don't feel direct enough. It's more like sliding on ice and aiming at something is like trying to hit something on that ice while sliding around at full speed with no brakes...i hope  you get the idea... Wink

Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #8 - Posted 2008-07-21 11:13:33 »

I guess it's possible to get used to it. I'd like a "dead zone" in the middle though, where the view is totally still. Like, for example, as long as the mouse is within a 32 pixel radius of the center of the screen.

Play Minecraft!
Offline DzzD
« Reply #9 - Posted 2008-07-21 18:41:13 »

ok, not have enought time to implement all those suggestions but enought to reduce the control speed and make the landing area bigger

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DzzD
« Reply #10 - Posted 2008-07-21 19:51:33 »

update 2:
better graphics + one sound more Smiley

EDIT:
oups one class file was not up to date ....

Offline ben

Junior Devvie


Projects: 1



« Reply #11 - Posted 2008-07-22 13:47:26 »

Nice work, it worked well for me.

Pretty fun, although a little difficult to begin with. However, if you scan the sky frantically while waiting for the next alien to appear, you stand a better chance of surviving a little longer, I find.

If you were planning to develop it further, I would say that a few more damage particles would be nice, since it takes several hits (3?) to kill an alien, it would be helpful to see that you are indeed hitting it (and damaging it) when you shoot at it.

Anyway, overall, it looks great.

Ben.

Offline DzzD
« Reply #12 - Posted 2008-07-22 23:13:32 »

Update 3:

http://demo.dzzd.net/FPSSample3/

- better alien 3d model
- alien fall vertically, move slower and only require two bullets to be killed
- auto-respawn after 5 second (pseudo one...)
- better user controls, control have been made independant of frame rate (thank to thijs)


I did not release this sample source code as I did not finish review of it and it is still dirty,messy, unreadable, bad practice and more...

Hardware mode is available by pressing H key



Quote
I ran it on a Core2Duo @ 3Ghz, so slowness shouldn't be an issue. It's just that the controls don't feel direct enough. It's more like sliding on ice and aiming at something is like trying to hit something on that ice while sliding around at full speed with no brakes...i hope  you get the idea...
I see, is that better now ?


Quote
I guess it's possible to get used to it. I'd like a "dead zone" in the middle though, where the view is totally still. Like, for example, as long as the mouse is within a 32 pixel radius of the center of the screen.
good idea about a dead zone, maybe with a non-linear it will be even better, like speed=k*mousepos² rathen than k*mousepos, maybe...


Quote
Pretty fun, although a little difficult to begin with. However, if you scan the sky frantically while waiting for the next alien to appear, you stand a better chance of surviving a little longer, I find.
hehe, it will help less now, aliens are now falling vertically


Quote
If you were planning to develop it further, I would say that a few more damage particles would be nice, since it takes several hits (3?) to kill an alien, it would be helpful to see that you are indeed hitting it (and damaging it) when you shoot at it.
yep, absolutly right, still need huge improvments


EDIT:
reviewed graphics (textures) +lighting

Online EgonOlsen
« Reply #13 - Posted 2008-07-23 08:27:25 »

I see, is that better now ?
Yes, much better.

Offline DzzD
« Reply #14 - Posted 2008-07-24 20:04:19 »

Just a small update: add some background music.

Offline gouessej
« Reply #15 - Posted 2008-07-24 20:58:58 »

Very good example but there is a problem with the focus. I can use the mouse but rarely the keyboard Sad

Offline DzzD
« Reply #16 - Posted 2008-07-25 00:01:02 »

damn even on hardware mode ? (focus is lost when switching, you should click on applet after each switch hard/soft)

Offline DzzD
« Reply #17 - Posted 2008-07-25 04:57:01 »

nothing related to your problem but I have made some few improvments :
- 3d engine mipmap level have been reduced => look smoother and less blink
- edge antialias activated (vertical one)

Offline gouessej
« Reply #18 - Posted 2008-07-25 08:02:55 »

damn even on hardware mode ? (focus is lost when switching, you should click on applet after each switch hard/soft)
Yes.

When I can't use the keyboard anymore even after clicking, I jump and it works anew.

Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #19 - Posted 2008-07-25 08:32:54 »

It runs very well on both of my machines (celeron M 1.5, E8400), although the  control is a little bit hard.  I didn't notice any difference between softeware and hardwere
modes, or could it be that i was running at the software mode all the time? I did receive the warning window after pressing "H".
Offline DzzD
« Reply #20 - Posted 2008-07-25 08:57:21 »

thanks for feedbacks,

Quote
It runs very well on both of my machines (celeron M 1.5, E8400), although the  control is a little bit hard.  I didn't notice any difference between softeware and hardwere
modes, or could it be that i was running at the software mode all the time? I did receive the warning window after pressing "H".
hum.. depending on GPU : software and hardware images can be very very similar, sometimes it is hard to see any differences  Cool. the biggest difference is that in hardware mode there is no ambiant (some things become completly black as some part of the wall in wood that is all around).

Offline zammbi

JGO Coder


Medals: 4



« Reply #21 - Posted 2008-07-25 09:23:42 »

The mouse movement I find a little annoying.
The game I find can freeze up a few secs randomly.
Jump is a little buggy, that you can fall through the ground, also you can jump on top of buildings.
Are the windows meant to be colourful?

Current project - Rename and Sort
Offline DzzD
« Reply #22 - Posted 2008-07-25 09:39:10 »

Quote
The mouse movement I find a little annoying.
arf  Undecided , do I am really the only one who like that kind of control ?

Quote
The game I find can freeze up a few secs randomly.
Jump is a little buggy, that you can fall through the ground, also you can jump on top of buildings.
not really a bug, rather something unfinished : as long as you are in contact with an object you can jump, so if you touch a buiding and jump you can get on its top.

Quote
that you can fall through the ground, also you can jump on top of buildings.
I saw that too, I made a full review of the collision engine and patch a lot of bugs ("paradoxaly", it was working better even with severals bugs in it....) and now it give me headhack....

Quote
Are the windows meant to be colourful?
yes, building are box, nothing inside

Offline DzzD
« Reply #23 - Posted 2008-07-26 01:20:04 »

Update 4:
not really an update on the game but on the 3DzzD API it use.

this result in a better texture quality without "blink" effect on face that are not pointing towards the camera.


Before I use a low level for mipmap to avoid blink on ground for example:

After updating the API, ground and faces that are not pointing toward the camera use same mipmap but other are greatly improved



I also made a comparison on software and hardware renderer using maximum quality setting on th GC (X800):

render in hardware mode (JOGL) :


render in software mode :


you can redo this using H and S keys to respectivly switch to Hardware/Software (first switch take some seconds others are imediates).


http://demo.dzzd.net/FPSSample3/

Offline mh114

Junior Devvie





« Reply #24 - Posted 2008-07-26 09:07:44 »

I guess I have the same problem as gouessej; arrow keys do not work. Sad Mouse work fine, though. WinXP, Java 6u7

Online EgonOlsen
« Reply #25 - Posted 2008-07-26 12:38:02 »

I have some problems with the arrow keys too on my EEEPC with the default Linux installation. They do work sometimes, but most of the time, pressing the keys doesn't do anything.
Switching to hardware mode is also impossible, because you are usually dead before hardware mode has been initialized. I still think that this game is close to unplayable, at least for me. I would be better if the bots wouldn't head directly towards the player no matter what he does. What about making them shoot at the player from a distance instead of letting them run directly into the player?

Offline DzzD
« Reply #26 - Posted 2008-07-26 13:04:24 »

Quote
I have some problems with the arrow keys too on my EEEPC with the default Linux installation. They do work sometimes, but most of the time, pressing the keys doesn't do anything.
Switching to hardware mode is also impossible, because you are usually dead before hardware mode has been initialized. I still think that this game is close to unplayable, at least for me. I would be better if the bots wouldn't head directly towards the player no matter what he does. What about making them shoot at the player from a distance instead of letting them run directly into the player?
you are absolutly right, but this was firstly intended to be a test, I will invastigate more on keyboard issue when I will come back. About robot you are right too, they are not enought intelligent and giving them a lazer could be a cool stuff. anyway this is still a WIP and as I do a lot of WIP in the same time I lack of time  Sad ....

Quote
I guess I have the same problem as gouessej; arrow keys do not work.  Mouse work fine, though. WinXP, Java 6u7
anybody have an idea about this issue?

Offline viwoj

Senior Newbie





« Reply #27 - Posted 2008-08-05 09:09:01 »

Thanks boy

Offline DzzD
« Reply #28 - Posted 2008-09-18 23:45:43 »

updated the model and made some improvment on the api

api news:
- remove a bug on 3ds loader : was throwing an exception when mesh version was 2 (blender and some other export 3ds V2, 3dsmax export V3)
- remove a bug on 3ds loader : camera fov was not properly loaded with keyframer
- remove a bug when calculate frustrum culling with camera FOV
- remove FPS limiter as it was bugged.

demo news:
- new level model !



http://demo.dzzd.net/FPSSample4/

http://demo.dzzd.net/FPSSample4/sources.zip

Offline zammbi

JGO Coder


Medals: 4



« Reply #29 - Posted 2008-09-19 05:37:44 »

I got a error on first load. But seems to be fine when I reloaded.


Quote
java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
   at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
   at sun.awt.Win32GraphicsConfig.createAcceleratedImage(Unknown Source)
   at sun.awt.windows.WComponentPeer.createImage(Unknown Source)
   at java.awt.Component.createImage(Unknown Source)
   at FPSSample.startOnce(FPSSample.java:219)
   at FPSSample.start(FPSSample.java:208)
   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

Edit: seems after loading I always get this.

Current project - Rename and Sort
Pages: [1] 2 3
  ignore  |  Print  
 
 

 
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!