Large open world

Started by anne_domini, October 05, 2015, 03:20:02 PM

Previous topic - Next topic

anne_domini

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?

EgonOlsen

#1
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.

anne_domini

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.

EgonOlsen

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.

anne_domini

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.

EgonOlsen

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.

anne_domini

#6
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

anne_domini

PPS Dont you need for wiki jar file, which converts OBJ to serialized?

EgonOlsen

You mean some little helper tool?

anne_domini

Yep, simple jar with usage like this:

java - jar converter.jar path/to/input/model.obj path/to/output/serialized.file

Input - obj file, output - serialized model

EgonOlsen