www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Melssj5 on September 30, 2008, 02:30:11 am

Title: Everything is 6.50 MB?
Post by: Melssj5 on September 30, 2008, 02:30:11 am
Hi, I tried to save the whole world as a file to read it without having  to load everything again, and I noticed that the outputfile was 6.50 MB, as that is too expensive to download I better tried to save just a small Object3D to see if works. but I found that the new outputfile was 6.50 MB again. Then I tried to save a smaller Object3D and I notices that the file was again 6.50 MB???


Why does this happens?
Title: Re: Everything is 6.50 MB?
Post by: Melssj5 on September 30, 2008, 04:16:31 pm
Well, this happened becausse the object3D was added to the world before saving it as a file. This means that the whole world is being saved with the object on somehow. If I save the object3d before adding it to the world then it will much lighter.
Title: Re: Everything is 6.50 MB?
Post by: EgonOlsen on September 30, 2008, 07:16:51 pm
Yes, because each object knows its world. That's a kind of design flaw of jPCT, but there wasn't a proper way around it.
Title: Re: Everything is 6.50 MB?
Post by: Melssj5 on September 30, 2008, 07:52:12 pm
On FLier Match I used to transfer the map and each new player to each client. On a LAN is not a problem but I should transfer them before adding to the world or something to make it more lighweigth for internet purposes.
Title: Re: Everything is 6.50 MB?
Post by: EgonOlsen on September 30, 2008, 10:25:36 pm
Either that or don't transfer the object itself but just a data model describing the new object's type and state.
Title: Re: Everything is 6.50 MB?
Post by: Melssj5 on October 01, 2008, 12:07:40 am
The idea is that each client can make their own models and play with them just by copying them on a scpeficied folder.
Title: Re: Everything is 6.50 MB?
Post by: EgonOlsen on October 01, 2008, 08:51:13 am
Ok...then you have to transfer them, of course... ;D
Title: Re: Everything is 6.50 MB?
Post by: Melssj5 on October 01, 2008, 05:08:04 pm
I should do something like in Unreal Tournament. If the client doesnt have the model then transfer it, if it does have it then just use it. The model should also be saved on the client and enable it to use it. But maybe Later I will code that.
Title: Re: Everything is 6.50 MB?
Post by: EgonOlsen on October 01, 2008, 08:17:07 pm
But wouldn't it be better to transfer the model in its original file format instead of a serialized form? That way, not only the model has to be present, it has to be serialized with the same class version. Or in other words: If there's a program update    on the clients, the server has to retransmit all models. That wouldn't be the case with normal 3ds or obj files.
Title: Re: Everything is 6.50 MB?
Post by: Melssj5 on October 01, 2008, 09:43:28 pm
mmmmm yes, I guess its a better idea.