Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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] 2 3 ... 5
1  Game Development / Game Play & Game Design / Re: Massive multiplayer puzzle on: 2010-10-27 13:00:44

One of the challenges is that people may not be inclined to type reviews or "score" the puzzles they've solved.
An automatic rating system could be a solution here. You could have an amazon-like prompt saying "people who solved this puzzle also solved that other puzzle" ...

Possible metrics could be: time to solve, number of retries, number of pieces used on the set, ...
2  Game Development / Shared Code / Re: Line of sight through 2d polygons (shadows, field of view) on: 2010-10-18 12:22:22
I've only skimmed through the thread because I'm wasting time at work (  Tongue ) but I would like to point out that all big commercial shooters use binary space partitions (or BSP) to quickly discard large volumes of their map which are definitely NOT in the line-of-sight.

I just thought I'd give you some terms to google Smiley
3  Java Game APIs & Engines / OpenGL Development / Re: What happened to GLU ? on: 2010-10-10 13:08:50
Thanks, all!
I never looked any further than the lwjgl.jar  Grin Roll Eyes
4  Java Game APIs & Engines / OpenGL Development / What happened to GLU ? on: 2010-10-06 17:15:54
Hi!
After a few years of inactivity, I decided to get Eclipse from under the dust and try my hands at LWJGL. To get back into things, I'm trying to convert some of my previous OpenGL attempts to LWJGL. However, I've always used the convenient gluLookat() and gluPerspective() to set my viewport correct.

GLU is mentioned in the API docs, but Eclipse says it's not in the jar. I guess you dropped it to keep things mean&lean.

What is the alternative to GLU? I am now downloading the source code and copying the few methods I need into my own source tree, but is that the only way?
5  Games Center / Archived Projects / Re: Iron legion tank action game on: 2009-02-15 15:02:56
I have an AMD64, 3400+ with 1.5G RAM and a Radeon x1950pro and your game runs at 60 FPS. At some point the first time, performance degraded to 10 FPS but I have been unable to reproduce this. It seems to have been related to where I was in the map.

I have a technical question: How do you take control of the mouse like that? The cursor disappears and no matter how wildly I move the mouse, your game gets the events. Most of my applications lose track of the mouse as soon as it leaves the window!

6  Java Game APIs & Engines / JOGL Development / Re: Problem with NeHe lesson 1 on: 2008-06-13 16:50:23
In your display mode, you may also want to explicitly manipulate the modelview matrix:

1  
2  
3  
4  
      GL gl = drawable.getGL();
      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
      gl.glMatrixMode(GL.GL_MODELVIEW); // Select The Modelview Matrix
     gl.glLoadIdentity(); // Reset The Modelview Matrix


Whenever you resize, you need something like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {

      GL gl = drawable.getGL();
      GLU glu = new GLU();

      System.out.println("reshape to x=" + x + ", y=" + y + ", width=" + width + ", height=" + height);
      if (height == 0) // Prevent A Divide By Zero By
     {
         height = 1; // Making Height Equal One
     }

      //this is already done by the calling method, according to JOGL documentation
     //gl.glViewport(x,y,width,height);   // Reset The Current Viewport

      gl.glMatrixMode(GL.GL_PROJECTION); // Select The Projection Matrix
     gl.glLoadIdentity(); // Reset The Projection Matrix

      // Calculate The Aspect Ratio Of The Window
     //glu.gluPerspective(90.0f,(double)width/height,0.5f,500.0f);

        glu.gluOrtho2D(0, width, 0, height);
   }


Your "coordinate system" will depend very much on what you supply with the gluOrtho2D call. As the name says, this one is for an orthogonal projection into a plane. In other words: you're drawing in 2D. There are similar calls for drawing in 3D.

Have fun :-)
I hope this gives you some pointers. Good luck ;-)
7  Game Development / Game Mechanics / Re: airplane matrix problem on: 2008-06-12 09:23:07
http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm

If you keep track of yaw, pitch and roll at the same type, you may be running into the famous gridlock problem (google it).

