Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - zammbi

Pages: 1 ... 20 21 [22] 23 24
News / Re: New forum version!
« on: September 17, 2008, 01:01:27 am »
News still says:
News: New forum version (1.1.4)

News / Re: LWJGL 2.0rc2 is out!
« on: September 16, 2008, 10:57:38 pm »
I wouldn't mind doing any beta testing when you release it.

Support / Re: skydome or skybox
« on: September 14, 2008, 03:50:41 pm »
I think both can look realistic, but I have seen more bad skyboxes then skydomes.

Support / Re: shrinking jpct.jar
« on: September 14, 2008, 05:01:58 am »
Well there was a topic on this around here, which said what classes to keep. But even when I didn't touch the classes it still never worked.
But I would love to know which settings, because I really want to shrink my game when its out.

Support / Re: shrinking jpct.jar
« on: September 13, 2008, 05:05:16 am »
I remember trying Proguard on jpct, but failed on all tries.

Support / Re: Breaking maps into zones
« on: September 12, 2008, 05:13:25 pm »
Oh I see bounding box might be what I want.
Er don't need to do anything with the mesh.
Zones will just hold a list of names of people currently in them.

Also I could just use an arraylist and just create zones when needed. How do other people divide there map into zones?

Support / Breaking maps into zones
« on: September 12, 2008, 11:42:22 am »
I'm trying to figure out how to break up a map into zones for the server so it can work out when to send positions of players to another.
I need the map to be broken into equal squares on all maps. But since there is no kind of get width method of a world/object3D, how am I meant to do this?

Support / Re: Sync the server position
« on: September 09, 2008, 05:00:08 am »
In my unfinished and buggy project FLierMatch, the server manages the position and direccion of a spaceship and for each movement it transfer it to each client and each client upgrades the position and direction of the ship inside the client game.
Thats what I did first. But caused a lot of warp back.
The server currently will still send the position if its totally out of sync. What I have now does what I want, though I will make it a little smarter later.

Support / Re: Sync the server position
« on: September 08, 2008, 04:26:16 pm »
Finally worked something out.
I changed it a little, so I made it think that the position was just out of sync and not the angle to make it more simple.
Still not great code at least it works  :)

Code: [Select]
guessPos.translate(clientX, y, clientZ);

SimpleVector a = guessPos.getZAxis();

charObj.translate(x, y, z);

final SimpleVector charPos = charObj.getTranslation();

a = guessPos.getTranslation();
newPos.translate(x, y, z);
float ang = (float) ((float) Math.atan2(x - a.x, z - a.z) +Math.PI);

//System.out.println("ang: " + ang + " x: " + x + " a.x:" + a.x + " z: " + z + " a.z: " + a.z);

clientX = a.x;
clientZ = a.z;

a = newPos.getZAxis();

a = MapLocation.get().checkCollision(charPos, a);

a = charObj.getTranslation();

x = a.x;
y = a.y;
z = a.z;

Projects / Re: Labyrinth Z
« on: September 07, 2008, 04:19:50 am »
Try looking on here, has all the free ones:
Including ones without ads. There are some good ones like huge diskspace, no ads and mysql/php which are free.

Support / Re: Sync the server position
« on: September 07, 2008, 04:15:48 am »
I don't understand?
G may not go there but each cycle will get closer and closer. Which in my above code it adds in the turning angle if the player also turned.
It is always guessing the next move even when not out of sync.

Support / Re: Sync the server position
« on: September 06, 2008, 07:16:38 pm »
Hm.. Yea my approach is hard to understand, thats because I don't really know how to do this right  :-\. The server only holds x,y,z and y rotation. It doesn't hold the objects themselves or the matrix. The client sends the x,y to sync.
Let me try draw what I was explaining before:

           CC /     |N
               /      |
              /        |
            OP      CS

Horrible pic heh.
At OP both server and client was sync then they go out of sync after that, so the client is at CC and the server is at CS. So I'm trying to get them back into sync or as much as possible. So we guess the next value which is G.
You see CS is going towards G as close as possible to the new position N.
The Y axis gets ignored since the player doesn't change that, only gravity does.
And its really late here, so looks like I'll work with this tomorrow.

Support / Re: Sync the server position
« on: September 06, 2008, 06:49:01 pm »
Ah sorry, its the method you said in another post.
Code: [Select]
public static float calcAngle(SimpleVector s1, SimpleVector s2) {
SimpleVector s1n = s1.normalize();
SimpleVector s2n = s2.normalize();

float pa=s1n.x*s2n.x+s1n.y*s2n.y+s1n.z*s2n.z;

// Inaccuracies may cause NaN...fix this:
if (pa<-1) {
if (pa>1) {
pa=(float) Math.acos(pa);
return pa;

Support / Sync the server position
« on: September 06, 2008, 05:12:04 pm »
I'm a totally stuck on the maths trying to sync the movement on the server with the client. Before this I had it so the client sync with the server but that caused annoying warp backs, so I'm trying to make it so the server syncs to the client.
Hopefully I'm too confusing trying to explain this.

The server holds the current client position(CC), current server position (CS), old client position(OC).
The server on every cycle sync as much as it can to the client.

This is done by creating a guess position(G) which the CS goes towards that direction to N (The new position).
G is worked out by the angle of OC and CC, then translate CC with this new angle.
N is worked out by the angle of CS and G, then translate CS with this new angle.

This is my current code but doesn't work as expected, just moves in one direction. Hopefully someone understands this and able to tell me whats wrong.

Code: [Select]
float differenceAngle = oldrotation - rotation; //has the player turned since last cycle.

final Object3D guessPos = new Object3D(0), charObj = new Object3D(0), newPos = new Object3D(0);

guessPos.translate(clientX, y, clientZ);
guessPos.rotateY(calcAngle(new SimpleVector(oldClientX,y,oldClientZ),new SimpleVector(clientX,y,clientZ)) + differenceAngle);

charObj.translate(x, y, z);

final SimpleVector charPos = charObj.getTranslation();

SimpleVector a = guessPos.getZAxis();

newPos.translate(x, y, z);
newPos.rotateY(calcAngle(new SimpleVector(charPos.x,charPos.y,charPos.z),new SimpleVector(a.x,a.y,a.z)));

clientX = a.x;
clientZ = a.y;
clientRotation = a.z;

a = newPos.getZAxis();

               a = m.getWorld().checkCollisionEllipsoid(charPos, a, Zone.ELLIPSOID_RADIUS, 2);

a = charObj.getTranslation();

x = a.x;
y = a.y;
z = a.z;

oldClientX = clientX;
oldClientZ = clientZ;
oldClientRotation = clientRotation;
oldrotation = rotation;

Projects / Re: 3D Sound using lwjgl binding of Open AL
« on: September 04, 2008, 11:14:00 am »
Nice one, demo works all good for me. I will surely be using this for my game when I add sound.

Pages: 1 ... 20 21 [22] 23 24