OpenNoteBlockStudio icon indicating copy to clipboard operation
OpenNoteBlockStudio copied to clipboard

Allow integration with custom export format options

Open 4321ba opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. Not really, it's more like an idea. Related: https://github.com/OpenNBS/OpenNoteBlockStudio/projects/1

Describe the enhancement you'd like So I had the idea that what if instead of you walking along the redstone track, the redstone line "came back" to you. I implemented it in python, and it looks pretty cool, though it is kinda big and slow.

Additional context Here is my code: https://github.com/4321ba/Galaxy_Jukebox So I am very close to being done with it, but I still need some features (custom instrument and sign with nbt (block entity) are the bigger ones) I really want to do, however university just started so it may be long until I have some time to finish it. (I'll also want to make a video about it.)

I would like to ask if you're interested in incorporating it into ONBS (maybe for a future version, I read somewhere that that'd use python), but if you don't want to include it, it would still be a good resource for your upcoming schematic rewrite (e.g. my script in python that outputs Sponge schematic files may help).

If you do include it, I could make bugfixes for it for the forseeable future :D.

I wouldn't mean this as a replacement for the original design, as they are very different, and this is not a clear win.

this design has some fundamental advantages and drawbacks: + you don't need to move + supports 20 tps (and every other tps) (with the scaffolding thing) + you can actually see the noteblocks that play (and there are also redstone lamps) + looks like a colorful galaxy, pretty cool + sand doesn't fall (there's always a redstone lamp under the block anyway XD) - pretty huge compared to the current design - very slow, on a 4th gen i5 desktop I need sodium+lithium optimization mods for middle-to-large pieces to even keep a playable state (<50ms or 60fps) - you need quite high render distances, so that all the redstone is loaded - most probably it doesn't work properly for pocket edition (e.g. idk if 1 gametick delay is possible there), though maybe it could be made compatible (with 10tps for sure)

also, it works well for 1.14+, but it doesn't for 1.13 and below (if there's enough demand, I could probably do it)

In the meantime here is my test world (1.17) with looots of pieces I exported with it (though they aren't titled, they are from Wynncraft and from Megido: Abyss).

here are some screenshots of royal colosseum by Ben e.g.: the noteblocks are ordered by instrument and pitch, and the "jukebox" can have 1,2,3 sides based on how big the song is (it has 2 here, there's one corner): 2022-02-17_19 49 22 2022-02-17_19 49 30 2022-02-17_19 49 47

4321ba avatar Feb 17 '22 19:02 4321ba

Holy cow, this looks insane!! I'm all for alternate schematic layouts, spiraling outwards is a great idea and a nice change from the default layout. I think it wouldn't hurt to provide it as an option once Python is embedded into the program - and yes, I'm still working on it.

As the current classic and branch schematics will also be rewritten in Python, we might create some sort of wrapper around nbtlib and pynbs to make it easier to create schematic templates, and then it will be quite simple to extend that format with your version. Eventually, I'd like to make export formats extensible with plugins (Python will make that much easier as it won't require recompiling the code every time you change something), but that's something for the future.

also, it works well for 1.14+, but it doesn't for 1.13 and below (if there's enough demand, I could probably do it)

The tooling for exporting to these formats is totally different from 1.13 (and quite outdated), so it's likely we'll drop support to those versions once the schematic export is rewritten. This is, of course, subject to change, but don't worry too much about it :)

very slow

I see you're using redstone lamps in sync with the song. Lighting updates tend to be very performance-heavy, so removing those could help a bit. (Perhaps you could make it optional by passing a bool to the export function?)

you need quite high render distances, so that all the redstone is loaded

The way I see it, it would likely be a format aimed at enthusiasts, just like the Japanese rittai onkyou's that branch schematics are based on. Of course it doesn't hurt to make it more accessible to the "general public", but sometimes it's a trade-off you just have to live with, haha.

pretty huge compared to the current design

That's its charm :) and as it won't replace the classic schematic layout, it's no big deal. Though if you'd like to make it more compact, perhaps you could use more vertical space, making the song "wrap" back inwards on the second half?

All in all, I really like the idea! It's quite unique and looks awesome, if a bit impractical for larger songs. Although it may take a while to integrate it fully with the program, I'm up for it if you plan to maintain it in the longer term.

Thanks again for your effort in creating the tool and proposing this change. Feel free to join our Discord if you'd like to discuss nbs development more closely!

Bentroen avatar Feb 17 '22 20:02 Bentroen

Thanks a lot! I've never actually tried the branch schematic version, though, trying it now, it looks like it needs some manual tweaking to export the full song

we might create some sort of wrapper around nbtlib and pynbs to make it easier to create schematic templates

that and the plugins sound like a pretty cool idea!

it's likely we'll drop support to those versions once the schematic export is rewritten

yeah I also think that's the better decision, the few people who need old versions can always just use an olden OBNS version

I see you're using redstone lamps in sync with the song. Lighting updates tend to be very performance-heavy, so removing those could help a bit. (Perhaps you could make it optional by passing a bool to the export function?)

yeah, I'll definitely add that as an option, it will probably help a bit, but just the amount of redstone updates is huge

you could use more vertical space, making the song "wrap" back inwards on the second half?

yeah, I was also thinking about that, but right now I don't think it's worth the extra complexity, even the largest pieces fit into the render distance of 32 (its like squared, so going up 1 render distance means bigger and bigger areas as the render distance goes up), and it was quite hard to make the lines able to turn at all XD and somehow its rare that the lines go more than 2-3 full circles around heres Countdown to Corruption e.g.: 2022-02-19_16 22 15

Although it may take a while to integrate it fully with the program, I'm up for it if you plan to maintain it in the longer term.

sounds awesome! I'll tell when I'm done with everything I still want to do, and then feel free to ping me (here or discord too, I joined there :D, my name is 1234ab) if/when it's time to integrate it

4321ba avatar Feb 19 '22 15:02 4321ba

Hi again! I worked on the project a bit (nothing major, but e.g. you can now opt out of the redstone lamps), and now consider it finished. I uploaded it to pip/PyPI, and also created a GUI for it for the time being, that is also on pypi (but I also made simple double-click-executable versions). I separated the gui and the converter, because that way it may be easier to integrate the converter into onbs, without it pulling in e.g. pyqt as a dependency.

The conversion can now be very easily done by installing the package from pypi, and calling a function.

Sadly I can't use GameMaker, so in case you decide that it would be worth it to include this in onbs, my guess would be that the biggest work is creating the gui for the exporter; however if I can help somehow, let me know! Afaik new ONBS versions now bundle python for the mp3 export? (and nbswave works quite similarly, with it being on pypi and calling a conversion function)

As the current classic and branch schematics will also be rewritten in Python, we might create some sort of wrapper around nbtlib and pynbs to make it easier to create schematic templates

Also, now there is a library called mcschematic, which makes it easier to export schematics from python (it uses nbtlib as well, but you can just call setblock)

I also made a short and a long YouTube video showing it in action.

4321ba avatar Feb 12 '23 15:02 4321ba