Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (540)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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
1  Game Development / Networking & Multiplayer / Re: What should one use to make a game like this? on: 2006-12-28 02:45:52
Not sure about the best way:) But if you're asking for the easiest way then the server also be the webserver for the applet, that way you won't have any problems connecting to it (If you want to connect to other servers than the one that served the applet then the applet needs to be signed).
Language-wise you have a range of choices server-side.
If you have full control of the server then just code a java server and connect using tcp sockets.
If the server is a webhotel then you might be able to use PHP or other server-side scripting like ASP/ASP.NET - perhaps (although unlikely) even JSP.
2  Java Game APIs & Engines / OpenGL Development / Re: Integral texture coords - possible? on: 2006-11-29 20:08:50
Is this texture matrix global, or is there a texture matrix for each texture?
3  Java Game APIs & Engines / OpenGL Development / Integral texture coords - possible? on: 2006-11-27 22:35:46
I was wondering if it was possible somehow to apply a scale to a texture to make it possible to use direct texel coordinates instead of normalized coordinates?
For example, if you wanted the 64 X 64 rectangle at 0,0 in a 256X256 texture you could just use coordinates 0,0 ; 64,0 ; 64,64 ; 0,64 instead of 0f,0f ; 0.25f, 0f ; 0.25f, 0.25f ; 0f, 0,25f.
I know I can just divide by dimensions, but it would make life a lot easier right Smiley And anyway OpenGL must translate normalized coordinates to actual texel coordinates anyway internally at some point right?
4  Java Game APIs & Engines / OpenGL Development / Re: Bitmask transparency on: 2006-04-13 08:48:19
Then I would have to use RGBA images to make it work I think?
 Is there any way I can use a 1 bit black/white image to mask out a 24 bit RGB image, or define one of the colors in a 24 bit image as translucent? I would prefer being able to use masking, since this is for isometric tiles, and 50% of the rectangle containing a tile is transparent - that way I could save 50% space if I just used the same mask texture for all tiles.
I looked at polygon stipples, but they are only 32X32.
5  Java Game APIs & Engines / OpenGL Development / Bitmask transparency on: 2006-04-11 13:35:52
Since hardware acceleration of Java2d supports bitmask transparency shouldn't it be possible to use it in OpenGL too?
I can't seem to find anything indicating this.
(I understand there are 2 kinds of "bitmask" transparency - one is assigning a special color as transparent, the other is using a 1 bit black/white texture as bitmask. The last option would be preferrable)
6  Discussions / General Discussions / Re: Optimal Linux Version for Java on: 2006-04-06 11:03:43
Thanks. I already considered Ubuntu because installation is supposed to be very easy.
I have a GeForce 3 on the old comp so I'll not worry about ATI issues - anyway my gaming box will obviously be my new comp since it'll be an Atlon64 X2 3800+ with 2 GB Ram and a GeForce 7800 GT running Windows XP Pro Smiley
I'll be using the old one mainly for running the server for the game I'm working on, + testing for Linux compatibility of the client and performance on low-end boxes.
7  Java Game APIs & Engines / OpenGL Development / Re: Isometric Tile Cutting on: 2006-04-05 23:13:32
I thought about that too - I'm just afraid it wold look "textured" that way?
Anyway I wouldn't really need to rotate the view I think, I could just do something like:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glTexCoord2f(0,0);
GL11.glVertex2f(-1, 8);
GL11.glTexCoord2f(0,1);
GL11.glVertex2f(15,16);
GL11.glTexCoord2f(1,1);
GL11.glVertex2f(31, 8);
GL11.glTexCoord2f(1,0);
GL11.glVertex2f(15, 0);
}
GL11.glEnd();


