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

Pages: 1 ... 123 124 [125] 126 127 ... 133
1861
Support / rearview mirror
« on: December 02, 2006, 05:38:47 pm »
nice work athanazio ;)

isnt it possible two use two cameras instead of cloning objects and using two worlds ?

Code: [Select]
r a f t

1862
Support / jPCT can't load instance objects in 3ds file?
« on: December 01, 2006, 07:16:46 pm »
you can do it with max script. just save translation and rotation of each object with a proper format. there is one trick: you must take care of cordinate system transformation as 3dmax and jpct uses different systems

Code: [Select]
r a f t

1863
Support / jPCT can't load instance objects in 3ds file?
« on: December 01, 2006, 03:08:21 am »
if your concern is memory you may implement your own 'instance' mechanism as i do in karga: that is export only one object to a 3ds file and save locations of others to a text file and use them. or alternatively you can use dummy objects with one vertex (not sure if jpct will load them) to mark locations

Code: [Select]
r a f t

1864
Support / Adding clothing, weapons, shields to 3d model.
« on: November 24, 2006, 10:19:29 am »
well, the link you found seems to be written for 2d enviroments. luckily jPCT is a 3d engine and you dont need that kind of tricks ;)

you can do in jPCT what that guy does in blender and indeed that's also what i do in karga: seperate your clothes to different textures where other parts of texture is transperent. then to create combinations, use java2d to draw that textures on top of others and finally use resulting image as your avatar's texture. this is what i called 'texture based dressing'. with a good texture artist you can create lots of combinations

for variations which cannot be done with texture, (like gun, hair etc) animate and store them in a series of 3ds files as you do for the body and attach them to body as childs (this will make them move and turn with the body) and apply the same animation as the body. that's if the body is at frame 2 of walk animation the gun and hair will be at same frame too. of course to do this, you wouldnt merge body and childs into a single 3d object

i guess there is much information about this mechanism in karga thread

hope this helps
Code: [Select]
r a f t

1865
Support / Adding clothing, weapons, shields to 3d model.
« on: November 23, 2006, 06:49:12 pm »
i originally store each key frame on a seperate 3ds file and each animation sequence in a different folder. then to use in karga a serialize animation sequence after stripping it. this way loading time drops to almost one fifth of loading it directly from key frames.  

Code: [Select]
r a f t

1866
Support / Networking optimized!
« on: November 06, 2006, 05:36:03 am »
yes, you should remove the blocking code from the rendering thread. with your current way you are consuming your most valuable cpu time by just waiting response from server. using nio or putting blocking code into a seperate thread will both do the job

and your ship's speed isnt determined by how frequently it gets data from server. server should only say your ship's position, direction and maybe speed, accelaration etc. for instance:

frame 1: server said your ship is moving to D direction with S speed
frame1-10: you should move the ship toward that direction
frame 11: server reported some other D and S
frame 11-20 move to that direction
..
and of course you will not receive responses at perfectly regular intervals. the next response may come at 25th frame, the other one at 40th, next one at 41 etc

i see 3 chocies:

* you ship does exactly what your server says at that time, and nothing else. that means your ship will respond after some lag since you wait for server's approval and it also wont move smoothly

* move your ship without waiting for server's response. if server says something different than you expect correct your ship's position accordingly. this will cause your ship jump from here to there during correction

* do the second thing but instead of making your ship jump to corrected position, modify its path to reach the corrected position smoothly. this is a bit complicated but commercial games do it

hope this helps ;)
Code: [Select]
r a f t

1867
Support / Networking optimized!
« on: November 06, 2006, 04:43:09 am »
Quote from: "Melssj5"
Does the data type imports a  lost, for example using short instead of int, I mean maybe it transmit some 0 bytes to fill the remaining space if they are only digits on this variables not big numbers


sure it would help. no matter what you store in a variable of primitive type (like int) serialization stores as much bytes as that type, 4 bytes for an int for example

this helps a little but your problem seems to be something else.

do you wait for server's response before continueing animation loop ? for example do you have any code piece like the one below in your animation loop ?

Code: [Select]
ObjectInputStream.readObject()

1868
Support / Networking optimized!
« on: November 06, 2006, 04:08:48 am »
mm, if you serialize an element of a linked list, then (depending on implementation of list) either all or on the avarage half of its elements are serialized  :roll:

you can use the following code piece to determine the serialized size of an object

Code: [Select]
   public static int getSize(Object o) throws IOException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos);
       
        oos.writeObject(o);
        oos.flush();
        oos.close();
       
        return bos.size();
    }


Code: [Select]
r a f t

