Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Phoebus Tileset Assembler - Can it be remade for other sets?  (Read 4591 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Phoebus Tileset Assembler - Can it be remade for other sets?
« on: December 20, 2017, 11:39:14 pm »

Hey guys,

The almighty Phoebus set has always included a "PhoebusTilesetAssembler.exe". A little tool that shows a preview of the tileset and lets you pick from different tiles. Those are then added to the tileset and the PNG is created for the player. That way people can pick the style they like best, out of several included versions.

I've never seen this in another tileset and was wondering if it would be possible to use it for other sets, or create a new, modern Tileset Assembler utility for people to use.

I can mod, and I can make pixel art, but I have no idea how I'd go about a project like this. Maybe someone here has an idea?
« Last Edit: August 02, 2018, 02:26:03 pm by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

AikonCWD

  • Bay Watcher
    • View Profile
Re: Phoebus Tileset Assambler - Can it be remade for other sets?
« Reply #1 on: December 21, 2017, 04:13:14 am »

Hi, I can pixel-art a bit, also Im a developer. Let me check what this tool does, maybe I can code something equal but generic for any tileset :D
Logged

Clément

  • Bay Watcher
    • View Profile
Re: Phoebus Tileset Assambler - Can it be remade for other sets?
« Reply #2 on: December 22, 2017, 05:51:25 am »

You only need to mix tilesets? No raw editing or other advanced stuff? That should not be too hard with a good drawing library. But I am more a C/C++ (and Qt when I need a GUI) dev, that would require different binaries (and big ones) for each platform. Not the best for distributing tilesets. It would be better to use java or mono to make a single portable executable. Although Phoebus program was written in C#, I cannot run it on Linux with mono.

Spoiler: Error report (click to show/hide)
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Phoebus Tileset Assambler - Can it be remade for other sets?
« Reply #3 on: December 22, 2017, 06:12:55 am »

Guess it was not updated for... well, ever, and doesn't work with the current DF anymore.

Well, it would need a UI, because I can't expect the average user to manage running a script. And pre-compiled, like an .exe, because people don't like installing stuff. ^^ That's the most important part.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Phoebus Tileset Assambler - Can it be remade for other sets?
« Reply #4 on: December 22, 2017, 10:51:43 am »

I could roll something up with SDL and Go. I can't guarantee Linux or OSX versions, but I can guarantee that the program itself would run on both systems if someone compiled it to do so.

I can use the existing tiled UI library I made for my building designer, so the whole thing will have a nice "DF" look.

Anyway, I'm kinda busy right now, but if I get some free time before anyone else gets something made I'll play with the idea for a while at least.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Aydjile

  • Bay Watcher
    • View Profile
Re: Phoebus Tileset Assambler - Can it be remade for other sets?
« Reply #5 on: July 25, 2018, 12:06:40 pm »

I would to see that. This assembler one of his biggest legacy of tileset customization. And it is gravely outdated to the point you can't use it with current Phoebus Tileset. Please make it happen.
Logged
Reality exists is only in our imagination.

Мой канал о жизни крепостей из Дварф Фортресс - https://www.youtube.com/user/Aydjile

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Phoebus Tileset Assambler - Can it be remade for other sets?
« Reply #6 on: August 02, 2018, 11:53:15 am »

Bump...
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Clément

  • Bay Watcher
    • View Profile
Re: Phoebus Tileset Assembler - Can it be remade for other sets?
« Reply #7 on: August 03, 2018, 01:38:02 pm »

Try this quick prototype (I hope I packaged it properly). tileset.xml defines how the tileset is built, previews.xml lets you add previews.
Logged

Taffer

  • Bay Watcher
    • View Profile
Re: Phoebus Tileset Assembler - Can it be remade for other sets?
« Reply #8 on: August 03, 2018, 09:38:30 pm »

Assembling (and disassembling) tilesets using ImageMagick. I've had this script in my repository for a while now, to automatically double my tilesets. Assembling tiles into a tileset is pretty simple with the montage command. Use the -tile argument to set the dimensions you want (not pixel size, but whether it's placing my 4 graphics tiles in a 4x1 grid or a 2x2 grid. In this case, -tile '4x1' specifies 4 columns, 1 row). The geometry flag is important: the '-geometry '1x1<'' flag says to only resize tiles that are smaller than 1x1 pixel (so don't resize anything), and this also eliminates the gap between tiles. If you don't pass a -geometry flag you'll end up with lines in between the tiles. Every tile has to be the same size this way, of course. Or just shrink things to your preferred size and make sure they're all larger than the minimum. See the help page for more detail.

You should also be able to use GraphicsMagick instead of ImageMagick, just prepend a 'gm' to all of the ImageMagick commands.

So your UI would display 01a.png, 01b.png, 01c.png, 01d.png as options, and clicking on 01c.png would copy it to 01.png in the working directory, overwriting anything there. Same for 02, 03, etc. Then the montage command combines 01.png, 02.png, 03.png, etc into your new tileset when you click "Assemble" or whatever.

You don't need to do it in shell, of course, as long as it can run ImageMagick or GraphicsMagick commands.
« Last Edit: August 04, 2018, 09:50:28 am by Taffer »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Phoebus Tileset Assembler - Can it be remade for other sets?
« Reply #9 on: August 05, 2018, 02:23:19 am »

Oh, Wow. Thanks guys :-)

