Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 98 99 [100] 101 102 ... 244

Author Topic: DFHack 50.14-r1.1  (Read 892810 times)

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1485 on: September 20, 2018, 11:02:25 am »

I use persistent tables extensively in my scripts. A single fort that runs for a couple years could have thousands of them.
I've run profiling in Fortbent before I stopped using your class system and doing this caused something like 20% of the CPU time during processing of the game in a later fort and by itself was dropping the FPS below 100 in the early game, so I wouldn't recommend this too much. In fact, that's why I stopped using your class system; the heavy use of persist-table was causing massive slowdown.
...
I am almost afraid to ask, but...how many persistent tables are getting used in your scripts, Rose?  And how often are you reading from them? 

I ask because I have a TLCM randomizer script that keeps track of what creatures have had their appearance randomized via persist-table, and in a developed fort it could have as many as 3000 entries (3-4 records for the majority of civilized creatures that have been active at some stage).  The persistent entries only get read once per save load cycle before a non-persistent table of checked creatures is filled, but those entries are still there, and now Putnam has me worried that I am unwittingly nuking a fort's late game FPS.

I probably would've stuck with roses stuff if I'd been able to get the JSON saving to reliably save with the game. I couldn't figure out a way to tell if quicksaving/autosaving was going on. The problem was more that every single table check was a persist-table check, IIRC.

If I recall correctly that was back when I loaded EVERYTHING into persistent tables instead of just what was needed/used. With Fortbent you had hundreds of classes (if I recall correctly) and I used to make a persistent table for each unit that was on the map and each units table would track all of the class tables. Now it only assings a unit table to units that need them, and the only information that gets added to the tables are the required information. For the Class System that means a unit that only ever switches between 3 classes will only have those 3 classes in their unit table, and I unit that never gets a class won't even have a unit table to begin with. I also changed the whole constantly doing persistent-table checks that it used to do.

This fixed a lot of the issues that used to be there. I'm sure there is still some slow down, but I haven't noticed anything too harsh, although it's been awhile since I played a fort to 100+ people. One thing I should work on is making the persistent-table stuff only used on save/reload and populating a normal non-persistent table with the information to be used while the game is running. Not sure how much work it would be to transfer what I have now to doing that, but it would make sure that you only get the overhead of calling persistent-tables at the start.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1486 on: September 20, 2018, 01:04:40 pm »

Wouldn't it be simpler to change the persist-table to use globals on further requests to the same table, as it suggests for performance in the comments?

EDIT: So, after spending hours going over code, I finally discovered why it's not possible (by default) to just pass "Esc" key in dwarfmode view: allow_options check in Screen.cpp (thanks for the hint, Putnam, couldn't have found it without seeing it possible in gui/overhaul) for that case in particular.

I'd cheerfully tagging that onto a screen, but I can only assume it is disabled by default for a reason. Any ideas why it's better to keep it off?

E2: Ah. Seems if it is on, options are shown even on non-dwarfmode.
« Last Edit: September 21, 2018, 07:58:59 am by Fleeting Frames »
Logged

taleden

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1487 on: September 22, 2018, 12:54:17 pm »

Is there a plugin or script, or could one be made, to alter the expanded furniture placement submenu (the one that shows each individual item available to place) so that the "Dist" could be toggled to show "Value" instead (or else "Value" added as a second column, the way the non-expanded list has both "Dist" and "Num")?

When furnishing noble rooms, the value of the item to be placed is much more relevant than the hauling distance. As it is I find I often have to keep going down the list hitting "v" to locate the particular items that I just had encrusted with the valuable gems, for example.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1488 on: September 22, 2018, 07:50:16 pm »

There isn't, but could be made. The distances are stored in df.global.ui_build_selector.choices, for what's it is worth.

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1489 on: September 23, 2018, 03:19:07 am »

could someone add some more options to the furniture planning mode?
there's min quality, but not max quality

for when i want to plan my dining hall all the way and not have my dorfs place masterwork or even artifact tables and thrones there.
same with regular dorfs rooms with bed etc. and the noble rooms and hospitals.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

zaporozhets

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1490 on: September 28, 2018, 04:36:13 pm »

Is anybody well-versed on constructions and materials?
I'm able to insert a lua created construction into df.world.constructions with a corresponding tiletype on the map, but it refuses to display a material and item type unless inserted onto an existing construction (e.g. a new wooden construction spawned on a stone wall displays correctly as an oak block fortification, whereas one spawned in the air is simply a "fortification").
Am I missing something obvious that links the map tile and the construction properties?
Would appreciate any help whatsoever.

