MTS Editor

bzt
Member
 
Posts: 26
Joined: Tue Sep 24, 2019 14:26

MTS Editor

by bzt » Fri Nov 29, 2019 13:51

Hi,

It's less than a week when I announced mtsconv, and now it's already obsoleted :-)

Let me introduce mtsedit, which knows everything that mtsconv knew, plus it can import Minecraft NBT .schematic files, and has an interactive GUI for quickly editing MTS files.

It was written in C (so it's small and fast), and has only one dependency, SDL2. I've tested it under Linux and Windows (compiled with mingw), it worked like a charm. Enjoy!

Image

Just for the records, because the Minetest wiki is very poor on documentation, I've also created a detailed description of the MTS file format (still incomplete).

Cheers,
bzt
Last edited by bzt on Fri Nov 29, 2019 13:55, edited 1 time in total.
 

User avatar
rubenwardy
Moderator
 
Posts: 5883
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: MTS Editor

by rubenwardy » Fri Nov 29, 2019 13:53

Oh wow!

What's the biggest MTS it can handle? CTF has some massive ones in its repo: https://github.com/mt-ctf/maps
 

bzt
Member
 
Posts: 26
Joined: Tue Sep 24, 2019 14:26

Re: MTS Editor

by bzt » Fri Nov 29, 2019 13:58

Hi @rubenwardy,

The max size is 256 x 256 x 256. It's not for editing huge maps, but to edit structures. I've loaded detailed schematics of the Tower Bridge and the Notre Dame, both worked as expected.

Please note I've just put together this little tool in my spare time, it's free and Open Source. It does not want to compete with World Edit and such programs. It's main goal is to be small, fast and simple to use.

Cheers,
bzt
 

User avatar
rubenwardy
Moderator
 
Posts: 5883
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: MTS Editor

by rubenwardy » Fri Nov 29, 2019 14:50

bzt wrote:Please note I've just put together this little tool in my spare time, it's free and Open Source. It does not want to compete with World Edit and such programs. It's main goal is to be small, fast and simple to use.


I was just wondering, I well understand the constraints of spare time

This serves a different purpose to world edit though, as world edit is done in game but this is external. Being able to quickly create and modify schematics externally is pretty cool
 

BuckarooBanzay
Member
 
Posts: 316
Joined: Tue Apr 24, 2018 05:58
Location: Switzerland
GitHub: thomasrudin-mt
In-game: BuckarooBanzai

Re: MTS Editor

by BuckarooBanzay » Fri Nov 29, 2019 16:02

I really love the simplicity of it, even the code is well readable and structured :O
 

User avatar
texmex
Member
 
Posts: 1614
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex
 

bzt
Member
 
Posts: 26
Joined: Tue Sep 24, 2019 14:26

Re: MTS Editor

by bzt » Sat Nov 30, 2019 06:52

Hi,

Thank you, I'm glad that you enjoyed this little tool!

Here's a quick heads up on the last commit:

1. the cursor displaying part completely rewritten, now it is fast and responsive even with large files (comes at a price though, now when you clear blocks, you'll see the background color and you'll have to release the mouse button to refresh what's beneath)
2. now both CW and CCW directions supported
3. preview file dimensions fixed (depending on the contents, sometimes there was a big empty border)
4. added compilation instructions in the README.md under Linux and Windows
5. user interface translated to Hungarian, Spanish, French, German, Polish and Russian

I was wondering, which OS is used to play Minetest the most? For Linux, compiling the editor is trivial, but if there are many Windows users, I might provide pre-compiled binaries.

Cheers,
bzt
 

bzt
Member
 
Posts: 26
Joined: Tue Sep 24, 2019 14:26

Re: MTS Editor

by bzt » Sun Dec 01, 2019 17:04

Hi,

New features! :-)

The GUI now supports history, you can undo and redo modifications. The block definitions file is almost entirely complete, and I've added default images for the nodes, so that the preview generation is working great (much better than mtsconv's).

So far MTSEdit lacked a very important component. It uses blocks.csv in the data directory to get the block node definitions. That file had to be written by hand, up until now, but no more! I've written an MTSEdit Export Minetest mod which is able to generate that csv using the Lua API from within the game. The mod is dependency-free, works with Mineclone2 and Minetest Game as well. As it can't export / import MTS files, only node definitions, therefore it suggests @Sokomine's excellent handle_schematics mod for that (that's the reason for the optional dependency).

Cheers,
bzt
 

User avatar
texmex
Member
 
Posts: 1614
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: MTS Editor

by texmex » Sun Dec 01, 2019 20:11

I was trying to compile on macOS but alas:
No ui driver can be detected. Install libsdl2-dev.