What I usually do for an airplane: I represent it with 3 unit vectors ("forward", "up", and "right"). For rolls, I rotate the "up" and "right" vectors around the "forward" vector. Pitch and yaw are similar: you take one vector, and you rotate the other 2 around it.
8  Game Development / Game Play & Game Design / Re: Loading a 3D Map on: 2008-06-12 09:13:08
and now my two coins... cents  Roll Eyes

The poly count sounds extremely high indeed, that's no doubt the reason you're running out of memory. Java comes with some basic post-mortem tools. See
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp#DebuggingOptions
http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html



Doesn't your 3D tool allow re-using models, or stamping or whatever? There has to be another way for your 3D tool to avoid duplication. Are you able to export extra information, like modelname, or materials, or even custom attributes from the 3D tool? In that case, you could use that extra information to fold all the models together again. For example, all meshes with material "spike" are ignored, and instead you replace it with your own mesh of a spike, that you re-use without duplication.

9  Games Center / Archived Projects / Re: Agent: 00PK on: 2008-06-11 11:14:45
Could your running jump be "running" into this problem ?

http://www.java-gaming.org/topics/2-players-from-one-keyboard/17883/view.html
10  Discussions / General Discussions / Re: Create a space to submit and to launch Java webstartable games on: 2008-06-01 12:42:45
Hiya all !

First off, great work on the JGT! It will definitely make browsing through the game show cases a lot easier!
I have a suggestion for a feature:

Why don't you implement "labels"?
- It's the new fashion. Many great sites do it, these days. Think flickr, gmail, ...
- It's easy for authors to link labels they feel are appropriate for their game. That means: low-maintenance for the site admins.
- Authors can create new labels, and the site would work without adjusting code. Again: low-maintenance.
- It's multi-dimensional. You can have labels for ...
  * technology used (lwjgl, jogl, JME, ...),
  * game genre (puzzle, action, rpg, fps, ...),
  * license type (free (beer), free (speach), open source, shareware, commercial, gpl, ...)
  * installation technique (webstart, jar, applet, ...)
  * OS support (unix, linux, sun, wintel, mac, OSX, ...)
  * development stage (tech demo, prototype, beta, finished, ...)
- There are tons of ways to navigate and search labels, but under the hood they all translate to very simple, logical queries
  * most popular labels
  * games per label
  * games similar to this game (fuzzy search on a set of labels, I'm just dreaming here  Grin)
- The technology is simple. You need a table called "label", and an m-to-n linktable called "labelsforgames", that's all!
11  Java Game APIs & Engines / Java 3D / Re: Gl_depth_test vs polygon sorting alogrithm such as bsp on: 2007-08-23 21:10:58
as far as I know, sorting your triangles doesn't eliminate the need for depth test. But by drawing your triangles from closer to further,  you eliminate overwriting the same pixel over and over again, so you're less likely to hit your fill rate.

Again afaik, bsp is not so much a sorting algorithm as a quick way to rule out a number of polygons that absolutely cannot possibly be visible, given the current location. The remaining set of polygons can still be sorted for faster drawing, and they definitely still need depth tests.

So, I think you've mentioned three techniques that can quite easily co-exist :-)
12  Java Game APIs & Engines / JOGL Development / Re: Demo-page for our diploma-thesis (swing-components with 3D extension) on: 2007-08-09 20:54:33
the kitchen demo (piped & non-pipe enabled) app works like a charm on my pc:
AMD 2800+, 512Mb RAM, nVidia 7600GS (AGP slot), java 1.5.0_12

maybe java 6 is to blame?
13  Games Center / Archived Projects / Re: Splatballs on: 2007-08-07 09:46:38
suggestion:
before you draw your new frame, draw a large black rectangle with 90% transparency. That will darken all trails with 10%. If your graphics are accellerated, that shouldn't slow things down.
14  Game Development / Networking & Multiplayer / Re: Mysql and transactions.. on: 2007-08-04 19:35:36
Here's the standard way to work with transactions in JDBC (assuming you're not running your code inside a J2EE server):
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
String driver = "mysql.driver.classname";
Class.forName(driver).newInstance();
String url = "jdbc:mysqlserver:port";