Also, is there a gui element (with the onInput() method) or another means of receiving keypresses that doesn't require the game being paused like a framed screen does?
« Last Edit: September 28, 2018, 07:10:15 pm by zaporozhets »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1491 on: September 28, 2018, 07:34:09 pm »

could someone add some more options to the furniture planning mode?
there's min quality, but not max quality
This was done in https://github.com/DFHack/dfhack/pull/1284. I don't think that's part of a release yet. Maybe we should make another release.

Also, is there a gui element (with the onInput() method) or another means of receiving keypresses that doesn't require the game being paused like a framed screen does?
Nearly all screens will pause the game. You might be able to advance fortress mode by calling logic() on the dwarf mode screen, but there's usually a good reason for the game to be paused.

What are you doing, anyway? This sounds suspiciously like some kind of always-present UI element that you're trying to add with Lua. Lua isn't very well-suited for that (well, custom screens aren't suited for that, but they're basically the only way to do that in Lua). It's easy to break the game (e.g. by not handling the options/help/movies keys properly, or just leaving the screen around at inappropriate times). I would recommend writing a plugin if that's what you're trying to do, because you can modify existing screens in C++ (and can still write the rest in Lua, if you want).
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.

zaporozhets

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1492 on: September 28, 2018, 08:04:58 pm »

Nearly all screens will pause the game. You might be able to advance fortress mode by calling logic() on the dwarf mode screen, but there's usually a good reason for the game to be paused.

What are you doing, anyway? This sounds suspiciously like some kind of always-present UI element that you're trying to add with Lua. Lua isn't very well-suited for that (well, custom screens aren't suited for that, but they're basically the only way to do that in Lua). It's easy to break the game (e.g. by not handling the options/help/movies keys properly, or just leaving the screen around at inappropriate times). I would recommend writing a plugin if that's what you're trying to do, because you can modify existing screens in C++ (and can still write the rest in Lua, if you want).

I'm working on a construction-based boat for adventure mode, the UI element is just a workaround to receive input as I couldn't find any another way of getting it (my experience and ability being somewhat limited), I want the player to be able to control it in a semi-native fashion by using the arrow keys rather than with a menu or just reactions.

I didn't really want to post anything on the forums until I had something more substantial to show than this crude prototype, but here's an idea of what I'm trying to do:


I really hope I don't have to look into making a plugin and there's another method, I've no experience with C++ and only a little experience with Java and lua.
« Last Edit: September 28, 2018, 08:07:00 pm by zaporozhets »
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1493 on: September 28, 2018, 08:20:45 pm »

Huh, I thought that buildingplan was abandoned for further work. Is there a way to access/place buildings that link to it? (I looked into it when making constructmultiz, but couldn't find a way to get at it - at least, without modifying buildingplan, which seemed like a nonstarter.)

@zaporozhets: Yeah, it's doable - see putnam's abandoned Mouse overlay.

I've worked around some of the issues lethosor mentions in indicator_screen (the one mentioned in links in my could use an update from home copy, but planning to release multiple ~ready things at once), but three remain:

1) Many commands expect appropriate dwarmode screen on top. Not really a problem when they're in keybinds, but an issue when called directly from commandline.

2) Some plugins (automaterial, stockpile menus in particular, but not the buildingplan you're interested in) also expect that. Can be worked around with dummy layering, but have to do it for each such case.

3) TWBT doesn't allow for clicking on the menu side of dwarmode view for partial screens, and screens are placed according to text mode  dimensions (i.e. screwing with things with mouse clicks/hovers).


But there is another - no, rather even the primary - means of receiving keypresses: The default keybinding command.

Note that with that plugin, the default DF behaviour is called first, then the command linked. So I have stuff like S bound to copying stockpile links with track stops, with no screen to receive input or show anything.

(I'm trying to move away from it for compatibility and due later adds having priority, but it's incredibly useful).

However, it doesn't allow one to look at left/right/up/down keys. Though you could theoretically avoid both C and gui screen by, say, using engravings on tiles as letters.
« Last Edit: September 28, 2018, 08:24:22 pm by Fleeting Frames »
Logged

taleden

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1494 on: September 28, 2018, 08:29:33 pm »

