Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - ab9rf

Pages: 1 [2] 3 4 ... 17
16
"equivalent padding", that sounds tricky. I would have thought hiding the steam stuff behind a pointer indirection would have been enough. But I did not really look what is this steam-specific data and how it is organized. I may be missing something.
While I can't speak for Putnam here, my take on that decision would be that it is the one that requires no changes at all outside of the single header file that defines the structure in question. Indirecting the Steam-specific data behind a pointer to another structure would necessitate adding code to allocate (and deallocate) that additional structure and to use indirections when accessing its content, which is therefore a more "involved" change than just adding an #else and some dummy variables to an #ifdef that is already there.

17
The notes for 50.05-alpha3 mentions that Itch.io and Classic support is scheduled to come with DF 50.06. Can you explain why?

My guess would be that Toady/Putnam (quite possibly the latter) has identified a layout solution that would make the layout of DF proper data the same in all versions, and move all vendor specific data to vendor specific locations outside of the space used by DF natively, but that's obviously just a guess.
No, it's that the DFHack team identified a structural issue with data layout. This was really evident to us almost immediately, the first time we analyzed an itch.io image, which would have around December 10 or so, well before Putnam was hired. Putnam subsequently confirmed our conclusion. The issue itself arises from some #ifdefs in the middle of the definition of gamest for data specific to mod management, which has extra functionality for Steam editions which requires extra data.

We could have accommodated this by either splitting the gamest up into two (or possibly three, I'd have to go look) chunks which would have to manually realigned (we locate the global variable game automatically off of the global table Toady provides, but that won't work as well if we have to chop up gamest into pieces), or else make two (or even three) different editions of DFHack for each release, one with a version of gamest that works with Steam editions and one that works with non-Steam editions. We obviously can do this, but doing it complicates our build process but more importantly makes using DFHack more difficult for end users, who would have to be careful to choose the correct edition of DFHack to install. The mechanism by which DFHack determines which version of DF it's been installed to run against would prevent catastrophic misoperation, as DFHack will detect that it is being run against a version of DF it is not compatible with and will shut down, but this would still be annoying for end users and is something we would like to avoid. DFHack is supposed to make DF easier to play, not harder.

When we discussed this issue with Putnam we found her agreeable to proposing a solution to Toady that would obviate the complexities that the above solutions entail. Our specific recommendation was to move the Steam-specific data elements to the end of the structure in question or to a separate structure, but Putnam instead elected to recommend replacing them with equivalent padding when the Steam configuration parameter is not set, which means gamest will have the same alignment on Steam and non-Steam builds. (This is probably because from our point of view gamest is one very large structure, while from Toady's point of view it is a compound of several smaller structures, one of which contains the mod-related stuff. Moving the Steam-specific data to the end of gamest as a whole would force a fairly complex restructuring of gamest from Toady's point of view, which is obviously not desirable.) The communications we have indicate that Toady is agreeable in principle to these proposals, but we have not (to date) received any definite confirmation that they will, in fact, be in the next release (which I personally attribute to simply the fact that Toady and Putnam both have a lot of stuff to deal with right now, and accommodating the DFHack team's requests is quite reasonably neither of their highest priorities). If they don't show up in the near future rest assured that we will implement a Plan B, and it is certainly not our intent to permanently leave itch.io and Classic players in the lurch, but we remain hopeful that Toady will remain agreeable to the solution that we worked out with Putnam and that the changes we jointly recommended, or some other equivalent solution to this problem, will find their way into a future release, which we also fervently hope will be the next release. At the same time, we recognize that making Dwarf Fortress more compatible with DFHack is not a development priority for Toady, and totally understand if Toady elects to defer, or even to decline, implementing such proposals in favor of advancing any other aspect of development that seems to him to be more fruitful.

18
A dwarf will never meet their grandfather in your fort if their grandfather is not in the fort.
How else are they supposed to know if their grandfather is in the fort?
You can do O(1) existence lookups, like say a hash table of creatures in the fort
Sure, why don't you get right on that.

19
A dwarf will never meet their grandfather in your fort if their grandfather is not in the fort.
How else are they supposed to know if their grandfather is in the fort?

20
No, because it would take forever, there are lower-hanging fruits, and the game does not run slow enough to do that.

Like... I am not terribly convinced that anyone who thinks this game runs unacceptably slow has ever played another game which is even mildly similar to this one in their life. Try playing Civilization IV sometimes, which is doing less simulation per tick and still takes multiple seconds. Or, hell, The Sims 3.
indeed, as harsh as I can often be with regard to the parts of this game that are not optimally coded, in reality most of the code is good. it's just that, well, it can always be better. and i've long been impressed by how robust dwarf fortress is.

21
In general, traffic priority doesn't help with FPS. When used for its intended purpose, it forces dwarves to take longer paths. Finding those paths would therefore require more pathfinding work.
it actually has very little impact on the amount of work done by the pathfinder

22
DF Dwarf Mode Discussion / Re: Steam: Labor
« on: January 12, 2023, 07:02:04 pm »
No, and the rest of the answers are basically just "it only accounts for raw skill". It takes the highest skilled available dwarf, basically.
and this is why labormanager will be updated for v50, since labormanager already does many of the things that people are wishing the default system used, and it would not be hard to add additional functionality after it gets updated

23
Tried. Game crashes due to the fact that two things tried to pathfind at the same time, which, yes, caused a crash. The problem is that most things that need to do pathfinding need to wait for the pathfinding, and if I'm using a mutex to control the pathfinder then you've suddenly got 8 threads all waiting on the pathfinder and... nothing changed at all.
I could have told you that, and I've never seen the source. The pathfinder stores the boundary data for A* in a statically allocated array, so two instances running at the same time will clobber each other's work. The pathfinder is not reentrant.

24
I can only assume that the pathfinder is called in different sections of the mainloop and in subcalls.

If it was as simple as
Code: [Select]
/* Main loop */

for unit in Units:
    target = unit.decideTarget()
    unit.findPathTo(target)

/* Continue main loop */
every time pathfinding was needed, then the theoretical speedup of a multithreaded for-loop would be O(N) since each thread would work on their own units only and not alter the world state save for their assigned units' paths.

If instead the pathfinder calls are sprinkled throughout the codebase, which given Toady's background is not unreasonable, then yeah, it would require a hellish rewrite of the code to get any worthwhile speedup. At the very least, the code will need to be restructured into a neat pipeline of stages.
There is a single instance of the pathfinder that uses a single, shared global structure to store the data required to implement the pathfinding algorithm. The code is not reentrant and cannot be called by two threads at the same time because they'd clobber each other's work on that shared singleton global structure. You'd just have to synchronize on entry to ensure that only one thread is using the pathfinder at a time, which defeats the whole point of multithreading.

This is the way it is with almost all the code in Dwarf Fortress. There are a tiny handful of places where small gains might be obtained by multithreading, but in actuality the overhead associated with synchronizing accesses that would need to be synchronized will completely obliterate any gains and might actually make the game slower. And the complexity of doing proper synchronization of multithreaded code means that the probability of bugs that cause either stochastic behavior or deadlocks goes way up.

There are lots of other ways to speed the code up that don't have these complexities (and I've had several fruitful discussions with Putnam about these ideas already) and it would make far more sense for Bay12 to pursue those rather than waste literally months of programmer time making the game capable of being multithreaded.