Properties props = new Properties();
props.putProperty("user", "username");
props.putProperty("password", "***");
Connection conn = DriverManager.getConnection(url, props);

//the next line is the real trick to work with transactions:
conn.setAutoCommit(false);
Statement workStm = conn.createStatement(); //this statement will perform all the work


Every statement that is created from the same connection, is part of the same transaction. Different connection = different transactions. Because you set autocommit to false, you'll need to commit or rollback yourself:
1  
2  
conn.commit();
conn.rollback();


I've never done fancy stuff like the savepoints, so I can't help you with that. Smiley
15  Java Game APIs & Engines / JOGL Development / Re: Texturing issue on: 2007-07-27 09:03:53
Question: why does the centre-point solution not work?
I think if you keep your centre-point always on the intersection between the two diagonals, you'll have what you're looking for, no?

16  Game Development / Networking & Multiplayer / Re: Java web start and jar file resources on: 2007-07-25 11:44:07
You don't. All resources should already be in your class path. I don't know how to construct a class path with multiple jars for JNLP, but for a stand alone application, you would typically modify the manifest in your "main" jar, and insert a class-path entry there, mentioning all the other jar files you need.
17  Game Development / Game Play & Game Design / Re: Turned based game design/architecture on: 2007-07-25 10:59:14
I have KeyListener and MouseListener to make the game react to local user inputs, so whenever he clicks on the screen with his mouse I can check if that x,y actually hit a country, and if it did, then I can highlight that country, thus refreshing the screen. If he did not hit anything, I could still refresh the screen with a message "You must select a country!", or simply do nothing.
er made some action, let the thread sleep for 100ms, and then off to the next action.

I'm going to focus on this part Wink
If your "game" class is listening to keys and mouse events directly, it sounds like you're not following the MVC pattern. I'm not sure if you're familiar with the pattern?
18  Discussions / Community & Volunteer Projects / Re: Looking for programmers for RPG/Strategy game on: 2007-07-25 10:55:20
I was about to ask "what is SE" ?
But then I figured you're talking about software engineering ... right ?  Wink
19  Game Development / Game Play & Game Design / Re: Turned based game design/architecture on: 2007-07-25 09:34:51
I see your point. Reducing the maximum frame rate may be enough to make the problem disappear, though. After all, you need barely enough fps to make your game somewhat responsive. I played a quick action game on my portable (the things I don't do for java-gaming.org!  Roll Eyes ) and my fan never kicked in.

Do you plan to use AWT/Swing, or any of the more gaming-oriented libs like JME/LWGL/JOGL?

In case of AWT/Swing, I guess the main question becomes: in the MVC pattern, how does the viewer object become aware that the screen needs an update because the model has changed?
- polling? You're back to 100% cpu usage if you're not careful.
- a callback? If your model would define an event "GameUpdateChangedEvent", and allowed for GameUpdateListeners to be registered, I think you're getting closer.
20  Game Development / Game Play & Game Design / Re: Turned based game design/architecture on: 2007-07-25 07:42:04
b) Screen only updated when something has happened, there is no animation going on (that is, it's not as a traditional game loop where it's updated as fast a possible)

-1 on this  Wink
one day, you'll want animations even in your turn-based game. And then you'll curse yourself for not having a "classic" game loop.
As Keldon said above, the model-view-controller pattern should be able to help you out, here.

the model is your actual game. It has methods to assign players, change turns, make moves, create units, etc... This object will apply game logic and raise an error when someone tries to do something out of their turn. It also has a lot of getter methods to figure out the current state.

the view is your standard 60 fps game loop. it keeps track of a camera, and asks the model where all the units are, and which units are active (need highlighting), etc.

the controller is the object that will call methods on the model to create players, start the game, etc. It does this based on input. Like Keldon suggested, you can start with a really simple console, and later move your code to the game loop.
21  Game Development / Networking & Multiplayer / Re: Developing secure and fault tolerant server on: 2007-07-24 17:28:50
I would suggest writing J2EE java beans for your server-side code. Once you've made an application in the form of an .ear-file, you can deploy it to any J2EE server (WebLogic, WebSphere, WebSphere Community Edition, Geronimo, JBoss, ...). Your Application server, together with a good transactional database (Oracle, Oracle Express, MS SQLServer, ... don't know about MySQL) will take care of all the redundancy and fail-over issues.

