Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (715)
Games in Android Showcase (214)
games submitted by our members
Games in WIP (788)
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
1  Java Game APIs & Engines / Android / Re: Physics on Android on: 2010-08-13 12:42:19
Thanks ewjordan, really interesting post and links...sounds like I was having a fit of ludicrous overconfidence with the "a few object pools" remark  Smiley
2  Java Game APIs & Engines / Android / Re: Physics on Android on: 2010-08-09 10:07:57
I tried using the (most excellent) phys2d library during the early stages of writing Word Drop.  It ran very slowly, with the main culprit seeming to be garbage collection.  If I ever really needed 2D physics for a new game, I will definitely take a look at it again - maybe with a few object pools it would start to look pretty workable.

P.S. Sorry for reviving a long-dead thread!
3  Java Game APIs & Engines / OpenGL Development / Re: Java2D -> LWJGL conversion on: 2006-07-29 18:20:29
OT, I didn't know that about glDrawPixels, that's a handy tip.  I use glDrawPixels to render text; if I find it too slow, I'll do a straight-forward optimization by swapping to textured quads.

(I'm hoping that glScissor will do clipping of glDrawPixels rendering.)
4  Java Game APIs & Engines / OpenGL Development / Re: Java2D -> LWJGL conversion on: 2006-07-29 10:32:53
Hi gamepro65,

If you haven't done any OpenGL before then there'll be a bit of a learning curve.

You probably wouldn't be needed to use a large proportion of the API for drawing images, mostly lots of glDrawPixels calls a bit like

GL11.glRasterPos2i(xPosition, yPosition);
GL11.glDrawPixels(imageWidth, imageHeight, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, imageData)

where imageData is a ByteBuffer containing the image pixel data.  You can use LWJGL's devIL library to load image files into ByteBuffers.  You can set things up to display in 2D a bit like this:

int width = Display.getDisplayMode().getWidth();   
int height = Display.getDisplayMode().getHeight();

GL11.glOrtho(0, width, 0, height, -1, 1);

You would also have to change your input code to use the LWJGL Keyboard and Mouse classes - you would no longer be dealing with AWT events.

If you want to swap to OpenGL purely for speed, it might not be worth the trouble unless your game really isn't fast enough.  Otherwise, I expect you would enjoy the process of learning OpenGL and LWJGL, and there are people on these boards who would be willing to advise if you have any trouble (like Riven, who has been helping me with a couple of things).  Cas is probably the local expert in using LWJGL for 2D games - have you seen Titan Attacks?
5  Java Game APIs & Engines / OpenGL Development / Re: Raster clipping on: 2006-07-28 22:45:38
Riven, glScissor looks like just what I need, many thanks!

EDIT: yup, glScissor works nicely, thanks.
6  Java Game APIs & Engines / OpenGL Development / Raster clipping on: 2006-07-28 20:10:00
This is another of those OpenGL questions rather than an LWJGL question.

Can anyone recommend how to do clipping during 2D raster drawing (glDrawPixels)?  OpenGL allows clipping planes in 3D, but these don't seem to apply to raster operations, and there don't seem to be any raster equivalent.

7  Java Game APIs & Engines / JOGL Development / Re: Huge textures on: 2006-07-27 11:22:42
OpenGL has a maximum texture size that is guaranteed to be supported (which I think is 512x512, but can't actually remember).  Some implementations may support bigger textures, but you can't rely on it.

You'll have to use multiple textures tiled over your terrain, I expect.
8  Java Game APIs & Engines / OpenGL Development / Re: Keyboard autorepeat on: 2006-07-26 12:57:43

I like your idea of just storing the timestamp of the key down and then comparing to the current time to determine whether a key event should be fired, rather than kicking off a Thread to generate the events in between sleeps.  I think I'll do the same.  (I assume your keyAutoFire method is called every frame.)

One thing I notice is that you appear to be checking all keys; I assume you get auto-repeat from multiple keys if you hold down multiple  at once.  I suppose that's the way you want it, but most applications don't seem to work that way - only the most recently depressed key keeps autorepeating.  I'm just going to autorepeat the most recently depressed key only, which will save iterating through all the keys each frame: quicker  Wink

Thanks for the reply; we LWJGL folks need to stick together!  Most other people on these boards seem to be using JOGL !
9  Java Game APIs & Engines / OpenGL Development / Keyboard autorepeat on: 2006-07-25 10:03:41
I'm wondering if any of you LWJGL users need keyboard autorepeating and, if so, how you go about using the Keyboard class to achieve it.  Keyboard tells you about key down and key up events only, it seems.  If anyone uses anything cleverer than an "on key down, start a thread that generates the key event every X millseconds; on key up, stop the thread"-type malarky, I would be interested to know.

I'm writing some GUI components for LWJGL and want keyboard auto-repeat in my TextFields and TextAreas.  (Yes, I know, there are plenty of GUI projects out there already  Smiley )
10  Game Development / Game Play & Game Design / Re: To die, or not to die...that is the question... on: 2006-06-27 12:09:24

I find myself agreeing with pretty much all of your ideas.  I like the idea of perma-death, and was thinking about it as part of one of my own game ideas (although that was not really an MMORPG, more like an ordinary multiplayer game (with short-lived military "missions") but with a persistent universe in the background (a overall "war" that the missions are part of).  In the context I was thinking, death is sort of expected (you play a soldier), and can almost be another aspect of an enjoyable game.

To make death more palatable to the player, I was thinking I would:

- keep a record of their past characters so that they can look back at those who sacrificed their lives so gallantly Wink
- have a sort of game "newspaper", or even as part of the "mission" loading screen, a brief obituary of recently killed noteable characters (e.g. "Corporal Smithers of Red Platoon was killed in action on such-an-such a mission after killing so-and-so many of the enemy and capturing a such-and-such.  Private (the name of the new char) has joined up as his replacement")

I also think you are on the right track with making new chars comparable in power to more experienced ones - I was thinking (as part of an idea for a different game, this time actually an MMORPG) of using the law of diminishing returns to make gaining strength/hit points/skills more and more difficult.

For example, all stats have a maximum of 1.0.  All start at 0.5.  When you add a point to the stat, it goes up maybe by ((max - current) * 0.05).  Add 10 points, your stat is 0.7.  Add 20 points, it's 0.82.  And no-one can possibly be more than twice as strong as anyone else;  new characters are useful in a group of experienced characters.

I know you want to dispose of the idea of levels completely, but people do enjoy watching stats creep upwards as they grind, and they like to be able to improve their character.  But in your game, it won't be a grind, they can take part fully even when their char is new.
11  Discussions / General Discussions / Re: Wurm Online has gone GOLD! on: 2006-06-08 11:54:07

I tried Wurm out last night (the normal JOGL one, not the LWJGL test) and it's really impressive.

It seems really "solid" (by which I mean the opposite of flakey).  As a player, it inspired confidence in me; the install was painless; nothing inexplicable or illogical happened in the game; no user actions got ignored (it gives good feedback along the lines of "you can't do such-and-such because of so-and-so").  It takes a while to work out what's going on, but it isn't at all frustrating.

On my PC (windows XP/Athlon 2500+/nVidia 6600) I've got it running at 800x600 with settings turned up quite high.  It's not blazingly fast but it looks very nice.

The OpenGL UI widgets are very slick too.

The only error I saw was an Exception dialog on startup - a NoSuchElementException while parsing the java.version system property; I'm running the original 1.5.0 (haven't got round to getting the lastest Java 5.0 update 7 ot whatever it is now).

I'll be signing up for the premium account (in spite of the extortionate monthly fee  Grin)!

12  Game Development / Networking & Multiplayer / Re: [SGS] DarkShooter on: 2006-03-30 11:37:17
It ought to be possible to get more than 1Hz by starting multiple timers that call the same GLO method, but staggered.  I dunno how you can ensure they are staggered evenly through each second, though.

Since the SGS guys are planning to allow sub-second resolution on PDTimer the problem does away anyway  Cheesy
13  Discussions / General Discussions / Re: "Project Darkstar" teaser site.... on: 2006-03-22 13:01:44
And don't give us any nonsense about timezones either, it's already more than half-way through the 22nd here in the UK  Grin

C'mon, unlock that website!
14  Game Development / Newbie & Debugging Questions / Re: glDrawElements and texturing on: 2006-03-20 11:50:19

You specify the texture co-ordinates in an array (as well as the vertices, normals etc), using

15  Java Game APIs & Engines / JOGL Development / Re: Easy way to get more than MAX_LIGHTS? on: 2006-02-15 13:45:23
One technique is to simply enable the closest MAX_LIGHTS lights to the object you are rendering, switching off the more distant (and therefore less significant) ones.
16  Game Development / Newbie & Debugging Questions / Re: Vector math question on: 2006-01-21 15:27:53
That's a neat solution, much more efficient than mine.
17  Game Development / Newbie & Debugging Questions / Re: Vector math question on: 2006-01-20 11:31:12
You could find the "surface normal" vector as a cross b and then rotate a around that normal vector by PI/2.

Using LWJGL's vector classes, something vaguely like:

Vector3f surfaceNormal = new Vector3f();
Vector3f.cross(a, b, surfaceNormal);

Matrix4f rotateAroundNormal = new Matrix4f();
Matrix4f.rotate((float)Math.PI/2.0f, surfaceNormal, rotateAroundNormal);

Vector n = new Vector3f();
Matrix4f.mul(a, rotateAroundNormal, n);

(I don't expect the code above to work first time, I haven't tested (or even compiled) it  ;-)
18  Java Game APIs & Engines / Java 2D / Re: Getting mouse position in 1.4.2 ? on: 2006-01-18 15:20:13

You can set the mouse position (and do some other stuff) using java.awt.Robot.  (It's a class designed for automated GUI tests.)
19  Game Development / Newbie & Debugging Questions / Re: Finding all the pixels enclosed by a polygon? on: 2006-01-13 09:36:33

The class java.awt.Polygon has a method contains(int x, int y).  You could use this method to test each pixel in the polygon's bounding rectangle, but it would be very slow.

Maybe someone can think of a cleverer way!
20  Games Center / 4K Game Competition - 2006 / Re: Flow 4k on: 2006-01-11 20:20:08
Fantastic, I really enjoyed that.  Runs nice and fast on my Athlon2500+.
21  Games Center / Archived Projects / Re: MONSTRUMO ! on: 2005-11-29 09:09:25
Congrats hvor!  Smiley
22  Discussions / Miscellaneous Topics / Re: Any tips for someone moving to freelance/contract work? on: 2005-11-22 12:27:08

Rates vary by location too - you might get a better rate in the South East than I do in the South West, for example.

I found all my contract jobs on the Jobserve website.

Most contractors start their own Limited company which, as I understand it (and I am not a lawyer so I could easily be wrong), means that any liability is limited to the company (rather than you personally) i.e. when your Java reactor controller causes a meltdown, your company would be sued (not you).  Maybe I'm wrong about this, because I know some contractors recommend taking out liability insurance.

When I got my very first contract, the agency helped me start my company - it's easy.

It's probably worth becoming VAT registered too (which you have to do anyway if your company turnover hits a certain limit); people expect to be charged VAT on top of your rate.  Also, you can apply to be in the "flat rate VAT" scheme so that you don't have to record the VAT you pay on purchases in order to reclaim it, you just pay a flat rate.  For software companies the flat rate is 13%, so you make a little extra because you charge 17.5%, and it makes it very easy to fill in your VAT return.

Hope this helps.
23  Discussions / Miscellaneous Topics / Re: whos fit in ant? need to run jini webserver on: 2005-11-21 12:46:31
Is tools.jar an executable JAR file with a manifest defining the main class?  If not, you've forgotton to specify the classname attribute with the name of the class you want to run.

(I think you are right that setting spawn="true" should leave the program running after ant finishes.)
24  Games Center / Archived Projects / Re: MONSTRUMO ! on: 2005-11-16 10:14:10
Happy Birthday!

I will try your game when I get some time, and will say some good things about it  Grin
25  Java Game APIs & Engines / OpenGL Development / Re: 2 questions on: 2005-11-15 12:14:08
Hi g666,

I don't know for sure, but I think the devIL library that comes with LWJGL can do the texture resizing for you so that you can avoid AWT.
26  Java Game APIs & Engines / OpenGL Development / Re: 2 questions on: 2005-11-10 12:22:28
1.  You can move your view around by multiplying your projection matrix by other transformation matrices (i.e. translate, rotate etc.) so you can move it about as if it were attached to a moving "cube" in space.

2.  OBJ format supports materials (which look a lot like OpenGL materials), although not all descriptions of OBJ mention this.  Take a look at:
27  Discussions / General Discussions / Re: Distributing Sun server-vm on: 2005-11-01 11:12:38
As I understand it (which may be badly  Roll Eyes ) JET compiled applications include all the JRE classes required to comply with the license (as Excelsior must comply with the license too).

They talk about it here:
28  Games Center / Archived Projects / Re: Space Dudes (Java 1.1 compat) on: 2005-10-17 20:39:41
Udderdude, that's a fun game!
29  Game Development / Newbie & Debugging Questions / Re: listing resources in jar files... on: 2005-10-06 12:38:42
Tomas, it's not a nice solution but you could include a file in your JAR that contains the list of shaders.



and go through the file reading the listed shader file names, and read each using another getResourceAsStream call.

Not too elegant, but it would work (as long as you keep the list file up-to-date  Wink)
30  Java Game APIs & Engines / JOGL Development / Re: Ray-picking on: 2005-09-29 20:06:05
Hi antoinelechacal,

I think turquoise3232 knows what he's talking about  Smiley

I tried your code with his method of getting winZ (the "window space Z") and it worked fine for me.  In my display method:

// Draw something to unproject onto.
gl.glVertex3d(-2.0, -0.5, -2.0);
gl.glVertex3d(-2.0, -0.5, 2.0);
gl.glVertex3d(2.0, -0.5, 2.0);
gl.glVertex3d(2.0, -0.5, -2.0);

double[] modelview = new double[16];
double[] projection = new double[16];
int[] viewport = new int[4];
gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, modelview);
gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, projection);
gl.glGetIntegerv(GL.GL_VIEWPORT, viewport);

// My mouse cursor is at a Point called "click"        
int winX = click.x;
int winY = click.y;
winY = viewport[3] - winY;
float[] winZ = new float[1];
gl.glReadPixels ( (int)winX, (int)winY, 1, 1, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, winZ );
System.out.println("2D: " + winX + ", " + winY + ", " + winZ[0]);       
double[] objX = new double[1];
double[] objY = new double[1];
double[] objZ = new double[1];
    winX, winY, winZ[0],
    objX, objY, objZ
System.out.println("3D: " + objX[0] + ", " + objY[0] + ", " + objZ[0]);

// Draw a small sphere where the "unproject" lands
GLUT glut = new GLUT();
gl.glTranslated(objX[0], objY[0], objZ[0]);
glut.glutSolidSphere(glu, 0.05, 6, 6);

I draw some "landscape" - a single polygon in this case - which causes the "window space Z" information to be stored in the depth buffer, then do the unproject (as per your code and turquoise3232's), and then draw a small sphere at the resulting co-ordinates (so I can see it).  I have a MouseMotionListener setting the value of "click" every frame - I move my mouse around and, hey presto, a little sphere tracks the surface of the "landscape".

Try it!

[EDIT: there's a brief FAQ item on gluUnProject here:]
Pages: [1] 2
CopyableCougar4 (232 views)
2017-03-24 15:39:42

theagentd (214 views)
2017-03-24 15:32:08

Rule (273 views)
2017-03-19 12:43:22

Rule (257 views)
2017-03-19 12:42:17

Rule (261 views)
2017-03-19 12:36:21

theagentd (278 views)
2017-03-16 05:07:07

theagentd (276 views)
2017-03-15 22:37:06

theagentd (198 views)
2017-03-15 22:32:18

theagentd (192 views)
2017-03-15 22:31:11

ral0r2 (170 views)
2017-03-03 11:52:41
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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‑
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!