I've (finally) updated the scripts to handle Minecraft's anvil save format and Sauerbraten's new formats (the scripts still produce v29 ogz files, but they can read up to v33, and Sauerbraten's map loader is backwards compatible).
I've also realised that using Sauerbraten to edit Minecraft maps isn't as great an idea as I originally hoped. Sauerbraten is optimised for a different kind of geometry and can get sluggish. Moreover existing tools (such as WorldEdit, which I used to make my adventure map) are quite good.Contents
Minecraft is a game played on vast randomly generated cubical earth-like worlds.
Sauerbraten is a compact open-source first-person-shooter styled after games such as Quake. Its maps are also based on cubical geometry. Moreover it sports a convenient and powerful in-game level editor.
The goal of this package is to convert some part of a Minecraft map to a Sauerbraten map, and vice-versa. The main purpose is to allow Sauerbraten's powerful editor to be used to edit Minecraft maps, though other applications are surely possible.
The package is written in Perl, which made it relatively quick to write and hopefully fairly platform independent (I only have a windows machine, so if you run this on Unix/Linux or Mac OS, please let me know how it goes). Of course it might have run a bit faster if it were written in C++. Anyone who wants to port it is welcome to ;).
There is another project with a very similar goal here, but it apparently doesn't run on windows.
|A generic Minecraft map||The Sauerbraten in-game editor||The same Minecraft map converted to Sauerbraten|
sauerbraten/packages/models/minecraft. Note: your Sauerbraten home folder may simply be the folder where you installed Sauerbraten (the one containing
sauerbraten.bat), or it may be elsewhere. The latter case can be confusing since Sauerbraten will still read maps from the installation directory, but it will save maps elsewhere while appearing to save to the same filename. If you find that you can convert from Minecraft, and load, edit and save the Sauerbraten map, but see no changes when converting back to Minecraft, this may be the problem.
sauerbraten/packages/minecraft/settings.plin a text editor.
$mc_folder='...';to indicate the directory containing your Minecraft save games. If you want to edit multiplayer maps, this should be the directory containing
minecraft_server.exe. If you want to edit single player maps, these instructions will give the directory you need.
$sauer_folder='...';if you want the Sauerbraten maps to be stored somewhere else.
$mc_ogz_scale=3;if desired. This indicates that the sidelength of one Minecraft block will be 23=8 Sauerbraten units. This seems about right visually. Note that decreasing this may lose some detail on some blocks, such as a 7/8 full block of water. Also increasing it will reduce the maximum possible size of converted region.
$mc_ogz_scale=3;it will be impossible to fit through a 1 block wide tunnel. Increasing to
$mc_ogz_scale=4;will allow the player to fit through a tunnel 1 block high and 1 block wide.
replaceblocksto remove ores and tall grass. This can cut down the size of the .ogz file. Other replacements can be made using the same format, expressing the block IDs in hex.
ogz_to_mcr.pl. The former reads a specified area on a Minecraft map and creates a Sauerbraten map representing it. The latter replaces a specified area of a Minecraft map with the contents of a Sauerbraten map. After following the instructions in the previous section, open a command prompt or terminal and navigate to the directory
sauerbraten/packages/minecraft. The following subsections describe the use of each script, as well as a very brief introduction to editing in Sauerbraten.
mcr_to_ogz.pl mcname sauername c0x c0z size
sauername.ogzrepresenting part of the Mincraft map
mcname(add "/DIM-1" or "/DIM1" to
mcnameto convert the Nether or End). The part converted will consist of all blocks with coordinates
size parameter must be between 7 and 10 inclusive (actually if you changed
$mc_ogz_scale, the maximum allowable value of
size is 13 -
$mc_ogz_scale). For example,
mcr_to_ogz.pl world mymap 0 0 7
Warning: Sauerbraten can freeze up when trying to load very large (and detailed) maps. I recommend sticking to size 7 or 8.
|So many blocks!|
mymap.ogzhas been created as in the previous subsection.
sauerbraten.baton Windows or
sauerbraten_unixon Unix/Linux/Mac OS(?).
/coop minecraft/mymapand press enter. The map we've created will be loaded.
/water, and then remove the block.
/savemapto save changes made to the map (or
/savemap minecraft/anothermapto give it a new name).
|The selected region is indicated by blue lines. The nearest face of the region is bounded by white lines since it's the selected face. The size of the cursor can be seen in the centre of the image||R+scroll to rotate||Copy and paste using C and V|
|Y+scroll to change a texture||Scroll down to extrude||Fear my giant bedrock tower!|
ogz_to_mcr.pl sauername mcname c0x c0z
mcnamewith the contents of
sauername.ogz. The part overwritten will have lower coordinates (16 c0x, 0, 16 c0z) and will be 128 blocks high. The length and width will depend on the size of
sauername.ogz; namely, it will be 2
$mapscale - $mc_ogz_scalewhere
$mapscaleis the scale of the map (type
/echo $mapscalein Sauerbraten to see this) and
$mc_ogz_scaleis specified in
sauerbraten/packages/minecraft/settings.pl(the default is 3). Continuing with the above example,
ogz_to_mcr.pl mymap world 0 0
|An unusual sand formation||*fear*|
Minecraft stores additional data, such as the contents of chests and furnaces, in tile entities. In addition to writing
sauername.ogz, the script
mcr_to_ogz.pl records tile entites in the file
sauername_tileents.txt. This file can be edited to change the contents of chests, and the result will be transferred back to Minecraft when
ogz_to_mcr.pl is run.
The format of
sauername_tileents.txt is as follows (see sample_tileents.txt for an example). The first line of each tile entity has the form
indexis referenced by the Sauerbraten map (see below) and
iddescribes the type of tile entity (eg Chest, MobSpawner...). For a Sign tile entity, the remaining lines are the lines of text on the sign. For a MobSpawner, the next line indicates the mob spawned (eg Zombie, Enderman...). Any numerical attributes of the tile entity are indicated by a line of the form
fmtindicates the format of the property (eg
propertyis the name of the property (eg BurnTime for a furnace). If the tile entity has a list of items (eg for a Furnace, Chest or Cauldron), these items are indicated by lines of the form
slot: id damage count
slotindicates which slot the item takes (eg 0 to 26 for a Chest),
damageare the item ID and damage value of the item, and
countis the number of items in the stack. Additionally any enchantments are indicated at the end of the line in the form
(id,lvl)(see here for enchantment ids and permissable levels). Finally a blank line indicates the end of the tile entity.
The tile entity data is represented in the Sauerbraten map by a rotating purple slab mapmodel. The parameters of the mapmodel are
mapmodel 0 109 0 index 0
indexis the index of the tile entity in
sauername_tileents.txt. The index is most easily changed by pressing period (.) while the entity is selected. Multiple blocks can refer to the same tile entity data; for example, copying a chest along with its tile entity mapmodel will produce a chest with identical contents.
More recent versions of Sauerbraten seem to do some optimisations, replacing textures that can't be seen. Therefore a block which is completely surrounded (such as ore) will get replaced by the surrounding material.
The lighting information is all lost - the Sauerbraten map produced has no lighting. I might consider in a later version placing lights on each light source (torch etc) to emulate the Minecraft light (an idea due to IkeKrull). Unfortunately lava doesn't intrinsically provide light in Sauerbraten and I don't really want to put a light in every lava block. Minecraft entities (such as passive and aggressive mobs) are also lost.
For the most part, water and lava look nicer in Sauerbraten than in Minecraft. However Sauerbraten doesn't allow sloping water surfaces. A stream of water in Minecraft which decreases in height is represented as a series of blocks with decreasing height. It looks OK, sort of.
This project was also an excuse for me to learn how to make models for Sauerbraten in Blender. If it looks like they were produced by an amateur, it's because they were. Most of them turned out OK, but I admit the fire model looks like a wobbling layered jelly desert.
|Underwater in Sauerbraten||The Sauerbraten representation of a trickling stream||Served on a plate of netherrack - Yum!|
A Sauerbraten map can contain features that wouldn't be seen in a Minecraft map (such as sloping faces, small scale details and blocks with mismatching textures on different faces). This is exacerbated when Sauerbraten replaces hidden textures. The "closest" minecraft block is chosen, but this may not be sensible in many cases.
The conversion of mapmodels is a bit more forgiving; as long as a valid mapmodel is used, the nearest fit will be found for its position and rotation. This can still make it tricky to get the rotation right for mapmodels which are symmetric.
Finally the converter fills out BlockLight and SkyLight with dummy values. Minecraft seems to recompute these fairly quickly, but any remaining dark patches can be removed by causing a block update.
|This was a plain extended piston, but when it contracts we can see that it has become sticky||If Minecraft leaves a patch unlit, place and remove a block to make it update the lighting|
The Perl scripts and md3 files are licensed under a Creative Commons Attribution 3.0 Unported License
The textures belong to Mojang. I trust they will contact me if they have issue with the textures being included in the download. In any case, presumably anyone with a use for the package will already legally have a copy of the texture.