Your client could be a J2EE client application (also wrapped inside an .ear-file), or it could be a regular java application (inside a .jar, for example) that uses IIOP to talk to the application server.

Warning: if you've never written a J2EE application before, the learning curve might be a little steep. But you get all the advantages almost for free, like transactional behavior, portability, scalability, redundancy, fail-over, database-independence, resource pooling, and whatnot. Take a look at the J2EE tutorials from Sun, they might give you an idea.
22  Java Game APIs & Engines / JOGL Development / Re: re: gluLookAt oddity on: 2007-07-24 16:52:27
It sounds like you're building your matrices the wrong way. I suggest you go find some tutorial, or maybe the nehe tutorials may help you, although I don't think they use gluLookAt().

I think this would be a good approximation of how the code should flow:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
glMatrixMode(GL.GL_MODELVIEW);                  // Select The Modelview Matrix
glLoadIdentity();                           // Reset The Modelview Matrix
gluLookAt(...)

//object A
glPushMatrix()
glTranslate( <position of objectA> )
glBegin(...)
  //draw objectA
glEnd()
glPopMatrix()

//object B
glPushMatrix()
glTranslate( <position of objectB> )
glBegin(...)
  //draw objectA
glEnd()
glPopMatrix()

// ..ad infinitum


Mind all the pushes and pops.
23  Java Game APIs & Engines / JOGL Development / Re: Blank Window (noob question) on: 2007-07-23 12:14:27
I think you're officially the first person I could help with OpenGL. Ever  Grin
quite welcome!
24  Java Game APIs & Engines / JOGL Development / Re: re: gluLookAt oddity on: 2007-07-23 12:08:24
Have you tried removing the glLoadIdentity call in your moveToLocation function?
I think each of your draw* methods should start with a push, then call moveToLocation, and at the end of the draw* methods should be a pop.

That way, each of your draw methods will have a clean gluLookAt() matrix to work with. If you gluLookAt() first, and then glLoadIdentity, you've undone your glLookAt().
25  Java Game APIs & Engines / JOGL Development / Re: Blank Window (noob question) on: 2007-07-22 10:52:00
Your TestRenderer class has two "display()" methods, so I'm guessing the one where you're drawing the triangle is never called, because it is overridden by the second one, the empty "display(GLAutoDrawable d)" method. I'm surprised your compiler doesn't give you a warning about this?

Anyway, I think you can safely move all the drawing content to the other "display()" method, and delete all methods that mention GLDrawable. GLAutoDrawable is the most recent version, so those are the methods you should use.

EDIT: also see http://www.java-gaming.org/forums/index.php?topic=12817.0

For reference, this here works:
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  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.media.opengl.DebugGL;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.glu.GLU;

import com.sun.opengl.util.Animator;

/**
 * example taken from http://www.java-gaming.org/forums/index.php?topic=1474.0
 * Whenever you run this, it's important to have the java.library.path property point to a directory
 * where you put the JOGL dll files, and have the CLASSPATH point to jogl.jar
 *
 * This is an older version that does not use the "Input" class just yet.
 */

