Have you tried to look into the SourceCode to see if there is a way to change the path?
You can use the OutputCapsules/BinaryWriter along with a new File()
but that’s not desirable.
What is your intention when changing the path?
Simple Reason why OutputCapsule is bad:
Linux: /home/<username>/.mygame
MacOS: /Users/<username>/.mygame or even /Application Support/MyGame
Windows: C:\Users\<username>\AppData\Local\Roaming\MyGame or
C:\Users\<username>\Documents\MyGame\ or
Whatever MS recommends (C:\Users\<username>\Saved Games\ or such)
Then the Windows App Store and Apples AppStore might also have rules on where to save which you have to follow.
Note: You can’t write to C:\Programs\
anymore without admin rights.
So unless you have good reasons and want to reinvent the wheel, probably try to stick to the same path.
See AppSettings, maybe they contain something like a SaveGame Folder.
Regards your int[][][]
: That’s not implemented since the Engine doesn’t use it since its also a hint that you are doing things wrong.
Even if you had Object
or Integer
as types, you would have 4 or 8 Byte per Entry.
Imagine you’d have a { [0..10], [0..10], [0..10]}
space, then you’d have: 10^3 * 8 == 8000 Byte == 8kB
just for empty values. Also note that expanding the space by doubling it leads to a 2^3 == 8
times the memory usage.
So 0…20 would be 64kB just for an empty file.
You CAN save some space (e.g. by iterating over x
and nulling if for a given x all y == z == null
), but that is just too much work for corner cases.
If you want to use those to store something by coordinates, rather use a LinkedList or maybe a HashMap. And then you can always serialize your own classes by extending Savable
Edit: You can however use those three dimensional arrays, if you don’t use them to store coordinates, so when your space is really limited, but I don’t really see a use.
Also note that the inbuilt JME System is better than something like jackson in terms of size and it’s a bit of a protection to save game manipulation (Though you can also use XmlWriter, if you don’t want them to be binary)