Dwarf Fortress

Dwarf Fortress

63 ratings
Topples' Layered Graphics Merge
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
109.601 KB
10 May @ 4:26pm
17 Jun @ 4:42am
2 Change Notes ( view )

Subscribe to download
Topples' Layered Graphics Merge

Description
REQUIRES DFHACK
This mod only works on mods formatted for it.

What does this do?
It allows multiple mods to edit layer graphics. Layered graphics are the more complicated graphics system that complicated creatures like dwarfs, humans, elves, goblins, and kobolds use.

Doesn’t the game already do this?
No. At best, only one mod’s graphics modification to a set of layered graphics will be shown. Currently it doesn’t seem possible to modify a creature’s graphics in vanilla unless you unload the entire vanilla creature graphics first.

What exactly can be done with this?
  • Small mods that might add only a few weapons or pieces of armor items with graphics is feasible unlike before. Many small mods like this can be used in a single world.
  • Supports adding new body part graphics, can also support mods that remove body parts in certain cases.
  • Support mods that add new graphics for syndromes.
  • Modifies default (as they appear in the world) and portrait graphics.
  • Modifies graphics for adults, children, and babies.
  • Easy for other modders to use.
  • A lot more; most things a modder would want to do graphics-wise.

How to use for standard players
  1. Subscribe to this mod.
  2. Get DFHack (It’s easy to use, really!)
  3. Load “Topples-graphics” as a mod when creating a world (in any order)
That’s it. This mod will detect mods that are trying to add more graphics and insert them automatically and do nothing when there are none.

How to use for modders
Basically you do as you would if you’re trying to create a graphics mod to replace a current creature’s layered graphics.
Let’s assume you are trying to add graphics for dwarf’s default (as they appear in the world) graphics.
  1. Copy the vanilla creature’s graphics file into you mod’s “graphics” folder.
    • this is “vanilla/vanilla_creatures_graphics/graphics/graphics_creature_dwarf.txt” (the vanilla creature file defines the default graphics for baby, child, and adults dwarfs)
    • this file can have the same name or a different name.
    • IMPORTANT! Copy the vanilla palettes files exactly how they are loaded in the “graphics_creature_dwarf.txt” file.
    • If you do not include this, it will crash on load.
    • If you do include this but in a different location than the default, it will crash when trying to load your modified graphics.
    • For our dwarf example, we copy into the “images” folder:
      • “dwarf/dwarf_body_palettes.png”
      • “dwarf/dwarf_clothes_palettes.png”
      • “dwarf/dwarf_hair_palettes.png”
    • Yes, you need to make a “dwarf” folder to place the palette pngs in.
  2. Add your new graphics where you want them in the file. Include new layer groups as you wish.
    • Give your added layers unique names.
      • Don't name yours "[LAYER:CLOTHING_HOOD" as that exists in vanilla.
      • Best Practice would be something like "[LAYER:TOPPLES_COOLMOD_CLOTHING_HOOD".
    • PLEASE DON’T INSERT [LAYER_GROUP] TAGS WITHIN VANILLA [LAYER_GROUP] TAGS!
      • It’s probably possible to handle for like, one mod but if many mods do it, it’ll cause chaos!
  3. Load your mod along with “Topples-graphics” (any order)
  4. Mod graphics will automatically be inserted where you placed them. Multiple mods that use this tool will automatically be loaded in this manner.

Mods that use Layer Graphics Merge
All mods that use this mod should all be able to be run together and have their graphics displayed.

  • FR_Encrust 2
  • Topples' Jewelry Graphics
  • Topples' Smoking

This modifies the games internal structures, doesn’t it? Might that make it crash?
It mostly utilizes that game’s existing functions for most steps. It will load modded graphics files as it does any file and then display the graphics using the existing game’s functionality. The only memory editing step involves placing individual graphics tokens in the correct spot. When the mod is unloaded or deactivated, it will clean up what it did and leave the default vanilla file untouched when going back the main menu. If the saved game that uses this graphics mod is reloaded, it will just perform the same modifications (and later on remove them when it is unloaded!)

Please note: As for any crash, if the game were to crash, it will not corrupt the game itself. Just reboot and all should be normal.

The mod might only break if the internal structures are changed. If this does happen, I will provide you a new script to replace in your mod folder to fix it for existing worlds (otherwise the mod will be updated and easily loaded for new worlds). I can’t say that internal changes to DF’s code will or will not happen. It does appear though that the layer graphics have reached “a sort of” maturity since Bay12 modified them to work for baby graphics in the later third of 2024.

As is, I’ve tested it for multiple uses cases, so it seems quite mature. I would be nice if others used it and report issues if they arise. If you aren’t yet convinced it’s crash-free. I would encourage you to try it for yourselves on simple worlds first, then you can use it in your long-term worlds if you like.

FAQ
Q: What if Dwarf fortress updates their graphics to add minor things like new hats? Would mods using outdated graphics be broken?
A: No (So long as the change doesn't restructure the entire graphics file). The scripts I use are made in such a way that it cumulatively regards changes to vanilla as extra modded graphics, so it will work with them in that fashion. It is a good idea to keep your mod up-to-date though since it your graphics might no longer be where you expect them to.

Q: Can I add graphics to total graphics conversion mods?
A: Yes, so long as they are using the modern Layer set graphics Systems introduced in late 2024.

Feedback
If you like what I do, you can donate to my Ko-fi[ko-fi.com]
15 Comments
Topples  [author] 30 Jul @ 3:24pm 
@frost.9
Yeah, I'll look at it.
frost.9 30 Jul @ 2:19pm 
Hey man, is it possible that the last DF updates somehow messed with this mod?

I'm working on a new mod with a bunch of custom weapons and everything was fine, but the wield graphics seems to have disappered after the last update and I can't figure that out.

Encrust 2 weapon graphics seems to stopped working properly too.

Could you check it out?
cruelfeline 13 Jul @ 11:21pm 
Ah, nevermind. I know what it is. The creatures graphics redux mod, I bet. Ah, darn. Oh well.
cruelfeline 13 Jul @ 10:59pm 
Hey,
Love this mod, really would like to use it, but it seems to somwtimes result in a graphical error when I embark. At least, I assume it's this mod because when I remove it, the error goes away.

The sprite looks like this:
https://drive.google.com/file/d/1f_40TrPqsm6Ro7tUAyyJ6Kc_SuGu6Rfk/view?usp=drivesdk

Box around the dwarf, letters in the upper left hand corner.

Is this clash with an incompatible mod? I do have some creature graphics installed, but I don't know enough to tell.
Topples  [author] 2 Jul @ 5:39am 
@상자
Thanks

@Thrice
I've included a list in the description

@frost.9
Great! Will check it out!
frost.9 28 Jun @ 3:14pm 
Man, that's awesome, it's really a game changer!

I just published a mod compatible with this - Fr_encrust 2

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3511239718
상자 27 Jun @ 9:09pm 
Genius
Thrice 27 Jun @ 8:05pm 
Is there a list of mods that are compatible with this?
Topples  [author] 17 Jun @ 4:56am 
Had to update the script after I found an issue when I was making my jewelry portrait graphics mod. Please use 1.0.2.
7isAnOddNumber 30 May @ 6:21pm 
Amazing utility. Thank you so much. Saved me so much headache.