I'll give those a spin once I have more than just my phone available.

Do they require any installation?  In the end they should be simple to run and "idiot-proof" as we say in German. There shouldn't be any way to misuse or break anything with the utility.

EDIT: Clement, I downloaded and tried it... my stupid tablet I have with me runs 32bit windows, which I assume is the reason the program won't start. ^^ I guess I'll have to wait till I'm back home in a month.
« Last Edit: August 05, 2018, 12:38:52 pm by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Phoebus Tileset Assembler - Can it be remade for other sets?
« Reply #10 on: August 05, 2018, 05:15:03 pm »

Probs. .sh typically refers to some kind of unix/linux shell (I guess (not sure) windows uses .bat?). ImageMagick itself is cross-platform, though you'll have to pick one of the alternate downloads for 32-bit.
« Last Edit: August 05, 2018, 05:17:10 pm by Fleeting Frames »
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Phoebus Tileset Assembler - Can it be remade for other sets?
« Reply #11 on: August 05, 2018, 10:31:04 pm »

Yeah it is a linux shell script, the "#!/usr/bin/bash" at the beginning gives it away. also that script isn't really made for assembling a tileset, it is more for doubling the size of one. It basically shows the basic steps needed to assemble a sheet, it isn't a ready to use product.

As for the GUI program idea I posted (much) earlier, I don't even have the stuff I need to compile those libraries any more, and I don't really have the time to do it anyway :(
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Clément

  • Bay Watcher
    • View Profile
Re: Phoebus Tileset Assembler - Can it be remade for other sets?
« Reply #12 on: August 10, 2018, 02:05:01 pm »

I made some improvements, then I wanted to try replicating Phoebus' assembler, and I needed more additions (it is more complex than I first thought). The configuration files got more complicated, but it should still be easy to use for the end-user (choose a few combo boxes and press "save").

Here is a Windows 32 bits example where I partially re-created Phoebus Tileset Assembler as an example. Source code is available here. Sorry, there is no documentation for now, I am not sure about the file formats yet.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Phoebus Tileset Assembler - Can it be remade for other sets?
« Reply #13 on: August 12, 2018, 01:08:46 pm »

Clément, I finally had time to test it. It's fantastic, anyone can alter it in the xmls and pngs. I can see a lot of ASCII sets using this; the same goes for TWBT menu tilesets. I might make a pack, mixing and merging a few options from the tileset repository on the wiki. :)

I can certainly find some use for it for the Meph Tileset (especially merging with Vordak), but if TWBT sets want to use this utility, it needs to load more than one base-file. It gets even more complicated, because the map-tileset and the menu-tileset don't necessarily have the same size. For example one is 32x32 and the other 12x24. I can fully understand if that last part is too difficult to handle, I don't think it's super important to allow alterations on the menu-tileset.

The easiest solution would be to add a tab at the top, allowing users to select which PNG they alter. I made a mock-up:
Spoiler (click to show/hide)

On that screenshot the first tab opens the menu/font.png, the second tab the Meph_32x32.png, the third tab the Items.png, the next one the constructions.png and the last one could be for creatures... of course that would mean files in raw/graphics, not data/art, but that's something else. ^^

Do you think you can add a tab to the top, which I can modify with the XML files? Essentially every tab would get it's own set of txts, preview files, and a subfolder in the assembler_data with different images.

To make matters worse, TWBT tilesets consist of 1-3 files each. The main.png with the sprites, the main-bg.png that determines which parts are transparent, and the main-top.png, which never change color. That allows tileset makers to have for example a sword that has a transparent area around the sword (so players can see the floor), while also changing color depending on material, but with a wooden handle, which will always be brown, regardless of material.

I packed you a few files to test/play with here: http://dffd.bay12games.com/file.php?id=13960 It's everything you need to change items from set A to set B.

Since the -bg and -top files are irrelevant for the players, I'd say we never show them to the user. One preview of the final product should be enough.

I already feel sorry for asking so much...


Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Clément

  • Bay Watcher
    • View Profile
Re: Phoebus Tileset Assembler - Can it be remade for other sets?
« Reply #14 on: August 12, 2018, 02:59:18 pm »

Don't worry about TWBT support, I saw it coming. I thought about it and it's mostly doing the same with multiple tilesets at once. I would need to de-hardcode the tileset size for creature graphics since they are not always 16×16.

I thought a way to group settings would be required for more complex assemblers. Tabs are okay but I was thinking to use them only on the left half (previews already have their tabs) and maybe vertical tabs would fit better.

Did you have a look at the configuration files (they are not XML in the last version)? Is the unicode-art okay for previews? Making them with ASCII only would need a CSV-like format containing the tile numbers (or ASCII characters when possible), that would be easier to type but less readable.



I'll try to explain the files. The main configuration file is "tileset-assembler.ini", it must be in the working directory. It is the only file with a fixed path, all the other can have whatever name you want.

tileset-assembler.ini use Qt's ini format. "title" sets the window title, it is only decorative. "output" is where to save the tileset, with multiple tilesets it would become a per tileset value.

The "tileset" section defines how to assemble the tileset. It requires the tile size and a list of layers. The layers are drawn in order may offer a choice. The ini part only references external text files describing the layers. The layer file begins with a tile list, only those tiles will be drawn in the tileset, this list is also used for highlighting the tiles in the previews. The next lines are all colon separated values (similar to DF raws/init but without the brackets). You can create one or more alternatives (the choices you can make from the GUI), the first parameter is the alternative name (displayed in the GUI). Each alternative can have several sources, the first parameter is the image file, the second is option and is the composition mode (see Qt doc, the name is the part after CompositionMode_, RasterOp modes are not accepted). Adding no source will simply draw nothing (useful for disabling a layer). You can specify a tile number (and optionally a source number) for the icon displayed in the combo box, if not specified the first tile in the first source is used.

Back to the ini, the "configuration" section gives the list of choices displayed in the GUI, this let you have a different configuration order from the drawing order. This will need to be extended for grouping settings in tabs.

"previews" section is the list of preview files and tab names. The preview files begin with the preview size and then optional keywords. "nocoloring" (used in tileset_preview.txt) change the drawing mode, the tiles are directly copied without coloring. "tiles" introduce the unicode tiles (I am using the unicode equivalent to CP437 as given here, except for 0, I use U+2400 ␀), it must be followed by a number of lines equal to the height given on the first line. "foreground" and "background" are similar but with hexadecimal digits for the colors. In the future I may add more sections like this for tileset source (for overrides/creatures support) and multiple layers (for showcasing TWBT transparency).

The last "colors" section are the colors you can change from the previews context menu. Palettes use DF colors.txt files, background and outline use Qt color names.



After writing this, I realize that unicode tiles won't work for creature tiles.
Logged
Pages: [1] 2