1869
Support / Re: Networking optimized!
« on: November 06, 2006, 02:28:23 am »
Quote from: "Melssj5"
My game FM recolects the events from the clients, passes them to the server, the server proces them, and return the state of all the clients to each client. now doing this means, 100% comunication with the server for each iteration, is this too bad?


hello Melssj5,

does this mean you send this data to server at each iteration and wait for server's response to continue iteration ? i dont think so but if it is, it is definitely not a good idea. you shouldnt block your animation loop for anything (other than pause of course)

Quote from: "Melssj5"
private SimpleVector posicion;
private Direccion direccion;
private int vida;//less tha 100
private String nick;//less than 8 chars
private int id;//one digit
public NodoRed sig;//a reference
public int cambio;//one digit


and if you send this data to server by serializing it make sure the NodeRed reference does not refer to a big object. as you know, if you serialize an object, all objects that can be reached from it is also serialized. you can make a size check to serializing that object to a ByteArrayOutputStream to determine how much bytes it takes

you may also wish to post your relevant part of code to let us have a look

Code: [Select]
r a f t

1870
Feedback / Software development
« on: October 20, 2006, 10:36:53 pm »
havent we already somewhat discussed this  in a previous thread  :wink:
Code: [Select]
r a f t

1871
Support / A question about "Alien running" applet
« on: October 13, 2006, 12:07:03 pm »
i export each key frame as a seperate 3ds file then load them and feed meshes into an Animation object. after this it is equivalent to from loading an md2 file.

either way, for smoothness frames are interpolated between key frames by Object3D.animate(float index, int seq) method

Code: [Select]
r a f t

1872
Support / Compiled JavaDOC
« on: October 13, 2006, 11:54:39 am »
there is indeed: http://www.jpct.net/doc/

download bundle also contains it

Code: [Select]
r a f t

1873
Projects / aptal karga (foolish crow)
« on: September 28, 2006, 09:54:28 pm »
hello,

since my last post these can be of most interest:
* singleton actions are in, they're available from either popup menu or by typing hot words :action name: in talk panel (:respect:, :clap: etc.)
* added support to rotate and move camera with dragging mouse and wheel respectively

tomorrow night karga is switching to papel system: papel will be money unit of karga and initially some of the dressings and later on some new services will be rented by karga papels. users will also be able to request papels from their partners for dance and kiss ;) hope people wont blame me for encouraging prostitution :roll:

anyway tomorrow (friday, 29th september) night there will be an online party at karga, all jPCT users are welcome ;)

hope to see you in karga

Code: [Select]
r a f t

party place, mushroom club ;)

1874
Support / problem with applet and heap space
« on: August 29, 2006, 01:15:05 pm »
hello,

a few days ago i've profiled karga and let me share what i found about memory concerns:

Code: [Select]
world.removeAll();
world = null;

unfortunately this code piece doesnt effectively retrieves heap back :/ Object3D has a package public field called myWorld referencing its world and world.removeAll() doesnt clear this field. so if you have a reference to any of the objects of your old world, that means you still hold a reference to your world :/

worse enough nulling all of your references to Object3D's and your world and callling System.gc() does not instantly retrieves heap back. if you carefully cleared all references, after some time jvm will correctly garbage collect your world but not instantly.

i suspect this is due to garbage collection mechanism: for instance if object A has a reference to object B, and object B has a reference to object A, and these two arent referenced by any other objects, jvm will eventually garbage collect the two. but i guess it takes some time for garbabe collector to detect the situation

btw, upcoming jPCT version (1.12) has an improved Mesh.compress() method which almost reduces memory requirements to half ;) it may help you a lot

you may also consider using java web start instead of applet. jws is much more flexible than applet and also allows setting max heap size even for untrusted applications

hope this helps
Code: [Select]
r a f t

1875
Projects / aptal karga (foolish crow)
« on: August 20, 2006, 05:26:34 pm »
thanks for the feedback Egon ;)

as you know, as i use fixed timestep aprroach in karga, fps is limited (30 at the moment) so even on a super fast machine or with an empty scene it doesnt -shouldnt- exceed 30 fps

am i missing something ? what's that surprising you  :roll:

a few people reported karga running extremely slow (5 or less fps) on  very fast machines. i've never encountered that but i was suspecting it may be because of dual core cpus (because of thread synchronization or whatever) but according to your benchmark this isnt the case. at least not for all dual core cpus  ;)

btw, i have now a moderate laptop (toshiba m70-162) with intel mobile 915m video chipset but i still cant run fps and car demo with hw renderer at linux (fedora 4) it complains saying it couldnt find a valid video mode :roll: by default fedora 4 didnt recognize my chipset, so i downloaded a recent X server and compiled and installed it

r a f t

Pages: 1 ... 123 124 [125] 126 127 ... 133