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 ... 126 127 [128] 129 130 ... 132
1906
Projects / Raven's projects
« on: November 17, 2005, 10:24:38 pm »
Quote from: "raft"
assuming constant fps it is trivial to decide where that user will be in each frame. with un-constrained fps it's somewhat more complicated


himm, i'm re-thinking now about the subject and, assuming constant fps even in an un-constrained enviroment may be a good assumption. normally fps doesnt change that much if something doesnt change radically (such as world size doubles or user opens another cpu eater application).

so, measuring fps every -say- 5 seconds and assuming it constant may also simplify things. i guess this way fps increases slightly since number of updates decrease. a drawback is, if one moves with key strokes every frame, fps/ups results in a smoother feeling

sorry raven, filling your forum with self thoughts  :oops:

Code: [Select]
r a f t

1907
Projects / Raven's projects
« on: November 17, 2005, 09:53:59 pm »
Quote from: "EgonOlsen"
in theory...it never happened for Paradroidz because collision detection is too fast


certainly it is. in fact everything, even those you mark as expensive in javadocs, is quite fast compared to render time. dont get me wrong, i dont mean rendering is slow :wink:

i choosed this way since i couldnt find effective solutions for some questions, especially in a multi-user enviroment. for instance, if some user moves from point A to B, basicly only these two points are broadcasted to other clients. assuming constant fps it is trivial to decide where that user will be in each frame. with un-constrained fps it's somewhat more complicated

Code: [Select]
r a f t

1908
Projects / Raven's projects
« on: November 17, 2005, 08:46:11 pm »
hello raven,

Quote from: "Raven"

So, to sum up, my question basically is: is this the way to go? Or is there some other method that's better when making 3D games? For example, should I be looking into threading each type of manager so it runs independantly?


as a rule of thumb, you should avoid threading whenever you can. it only complicates things and cost some performance (due to syncronization and context switching overhead). use threading where you have to do so (for example when use blocking i/o)

in karga, to simplify things, i targeted a constant fps. even collision detection and other non-render stuff doesnt cost much compared to rendering, so if i cannot reach targeted fps, i simply skip rendering for some frames and update the game state only. this method depends on measuring render time, something like this:

Code: [Select]

while (running) {
    long startTime = System.nanoTime();
    gameUpdate();
    gameRender();
    long elapsedTime = System.nanoTime() - startTime;

    if (elapsedTime < expectedElapsedTime) {
        // sleep here for some time
    } else {
        // do some gameUpdate without render
    }
}


with this approach, even on a slow machine updates stay closer to high targeted fps (50 for instance) so you can decide animation indexes etc depending on targeted fps

instead of controling animations and other things (movements etc) from a central location i've also defined a FrameListener interface which lots of my 3d objects implement. so they can 'take care of themselves'
Code: [Select]

public interface FrameListener {
    public void timeForNewFrame(/* pass here whatever you want like frame no, world etc*/);
    public void timeForRender(/* same as above */);
}



so what i do in gameUpdate and gameRender is:
Code: [Select]

private void gameUpdate() {
    for (FrameListener l : frameListeners) {
        l.timeForNewFrame(/* some parameters */ );
    }
}
private void gameRender() {
    for (FrameListener l : frameListeners) {
        l.timeForRender(/* some parameters */ );
    }
}


hope this helps :wink:

Code: [Select]
r a f t

1909
Support / Question: Models, lighting, and more.
« on: November 07, 2005, 09:14:02 am »
Quote from: "Raven"
I think you're talking about the same thing that Helge had already already pointed out to me, except that you want me to put it in a seperate file? But wouldn't I then have to align my map.3ds with the lights.3ds after I import them into jPCT?

not exactly, i think we were talking about different things.
i couldnt get what you meant by aligning ? those dummy 'light' objects are already positioned in your world. just export the world to map.3ds and lights to lights.3ds
Code: [Select]
r a f t

1910
Support / Undersampling
« on: November 06, 2005, 01:54:35 pm »
Quote from: "EgonOlsen"
Undersampling simply renders at half the resolution and doubles  the rendered pixels in x- and y-direction. Maybe scaling is faster because it can benefit from hardware support, but i somehow doubt it, because it's a non-accelerated BufferedImage.


on my box (both redhat and win xp), scaling runs almost 10% faster then undersampling. swing uses VolatileImage (accelerated) by default for back buffer, but the result doesnt change even if i disable double buffering. strange :?: (btw, i dont if copying from a non-accelerated image to an accelerated one offers any improvement)

anyway, i preferred the undesampling way since it makes things (like 2d blitting) much easier. and 50% undesampling makes almost a 50% speed impovement so i see no point in using other scaling ratios

Code: [Select]
r a f t

1911
Support / Re: Question: Models, lighting, and more.
« on: November 06, 2005, 01:22:07 pm »
Quote from: "Raven"
I'm wondering what the best way would be for me manage this. There's also the question of object placement: Figuring out where to place objects like "Healthpacks" for example.


possibly not best way, but i find this very handy:
i either:
* place dummy objects to mark those positions and save them in a seperate file (like lights.3ds) and then use the center of those objects to place lights
* again place dummy objects but save thier positions with max script (faster loading time and less space)

