Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 130 131 [132] 133 134 ... 184

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

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1965 on: May 21, 2016, 01:03:42 am »

Is there a guide to find render_map address?

As well as to find all other addresses https://github.com/mifki/df-twbt/blob/master/PATCHES.md

Thanks. Was lookin in the .cpp file (it contains half the instructions).
If anyone is interested the win 43.02 rendermap offset is:0xB1F140

What are you doing, if not a secret?
Mostly playing around.
At first i wanted to screenshot the map. But that needs image saving (and before that somehow forming the image). And i'm too lazy to do the opengl things you did.
Then i thought maybe i could do the multilevel render without patches (not sure i understand what they do). But got distracted.
Current thing i've done is a remote viewer + super simple http server mostly in lua. The best thing it does not move the players viewscreen. So you could have other players spying (and maybe issueing some orders?) to individual dwarves.
The code is in: code + offsets

Rogue Yun

  • Bay Watcher
  • Beware of the Carp
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1966 on: May 22, 2016, 06:44:41 pm »

A youtuber that I watch seems to be having trouble with what I think might be a problem with tile overrides.

https://www.youtube.com/watch?v=fDbuQ8CnGm0

I thought I'd post it here because that is the conclusion that I jumped to. He is a great youtuber and is one of the ones that got me through the learning curve so I wanna try to help him as best I can.
Logged

.:Simple Mood 16x16 ASCII:.
Keep it Simple. Keep it Safe.

Das123

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1967 on: May 22, 2016, 07:01:55 pm »

A youtuber that I watch seems to be having trouble with what I think might be a problem with tile overrides.

https://www.youtube.com/watch?v=fDbuQ8CnGm0

I thought I'd post it here because that is the conclusion that I jumped to. He is a great youtuber and is one of the ones that got me through the learning curve so I wanna try to help him as best I can.

Lol. Thanks Rogue Yun. (I'm DasTactic on YouTube) I was just coming in here to post some more info...

Since recording I've hunted it down to the tileset overrides and that the game doesn't redraw the screen for tiles with the same basic ID. I'm using SpaceFox but this actually applied for all tilesets with overrides. If you have an ID that has been overridden for one tile (for example the floor of a workshop) and then move the screen (through z-layers or the X and Y) and there is supposed to be a basic tile of the same ID (eg. rough stone floor) then the override will still be active and place the overriden workshop floor tile where the rough stone floor tile should be.

Also it seems to work either way for walls and bridges yet I couldn't find a wall override in override.txt, only a bridge override.

I tried the following:
Commenting out the overrides, and that works but then you don't get the nicer graphics.
Resizing the tileset to be the same dimension as the replacement tileset but that didn't fix it.
Changing the target tileset referenced but the issue remains.

In the end I just changed the floor of the workshops to a less contrasting tile override and while it looks OK it doesn't solve the issue.

Thanks

Das
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Text Will Be Text - dfhack plugin
« Reply #1968 on: May 22, 2016, 07:12:11 pm »

A youtuber that I watch seems to be having trouble with what I think might be a problem with tile overrides.

https://www.youtube.com/watch?v=fDbuQ8CnGm0

I thought I'd post it here because that is the conclusion that I jumped to. He is a great youtuber and is one of the ones that got me through the learning curve so I wanna try to help him as best I can.

Lol. Thanks Rogue Yun. (I'm DasTactic on YouTube) I was just coming in here to post some more info...

Since recording I've hunted it down to the tileset overrides and that the game doesn't redraw the screen for tiles with the same basic ID. I'm using SpaceFox but this actually applied for all tilesets with overrides. If you have an ID that has been overridden for one tile (for example the floor of a workshop) and then move the screen (through z-layers or the X and Y) and there is supposed to be a basic tile of the same ID (eg. rough stone floor) then the override will still be active and place the overriden workshop floor tile where the rough stone floor tile should be.

Also it seems to work either way for walls and bridges yet I couldn't find a wall override in override.txt, only a bridge override.

I tried the following:
Commenting out the overrides, and that works but then you don't get the nicer graphics.
Resizing the tileset to be the same dimension as the replacement tileset but that didn't fix it.
Changing the target tileset referenced but the issue remains.

In the end I just changed the floor of the workshops to a less contrasting tile override and while it looks OK it doesn't solve the issue.

Thanks

Das

There's a command
Code: [Select]
twbt redraw_all 0|1 that switches full screen redraws, does it help?

PS. I was watching one of let's play videos just the other day (which I don't usually do) and somehow it was yours haha.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1969 on: May 22, 2016, 07:43:33 pm »

Since recording I've hunted it down to the tileset overrides and that the game doesn't redraw the screen for tiles with the same basic ID.

You can use the command twbt redraw_all 1 to force tiles to be redrawn every frame, fixing this issue at some FPS cost.
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Text Will Be Text - dfhack plugin
« Reply #1970 on: May 22, 2016, 07:57:58 pm »

Since recording I've hunted it down to the tileset overrides and that the game doesn't redraw the screen for tiles with the same basic ID.

You can use the command twbt redraw_all 1 to force tiles to be redrawn every frame, fixing this issue at some FPS cost.

It shouldn't affect simulation FPS, I believe.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1971 on: May 22, 2016, 09:30:55 pm »

Any news on this? I would really like to address this at some point to stop TwbT from breaking so many other tools, and to avoid the need for the separate automaterial/mousequery/resume plugins. I may be able to help with this in a week or two, if you need help, but there's an example for at least one of the relevant hooks in plugins/devel/color-dfhack-text.cpp.

Hi mifki, I have a question about some of the sorcery behind rendering the screen.  When I use

Code: [Select]
dm = require('gui.dwarfmode')
size_x = dm.getPanelLayout().map.width
size_y = dm.getPanelLayout().map.height

in most modes, I get the size of map panel in tiles.  But in TWBT mode the width seems to be much wider than the actual display, but otherwise acting normally (i.e., the reported width is higher when the minimap is suppressed).  My wild guess is that the reported width is the panel's width in text tiles.

...

DFHack offers a way to hook into Gui::getDwarfmodeViewDims(), the C++ equivalent of getPanelLayout(). The problem here is twofold:
a) The Lua version calculates stuff itself, rather than calling the C++ function, which means it can't be hooked into.
b) TwbT doesn't actually hook into that function in the first place (it distributes a couple modified plugins instead)
I suspect that TwbT hooking in and making the Lua function delegate to the C++ function would solve the issue.

