Show Posts
|
|
Pages: [1] 2
|
|
2
|
Game Development / Networking & Multiplayer / Router connection issues
|
on: 2005-02-21 21:50:29
|
|
Alright guys, I'm new here, so don't take to me too harshly.
I've got the fundamentals of java down, so I'm tackeling my first real java program - a direct two-way chat program. This involves networking, sockets, etc... which I don't consider the fundamentals.
The program works great on my home lan, but if I set up the server and try to connect outside the network, nothing happens. I'm assuming this is because the router is throwing things off. How can I take this into account when writing a simple client-server program?
If you need source code, i've got four short classes, so just ask me and I'll post 'em.
|
|
|
|
|
5
|
Game Development / Game Play & Game Design / Connection design issues:
|
on: 2004-06-28 20:58:18
|
|
This probably could fit in with networking, but this more abstract design oriented than hard code.
Basically what I want to do is make a starcraft-ish type of PvP battle game, but I'm not sure how one would go about identifying other people online to engage with. I was thinking you could log on and arrive at a splash screen with a list of players online, then click on a player's name and they would get a challenge message. However, I would like to do this without a server so getting all the players into a list would be difficult. I know with RMI there is a registry, which is basically a phonebook with all the active machines, is there something like that in the regular networking api?
|
|
|
|
|
6
|
Java Game APIs & Engines / Xith3D Forums / Rotating TransformGroups
|
on: 2004-06-26 14:51:05
|
Ok, so in my current project, I have several different subclasses of TG's that represent different vehicles. At this point, they can move around in a bounded environment enclosed by a primitive skybox. Unfortunately in the rotate methods: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| public void rotateHoriz(int right){ horizAngle += (float)(right*Math.PI/8); Transform3D t = new Transform3D(); t.lookAt(location, new Vector3f(location.x + (float)Math.sin(horizAngle), location.y + (float)Math.sin(horizAngle), location.z + (float)Math.cos(horizAngle) ), new Vector3f(0, 1f, 0)); t.set(location); setTransform(t); }
public void rotateVert(int up){ vertAngle += (float)(up*Math.PI/8); Transform3D t = new Transform3D(); t.lookAt(location, new Vector3f(location.x + (float)Math.sin(horizAngle), location.y + (float)Math.sin(horizAngle), location.z + (float)Math.cos(horizAngle) ), new Vector3f(0, 1f, 0)); t.set(location); setTransform(t); } |
which look like that, the transformgroups fail to rotate in the right direction. I've tried rotY(horizAngle) and rotX(vertAngle), but the groups face the same direction anyway. Any suggestions?
|
|
|
|
|
7
|
Java Game APIs & Engines / Xith3D Forums / Re: Problem with new Xith
|
on: 2004-06-25 01:50:44
|
|
Fix0red it.
What happened was: Before I installed the new Xith/JoGL, I set the front clip distance to zero. It was a test to see what it would do, but I never got around to isolating that variable. Now I know what it does, and everything is good again.
|
|
|
|
|
9
|
Java Game APIs & Engines / Xith3D Forums / Problem with new Xith
|
on: 2004-06-23 17:22:11
|
|
I d-loaded and extracted the most recent Xith version and when I ran the same code that worked finely with the old Xith, I got this error:
Exception in thread "main" java.lang.AbstractMethodError: com.xith3d.render.jogl .OldStyleGLCapabilitiesChooser.chooseCapabilities(Lnet/java/games/jogl/GLCapabil ities;[Lnet/java/games/jogl/GLCapabilities;)I at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAn dCreateContext(WindowsGLContext.java:271) at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(Wind owsOnscreenGLContext.java:204) at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(Windows GLContext.java:117) at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent (WindowsOnscreenGLContext.java:110) at net.java.games.jogl.impl.GLContext.setRenderingThread(GLContext.java: 253) at net.java.games.jogl.GLCanvas.setRenderingThread(GLCanvas.java:148) at com.xith3d.render.jogl.CanvasPeerImpl.render(CanvasPeerImpl.java:1089 ) at com.xith3d.scenegraph.View.renderOnce(View.java:755) at com.xith3d.scenegraph.View.renderOnce(View.java:688) at Client.<init>(Client.java:114) at Client.main(Client.java:438)
WTF mate?
EDIT: Fixed the damn smileys
|
|
|
|
|
11
|
Java Game APIs & Engines / Xith3D Forums / Re: webstart
|
on: 2004-06-18 21:51:54
|
|
Ok, I got everything packaged, but when I run the jnlp, it shows Java (tm) loading... for a second or two, then exits? Did I do something wrong? I already checked the website troubleshooting and they had a similar problem for 1.3, but i'm using 1.4....
|
|
|
|
|
12
|
Java Game APIs & Engines / Xith3D Forums / Re: webstart
|
on: 2004-06-18 12:36:37
|
I'm making progress. I have a jar file with all my stuff in it, however, when I try to run the jnlp (I'm running it on my local machine), it tells me that the jar resources aren't signed by the same person. Is there a way around this? I think it may have something to do with the fact that I just linked to http://www.xith.org/jws/libs/... Out of laziness. I will eventually create my own jars for the native files but this is just a test right now.
|
|
|
|
|
13
|
Java Game APIs & Engines / Xith3D Forums / webstart
|
on: 2004-06-17 21:17:28
|
|
I suppose this is a general issue, not just with xith, but I have the start of a game and I was trying to hook it up to webstart. I "borrowed" a .jnlp template from one of the demo programs and editted it as it fit my needs. Now I want to do one of two things.
Option 1: This is to run it from my local machine with a code base of
file:\\c:\mars\networking
This should work, however, it tells me that it cannot load the file. This option isn't feasible, however, in the long term because I will eventually have to run option two.
Option 2: I have a geocities website (problem number 1). I want to upload the class files and the .jnlp to the website and webstart it from there, but geocities doesn't seem to like jnlp files.
Any ideas?
|
|
|
|
|
15
|
Java Game APIs & Engines / Xith3D Forums / rotation point
|
on: 2004-03-02 19:50:53
|
|
What determines the axis of rotation in a Shape3D or TransformGroup? Is there a way to control the axis? If I try to rotate a Shape3D, the computer uses a corner of the figure and makes the rotation look really bad.
|
|
|
|
|
16
|
Java Game APIs & Engines / Xith3D Forums / Re: shapes around view :)
|
on: 2004-02-22 22:25:49
|
I believe what you do is, you have two Point3f objects, one representing the view and one representing the object. 1 2 3 4 5 6
| Point3f vLoc = ... Point3f oLoc = ... float radius = cuberoot( Math.pow(vLoc.x - oLoc.x, 2), Math.pow(vLoc.y - oLoc.y, 2), Math.pow(vLoc.z - oLoc.z, 2)); |
There is a cuberoot function in 1.5 beta, but using one in 1.4.2 I am not QUITE sure how to do it. You could probably google for it, as I am sure that there is a formula for cubic equations that would be able to solve this, but its really complex. EDIT : http://www.math.vanderbilt.edu/~schectex/courses/cubic/
|
|
|
|
|
17
|
Java Game APIs & Engines / Xith3D Forums / Parabolic paths
|
on: 2004-02-14 11:50:32
|
|
How would I use a LineArray to display a parabola (tracing the path of a projectile)
float hAngle = unitAngle; float velocity = 5; Point3f[] pointz = new Point3f[] { new Point3f(unitLoc.x, unitLoc.y, unitLoc.z), new Point3f(unitLoc.x + velocity*(float)Math.sin(hAngle), unitLoc.y + velocity*1 +.5f*-9.8f*1, unitLoc.z+ velocity*(float)Math.cos(hAngle)), new Point3f(unitLoc.x + (float)Math.sin(hAngle), unitLoc.y + velocity*2 +.5f*-9.8f*4, unitLoc.z+ (float)Math.cos(hAngle)), new Point3f(unitLoc.x + (float)Math.sin(hAngle), unitLoc.y + velocity*3 +.5f*-9.8f*9, unitLoc.z+ (float)Math.cos(hAngle)), new Point3f(unitLoc.x +(float)Math.sin(hAngle), unitLoc.y + velocity*4 +.5f*-9.8f*16, unitLoc.z+ (float)Math.cos(hAngle)), };
LineArray path = new LineArray(pointz.length, LineArray.COORDINATES); path.setCoordinates(0, pointz); Shape3D parabola = new Shape3D(path, new Appearance()); scene.addChild(parabola); v.renderOnce(); try{ wait(1000); } catch (InterruptedException ie) {} scene.removeChild(parabola); v.renderOnce();
I tried using this code, but nothing is rendered... any ideas?
|
|
|
|
|
19
|
Java Game APIs & Engines / Xith3D Forums / Re: Questionably effective terrain generator
|
on: 2004-01-31 14:16:08
|
|
Could someone help me in jar'ing a program in Xith3d? The GSG isn't very helpful, no offense to whoever wrote it, I just have never jar'ed up a program before and Sun's guide isn't that great either. Just listing the files that need to be loaded would be very helpful. I can only provide screenshots of my programs now, but I'd like to eventually webstart something non-trivial.
|
|
|
|
|
22
|
Java Game APIs & Engines / Xith3D Forums / Questionably effective terrain generator
|
on: 2004-01-28 20:32:00
|
Here's the code that I wrote/stole from other programs, to randomly generate 3d terrain. When I run it however, the screen appears to have nothing. Any ideas what's going wrong? (Basic summary @ bottom) 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 110 111 112 113 114 115
| import javax.vecmath.*; import com.xith3d.scenegraph.*;
import com.xith3d.render.*; import com.xith3d.render.jogl.*;
public class LandTest {
private Square[][] tiles; private Point3f[][] vertices; private final int NUM = 32; public static int counter = 0;
public static void main(String[] args){ new LandTest(); }
public LandTest(){ initVerts(); initSquares();
VirtualUniverse universe = new VirtualUniverse(); Locale l = new Locale(NUM/2f, 0, NUM/2f); View v = new View(); universe.addLocale(l); universe.addView(v);
BranchGroup scene = new BranchGroup(); l.addBranchGraph(scene);
Transform3D rotate = new Transform3D(); rotate.rotXYZ(0,0,0); TransformGroup objRotate = new TransformGroup(rotate); scene.addChild(objRotate);
for(int x = 0; x < NUM; x++){ for(int y = 0; y < NUM; y++){ objRotate.addChild(new Shape3D(tiles[x][y].getGeometry(), new Appearance())); } }
scene.compile();
RenderPeer rp = new RenderPeerImpl(); CanvasPeer cp = rp.makeCanvas(null, 640, 480, 32, false);
Canvas3D canvas = new Canvas3D(); canvas.set3DPeer(cp);
v.addCanvas3D(canvas); v.setFrontClipDistance(.5f); v.setBackClipDistance(20f);
Transform3D t = new Transform3D(); t.lookAt(new Vector3f(0, 5f, 10f), new Vector3f(NUM/2f, 0, NUM/2f), new Vector3f(0, 1f, 0)); v.setTransform(t);
for(int i = 0; i > -1; i++){ v.renderOnce(); }
}
private void initVerts(){ vertices = new Point3f[NUM+1][NUM+1]; for(int x = 0; x <= NUM; x++){ for(int y = 0; y <= NUM; y++){ vertices[x][y] = new Point3f(x, (float)(20*Math.random()-10), y); } } }
private void initSquares(){
tiles = new Square[NUM][NUM]; for(int x = 0; x < NUM; x++){ for(int y = 0; y < NUM; y++){ tiles[x][y] = new Square( vertices[x][y], vertices[x+1][y], vertices[x][y+1], vertices[x+1][y+1]); } } } }
class Square {
private Geometry shape;
Square(Point3f v1, Point3f v2, Point3f v3, Point3f v4){ Point3f[] coords = new Point3f[] { v1, v2, v3, v1, v4, v3 }; Color3f[] colors = new Color3f[] { new Color3f(0, 1f, 0), new Color3f(0, 1f, 0), new Color3f(0, 1f, 0), new Color3f(0, 1f, 0), new Color3f(0, 1f, 0), new Color3f(0, 1f, 0) };
TriangleArray array = new TriangleArray(coords.length, GeometryArray.COORDINATES|GeometryArray.COLOR_3); array.setCoordinates(0, coords); array.setColors(0, colors); }
public Geometry getGeometry(){ return shape; } } |
Ok, so first thing it does: creates a 2^5 +1 x 2^5 + 1 array of Point3fs with definite x and z values. The height of that point is determined randomly at runtime. Then, Square objects are created from those points, constructing a 2^5 x 2^5 array of tiles. Each Square has its own Geometry which is used to create Shape3Ds and they are stored in an unrotated TransformGroup. If anything is rendered, however, I can't see it at runtime. (The window with its trademark Xith Brown/Black bg appears, but nothing is in it).
|
|
|
|
|
24
|
Java Game APIs & Engines / Xith3D Forums / Re: Vector3f help
|
on: 2004-01-06 20:55:38
|
|
Aight, I figured it out, thanks. I said I was playing with the ASE loader demo, I meant the one provided in the GSG, so I was using Will's(?) 3ds Max model. I'll show you my new demo as soon as I get the turret moving properly (ie, not so it can shoot through the front of the tank itself).
|
|
|
|
|
25
|
Java Game APIs & Engines / Xith3D Forums / Vector3f help
|
on: 2004-01-02 15:27:25
|
|
I was playing around with the ASE loader demo and I'm trying to write a program that loads the tank and lets you drive it around using the arrowkeys.
My problem is that I'm not sure which dimensions x, y, and z represent. I know in 2 dimensions, x and y represent height and width. Which is height, width, depth?
|
|
|
|
|
27
|
Java Game APIs & Engines / Xith3D Forums / Pyramids with square bases
|
on: 2003-11-28 19:16:51
|
|
Ok, I'm a noob to the very core of the definition of the word, but pardon the stupidity of my question:
I've been playing around with Xith3D for all of a week now, and I'm trying to use the the Cube.createCubeViaTriangles() idea to create a pyramid with a square base. Unfortunately, anytime i call the following method, it returns a simple, 2D triangle:
public static Geometry createTriangle(float x, float y, float z, float size){ float half = size/2f;
Point3f[] coords = new Point3f[] {
new Point3f(x, y+half, z), new Point3f((float)(x+half*Math.cos(Math.PI/6)), y-half, (float)(z+half*Math.cos(Math.PI/2))), new Point3f((float)(x-half*Math.cos(Math.PI/6)), y-half, (float)(z+half*Math.cos(Math.PI/2))),
new Point3f(x, y+half, z), new Point3f((float)(x+half*Math.cos(Math.PI/6)), y-half, (float)(z+half*Math.cos(Math.PI/2))), new Point3f((float)(x+half*Math.cos(Math.PI/6)), y-half, (float)(z-half*Math.cos(Math.PI/2))),
new Point3f(x, y+half, z), new Point3f((float)(x-half*Math.cos(Math.PI/6)), y-half, (float)(z+half*Math.cos(Math.PI/2))), new Point3f((float)(x-half*Math.cos(Math.PI/6)), y-half, (float)(z-half*Math.cos(Math.PI/2))),
new Point3f(x, y+half, z), new Point3f((float)(x-half*Math.cos(Math.PI/6)), y-half, (float)(z-half*Math.cos(Math.PI/2))), new Point3f((float)(x+half*Math.cos(Math.PI/6)), y-half, (float)(z-half*Math.cos(Math.PI/2))) };
Color3f[] colors = new Color3f[] {
new Color3f(1f,1f,1f), new Color3f(1f,0f,0f), new Color3f(0f,1f,0f),
new Color3f(0f,1f,0f), new Color3f(0f,0f,1f), new Color3f(1f,1f,1f),
new Color3f(1f,1f,1f), new Color3f(1f,0f,0f), new Color3f(0f,1f,0f),
new Color3f(0f,1f,0f), new Color3f(0f,0f,1f), new Color3f(1f,1f,1f), };
TriangleArray qa = new TriangleArray(coords.length, GeometryArray.COORDINATES|GeometryArray.COLOR_3|GeometryArray.TEXTURE_COORDINATE_2);
qa.setCoordinates(0,coords); qa.setColors(0,colors);
return qa; }
What am I doing wrong?
|
|
|
|
|
29
|
Java Game APIs & Engines / Xith3D Forums / Re: trouble running the demos
|
on: 2003-11-21 23:30:37
|
|
Sorry about the delay, it took a while to figure out what was going wrong here and why and then I had a history essay, so I didn't get on much. Here is the output!
C:\Xith3D>java -cp libs/xith3d.jar com.xith3d.test.CubeTest starting frame speed test Init GL is net.java.games.jogl.impl.windows.WindowsGLImpl OpenGL Renderer = GeForce2 MX/AGP/SSE2 OpenGL Version = 1.2.2 OpenGL Vendor = NVIDIA Corporation OpenGL Extensions = GL_ARB_imaging GL_ARB_multitexture GL_ARB_texture_compressio n GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_A RB_texture_env_dot3 GL_ARB_transpose_matrix GL_S3_s3tc GL_EXT_abgr GL_EXT_bgra G L_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vert ex_array GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_packed_pixels GL_EXT _paletted_texture GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary _color GL_EXT_separate_specular_color GL_EXT_shared_texture_palette GL_EXT_stenc il_wrap GL_EXT_texture_compression_s3tc GL_EXT_texture_edge_clamp GL_EXT_texture _env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_cube_ map GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_vertex_weighting GL_IBM_textur e_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_evaluators GL_NV _fence GL_NV_fog_distance GL_NV_light_max_exponent GL_NV_packed_depth_stencil GL _NV_register_combiners GL_NV_texgen_emboss GL_NV_texgen_reflection GL_NV_texture _env_combine4 GL_NV_texture_rectangle GL_NV_vertex_array_range GL_NV_vertex_arra y_range2 GL_NV_vertex_program GL_SGIS_generate_mipmap GL_SGIS_multitexture GL_SG IS_texture_lod GL_WIN_swap_hint WGL_EXT_swap_control
All I get is a blank window grrr...
|
|
|
|
|