25
Utilities and 3rd Party Applications / Re: DFHack 0.47.05-r8
« on: January 05, 2023, 07:12:02 am »
Issues on GitHub are welcome too, although there is some risk of duplicating work there (we're trying to get PRs up for changes within a reasonable time, but it doesn't always happen)
we are definitely behind in merging structures updates, but this isn't really surprising given that (a) it's been holidays and (b) there is a lot going on right now

26
Utilities and 3rd Party Applications / Re: DFHack 0.47.05-r8
« on: December 30, 2022, 07:05:20 pm »
On the DFHack side of things, has there been (or are there any plans to) changes to the persistent storage stuff? Previously I was using that heavily, but I moved to mixing it with writing/reading a basic JSON file when the game was saved/loaded. Wondering if I should keep doing that or if I should go back to using the persistent storage, or if I should use a completely different system?
We implemented a persistence API some time ago (in DFHack 0.44.12-r3), using JSON written to a cosave file in the game folder.

27
Utilities and 3rd Party Applications / Re: DFHack 0.47.05-r8
« on: December 29, 2022, 11:58:28 pm »
Wow, you already have a build of DFHack going. Is v50 a bigger load of work to update DFHack for than previous major updates? Or is every major update about the same for DFHack?
This one is easily the most substantial amount of work to update for since the shift to 64-bit builds in 2015.

28
What is the name of this flag?
It's in Toady's "cheat sheet" as "game.external_flag". The DFHack team is treating this as an "ignored global" because it's within the larger "game" structure and we prefer to simply note its location as part of that larger structure so you won't find it in our symbols.xml as a separate entry, but of course I'm sure you know how to find Toady's handy-dandy list of globals and can get to it that way. According to what we've been told, setting the low bit of the byte at this address to 1 disables work policy processing entirely and leaves all labor management up to external tools.

29
Utilities and 3rd Party Applications / Re: DFHack 0.47.05-r8
« on: December 27, 2022, 06:17:30 pm »
OK, it looks like I'm stuck for the time being. DFHack doesn't seem to recognize the Classic version, which is what I'd intended to use until keyboard support has been restored (at which time I intend to buy it via Itch.io, not Steam, which may have a different layout from the 4 steam versions it seems to recognize, based on the stderr.log contents).
we have yet to analyze either the itch.io or classic executables yet, so we only have symbols.xml for steam releases. it's on the agenda, certainly, but i haven't done it in part because we know that a major structure (gamest) is larger in Steam than in classic (and probably also itch) because there's stuff in there for the steam workshop, and so we need to come up with a strategy for dealing with having a structure that is different between releases of the same version on the same platform, which we've never had to deal with before now. we discussed this a few days ago, but honestly i've been sick since christmas eve and haven't had the chance to process the discussion and turn the results of it into a working strategy

30
Utilities and 3rd Party Applications / Re: DFHack 0.47.05-r8
« on: December 27, 2022, 11:02:48 am »
@ab9rf: Thanks for your suggestion. I may well fail to understand things correctly, but I don't think the issue is designation of the version as "cmake ..\..\.. -G"Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" seems to insist on using the 2022 version, producing the following error message:

CMake Error: Could not create named generator Visual Studio 17 2022
Your cmake is too old. cmake versions prior to 3.21 do not know what VS 2022 is and thus cannot use it.

Pages: 1 [2] 3 4 ... 17