But I would either A: lose detail to stretching or B: waste texture memory due to the texture being shrinked on a diagonal
8  Java Game APIs & Engines / OpenGL Development / Re: Isometric Tile Cutting on: 2006-04-05 20:25:18
You're probably right that this isn't a feasible way to do isometric tiling.
I'll probably have to either use alpha textures or opaque textures combined with a bitmask (can this be done in OpenGL?).
*sniff* I had it all figured out how I was gonna implement dynamic colored lighting by setting colors on the diamond corners - but if diamond corners don't correspond to texture corners I have to find another way to make it work - any ideas?
9  Java Game APIs & Engines / OpenGL Development / Re: Alpha blending - what am I missing? on: 2006-04-05 19:54:02
Thanks Smiley I couldn't get to work but looking around in here I saw I also had to call GL11.glEnable(GL_BLEND);
Works like a charm now:)
10  Java Game APIs & Engines / OpenGL Development / Alpha blending - what am I missing? on: 2006-04-05 18:13:16
I tried the following code, thinking it would give me a translucent blue rectangle overlapping a red rectangle - but the blue rectangle is also opaque - am I doing something wrong?
I tried specifying 8 alpha bits in the AWTGLCanvas constructor, but no luck..

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
GL11.glColor4f(0, 0, 1, 1f);
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glVertex2f(10, 10);
GL11.glVertex2f(10, 30);
GL11.glVertex2f(30, 30);
GL11.glVertex2f(30,10);
   
         
}
GL11.glEnd();

GL11.glColor4f(1, 0, 0, 0.1f);
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glVertex2f(15, 20);
GL11.glVertex2f(15, 40);
GL11.glVertex2f(25, 40);
GL11.glVertex2f(25,20);
           
                 
}
GL11.glEnd();
11  Discussions / General Discussions / Optimal Linux Version for Java on: 2006-04-04 12:09:18
I'm getting a new comp and will probably be installing Linux on my old one.
Could anyone recommend a linux version that plays well with Java? Especially when it comes to networking with NIO.
12  Java Game APIs & Engines / OpenGL Development / Re: Isometric Tile Cutting on: 2006-04-03 23:35:33
The coordinates are the corners of the diamond:
Click to Play


Where do you get your coordinates from?


btw, I enabled FSAA I think ? (int samples in PixelFormat constructor?) And I get some smoothing.
13  Java Game APIs & Engines / OpenGL Development / Re: Isometric Tile Cutting on: 2006-04-03 23:17:56
ah.. I had to google fsaa didn't see it, thanks Smiley

I'm using AWTGLCanvas in a Frame atm so I'll have to wait unti I have a little more time to do the test with Display.
Anyway I can't see how "float x1 = 1.0f - 1.0f / tex.getImageWidth();" is anywhere near "(16.0f-1)/tex.getImageWidth()"?
14  Java Game APIs & Engines / OpenGL Development / Re: Isometric Tile Cutting on: 2006-04-03 22:52:55
Ok thanks - could you tell me how to turn it on? Do I need to go fullscreen first as the name suggests?. I tried translating by 0.375 and now I get antialiased edges - am I supposed to apply that translation only when actually drawing lines or points?
BTW, this is the full drawing code, I use the Texture class from Matzon/Kevglass:
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  
public void paintGL() {
            try {
               if(tex == null)
                  tex = loader.getTexture("tex0.gif");
     
               makeCurrent();
               
               GL11.glViewport(0, 0, getWidth(), getHeight());
               GL11.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
           
               GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
               GL11.glMatrixMode(GL11.GL_PROJECTION);
               GL11.glLoadIdentity();
               GLU.gluOrtho2D(0.0f, (float) getWidth(), 0.0f, (float) getHeight());
               GL11.glMatrixMode(GL11.GL_MODELVIEW);
               GL11.glPushMatrix();
               GL11.glTranslatef(0, getHeight(), 0.0f);
               GL11.glScalef(1, -1, 1);
               //tex.bind();
     
               
               
               GL11.glEnable(GL11.GL_TEXTURE_2D);
           
               
               GL11.glBegin(GL11.GL_QUADS);
               {
                  GL11.glTexCoord2f((0.0f-1)/tex.getImageWidth(), 8.0f/tex.getImageHeight());
                  GL11.glVertex2f(-1, 8);
                  GL11.glTexCoord2f((16.0f-1)/tex.getImageWidth(),16.0f/tex.getImageHeight());
                  GL11.glVertex2f(15,16);
                  GL11.glTexCoord2f((32.0f-1)/tex.getImageWidth(),8.0f/tex.getImageHeight());
                  GL11.glVertex2f(31, 8);
                  GL11.glTexCoord2f((16.0f-1)/tex.getImageWidth(), 0.0f/tex.getImageHeight());
                  GL11.glVertex2f(15, 0);
                 
                 
               }
               GL11.glEnd();
     
               
   
   
               
               GL11.glPopMatrix();
               swapBuffers();
            } catch (Exception e) {
               throw new RuntimeException(e);
            }


PS: Is there any way I can avoid dividing by the texture dimensions and just use absolute pixel values instead?
15  Java Game APIs & Engines / OpenGL Development / Re: Isometric Tile Cutting on: 2006-04-03 22:32:45
Could you clarify the FSAA bit? I definitely don't want to antialias the jagged edges as they're supposed to fit the jags of neighbor tiles:)