mifki: I'm kind of busy this week (hoping to get r1 done!), but feel free to stop by #dfhack or something and I can try to help with the hooks. As far as I remember, you'll only need to add a few functions to twbt.cpp, and that'll fix some issues with Lua scripts and eliminate the need to distribute automaterial/mousequery/resume. (There's an example in devel/color-dfhack-text.cpp if you want to play around with it - not sure if it provides an example of the getDwarfmodeViewDims() hook, but it should at least be similar.)
Hi, it's been a while, but I hope this hasn't been forgotten.

It appears to me that TWBT draws a map assuming the map tiles are sized like text tiles, which might be the root cause of the announcement-centering issue and the getPanelLayout() issue.  Drawing only the required tiles (rounding up) might help a smidge with FPS as well.  lethosor's idea might also eliminate the need for modified plugins, reducing your workload each release.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Text Will Be Text - dfhack plugin
« Reply #1972 on: May 22, 2016, 11:44:54 pm »

It appears to me that TWBT draws a map assuming the map tiles are sized like text tiles, which might be the root cause of the announcement-centering issue and the getPanelLayout() issue.  Drawing only the required tiles (rounding up) might help a smidge with FPS as well.  lethosor's idea might also eliminate the need for modified plugins, reducing your workload each release.

Not quite. TWBT just calls the DF map rendering function, and that function uses window size in text tiles (because, well, DF doesn't have "text" or "map" tiles, so that's just df.global.gps.dimx/dimy values). In order to render the correct map size and position, TWBT temporarily adjusts these values to be window size in map tiles, renders map, and changes them back.

But when the game centres on an announcement location, it, again, uses window size in text tiles, while the map size is different, resulting in wrong centring. Since it happens inside DF code, there's not much we can do.

However, in some cases, for example, when you press a key to zoon to a unit, I, again, intercept that key, temporarily adjust window size to be the map size, pass the key to DF, and change it back. But this requires handling all cases separately (where possible at all). So if it doesn't centre properly in some cases, maybe I just need to add code for those cases.

On the other hand, if we're talking about DFHack code and map centring done in DFHack code, if any, then yes, doing what lethosor suggests will help.

Das123

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1973 on: May 22, 2016, 11:57:27 pm »