This is when running make with the sdl2 package installed, which is the one used for SDL development on macOS. Is it an issue of unset paths? I found some similar issue in a Rust project but I don't know how I would go about adapting it to a C environment. Halp!
 

bzt
Member
 
Posts: 26
Joined: Tue Sep 24, 2019 14:26

Re: MTS Editor

by bzt » Wed Dec 04, 2019 10:49

Hi @texmex,

Yes, it is probably a path issue. The Makefile gives that message when it's unable to locate the SDL header files. Under MacOSX, it is usually looks for /Library/Frameworks/SDL2.framework/Headers. Please download the latest commit, I've added support for user home libraries. If even that fails, then please open up a Terminal, issue the following command and let me know it's output: "find / -name SDL.h".

Cheers,
bzt
 

bzt
Member
 
Posts: 26
Joined: Tue Sep 24, 2019 14:26

Re: MTS Editor

by bzt » Wed Dec 04, 2019 11:09

It looks like this simple editor is not so simple any more (if we are looking at it's list of features :-) ). But it is still a single small executable (less than 256k).

The latest features:

1. not only the UI is translated, but the user can provide block name translations too (same format as the Minetest mods). I've provided quite a few translations (sorry about the quality, courtesy of Google Translate, but much better than nothing), see data/blocks_de.txt, blocks_ru.txt etc.
2. implemented brush feature. Now you can paint with sphere, dome, cylinder, cube, etc.
3. layer operations, you can insert or remove entire slices along each axis individually
4. flood fill, you can replace entire areas of the same block with another block type
5. redo / undo refactored and moved to a new source file to accomodate storing info on these new features
6. the Minetest mod part can now load and save MTS files easily using an intuitive tool, still without any dependency.

There's one feature that MTSEdit supports but which is not implemented in the Minetest Engine yet, biome specific names. With MTSEdit you can create schematics that does not contain "mcl_core:dirt" or "default:dirt" names directly, but instead "biome:node_filler" or "biome:node_top" for example. The purpose of this is to create structures that can be built-up in the world depending in which biome they are spawned. There's already a node name alias support in ME, so I'm hoping the developers will pick this up :-) It would be great, would allow houses made of sand in the desert and made of trees on the taiga using the same schematics.

Cheers,
bzt
 

User avatar
texmex
Member
 
Posts: 1614
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: MTS Editor

by texmex » Wed Dec 04, 2019 14:43

bzt wrote:Hi @texmex,

Yes, it is probably a path issue. The Makefile gives that message when it's unable to locate the SDL header files. Under MacOSX, it is usually looks for /Library/Frameworks/SDL2.framework/Headers. Please download the latest commit, I've added support for user home libraries. If even that fails, then please open up a Terminal, issue the following command and let me know it's output: "find / -name SDL.h".

Cheers,
bzt

Cheers, I’ll check it out!
 

warpnarget
New member
 
Posts: 8
Joined: Sat Oct 12, 2019 21:34
In-game: warpnarget

Re: MTS Editor

by warpnarget » Wed Dec 04, 2019 23:49

/usr/local/Cellar/sdl2/2.0.10/include/SDL2/SDL.h
/Library/Frameworks/SDL.framework/Versions/A/Headers/SDL.h
 

bzt
Member
 
Posts: 26
Joined: Tue Sep 24, 2019 14:26

Re: MTS Editor

by bzt » Thu Dec 05, 2019 00:40

warpnarget wrote:/usr/local/Cellar/sdl2/2.0.10/include/SDL2/SDL.h
/Library/Frameworks/SDL.framework/Versions/A/Headers/SDL.h

Thanks! Looks like the "Version/A" part was missing, and they have removed the version from the path since I last used Mac? Good to know. Makefile fixed.

Cheers,
bzt
 

warpnarget
New member
 
Posts: 8
Joined: Sat Oct 12, 2019 21:34
In-game: warpnarget

Re: MTS Editor

by warpnarget » Thu Dec 05, 2019 15:57

ld: warning: option -b is obsolete and being ignored
ld: file not found: binary
make: *** [icons.o] Error 1
 

User avatar
Peppy
Member
 
Posts: 35
Joined: Sun Nov 06, 2016 07:34
Location: France
IRC: Peppy
In-game: Peppy

Re: MTS Editor

by Peppy » Thu Dec 05, 2019 20:11

Hi bzt

Would you add node force placement support ?
(some trees schematics from MTG do use this to get rid of sapling)

Thanks a lot for this very nice tool !
 


Return to Minetest-related projects



Who is online

Users browsing this forum: Google [Bot] and 1 guest