Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 179 180 [181] 182 183 ... 185

Author Topic: Text Will Be Text - dfhack plugin  (Read 800566 times)

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2700 on: February 19, 2021, 06:10:35 pm »

Here's an update to this post back in 2018 july.

Nice!  Would you consider
  • Hosting the download at https://dffd.bay12games.com/ ?  It's dedicated hosting for DF, with no signup barriers and likely to outlast anything else the community uses  ;)
  • Are you interested in helping to port TwbT into the main DFHack repo?  With Mifki inactive, it would make maintainence and packaging a lot easier to have it all built and tested together.

Alas, I never got my registration confirmation for dffd (or mantis), so I can't. Otherwise would use it, yeah.

As for the second, haven't really looked into how precisely to do it for several reasons that ultimately boil down to no:

43.03 repo: Would take some time to figure out to have future compilation take more time and I dunno anybody who plays 4303 and would get new release either. Pain for no gain to anyone.

main repo: If speaking of the above version of TWBT, it'd be easier (but still an exercise) to lift the code for features, rewriting it in places, but it's still a fair bit of effort on top of the technical downsides as with previous. 

As the features as whole aren't 100% upsides either, especially with being about aesthetics, would probably have to add and test bunch of code for toggles. I'd also feel responsible to fix the known stability issues as well, tbh.

Still, I might do it if I would be actively using it and there was subsantial enough positive interest; it's not like these upload posts take 0 time either. Not sure, but I guess it could still take week+.

However as it is, though, already suffer enough from modder's curse. mikekchar inspired me a while ago to only code up stuff I'll personally actually proceed to use, as a way to limit the damnation. Not the worst ideas, I'd say, given my most popular DF creations have only been of use to handful of players.

lethosor

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2701 on: February 19, 2021, 06:52:46 pm »

Regarding GitHub status: Thurin and BenLubar are working on getting CI set up on Thurin's fork. This would allow automated builds to happen more easily. Research would still need to be done semi-manually for new DF versions, but this would make updates for new DFHack versions significantly faster (it's the same system as df-ai and weblegends, if anyone is familiar with those). As a slightly-longer-term option, we might move Thurin's fork into the DFHack organization, or some other similar option.

Fleeting Frames: is the source code with your changes publicly available (I might have missed a link)? The download appears to be just 64-bit Linux binaries for 0.43.03, which are useful for that specific version+platform but obviously aren't portable. I can't make any promises about help from my end, but if we do end up with a more-actively-maintained TWBT fork, it could be nice to have the ability to get some of those changes merged in as well (if you're okay with that).
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Manadras

  • Escaped Lunatic
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2702 on: February 20, 2021, 02:29:53 pm »

... Suddenly every time I pressed escape to exit menus, especially the Z menu, I get a black screen. The game is not frozen but the playing window turns pitch black. I can still see the rest of the game like the menu on the right, and the borders and such. And the game is running.

Same issue here, all the time. It doesn't happen if I set [PRINT_MODE:TWBT_LEGACY].

The black screen bug on the main map with TWBT when exiting some menus such as Status (z) or Stockpile settings (s) seems to have been around for years, especially when calculation FPS dips down to or below graphics FPS.

This is the autohotkey script I use to deal with it. It basically sends "F12" a short time after you press ESC (1/10 of a sec), which forces a redraw of the main window just after the game exits the menu.

;---begin code---

#UseHook
#MaxHotkeysPerInterval 200

~Esc::
sleep, 100
Send {F12}
return

;---end code---
« Last Edit: February 20, 2021, 02:40:27 pm by Manadras »
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2703 on: February 20, 2021, 06:52:12 pm »

Hm. That's interesting solution, though it doesn't seem like pressing F12 always works at 10 FPS. Could also use a keybinding command (if willing to change LEAVESCREEN key). Seems redraw_all 1 doesn't fix it, either. I've found entering/exiting a viewscreen layer again can fix it previously, however.

@lethosor: It is not. I'd have to decide about git one way or another (mainly dithering which name I'd want people to see it under), but that's (basically) why. There's neat xkcd comic about this :)
« Last Edit: February 20, 2021, 06:55:06 pm by Fleeting Frames »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2704 on: February 20, 2021, 08:08:59 pm »

From what I remember, GFPS actually can't drop below FPS, due to how they are synchronized (although the number displayed in the FPS counter is calculated differently and smoothed, so you might sometimes see cases where GFPS is 1 above FPS, for instance).

Anyway, it's good to know that low FPS could be a cause of this. I think a more robust fix would be to detect viewscreen changes with an onStateChange event handler (watching for SC_VIEWSCREEN_CHANGED), because it wouldn't require changing keybindings or using external utilities. Something like this might work, if I'm understanding the issue correctly (it assumes the issue occurs when switching back to the fortress mode screen):