Code: [Select]
r a f t

1912
Support / Re: serial version uid
« on: November 03, 2005, 05:56:18 am »
Quote from: "EgonOlsen"
you can't deserialize old stuff with a changed class. So where is the actual difference?

you can, even if you changed the class incompatibly. you can change method names, signatures even add new fields (they are simply set to nulls or zeros during deserialization). i'm not sure what happens if you change field types or remove a field but the others dont break deserialization

Code: [Select]
r a f t

1913
Support / serial version uid
« on: November 02, 2005, 02:00:08 pm »
egon, can u please add a serial version uid to serializable classes ? it becomes incompatible with the previous version and it breaks loading previously serialized objects. sun suggests it too and it wont hurt for sure

Code: [Select]
private static final long serialVersionUID = 999L; // or whatever long

of course you can change it in time when it is necessary (such as when internal fields are not backward compatible)

and when did you update the site, i must have missed it. it looks nice :wink:

Code: [Select]
r a f t

1914
Projects / ┐how much pleople still using jpct?
« on: October 29, 2005, 08:25:12 pm »
+1
although not reading all posts, i'm here too :wink:
Code: [Select]
r a f t

1915
Projects / aptal karga (foolish crow)
« on: October 25, 2005, 12:17:33 pm »
if you say so..  :D

1916
Projects / aptal karga (foolish crow)
« on: October 25, 2005, 04:40:37 am »
if you say so..  :roll:

1917
Projects / aptal karga (foolish crow)
« on: October 24, 2005, 10:53:41 am »
as i know, ack's are only sent in response to other packages, as receipts. if application doesnt send any data, no packages will be transfered. when the socket is closed (either manually or by an application crash) a connection reset or whatever package is sent to notify peer. but i'm not sure, i dont know much about tcp as i said. who cares, as long as java net api's keep this much high level :wink:

Quote from: "rolz"
p.s. nice to see you people back after summer hiatus :)
 thx :D

Code: [Select]
r a f t

1918
Projects / aptal karga (foolish crow)
« on: October 24, 2005, 10:13:40 am »
Quote from: "rolz"
regarding heartbeat what transport do you use for the game - HTTP or just plain TCP/IP or UDP ? I assume in case when you use connected sockets you will not need heartbeat at all

no udp or http. i use primarily tcp and for some criticial state information rmi (my type safety obsession :roll: ) i'm afraid heartbeat is necessary even for tcp sockets. otherwise you cannot detect -for instance- an unplugged network cable during inactivity.

i was testing karga in a friends' wireless network. they somehow disconnected but the server and even the clients didnt detect it. i dont know much about tcp low levels but i cannot find any other explanation for this

Quote from: "rolz"
regarding serialization - are you sure you need to send mesh data over network ? ;) You may want to choose lightweight objects with minimum required data - like name, gender, body type, hair color and so on - and a factory on client side that will create 3D objects from lightweight ones.

lol, you got me wrong. i'm not sending mesh data over network for sure. i was talking about about loading animation meshes from serialized (instead of 3ds or md2) files during startup ;)

thanks for the suggestion, it sounds good. i do something similar to your 'incremantal serialization' as i wrote in my first jpct days. i believe, using transient fields in cooperation with readObject and writeObject methods may significantly lower the necessary space for serialized meshes or other jpct objects. helge are you with us ? :wink:

Code: [Select]
r a f t

1919
Projects / aptal karga (foolish crow)
« on: October 24, 2005, 01:53:48 am »
since my last post:

* added jump
* some gui impovements and add-ons
* added 'dont see a user' option. (both sides simply dont see each other anymore) this has no take back at the moment so use it carefully ;-)
* added one way (client to server) heart beat mechanism. this is certainly necessary to detect network failures (especially in wireless ones)
* added basic i18n (internationalization) support. translated most parts to turkish but i've noticed that it's really hard to use turkish in computer generated messages :shock: for instance prepositions are in form of suffices which change depending on both wovels and last part of the word :evil:
* changed the way animations are loaded (from pre-serialized data). this takes 25% much space (than 3ds) but loads almost 20 times faster.
* added stand and talk animations (well in fact only the mechanism, animations are dummy). paired animations (like kissing each other) is coming soon. stand by ;)
* prepared a formal business plan. for god's sake, should i ever able to find resources for this project  :roll:

btw, i still think much can be done to decrease the serialized data size (with custom writeObject(..) and readObject(..) methods). even the mesh of a simple cube takes 2.5k space when serialized  :?:

Code: [Select]
r a f t

1920
Support / Undersampling
« on: October 23, 2005, 10:47:44 pm »
for the ones who use software renderer, using a small sized FrameBuffer and then scaling it to screen may be a better alternative to under sampling.

i didnt make any comprehensive tests but it seems this way peforms better than under sampling. furthermore one can use any sampling ratio. i remember i read something like sun graphics engineers suggest scaling images on the fly (i dont know why)

btw, assuming all others the same, can we say rendering time is proportional to FrameBuffer's area ?

Code: [Select]
r a f t

Pages: 1 ... 126 127 [128] 129 130 ... 132