-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathReadme.original
46 lines (30 loc) · 3.71 KB
/
Readme.original
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Hello,
you have just discovered the data folder of Cubosphere.
If you are interested in changing (e.g. modding) Cubosphere or adding contents to the game, please read this file carefully!
Since Beta 0.2a we have changed the file access of Cubosphere by using ZIP archives. This comes with the advantage, that there are not about 2000 single files on your hard drive.
However, when making changes in a single file, you definitly do not want to update the entire ZIP archive each time. Therefore, Cubosphere has a custom file system, which is presented in the following section:
Upon starting Cubosphere, the file "boot.lua" inside the data directory is executed. This file inits the Cubosphere file system by mounting all ZIP archives in the data directory in alphabetical order. Thus, if there were three archives "data000.zip", "data001.zip" and "data002.zip", they were mounted in this order to the file system. When Cubosphere needs to access a file, this stack is read reversed. First, the Cubosphere would try to open this file from archive "data002.zip". If it was not able to locate this file inside "data002.zip", it would jump to "data001.zip" and eventually to "data000.zip". If the desired file was not found in none of the archives, the normal file system is taken into account.
Using this mount order has several advantages:
- Minor patches can be delivered as additional dataXXX.zip files with an increasing trailing number.
The patched files are preferably accessed, whereas the old buggy files are hidden and not used.
- Since the normal file system is lastly taken into account, there is no mismatch between files from previous releases of Cubosphere, which had been installed into the same directory.
However, when you are trying to create modifications or additional content for Cubosphere, the mounting order is not very helpful. Here are the steps to go in order to modify Cubosphere.
1. Make sure you do not have any deprecated files in your data directory (e.g. stemming from an older Cubosphere version), since they can lead to incompatiblities.
2. Open the "boot.lua" with an editor. For Windows users: Please choosen an editor that supports Unicode and Unix line delimiters in order to get the file displayed correctly.
3. Edit line 4 of the boot script. Change it from
PreferZip=1;
to
PreferZip=0;
4. Save the file
Using this configuration, Cubosphere mounts the hard drive file system after the ZIP archives, so that uncompressed files on your local hard drive are preferred.
When you want to edit a file, simply extract in out of the appropriate ZIP archive (make sure to keep the directory structure) and edit it on your local hard drive. With the "PreferZip=0" option, your modified file is loaded from hard drive and the files in the ZIP archives are ignored.
To give a little example:
To modifiy the background in the main menu, you have to extract the file "textures/logo.jpg" out of "data000.zip" into <CUBOSPHERE DATA DIRECTORY>\textures\logo.jpg
Make sure, you have switched to PreferZip=0 (see above) and modifiy the texture. Start Cubosphere and you will see your modified background texture!
For simple editing, please do only extract the files, you are about to modify. Doing so, modified files are uncompressed on your hard drive whereas original files reside inside the archives.
This allows an easy distinguishment of modified and originals files.
It is worth to mention, that music files cannot be read from ZIP files! The used library SDL_mixer is unable to recognize compressed MP3 files. So music files have to be stored the traditional way.
Have fun editing and playing Cubosphere!
You can send questions, feedback, comments, bug reports, modifications or additional content to cubosphere@web.de
Regards,
The Cubosphere Team