DFHack / dfhack

Memory hacking library for Dwarf Fortress and a set of tools that use it
Other
1.87k stars 475 forks source link

Tab showing the last combat log on a dwarf menu #2520

Open rafaelkb opened 1 year ago

rafaelkb commented 1 year ago

we could have a tab showing the last combat log, a tab in the character window. It would be cleaned up each two or three days so we can save memory.

https://i.imgur.com/3A5nlXI.png

lethosor commented 1 year ago

One problem is that the DF report structure in v0.47 doesn't contain any reference to the triggering unit(s), so there would be no reliable way to associate reports with the units in question. Perhaps it has changed in v50, though.

It would be cleaned up each two or three days so we can save memory.

DF keeps a global list of reports, so we wouldn't need to manage it ourselves. It's a rolling buffer with a maximum of 3000 or 30000 reports (can't remember which), so if there is a lot of combat, it's possible that reports would get lost more quickly than 2-3 days (but if you only want to show the most recent, this should generally not be an issue).