v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:Jifodus/Dwarf Fortress Utility Framework

From Dwarf Fortress Wiki
< User:Jifodus
Revision as of 09:09, 11 December 2007 by Jifodus (talk | contribs) (New page: I'm currently writing a framework for Dwarf Fortress utilities. The general idea is to use C++ interfaces in a cross-compiler fashion that is very easy to use. Please note, since this is ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

I'm currently writing a framework for Dwarf Fortress utilities. The general idea is to use C++ interfaces in a cross-compiler fashion that is very easy to use.

Please note, since this is still currently under development, I don't have the time to make a pretty WikiPage. I also will not post the interface & file format document for the same reason. Once there is a release, I will have a solid data format that will probably never change, as well as unchanging interfaces.

I'm scheduling the initial release date to be December 15, 2007. At that time, the following features will be in place:

  • Written in C++, using interfaces
  • Memory data
    • Stored in a Lua format
    • Stored in a CSV format
    • Stored in an XML format?
  • Sample utility for implementation reference: reimplementation of StartProfile
  • Library self-contained in DLL
  • API header & library
  • Cross-compiler portable
  • Complete source code

After the first release, and it's been thouroghly bug checked, the next release will have:

  • Auto-retrieve memory data off the internet
  • Auto-update framework code itself
  • Have an installer that will install the DLL and data file to a shared location, so multiple utilities can use the same library
  • Implement specific subsets of the std library; reduce utility size more, no large dependencies
    • std::string
    • std::vector
    • Console IO
    • File IO

And further down the road (through auto-update):

  • Easy to use GUI framework; for making tools with a nice GUI
  • Cross-process memory allocation

Expected Data Format/Requirements

Native/internal type strings:

  • string
  • vector
  • pointer
  • dword
  • word
  • byte
  • float
  • double
  • raw (array fixed-size array of bytes; size defined by the type)

Object Data Requirements

  • string
    • length : dword -- The length of the string
    • capacity : dword -- The capacity of the string
    • buffer : raw -- [Optional] The 16 byte string buffer embedded in the string object
    • buffer_ptr : pointer -- A pointer to the character data
  • vector
    • begin : pointer -- The start of the vector
    • end : pointer -- The end of the vector
    • last : pointer -- The just beyond the last possible item in the vector

Requirements For Data Files

Stuff between {} denotes a set of information

-- To format a new type
{
 type_name, -- [Required]
 size, -- [Optional], [Default: 0] In bytes
 -- Any number of members can be included into a type definition
 member = {
  type, -- [Required]
  offset, -- [Required]
  size, -- [Optional]
  subtypes = { -- [Optional], Used to specify the type the vector wraps
   array,
   of,
   more,
   types
  }, -- (end subtypes)
  fixed_size_array_count -- [Optional] [Default: 1]
 }, -- (end member)
 -- more?
}
-- To format a memory location
{
 pointer_name,
 type,
 address
}

So for example a string can be formatted like this:

{
 "string",
 28, -- 4 + 16 + 4 + 4
 "length" = { dword, 20 },
 "capacity" = { dword, 24 },
 "buffer" = { type = raw, offset = 4, fixed_size_array_count = 16 }
 "buffer_ptr" = { type = pointer, offset = 4 }
}

A pointer to the creature vector could be

{
 "main_creature_vec_location",
 { type = vector, subtypes = { creature } },
 "0x0141FA30"
}

Of course, this is just a basic idea of what the data files will need. The data will also have to at least include version information.

Anyway, a quick overview of the framework as it's supposed to be for the first release.