There's a command
Code: [Select]
twbt redraw_all 0|1 that switches full screen redraws, does it help?

PS. I was watching one of let's play videos just the other day (which I don't usually do) and somehow it was yours haha.

Thanks Mifki and PerridexisErrant. That worked perfectly. :)
Logged

jecowa

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1974 on: May 30, 2016, 12:26:52 am »

It looks like there are some people experiencing crashes for unknown reasons. If all Dwarf Fortress players could fill out a questionnaire, what would be good questions to have on it in order to try and determine the conditions that cause a crash?

Here's a starting point:
  • Do you play Dwarf Fortress?
  • Does Dwarf Fortress ever crash while you are playing?
  • If so, how often does Dwarf Fortress crash?
  • If you get crashes, under which of these conditions does the game crash:
    • While launching the game?
    • In the middle of playing the game?
    • While exiting out of the game?
  • Have you happened to notice how much RAM Dwarf Fortress is usually using around the time that it crashes? If so, how much? (e.g. 400 MB, 1 GB, 1.6 GB, etc.)
  • What is the size of your Dwarf Fortress world? (pocket, small, medium, large, etc.)
  • What embark size do you use? (e.g. 5x5, 4x4, 3x3, 5x2, 1x1, 16x16, etc.)
  • What operating system are you using? (e.g. Windows, Linux, Mac, etc.)
  • Are you using the Lazy Newb Pack?
  • What version of Dwarf Fortress are you using?
  • Are you using DFHack? If so, what version of DFHack are you using?
  • Are you using TWBT? If so, what version of TWBT are you using?
  • If you are using DFHack, did you install it by yourself, or do are you using a DFHack that came preinstalled with the Lazy Newb Pack?
  • If you are using TWBT, do you have multilevel rendering enabled? (i.e. The feature that lets you see more Z-levels at once.)
  • What graphics pack and/or tileset are you using?
  • Did you install the graphics pack / tileset yourself, or did you use the Lazy Newb Pack?
  • Are you using any other mods with TWBT? If so, what are they?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1975 on: May 30, 2016, 04:10:03 pm »

DF/DFHack/TWBT version and active TWBT features are really the most helpful. Maybe OS and memory usage too, to rule out out-of-memory crashes, but LNP usage probably doesn't affect it at all. (Also, "which LNP" would be a better question in any case, since there are multiple separately-maintained packs, although regardless of that, the TWBT features in use are more relevant.)
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.

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1976 on: May 31, 2016, 04:07:02 am »

i haven't had the time (and muse) to look into it again,
but when i set multilevel 0, it seemed to get rid of the "graphic artifacts" with fake workshop tiles and walls when moving the screen.
i'll test it some more and maybe that solves many crashes aswell.
my next suspect or causing crashes is the mousequery (aka "mouse controls") DFHack-Plugin, but without mouse i wouldn't play the game.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Text Will Be Text - dfhack plugin
« Reply #1977 on: May 31, 2016, 04:21:44 am »

i haven't had the time (and muse) to look into it again,
but when i set multilevel 0, it seemed to get rid of the "graphic artifacts" with fake workshop tiles and walls when moving the screen.
i'll test it some more and maybe that solves many crashes aswell.
my next suspect or causing crashes is the mousequery (aka "mouse controls") DFHack-Plugin, but without mouse i wouldn't play the game.

Code: [Select]
twbt redraw_all 0|1
should fix artefacts when moving screen

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1978 on: June 01, 2016, 07:12:25 am »

Code: [Select]
twbt redraw_all 0|1
should fix artefacts when moving screen
thanks, i'll add it.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

utkonos

  • Bay Watcher
  • Sleepy dwarf
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #1979 on: June 05, 2016, 03:43:20 am »

Hi there again!
Have posted this problem a while ago, but looks like it's still here:

Humanoid (animal persons, dwarfs, humans etc) corpse overrides doesn't work in DF 0.42.06. Other corpses override fine. Problem exists at least from 0.42.05, but everything worked fine in 0.40.24. Tested it on mine Set, SpaceFox and GemSet using manual installation and LNP. These overrides didn't change since 0.40.24.

PS: removing [APPLY_CREATURE_VARIATION:ANIMAL_PERSON] from animal person "fixes" the problem.
Pages: 1 ... 130 131 [132] 133 134 ... 184