PS: I have turned the Y-Axis, so the translation should be like this? :

1  
2  
GL11.glTranslatef(0.375f, getHeight()+0.375f, 0.0f);
GL11.glScalef(1, -1, 1);
               
16  Java Game APIs & Engines / OpenGL Development / Isometric Tile Cutting on: 2006-04-03 22:19:55
I'm porting my Java2D Isometric engine to LWJGL, and am considering cutting diamond-shaped tiles from a bigger texture using glTexCoord2f and glVertex2f. In Java2D I just use drawimage with a rectangle containing the tile - the rest of the rectangle being transparent. This is a lot of wasted space and if I'm drawing diamond-shaped quads I can also take advantage of glColor3f on the vertexes to create a dynamical lighting.
With my original test-image:(scaled up)
Click to Play
I got the following result:
Click to Play
using this code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glTexCoord2f(0, 8.0f/tex.getImageHeight());
GL11.glVertex2f(0, 8);
GL11.glTexCoord2f(16.0f/tex.getImageWidth(),16.0f/tex.getImageHeight());
GL11.glVertex2f(16,16);
GL11.glTexCoord2f(32.0f/tex.getImageWidth(),8.0f/tex.getImageHeight());
GL11.glVertex2f(32, 8);
GL11.glTexCoord2f(16.0f/tex.getImageWidth(), 0.0f);
GL11.glVertex2f(16, 0);
}
GL11.glEnd();


Problem: The diamond being cut was being shifted 1 pixel to the right.
So I subtracted 1 from all x-values:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glTexCoord2f((0.0f-1)/tex.getImageWidth(), 8.0f/tex.getImageHeight());
GL11.glVertex2f(-1, 8);
GL11.glTexCoord2f((16.0f-1)/tex.getImageWidth(),16.0f/tex.getImageHeight());
GL11.glVertex2f(15,16);
GL11.glTexCoord2f((32.0f-1)/tex.getImageWidth(),8.0f/tex.getImageHeight());
GL11.glVertex2f(31, 8);
GL11.glTexCoord2f((16.0f-1)/tex.getImageWidth(), 0.0f/tex.getImageHeight());
GL11.glVertex2f(15, 0);
}
GL11.glEnd();


And got the following result, exactly what I wanted:

Click to Play



Now the million dollar question is: Can I trust this tile cutting to work pixel perfect on all cards/systems or is the exact set of pixels defined by a quad somewhat undefined?

17  Game Development / Networking & Multiplayer / Re: [SGS] DarkShooter on: 2006-03-30 11:27:19
Again Jeff  thanks,