public class TestRenderer1 implements GLEventListener {
   public static void main(String[] args) {
      System.out.println("library property = "
            + System.getProperty("java.library.path"));

      Frame frame = new Frame("Triangle Demo");

      GLCanvas canvas = new GLCanvas();
      canvas.requestFocusInWindow();
      canvas.addGLEventListener(new TestRenderer1());

      frame.add(canvas);
      frame.setSize(512, 512);

      final Animator animator = new Animator(canvas);
      frame.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
            new Thread(new Runnable() {
               public void run() {
                  animator.stop();
                  System.exit(0);
               }
            }).start();
         }
      });
      frame.setVisible(true);
      animator.start();
   }

   public void init(GLAutoDrawable drawable) {
      GL gl = drawable.getGL();

      drawable.setGL(new DebugGL(drawable.getGL()));

      System.out.println("Init GL is " + gl.getClass().getName());
   }

   public void display(GLAutoDrawable drawable) {
      GL gl = drawable.getGL();

      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
      gl.glMatrixMode(GL.GL_MODELVIEW); // Select The Modelview Matrix
     gl.glLoadIdentity(); // Reset The Modelview Matrix

      //this method should not be called in case of ortho projection
     //glu.gluLookAt(0,0,100, 0,0,0, 0,1,0);

      gl.glBegin(GL.GL_TRIANGLES);
         gl.glColor3f(1.0f, 0.0f, 0.0f);
         gl.glVertex3f(0.0f, 0.0f, 0.0f);
         gl.glColor3f(0.0f, 1.0f, 0.0f);
         gl.glVertex3f(100.0f, 0.0f, 0.0f);
         gl.glColor3f(0.0f, 0.0f, 1.0f);
         gl.glVertex3f(100.0f, 100.0f, 0.0f);
      gl.glEnd();
   }

   public void reshape(GLAutoDrawable drawable, int x, int y, int width,
         int height) {

      GL gl = drawable.getGL();
      GLU glu = new GLU();

      System.out.println("reshape to x=" + x + ", y=" + y + ", width="
            + width + ", height=" + height);
      if (height == 0) // Prevent A Divide By Zero By
     {
         height = 1; // Making Height Equal One
     }

      //this is already done by the calling method, according to JOGL documentation
     //gl.glViewport(x,y,width,height);                  // Reset The Current Viewport

      gl.glMatrixMode(GL.GL_PROJECTION); // Select The Projection Matrix
     gl.glLoadIdentity(); // Reset The Projection Matrix

      // Calculate The Aspect Ratio Of The Window
     //glu.gluPerspective(90.0f,(double)width/height,0.5f,500.0f);

      //if you want to use Ortho2D projection, be sure to comment out the "gluLookAt" method inside the display() method
     //glu.gluOrtho2D(-width / 2, width / 2, -height / 2, height / 2);
       glu.gluOrtho2D(0, width, 0, height);
   }

   public void displayChanged(GLAutoDrawable drawable, boolean modeChanged,
         boolean deviceChanged) {
   }

}
26  Discussions / General Discussions / Re: What's Killing Game Development? on: 2007-07-21 12:34:12
Makes you wonder how ANY game gets released  Grin

I must confess I'm a sucker for fancy graphics. I'm disappointed when I'm not blown away by the graphics, then again I complain when the gameplay suffers   Roll Eyes
27  Java Game APIs & Engines / JOGL Development / re: gluLookAt oddity on: 2007-07-20 09:37:18
I don't immediately know what's wrong, but I advise you to take a look at http://nehe.gamedev.net/, they're great tutorials on OpenGL.
gl !
28  Discussions / General Discussions / Re: Heightfield-ray intersection on: 2007-07-19 07:48:09
What I did In JOGL, was ask for the (x,y) coordinates of the mouseclick, ask the depth from the buffer, and then use glu.gluUnproject() to get world coordinates. Since you have a heightmap, you don't really need the unprojected "height", but the other two coordinates will tell you what position on the map you clicked. Voila  Grin
29  Games Center / Archived Projects / Re: Treasure Tomb Development Diary on: 2007-07-17 14:36:53
I'm enjoying the day-by-day read as well, and I wanted to throw in another suggestion.

As a replacement for the laser cannons, in your "pyramid" tile-set, the sphinxes are said to have a deadly gaze.  Cool
30  Game Development / Performance Tuning / Re: immutable, cloned, or mix? on: 2007-07-09 12:08:58
From what little I know of the Sun Swing API, Sun circumvented the problem by not getting/setting objects. The "Coordinates" class has been deprecated.
Pages: [1] 2 3 ... 5
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (16 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

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

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

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

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

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

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

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

BurntPizza (49 views)
2014-08-09 21:09:32
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!