Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (546)
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  Discussions / General Discussions / Re: Your feeling on discovering that your game is uncannily similar to another game? on: 2013-08-08 15:40:17
Good question. With as many games as are in existence, or being developed, I can't imagine this scenario not becoming more common.

I don't think there is any one right answer, though, because how I would move forward would depend on many factors:

Passion for the concept (and its possible evolution)
Motivation for making the game
Time/money investment on the project
Project momentum
Other developers involved in the project
etc...

The right answer may be "move forward, don't quit, evolve/finish your game", but there may also be times when you have to consider the opportunity cost of the "original" game you are not making while working on the "clone".



2  Games Center / Showcase / Re: Bunny Press - A game made in 48 hours on: 2009-05-07 14:24:38
Congrats! Very cool.
3  Game Development / Performance Tuning / Re: Whats wrong here, advice please! on: 2009-05-06 13:43:38
Does everything on the screen flicker? What happens if you remove all the drawString code? Are you using double buffering for rendering?
4  Games Center / Showcase / Re: Bunny Press - A game made in 48 hours on: 2009-05-06 03:47:51
Very nice job! 48 hours, huh?
5  Discussions / General Discussions / Re: Which Compiler do you use to Make games ? on: 2009-05-05 13:58:01
Eclipse 3.2
Sun JDK 1.6

Features that I really appreciate: autocomplete, easy refactoring, incremental compiling, tooltip class help,  plugins! (like for SVN), the fact that you can edit, compile, build, version, debug, and deploy from one GUI... There's more but that's what comes to mind. It definitely makes me more productive.

Caveats: You can find these features in other IDEs, of course. Also, there are some people who really prefer using CLIs and scripting everything themselves, which in some cases, results in quicker results than IDEs doing the same work --- since the scripts don't usually have a lot of overhead code. Bottom line, just experiment and find what works best for you. It's nice to have choices... Cheesy
6  Game Development / Newbie & Debugging Questions / Re: need help making basic GameEngine Class on: 2007-11-19 23:24:06
I haven't read the books you mentioned, but these two books really helped me out...

"Developing Games in Java"
http://www.brackeen.com/javagamebook/

"Killer Game Programming in Java"
http://fivedots.coe.psu.ac.th/~ad/jg/

The author of the last book has another book out as well, which I haven't read:

"Pro Java 6 3D Game Development"
http://fivedots.coe.psu.ac.th/~ad/jg2/

Would anyone who has read "Pro Java 6 3D Game Development" care to comment on it?
7  Game Development / Newbie & Debugging Questions / Re: Problem Changing Scene on Timer Event on: 2007-11-05 18:36:44
Could you post the relevant code?

Here is some sample code that uses a timer to send repaint events to a JFrame at a specified interval. It alternates the color of some text on the window with each update.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
import java.awt.Color;
import java.awt.Graphics;
import java.lang.reflect.InvocationTargetException;
import java.util.Timer;
import java.util.TimerTask;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class TimerTest implements Runnable
{
   JFrame f          = new MyFrame();
   int repaintCount    = 0;    
   
   public static void main(String[] args)
   {
      try
      {
         SwingUtilities.invokeAndWait(new TimerTest());
      }
      catch (InvocationTargetException e)
      {
         e.printStackTrace();
      }
      catch (InterruptedException e)
      {
         e.printStackTrace();
      }
   }

   public void run()
   {
      f.setBounds(0, 0, 500, 500);
      f.getContentPane().setBackground(Color.BLACK);
      f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      f.setVisible(true);
      f.setIgnoreRepaint(true);
      Timer t = new Timer(true);
      t.scheduleAtFixedRate(new MyTimerTask(), 0, 250); // run every 250 millis econds (or 4 times a second)
  }

   private class MyTimerTask extends TimerTask
   {
      public void run()
      {
         f.repaint();
         repaintCount++;
      }
   }
   
   private class MyFrame extends JFrame
   {
      public void paint(Graphics g)
      {
         super.paint(g);
         Color c = (repaintCount % 2 == 0) ? Color.RED : Color.BLUE;
         g.setColor(c);
         g.drawString("THIS IS A TEST", 200, 240);
         g.dispose();
      }
   }
}