Quote
When start is called, a numerb fo seconds for a tick is passed in.  This is the resolutionof PDTimer, so a 1 would be 1 second per tick, a 5 woudl be 5 seconds per tick.

So ont he server model would 1 second per tick be considered sufficient?  I would be expecting to the run the client side at about 60 ticks per sec, would this not lead to lots of difficutlies syncing up the server and client?
 

1 Hz is pretty good for a poker game...

On the other hand, 60 Hz is not needed.
In a graphical realtime MMORPG 5-20 Hz is probably more realistic - fluid movements on the screen should be handled by interpolation.
18  Game Development / Networking & Multiplayer / Re: [SGS] Darkstar and physics simulation on: 2006-03-30 09:19:22
But the problem is that the object might already have been committed for (step) by another task.
19  Game Development / Networking & Multiplayer / Re: [SGS] DarkShooter on: 2006-03-30 08:52:14
Quote
So to perform the dynamics (I hesitate to say physics) and collision on the server I would set up a regular timer to
update these calculations. Basically for each sector the timer wakes up, gets all the Actors, update position perform collision, send any results to the players in that sector.  I think this would have to be a GET.

See above,  GETTing all the actors would work fine ona  single CPU, single slice system, but it will not scale.

Well if you're doing an update of the objects I don't see any way around a GET ?


The trick is not all object have to be updated by the same task.  By splitting it up you get parallelism.


Obviously you would only GET the objects that are updated - with sectors this would be objects "owned" by the sector to be updated (for object types that rarely change state an initial PEEk as you suggested before would probably be optimal) + objects from other sectors whose state is updated by interaction with objects from this sector.
20  Game Development / Networking & Multiplayer / Re: [SGS] DarkShooter on: 2006-03-29 21:10:59
Quote
So to perform the dynamics (I hesitate to say physics) and collision on the server I would set up a regular timer to
update these calculations. Basically for each sector the timer wakes up, gets all the Actors, update position perform collision, send any results to the players in that sector.  I think this would have to be a GET.

See above,  GETTing all the actors would work fine ona  single CPU, single slice system, but it will not scale.

Well if you're doing an update of the objects I don't see any way around a GET ?
21  Game Development / Networking & Multiplayer / Re: [SGS] DarkShooter on: 2006-03-29 13:05:10
You're right, you can't enforce ownership, this is why I put ownership in quotes.
But a clever design could respect it as much as possible.

A paradigm-shift is needed to utilize SGS properly - patterns/concepts like game-loop etc. must be translated / rethought to create something that fits into the new framework.
22  Game Development / Networking & Multiplayer / Re: [SGS] DarkShooter on: 2006-03-29 12:52:01
I believe you're right that subdivision into different sectors would be optimal.
This subdivision could be conceptual or geographical in terms of the game world.
Each host could then assume "ownership" of one or more sectors.
Inter-sector get() operations should be kept to a bare minimum but can't be completely avoided as objects might move between sectors or otherwise influence objects in other sectors.
Old-skool sectors with "portals" are trivial: Only players and their attached objects (inventory, spell affects etc.) move between sectors. Seamless sectors are probably a must for any serious MMORPG. Obviously inter-section information flow management is critical here.

You're talking about jumping between sectors so let's assume we're talking old-skool sectors - this is probably a good place to start as [postulate] every old-skool problem must also be solved in seamless subdivision [/postulate], so why not solve those problems first?


 
23  Game Development / Networking & Multiplayer / Re: [SGS] DarkShooter on: 2006-03-29 12:28:45
Maybe a nice first step would be to separate what you can expect SGS to solve for you from things it can't possibly solve.
Synchronizing between server and client is not an SGS problem, all it adds to solve that problem is a protocol-agnostic and optionally reliable communication channel. There are multiple possible solutions to this problem like dead-reckoning etc. But to not bloat the thread it would probably be wise to concentrate on SGS related problems?
24  Discussions / General Discussions / Re: "Project Darkstar" teaser site.... on: 2006-03-27 22:34:48
A possible solution might be not to make these sectors GLO's then?
25  Java Game APIs & Engines / OpenGL Development / That Y Axis.. on: 2006-03-27 22:17:00
I can't really decide if I'm going to scale and translate that Y-axis in place so it behaves like AWT/Swing.
What are you people doing? Just getting used to the Y axis pointing up?
26  Discussions / General Discussions / Re: "Project Darkstar" teaser site.... on: 2006-03-23 19:42:24
I'm reading the server-api tutorial atm, and I'm a litte surprised to read:

Quote
The SGS is a distributed system. Each host contains an SGS slice that consists of a single stack of
software running in a single process space. Each slice can handle 200-500 users, depending on the game
and the hardware.

Does this mean machine=host so that one computer can only handle 200-500 users? Or can one machine contain multiple slices?
200-500 seems low to me? Look at a small "indie" game like Runescape, handling up to 2000 clients per server (Or is a Runescape server also a cluster?)

These are rough estimates.  What it really depends on is how many events have to get pushed through the slice per unit time.  We can probably handle a lot more than 500 users for some kinds of games, and fewer than 200 for pathological cases.  Asking how many users a slice can support is a little like asking how fast a computer is without naming the benchmark!

Reading the Programming guide a second time I can see why those numbers seem low to me:
Every single little game object being checked out/in of storage, instantiated in copies for every get/peek and synchronized between hosts in the cluster must come with a quite high performance price. But the potential benefits from scalability and fault tolerance probably more than makes up for this.
You can get 5-10 cheap PCs for the price of 1 server with ECC Ram and the works, and with good scalability these should easily be able to outperform the server machine.
27  Discussions / General Discussions / Project Darkstar forum on: 2006-03-23 14:08:44
How about a forum under "Java Game APIs" dedicated to Project Darkstar?
Quite a few members here (including myself) seem to be excited about the project.
28  Discussions / General Discussions / Re: "Project Darkstar" teaser site.... on: 2006-03-22 22:58:57
I'm reading the server-api tutorial atm, and I'm a litte surprised to read:

Quote
The SGS is a distributed system. Each host contains an SGS slice that consists of a single stack of
software running in a single process space. Each slice can handle 200-500 users, depending on the game
and the hardware.

Does this mean machine=host so that one computer can only handle 200-500 users? Or can one machine contain multiple slices?
200-500 seems low to me? Look at a small "indie" game like Runescape, handling up to 2000 clients per server (Or is a Runescape server also a cluster?)
29  Java Game APIs & Engines / OpenGL Development / Re: Overlapping polygons on: 2006-03-22 21:42:42
Well if Red has Z=3, Green has Z=2 what Z must Blue have then? No number greater than 3 and smaller than 2 exists ;p

Edit: Ok, I guess I was a little too fast then, so the Z-value is actually painted for each pixel?
Thanks, this is something that has been puzzling me ever since I first read about the painters algorithm.
30  Java Game APIs & Engines / OpenGL Development / Overlapping polygons on: 2006-03-22 21:33:37
I was wondering, can OpenGL handle this problem:

Triangle Red overlaps Green, Green overlaps Blue but blue also overlaps red..
Surely something better than sorting polys and drawing them sequentially must be done, since no general absolute ordering works for polys in 3D space?
Pages: [1] 2 3
 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (24 views)
2014-12-23 03:34:11

rwatson462 (53 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (85 views)
2014-12-09 22:41:13

BurntPizza (110 views)
2014-12-08 04:46:31

JscottyBieshaar (79 views)
2014-12-05 12:39:02

SHC (89 views)
2014-12-03 16:27:13

CopyableCougar4 (97 views)
2014-11-29 21:32:03

toopeicgaming1999 (155 views)
2014-11-26 15:22:04

toopeicgaming1999 (152 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!