Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (116)
games submitted by our members
Games in WIP (563)
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  
  A wolf3d-like java game  (Read 5871 times)
0 Members and 1 Guest are viewing this topic.
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Posted 2005-05-18 12:27:49 »

have u played wolf3d before? well check out my java version of this game, here is the download link:

http://www.freewebs.com/phu004/javaFPS.zip
(include source code)
run the play.html after you unzip the file.


here are some problems you might meet

1. Q: nothing happens when i press the keyboard.
A: you might have turned the caps-lock on, turn it off .


2。Q: the game speed is too fast or too slow.
A: press "+" and "-" to increased and decrease the game speed, until you feel comfortable

3。Q: the crosshair can't not move up or down, how can i hit the enemy?
A: you only need to aim along the x-axis.

4。 Q: how can i win the game?
A: press "m" and you will see where your objective located on the map

if you don't manage to download the file, I also provide a link which you can play directly by clicking it

http://www.freewebs.com/phu004/play.html

here is a screen shot of it


hope you guys could enjoy my game!
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #1 - Posted 2005-05-18 12:59:17 »

thats pretty good, especially the bit where u can creep up behind that guy! Grin
Offline EgonOlsen
« Reply #2 - Posted 2005-05-18 13:18:13 »

You seem to have a threading issue in this game. On hyperthreading machines, the graphics are flickering like crazy because walls are missing for a frame or two, doors jump in front of you and back and so on. On non-hyperthreading cpus, i couldn't reproduce this. Here's a screenshot of a missing wall for you to see what i'm actually taking about: http://www.jpct.net/pics/missing.jpg

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

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #3 - Posted 2005-05-18 21:13:02 »

This happens on fast machines(my machine is an old p3 800, so no problem at all), you can try to reduce the frame rate by pressing  "-" ,  you could also check the frame rate by pressing "r".   Anyway I should make my program automatically  adjust the frame rate according to other players' machines.
Offline EgonOlsen
« Reply #4 - Posted 2005-05-19 03:42:54 »

Quote
This happens on fast machines(my machine is an old p3 800, so no problem at all),  

Are you sure? It does happen on a P42.8HT and on a P43.2HT...it doesn't happen on a Athlon XP3200+ and Athlon64 3000+. Adjusting the speed with r doesn't help btw.
That's why i think it may have something to do with threading. I have had this problem myself: What works fine on "normal" cpus shows wierd effects on hyperthreading ones (or dual cpus setups).

Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #5 - Posted 2005-05-19 07:52:20 »

It does happen on a P42.8HT and on a P43.2HT...it doesn't happen on a Athlon XP3200+ and Athlon64 3000+.


//that's  really wired,  i dont have a very good understanding how threads work and how threy are related to cpus,  so i dont any clue at this point.   Embarrassed
But thank you for reminding me of this problem!
Offline woogley
« Reply #6 - Posted 2005-05-19 11:35:11 »

Impressive! ran pretty smooth (after I capped the framerate to about 30-35) on my XP // AMD 3200+ // 2.5GHz // 512MB RAM

The lighting effect (not to mention weapon 4's roation effect) is very cool Wink

As far as the threading issue goes, I only noticed very minor flickering. I wouldn't mind help you debug EgonOlsen's problem but you dont seem to provide the source code to your Ticker class..
Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #7 - Posted 2005-05-20 08:43:09 »

seems like i forgot to put my Ticker.java in the source code, here it is http://www.freewebs.com/phu004/Ticker.java

I really appreciate your help, but personally i think my code is difficult for other to read.  I merely include any comments in my code since i am the only guy involved making this game.  So dont spend too much time on it if you find it difficult to read.
Offline EgonOlsen
« Reply #8 - Posted 2005-05-20 09:32:40 »

I think that the problem is pretty obvious: You are triggering your game logic (i.e. actionPerformed()) from your Ticker-class. This may happen in the middle of a painting, which results in in-between-states being painted, which is what causes the flickering. Maybe you should consider to overwrite paint() and update() with nothing and do the actual painting from inside your Ticker-triggered method.

Edit: I've modified your code to work that way and the problem is gone.

Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #9 - Posted 2005-05-20 10:49:38 »

Edit: I've modified your code to work that way and the problem is gone.

//Wow you've solved the problem that puzzling me for so long, that's terrific!  Can you send your modified code to my phu004@gmail.com?  cheers!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline EgonOlsen
« Reply #10 - Posted 2005-05-20 11:34:45 »

Quote
Can you send your modified code to my phu004@gmail.com?  cheers!
Done!
Your basic problem was, that rendering and processing of the scene overlapped. You called actionPerformed() from your Ticker which itself called repaint(). But repaint() just schedules your applet for repaint and returns. The actual (re-)paint may happen at any time the VM likes...and if that happens while you are in your actionPerformed() again, you'll get strange results. Hyperthreading/dual cpu machines are more sensible to this compared to none-HT machines...don't know exactly why.

Offline phu004

JGO Coder


Medals: 4
Projects: 9
Exp: 10 years


NoSuchPersonException


« Reply #11 - Posted 2005-05-20 23:28:33 »

Thanks EgonOlsen!  I applied the changes you have done in javaFPS.java  to my game and my previous applications, now they all run smoother than ever before.   Grin Grin Grin


Offline EgonOlsen
« Reply #12 - Posted 2005-05-21 16:08:25 »

Quote
Thanks EgonOlsen!  I applied the changes you have done in javaFPS.java  to my game and my previous applications, now they all run smoother than ever before.   Grin Grin Grin
At your service... Grin

Pages: [1]
  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!