Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Making DFHack obsolete  (Read 911 times)

Panthera Leo

  • Bay Watcher
    • View Profile
Making DFHack obsolete
« on: February 19, 2011, 08:25:52 pm »

I wonder if Toady could be persuaded to create a interface (.so/.dll) for DF? I'm sure the functions for accessing the same thing in are in the code anyway... I'd think all that has to be done is to move them and the data structures to their own object, and compile it separately.

It should not make that much slower as every C/C++ function is a pointer anyway. The only difference is if the pointer is hard-coded in the executable or stored in memory at run-time, iirc. It would solve the memory mapping issues, I would think.

The idea being, while a step or three more complicated to compile (though not that hard, if the source code is properly maintained >.>) DFHack is effectively reinventing the wheel anyway. The built in functions already know where the data structures are and manipulate them. DFHack finds them the hard-way and does the exact same thing.

So, Toady One, what are the odds of you refracting those functions into a .h(pp) and (.so/.dll) file? Doing the same thing SDL does for you currently. (Though I think SDL is written in assembly from the start.)

It would allow programs like Runesmith or Dwarf Therapist to be updated in real-time. Beyond the first step of moving said functions to be publicly accessible (as DFHack makes them again away) and altering the 'make' file(s), I'm not sure it would change anything.

(Well, it would be nice to have documentation to go with it, but given that fact someone already pics apart your program byte by byte, I'm not sure that would be a issue.)
Logged

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Making DFHack obsolete
« Reply #1 on: February 19, 2011, 08:38:33 pm »

Green text doesn't summon Toady One to your thread, that's just for the Future of the Fortress thread.  It's very rare that he ever respond to suggestion threads at all anymore.

Also, you want limegreen, not just green.

Anyway, what you are talking about is making a backdoor into Toady's code to allow memory-accessing tools better access to the inner workings of the game's code.  This sort of proposal has come up several times in the past, and Toady has directly responded to this when it involved the talk about making a full third-party interface:

Spoiler (click to show/hide)

See this post for an awful lot more on it.

Yes, those are about interface, but the way that it was going to be done is the exact same thing.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Panthera Leo

  • Bay Watcher
    • View Profile
Re: Making DFHack obsolete
« Reply #2 on: February 19, 2011, 08:56:36 pm »

Anyway, what you are talking about is making a backdoor into Toady's code to allow memory-accessing tools better access to the inner workings of the game's code.

Has it now? :P Sorry to waste peoples time, Clearly I need to brush up on my 'Search-fu'. Thanks for the link. Also, thanks for the green info, but I think I'll leave it as is if only to make reading my rambling that much easier.

I wasn't thinking API, was just thinking making what is public as is. If they didn't like it, well they don't have to use it. Then again, I have twisted view of things. The only difference between what is and the suggestion is not everyone's willing to sift though the assembly. (IE, assembly/encryption is not secure in any way shape or form. It just adds to the work that needs to be done to do the same thing. The idea that is , pardon me being blunt, akin to a child's security blanket. It provides zero protection, it just makes one feel fuzzy and warm.) The suggestion expedite what already is.

Edit: That is the only way to secure information is to make it null or of no value once the assembly/encryption is understood. A program can't do that as it has to be plainly laid out for the machine, and assembly has no natural obsolescence. It can me distorted or erased, but in the end it still much be plainly visible at some point to the machine and that's all it takes.

Err, I'm just complaining now. Thanks for the info and link.
« Last Edit: February 19, 2011, 09:03:29 pm by Panthera Leo »
Logged

Artanis00

  • Bay Watcher
    • View Profile
Re: Making DFHack obsolete
« Reply #3 on: February 20, 2011, 07:00:32 am »

I wasn't thinking API, was just thinking making what is public as is.

Actually, that is an API, which can be read-only--or even write-only--just fine.
Logged
Git - fast, efficient, distributed version control system
Github - Free public repositories, issue tracking, wikis, downloads...

Panthera Leo

  • Bay Watcher
    • View Profile
Re: Making DFHack obsolete
« Reply #4 on: February 20, 2011, 08:15:54 pm »

I wasn't thinking API, was just thinking making what is public as is.

Actually, that is an API, which can be read-only--or even write-only--just fine.

Yes, but only by definition would it be a interface; However, what I had in mind barely qualifies in name only. A API is laid out in advances, documented, and some care is given to it. As much as my last few posts give the impression as a "whatever, 'it works', ship it" attitude, I'm a bit more snobbish then that. Normally, I'm of the view if you haven't given it the time to do it right, then you have not done the job at all.

Which is why I never call it a API, I wouldn't regard it as one. The original idea was the only difference between what's happening - and being condoned - now and the idea is on one side of the coin, it happens purely from what amounts to a (hex-editor/memory scanner) in pure assembly. The other is in a formal language I suspect to be C or C++. They both do and accomplish the same thing by the same means.

The only real difference being the time involved, and someone's preconceptions.

However, the question was asked and answered. I'm just clarifying the point.
« Last Edit: February 20, 2011, 08:18:35 pm by Panthera Leo »
Logged