8  Game Development / Newbie & Debugging Questions / Re: Enum in Java 6 on eclipse on: 2007-11-03 02:07:40
If you can post the error(s) you see and the code you are using, that would help.  My suspicion, though, is that your compiler compliance level isn't set correctly.

Right-click on the project and choose Build Path -> Configure Build Path. On the window that appears, click on the Java Compiler entry and then look at your Compiler Compliance Level. Is it 6.0? If not, try setting it to 6.0 and see if that helps.

9  Discussions / General Discussions / Re: subtle blips while playing java games? on: 2007-11-02 01:32:12
To figure out the JVM version, run the java command with the -version option:

java -version

Also, you can supply the following options (if you're running the Sun HotSpot JVM) if you want to correlate GC operations to the blips you are seeing:

java -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
10  Discussions / General Discussions / Areas of study or book suggestions for mathematics for 3D programming? on: 2007-10-29 17:40:53
I'm pretty new to 3D programming. I know there are books out there that cover the Java APIs that handle 3D operations, but I'm interested in any recommendations for good books that helped you to understand the math behind or in front of the code.

For lack of book suggestions, what areas of mathematics should I study to get a good grasp of the math behind 3D concepts?
11  Java Game APIs & Engines / OpenGL Development / Re: Help with LWJGL? on: 2007-10-27 16:38:35
I haven't used NetBeans or JCreator, but I have seen errors like those before...

The first error is a classpath issue and so if you can find a way to configure the classpath for the java command that is used to run the code, I think it may resolve the issue.

The second error looks like it has to do with a file path that uses spaces. Notice how the error message cut off the path right after C:\Documents? If you can quote the path, as in...
java -classpath "C:\Documents and Settings\eng06itara\Game\build\classes" (full name of class w/package), it should work.

As I said, I haven't used those IDEs and so hopefully someone can answer for those specifically, but I thought these suggestions might help you.
12  Discussions / General Discussions / Re: Useful Design Patterns for Games on: 2007-10-27 07:14:26
Thanks for your responses.

purpleguitar, I found that javaworld article very interesting, even came with examples.  Smiley  I'm going to make some adjustments to my code to reflect what I've learned. I don't have access to the paper you mentioned and so no joy there.

JonathanC, I'm trying to learn more about game implementations and design patterns at the same time. For me, it's sometimes difficult to realize the benefits of a design pattern from dry descriptions of the design patterns themselves, as you might find in some books.  I was also hoping that I could narrow my focus for which patterns to better study. I understand what you are saying about not trying to force patterns into a game, but I think there must be a common set of design patterns that are naturals for the various parts of common game types.
13  Discussions / General Discussions / Useful Design Patterns for Games on: 2007-10-26 10:36:57
Would anyone care to share which design patterns they found useful in game development and what problem those patterns solved in their games?

For example, the Template Method design pattern could be useful for a reusable game loop template because game loops are so similar between games.

14  Game Development / Newbie & Debugging Questions / Re: Command line on: 2007-10-26 01:25:15
You might also consider using an IDE, like Eclipse, with Ant build files that you can write to do that kind of packaging (and a lot more <g>).
15  Discussions / General Discussions / Re: Java Gaming book on: 2007-10-25 09:44:27
In the previous post, I mentioned that the author of "Killer Games..." was *writing* another book. As you can see from the links, it's been out for several months. Sorry about the confusion.
16  Discussions / General Discussions / Re: Java Gaming book on: 2007-10-25 09:38:50
I've also bought both of the books mentioned previously on this thread, and agree that although there is overlap, you do get some good insights from both authors. The author of "Killer Games..." is writing another book (see links below), which does use Java 6.

http://fivedots.coe.psu.ac.th/~ad/jg2/
http://fivedots.coe.psu.ac.th/~ad/jg2/diffKGPJ.html

I'm curious if anyone knows whether David is considering writing another book on the subject. (David?)
17  Java Game APIs & Engines / Tools Discussion / Re: A Java update came out. Do I need to update files and environment variables? on: 2007-10-25 02:07:14
You should be able to tell from the Package Explorer window in Eclipse whether your projects are now using the new JRE. If not, you can right-click on the JRE listing, click configure, and browse your way to the new JDK directory.

In terms of changing anything, you probably won't have to if you haven't hard-coded any JDK paths yourself anywhere (e.g. in an Ant build file).

If you're upgrading from 1.5 or earlier, you might want to check the setting for your compiler compliance level (Build Path -> Configure Build Path -> Java Compiler -> Compiler Compliance Level) and adjust it as you see fit...

18  Game Development / Newbie & Debugging Questions / Re: Thread.sleep accuracy? on: 2007-10-22 00:52:47
Thanks DzzD (and others) for your responses. I did try your suggestions and was able to get a steady rate of 10 millisecond waits.

I'm still playing around with which changes made the most difference, but I had to apply almost all of them to get the desired result

I will also include the Thread.sleep call and see if I can reproduce the problem from before.
19  Discussions / Business and Project Management Discussions / Can independent Java game developers make a buck (or two)? on: 2007-10-21 19:12:53
My question concerns whether an independent developer creating Java games can make enough income to sustain themselves (and a family) in an age where there are millions of dollars spent on console and computer games, with huge teams of developers, artists, musicians, and others...

I'm starting on a path to write Java games and (hopefully) either sell them on the web or host a site that offers them for free at the expense of users having to deal with advertisements. Pretty standard stuff, I think.

It's been my dream to write games for a long time, and I'm very excited to finally start. However, how realistic is my vision?

For any indy developers out there, please let me/us know your experiences in this department...
20  Discussions / General Discussions / Write once, run anywhere --- with Java games? on: 2007-10-21 18:56:57
I'm curious if anyone is willing to share their experiences with the areas of pain while trying to make sure that their Java games ran correctly across platforms, such as Mac OS, Linux, and Windows XP? What kind of compromises needed to be made, if any?

Also, are there any statistics to show what platform is used most to run Java games?
21  Game Development / Newbie & Debugging Questions / Re: Thread.sleep accuracy? on: 2007-10-21 18:43:46
I'm using Linux (kernel 2.6.2.2) and I thought I read that the timer that Thread.sleep uses has a 1 millisecond resolution time on that platform.

However, I took Thread.sleep out of the equation completely, and I'm still not getting constant results, which leads me to believe that unless others can reproduce these numbers that it must be something specific to the OS or the JRE and System.nanoTime/System.currentTimeMillis call on this platform that's problematic.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
public class ClockTest 
{
   public static void main(String[] args)
   {
      for (int i = 1; i <= 20; i++)
      {
         // Using relative clock time
        long start = System.nanoTime();
         
         // 10 millisecond delay in nanoseconds
        long delay = start + 10000000;
         
         while (System.nanoTime() < delay);
         
         long end = System.nanoTime();
         
         // Output results *after* the time captures to reduce extraneous code's CPU cycles
        System.out.println("Attempt " + i + ": " + ((end - start) / 1000000) + " millsecs");
      }
   }
}


Attempt 1: 10 millsecs
Attempt 2: 10 millsecs
Attempt 3: 10 millsecs
Attempt 4: 10 millsecs
Attempt 5: 10 millsecs
Attempt 6: 17 millsecs
Attempt 7: 10 millsecs
Attempt 8: 10 millsecs
Attempt 9: 10 millsecs
Attempt 10: 10 millsecs
Attempt 11: 17 millsecs
Attempt 12: 10 millsecs
Attempt 13: 10 millsecs
Attempt 14: 10 millsecs
Attempt 15: 10 millsecs
Attempt 16: 16 millsecs
Attempt 17: 10 millsecs
Attempt 18: 10 millsecs
Attempt 19: 10 millsecs
Attempt 20: 10 millsecs
22  Game Development / Newbie & Debugging Questions / Re: Thread.sleep accuracy? on: 2007-10-21 03:12:23
Orangy, I tried your suggestion but I'm still not getting the constant timing delay that I would need, for example, for a game or rendering loop. I even switched from a 5 to a 10 millisecond delay. (broumbroum, I also tried setting the main thread to the max priority without good results either.)

My system resources utilization is very very low: CPU, memory, disk I/O all very low usage. I don't know what the kernel scheduler time slice per process is, don't know what the Java scheduler time slice is per thread (using the Sun HotSpot JVM), and haven't turned on GC logging  to know what GC activity is happening --- but I'm assuming that a steady 10 millisecond delay rate should be achievable. With a 10 millisecond slice of time, the game loop would proceed at 100 cycles per second, which sounds like a reasonable number.

If the problem is really the OS process scheduler or the JVM thread scheduler (e.g. with time it's giving to the GC native thread), how are other Java games achieving any kind of constant frame rate? Are their threads using Thread.sleep at all?

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
public class ClockTest 
{
   public static void main(String[] args)
   {
      for (int i = 1; i <= 20; i++)
      {
         // Using absolute clock time
        long start = System.currentTimeMillis();
         long delay = start + 10; // 10 millisecond delay
        try
         {
            // Sleeping for 0 milliseconds
           Thread.sleep(0);
            while (System.currentTimeMillis() < delay);
         }
         catch (InterruptedException e)
         {
            e.printStackTrace();
            System.exit(1);;
         }
         long end = System.currentTimeMillis();
         
         // Output results *after* the time captures to reduce extraneous code's CPU cycles
        System.out.println("Attempt " + i + ": " + (end - start) + " millsecs");
      }
   }
}


Results:
Attempt 1: 10 millsecs
Attempt 2: 13 millsecs
Attempt 3: 10 millsecs
Attempt 4: 10 millsecs
Attempt 5: 10 millsecs
Attempt 6: 11 millsecs
Attempt 7: 10 millsecs
Attempt 8: 10 millsecs
Attempt 9: 10 millsecs
Attempt 10: 10 millsecs
Attempt 11: 20 millsecs
Attempt 12: 10 millsecs
Attempt 13: 10 millsecs
Attempt 14: 10 millsecs
Attempt 15: 10 millsecs
Attempt 16: 10 millsecs
Attempt 17: 10 millsecs
Attempt 18: 10 millsecs
Attempt 19: 10 millsecs
Attempt 20: 10 millsecs

23  Game Development / Newbie & Debugging Questions / Thread.sleep accuracy? on: 2007-10-20 22:30:16
I'm new to game development with Java and I've noticed some odd behavior with Thread.sleep.

It seems that the accuracy of Thread.sleep is suspect. Take the following code as an example...
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
public class ClockTest
{
   public static void main(String[] args)
   {
      for (int i = 1; i <= 20; i++)
      {
         // Using absolute clock time
        long start = System.currentTimeMillis();
         try
         {
            // Sleeping for 5 milliseconds
           Thread.sleep(5);
         }
         catch (InterruptedException e)
         {
            e.printStackTrace();
            System.exit(1);
         }
         long end = System.currentTimeMillis();
         
         // Output results *after* the time captures to reduce extraneous code's execution time
        System.out.println("Attempt " + i + ": " + (end - start) + " millsecs");
      }
   }
}

...which produces...

Attempt 1: 6 millsecs
Attempt 2: 6 millsecs
Attempt 3: 5 millsecs
Attempt 4: 5 millsecs
Attempt 5: 5 millsecs
Attempt 6: 5 millsecs
Attempt 7: 5 millsecs
Attempt 8: 5 millsecs
Attempt 9: 5 millsecs
Attempt 10: 5 millsecs
Attempt 11: 21 millsecs  <-- ouch
Attempt 12: 5 millsecs
Attempt 13: 5 millsecs
Attempt 14: 5 millsecs
Attempt 15: 5 millsecs
Attempt 16: 5 millsecs
Attempt 17: 6 millsecs
Attempt 18: 5 millsecs
Attempt 19: 5 millsecs
Attempt 20: 5 millsecs

I'm using the 1.6.0_01 JDK under Linux (Intel single core CPU). As you can see, sometimes, Thread.sleep can take over 4x the amount of time requested. Most of the time, it seems that it can handle a 5 millisecond request time, and so it's not that the OS time facilities that the JVM uses can't handle that small of a resolution. It would seem that other factors are involved... maybe JVM native threads (e.g for garbage collection)Huh

Can anyone explain the difference in the numbers?  Also, how do you release CPU time to other threads (e.g. the AWT thread) while still being able to keep a constant frame rate if Thread.sleep durations are not consistent?
1  
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.

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

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

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

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

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

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

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

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

Norakomi (35 views)
2014-08-06 19:49:38

BurntPizza (64 views)
2014-08-03 02:57:17
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!