could someone add some more options to the furniture planning mode?
there's min quality, but not max quality
This was done in https://github.com/DFHack/dfhack/pull/1284. I don't think that's part of a release yet. Maybe we should make another release.
I'm using DFHack 0.44.12-r1 from PESP 0.44.12-r03 and I see a "Max Quality" setting for building plan, which I've made good use of. But some other additions I'd find useful are a "Non-Decorated Only" (there's already Decorated Only, but sometimes I want to specifically avoid using that stuff), and/or even better, a way to set a minimum or maximum item value (i.e. to make sure the really good decorated stuff goes in the royal throne room, while the mediocre decorated stuff goes in the suite of the new baron who just inherited from some other site I don't care about).
Logged

taleden

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1495 on: September 28, 2018, 08:38:31 pm »

Is there any way with dfhack to forcibly cancel whatever job is associated with a specific item, and/or unflag that item as being part of a job?

Somehow I ended up with two minecarts floating in open space 1z above a ramp, flagged "TSK" so I can't get them moved or dumped somewhere else, but there is no job in the list that refers to them and forbidding/unforbidding doesn't un-TSK them.

edit: nevermind! I misunderstood what was going on; it was a couple of minecarts refusing to fall down into a space already containing other minecarts, and I didn't realize the lower ones would block the upper ones from falling, so the "TSK" actually indicated the item was "in flight". As soon as I bumped the upper ones sideways to interrupt their fall, the "TSK" went away and I was able to get them moved.
« Last Edit: September 28, 2018, 10:31:20 pm by taleden »
Logged

zaporozhets

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1496 on: September 28, 2018, 09:02:43 pm »

@Fleeting Frames
Thank you very much for this, gives me a lot to go off.
Logged

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1497 on: September 29, 2018, 03:33:12 am »

could someone add some more options to the furniture planning mode?
there's min quality, but not max quality
This was done in https://github.com/DFHack/dfhack/pull/1284. I don't think that's part of a release yet. Maybe we should make another release.
I'm using DFHack 0.44.12-r1 from PESP 0.44.12-r03 and I see a "Max Quality" setting for building plan, which I've made good use of. But some other additions I'd find useful are a "Non-Decorated Only" (there's already Decorated Only, but sometimes I want to specifically avoid using that stuff), and/or even better, a way to set a minimum or maximum item value (i.e. to make sure the really good decorated stuff goes in the royal throne room, while the mediocre decorated stuff goes in the suite of the new baron who just inherited from some other site I don't care about).
oh, thanks. i haven't played with 0.44.12-r1 any further after seeing that mousequery edge wouldn't work properly. it still doesn't as i read twbt and dfhack have been merged and it seems the one that had the fixed mousequery was dropped in that process.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1498 on: September 30, 2018, 06:39:50 pm »

Nearly all screens will pause the game. You might be able to advance fortress mode by calling logic() on the dwarf mode screen, but there's usually a good reason for the game to be paused.

What are you doing, anyway? This sounds suspiciously like some kind of always-present UI element that you're trying to add with Lua. Lua isn't very well-suited for that (well, custom screens aren't suited for that, but they're basically the only way to do that in Lua). It's easy to break the game (e.g. by not handling the options/help/movies keys properly, or just leaving the screen around at inappropriate times). I would recommend writing a plugin if that's what you're trying to do, because you can modify existing screens in C++ (and can still write the rest in Lua, if you want).

I'm working on a construction-based boat for adventure mode, the UI element is just a workaround to receive input as I couldn't find any another way of getting it (my experience and ability being somewhat limited), I want the player to be able to control it in a semi-native fashion by using the arrow keys rather than with a menu or just reactions.

I didn't really want to post anything on the forums until I had something more substantial to show than this crude prototype, but here's an idea of what I'm trying to do:
-snip-
I really hope I don't have to look into making a plugin and there's another method, I've no experience with C++ and only a little experience with Java and lua.
welp time to cross off boats and movable constructions off the personal todo list, I guess that means building a mobile house is possible now.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

taleden

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r1
« Reply #1499 on: October 01, 2018, 11:30:19 am »

Is it possible for a lua or ruby script to augment the in-game GUI on a specific screen or submenu? I just noticed that all the examples of this that I can think of (cage-butcher showing the "Bu" flag indicator in the cage's "q" menu, eggs-fertile showing the status in the nest's "q" and "t" menus) are plugins, not scripts.

I found a few scripts that detect the current screen or submenu (i.e. to read which unit is highlighted in the "u"nits screen or cage "q" occupants menu), but I can't find any examples of a script adding text to the screen in those contexts. So if it's possible to do this I'd love a pointer to an example!
Logged
Pages: 1 ... 98 99 [100] 101 102 ... 244