serialize related questions

Started by John Tribe, March 01, 2013, 12:05:46 AM

Previous topic - Next topic

John Tribe

1. is serialize() save transformedCenterData and size information?
2. is there a way to force save this data
3. is ID change when deserialize and add to world? If not, what you suggest to make relation with another data .. like game Data?
4. is call compile and build,  clear some information? (e.g. position, rotation)

sorry for the stupidity
Best game prices in http://games2see.com

EgonOlsen


  • Center and rotation pivot will be saved. Translations, rotations, scale etc. won't.
  • No. You have to save this yourself if you need it.
  • I don't get the question...
  • compile() doesn't but build() recalculates the center and the rotation pivot. Translations and rotations will remain untouched but their actual outcome may change because of the recalculated center.

John Tribe

About 3 :

I have the hero and monster object the all of them have they own object3d. and if i save the object3d[] array of all of them(as one array) and hero objects and monster objects i save as gameObjects[] array, then when i loading i need to create mapping with the heros , monster objects and objects3d ,first i thought that id is unique, but isn't. Do you have any ideas? I can use name field for this, but i would like to leave this for display purpose. 

Thanks for help
Best game prices in http://games2see.com

EgonOlsen

Even if the id would have been stored in the file, you can't ensure that it will be unique after loading because you might have saved multiple objects with the same id.

John Tribe

after loading serialized object, I am trying to copy object and i getting exception in my face. Someone could tell me why?

Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 3518
   at com.threed.jpct.Object3D.copy(Unknown Source)
   at com.threed.jpct.Object3D.<init>(Unknown Source)
   at com.threed.jpct.Object3D.cloneObject(Unknown Source)
Best game prices in http://games2see.com

EgonOlsen

Which version of jPCT are you using? Looks like an older one to me!?

John Tribe

#6
Manifest-Version: 1.0
Created-By: EgonOlsen
Version: 1.15beta3

well i uploaded the newest version: 2012-12-18 -  still the same. 

Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 17426
   at com.threed.jpct.Object3D.copy(Object3D.java:904)
   at com.threed.jpct.Object3D.<init>(Object3D.java:776)
   at com.threed.jpct.Object3D.cloneObject(Object3D.java:3518)

there are lines now :D
Best game prices in http://games2see.com

EgonOlsen

How do you store your objects? Make sure that you aren't storing them in reduced mode.

John Tribe

Best game prices in http://games2see.com