Show Posts
|
|
Pages: [1] 2 3 ... 5
|
|
1
|
Game Development / Game Play & Game Design / Re: Massive multiplayer puzzle
|
on: 2010-10-27 15: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, ...
|
|
|
|
|
4
|
Java Game APIs & Engines / OpenGL Development / What happened to GLU ?
|
on: 2010-10-06 19: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 16: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 18: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); gl.glLoadIdentity(); |
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) { height = 1; }
gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); 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 ;-)
|
|
|
|
|
10
|
Discussions / General Discussions / Re: Create a space to submit and to launch Java webstartable games
|
on: 2008-06-01 14: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  ) - 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 23: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 :-)
|
|
|
|
|
13
|
Games Center / Archived Projects / Re: Splatballs
|
on: 2007-08-07 11: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 21: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);
conn.setAutoCommit(false); Statement workStm = conn.createStatement(); |
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. 
|
|
|
|
|
16
|
Game Development / Networking & Multiplayer / Re: Java web start and jar file resources
|
on: 2007-07-25 13: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 12: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  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?
|
|
|
|
|
19
|
Game Development / Game Play & Game Design / Re: Turned based game design/architecture
|
on: 2007-07-25 11: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!  ) 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 09: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  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 19: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 18: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); glLoadIdentity(); gluLookAt(...)
glPushMatrix() glTranslate( <position of objectA> ) glBegin(...) glEnd() glPopMatrix()
glPushMatrix() glTranslate( <position of objectB> ) glBegin(...) glEnd() glPopMatrix()
|
Mind all the pushes and pops.
|
|
|
|
|
24
|
Java Game APIs & Engines / JOGL Development / Re: re: gluLookAt oddity
|
on: 2007-07-23 14: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 12: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.0For 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;
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); gl.glLoadIdentity(); 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) { height = 1; }
gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); glu.gluOrtho2D(0, width, 0, height); }
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { }
} |
|
|
|
|
|
28
|
Discussions / General Discussions / Re: Heightfield-ray intersection
|
on: 2007-07-19 09: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 
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|