Author Topic: Large open world  (Read 1115 times)

Offline anne_domini

  • byte
  • *
  • Posts: 17
    • View Profile
Large open world
« 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Large open world
« Reply #1 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.
« Last Edit: October 05, 2015, 10:59:33 pm by EgonOlsen »

Offline anne_domini

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Large open world
« Reply #2 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Large open world
« Reply #3 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.

Offline anne_domini

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Large open world
« Reply #4 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Large open world
« Reply #5 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.

Offline anne_domini

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Large open world
« Reply #6 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
« Last Edit: October 12, 2015, 11:38:28 pm by anne_domini »

Offline anne_domini

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Large open world
« Reply #7 on: October 13, 2015, 10:57:23 am »
PPS Dont you need for wiki jar file, which converts OBJ to serialized?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Large open world
« Reply #8 on: October 13, 2015, 01:00:24 pm »
You mean some little helper tool?

Offline anne_domini

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Large open world
« Reply #9 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Large open world
« Reply #10 on: October 14, 2015, 07:32:06 am »

Offline anne_domini

  • byte
  • *
  • Posts: 17
    • View Profile
Re: Large open world
« Reply #11 on: October 15, 2015, 12:05:28 am »