Code: [Select]
dfhack.onStateChange.twbt_rerender = function(event)
    if event == SC_VIEWSCREEN_CHANGED and df.viewscreen_dwarfmodest:is_instance(dfhack.gui.getCurViewscreen()) then
        dfhack.timeout(5, 'frames', function()
            dfhack.screen.zoom(df.zoom_commands.zoom_resetgrid)
        end)
    end
end



@lethosor: It is not. I'd have to decide about git one way or another (mainly dithering which name I'd want people to see it under), but that's (basically) why. There's neat xkcd comic about this :)
I would honestly suggest making a fork of TWBT, then (if you haven't yet) making a new branch off of the right commit and applying your changes there. GitHub has decent support for working with changes from multiple forks, which would make it easier for it to be merged upstream eventually, if desired.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

treehugger

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2705 on: February 23, 2021, 09:35:21 am »

... Suddenly every time I pressed escape to exit menus, especially the Z menu, I get a black screen. The game is not frozen but the playing window turns pitch black. I can still see the rest of the game like the menu on the right, and the borders and such. And the game is running.

Same issue here, all the time. It doesn't happen if I set [PRINT_MODE:TWBT_LEGACY].

The black screen bug on the main map with TWBT when exiting some menus such as Status (z) or Stockpile settings (s) seems to have been around for years, especially when calculation FPS dips down to or below graphics FPS.

This is the autohotkey script I use to deal with it. It basically sends "F12" a short time after you press ESC (1/10 of a sec), which forces a redraw of the main window just after the game exits the menu.

;---begin code---

#UseHook
#MaxHotkeysPerInterval 200

~Esc::
sleep, 100
Send {F12}
return

;---end code---

Marvelous!! Thank you so much for this!
Logged

Rydel

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2706 on: March 22, 2021, 10:34:41 am »

Here are some examples of what you can do with Japas changes, just so you know the ingame effect it can have:

Spoiler: animated water (click to show/hide)
Spoiler: animated soap maker (click to show/hide)

Spoiler: varied bars/blocks (click to show/hide)

Suffice to say, I'd really love to see these additions being maintained for future updates. ;)
This is just wow. Didn't expect it to get this far :).

I'm getting back into the game and resuming work on my graphic set - is this animation feature in the current version of TWBT? If so, how do I use it? I think I see how to set up random tiles from Meph's set, but while he has the tiles for animation, it didn't look like he was using them.

jecowa

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2707 on: March 22, 2021, 05:00:54 pm »

MultiType is `A` for random animation or `S` for synchronized animation.

Examples from Meph Overrides.txt:

Quote
Current: West to East.
[OVERRIDE:55:T:RiverW:_MDF_overrides_9:S:16:240:241:242:243:244:245:246:247:248:249:250:251:252:253:254:255]
[OVERRIDE:55:T:RiverNW:_MDF_overrides_9:S:16:240:241:242:243:244:245:246:247:248:249:250:251:252:253:254:255]
[OVERRIDE:55:T:RiverRampW:_MDF_overrides_9:S:16:224:225:226:227:228:229:230:231:232:233:234:235:236:237:238:239]
[OVERRIDE:55:T:RiverRampNW:_MDF_overrides_9:S:16:224:225:226:227:228:229:230:231:232:233:234:235:236:237:238:239]

[OVERRIDE:55:T:MagmaFlow:_MDF_overrides_9:A:14:192:193:194:195:196:197:198:199:198:197:196:195:194:193]

There's more stuff for water and rivers in there if you checkout his overrides file.
Logged

Rydel

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2708 on: March 22, 2021, 08:15:43 pm »

Thanks a bunch!  Also, did we end up with a way to override the tiles in the map while generating a world or embarking?

jecowa

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2709 on: March 22, 2021, 11:42:30 pm »

No, the map tiles use the text (FONT) tiles when using TWBT. People have made tilesets for the map, but just to be used temporarily to take a screenshot.
Logged

Rydel

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2710 on: March 29, 2021, 07:03:25 pm »

Is there a way for an item to check for a CREATURE_MAT material without caring what king of creature it's from? I've tried CREATURE_MAT::WHATEVER and CREATURE_MAT:ANY:WHATEVER, but both give me "invalid material flag once the object comes on screen.

EDIT:
I attempted to override each part for each creature (so both regular and rotten eye, gut, stomach, heart, kidney, spleen, pancrea, muscle, liver, brain, lung, and gizzard, plus bone, skull, hair, hoof, horn, and shell for each of the games 750+ creatures, but unfortunately, TWBT throws an error for each creature/part combination that doesn't actually exist, so a simple spreadsheet formula isn't enough - I'd need a generator capable of actually parsing the raws. Also, either generating these errors or processing 21,000 overrides for a single tile creates noticeable lag, but the brute force method might be a no go.

EDIT EDIT:
I think I've made an override that works, but overriding every creature/part combination - it doesn't choke if their aren't a bunch of errors.  However:
1. This doesn't seem to work on Forbidden Beasts, Night Creatures, or other procedurally generated creatures. Is there a way to override their body parts?
2. This won't work on modded creatures unless the mod specifically has overrides added for it
3. This is a lot of work, so I'm hoping there is a simpler way
« Last Edit: April 02, 2021, 08:47:37 pm by Rydel »
Logged

Rydel

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2711 on: April 02, 2021, 09:03:32 pm »

Also,

Is there a way to override skulls? It doesn't accept TOTEMABLE as a tag
What's the best way to determine why an object is not being overridden? I have a few cases where the original graphic is showing up where I seem to have an override with the right tile, kind, ID, and type.

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2712 on: April 02, 2021, 11:12:43 pm »

Stock TWBT sadly doesn't overwrite sentient items: link, so skulls are excluded.

This is done because otherwise an unit that walks over corpse of their species will lose their graphics set tile in favour of their raw tile id.

jecowa

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2713 on: April 02, 2021, 11:50:39 pm »

Is there a way for an item to check for a CREATURE_MAT material without caring what king of creature it's from? I've tried CREATURE_MAT::WHATEVER and CREATURE_MAT:ANY:WHATEVER, but both give me "invalid material flag once the object comes on screen.

EDIT:
I attempted to override each part for each creature (so both regular and rotten eye, gut, stomach, heart, kidney, spleen, pancrea, muscle, liver, brain, lung, and gizzard, plus bone, skull, hair, hoof, horn, and shell for each of the games 750+ creatures, but unfortunately, TWBT throws an error for each creature/part combination that doesn't actually exist, so a simple spreadsheet formula isn't enough - I'd need a generator capable of actually parsing the raws. Also, either generating these errors or processing 21,000 overrides for a single tile creates noticeable lag, but the brute force method might be a no go.

EDIT EDIT:
I think I've made an override that works, but overriding every creature/part combination - it doesn't choke if their aren't a bunch of errors.  However:
1. This doesn't seem to work on Forbidden Beasts, Night Creatures, or other procedurally generated creatures. Is there a way to override their body parts?
2. This won't work on modded creatures unless the mod specifically has overrides added for it
3. This is a lot of work, so I'm hoping there is a simpler way

I don't know if you can override individual parts of creature remains. Meph tried to get a special icon for turtle shells, but it doesn't work.
Code: [Select]
[OVERRIDE:253:I:ANY:::_MDF_overrides_13:162:16:::CREATURE_MAT:POND_TURTLE:SHELL] I was messing with it earlier trying to get it to work, but the closest I came was making all vermin remains from every creature look like turtle shells.

I feel like something like
Code: [Select]
[OVERRIDE:253:I:CORPSEPIECE:CORPSEPIECE::_MDF_overrides_13:162:16:::CREATURE_MAT:POND_TURTLE:SHELL] bodyparts should work, but no.

I think TWBT has been patched so that "ANY" is specifically ignored. I'm not sure if it ever did anything.

Some creature parts can be overridden, though. It looks like you need to specify for each creature based on Meph's overrides.txt. Search for "lever" to find the relevant section. Meph might have already done all the work creating overrides for creature guts in there.

Also,

Is there a way to override skulls? It doesn't accept TOTEMABLE as a tag
What's the best way to determine why an object is not being overridden? I have a few cases where the original graphic is showing up where I seem to have an override with the right tile, kind, ID, and type.

Not seeing any clue of that in Meph.

The overrides instructions list special rules for BONE and SHELL, but I don't understand:

Quote
MatFlag is a material flag, or empty to match any material.

Stock TWBT sadly doesn't overwrite sentient items: link, so skulls are excluded.

This is done because otherwise an unit that walks over corpse of their species will lose their graphics set tile in favour of their raw tile id.

I don't understand why this is a problem more for skulls than other items. Same thing happens when creatures walk over vermin remains. I think the species doesn't matter as long as the raw id is the same.

What do I need to search for in the linked file to find the part that disables sentient items?
« Last Edit: April 03, 2021, 12:10:39 am by jecowa »
Logged

Rydel

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #2714 on: April 03, 2021, 07:01:38 am »

Unfortunately, ANY did not work.  I did implement it by running each each creature/CREATURE_MAT combination that exists in the game (with help from a list Rose posted earlier) - like what Meph did, but more extensive, as he only did domestic animals.  It gives errors with procedurally generated creatures, but I think that this is just if the creature generates without this part. Unfortunately, while not giving errors, they don't seem to actually change the graphics.  Despite having [OVERRIDE:253:I:CORPSEPIECE:CORPSEPIECE::corpse:R:7:140:141:142:143:144:145:155::::CREATURE_MAT:BIRD_EMU:BONE], my emu bones still use the generic corpse part image.

I have a line for pend turtle shells that doesn't throw an error, though my test fort didn't have any pond turtle shells to see if it actually works:
[OVERRIDE:253:I:CORPSEPIECE:CORPSEPIECE::corpse:136::::CREATURE_MAT:POND_TURTLE:SHELL]
Pages: 1 ... 179 180 [181] 182 183 ... 185