www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: anne_domini on October 05, 2015, 03:20:02 pm

Title: Large open world
Post by: anne_domini on October 05, 2015, 03:20:02 pm
Does jpct ae have some built-in features to handle large open worlds?
Or i need to do all by myself? I mean things like splliting world into chunks, dynamically load/unload unneeded models etc?
Title: Re: Large open world
Post by: EgonOlsen on October 05, 2015, 10:57:56 pm
jPCT is a 3D engine, it's not a game engine (albeit it has elements that go into that direction). So yes, you have to build such things yourself. At leasts you want these chunks to stream and load/unload on demand. If all you need is spatial subdivision, you could use jPCT's octree support.
If you do make your own solution, I suggest to do some tests first to see what you really need. I've seen cases where people were convinced that they needed some highly sofisticated chunk management when the best thing to do would have been to render the whole thing in one draw call.

Edit: For example...the terrain for my RPG is rendered as one large (more or less) model, because that's faster than splitting it into several draw calls by using an octree. The octree is used for collision detection though.
Title: Re: Large open world
Post by: anne_domini on October 07, 2015, 02:41:54 am
It is not a game, it is sorta "viewer".
I wish i could load all of things at once and render them, but it is not an option (most heavy space loading time ~4mins on xt1254 (Snapdragon 805 4@2.65ghz) and it consumes about 160Mb of ram)
Now implementing chunking... will see how it is going to work.
Title: Re: Large open world
Post by: EgonOlsen on October 07, 2015, 07:58:09 am
Make sure to load the chunk in serialized format if possible and not in their native format like OBJ or 3DS, because those require a lot more time and memory to load.
Title: Re: Large open world
Post by: anne_domini on October 07, 2015, 02:15:08 pm
Yep, it will be my next step after implementing general algorythms of chunk managments.
Btw, can you give some basic info about jpct serialized model format, like loading time(compared to obj) and does it use compression?
Thank you in advance.
Title: Re: Large open world
Post by: EgonOlsen on October 07, 2015, 02:58:33 pm
I've no data about loading OBJ compared to serialized format. It highly depends on the model and the device anyway.
It's not compressed, but you can easily zip it and load it via a ZipInputStream.
Title: Re: Large open world
Post by: anne_domini on October 12, 2015, 11:34:18 pm
Tried to swtich project to serialized format, works fine :)
Loading times for 300Kb OBJ - 0.25 sec
Same object in serialized format ~ 0.02 sec
(Same timings on PC and Android device)
PS maybe this will be useful to some1
Title: Re: Large open world
Post by: anne_domini on October 13, 2015, 10:57:23 am
PPS Dont you need for wiki jar file, which converts OBJ to serialized?
Title: Re: Large open world
Post by: EgonOlsen on October 13, 2015, 01:00:24 pm
You mean some little helper tool?
Title: Re: Large open world
Post by: anne_domini on October 13, 2015, 11:33:12 pm
Yep, simple jar with usage like this:
Code: [Select]
java - jar converter.jar path/to/input/model.obj path/to/output/serialized.file
Input - obj file, output - serialized model
Title: Re: Large open world
Post by: EgonOlsen on October 14, 2015, 07:32:06 am
It would be a nice addition, yes. It would be even nicer if it would support object arrays as well...(, java.io.OutputStream, boolean)]http://www.jpct.net/doc/com/threed/jpct/DeSerializer.html#serializeArray(com.threed.jpct.Object3D[], java.io.OutputStream, boolean) (http://www.jpct.net/doc/com/threed/jpct/DeSerializer.html#serializeArray(com.threed.jpct.Object3D[))... ;)
Title: Re: Large open world
Post by: anne_domini on October 15, 2015, 12:05:28 am
inside it use DeSerializer.serializeArray
https://www.dropbox.com/s/st8rhex9n9htknk/JPCTAEModelSerializer.jar?dl=0