Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: The direction of the Interface  (Read 7147 times)

lucusLoC

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #15 on: December 16, 2009, 02:21:33 pm »

i think you misunderstand my point. the reason we have memory hack tools like DC (or whatever the currently working tool is called) is because DF does not actually have the ability to do those functions. there is no way to manage dorfs en mass, and in order to expose that functionality in a script format the game has to be capable of doing it in the first place.

and "my way" is less breakable than "your way" simply by the virtue that "my way" is editable by whoever has the template. "your way" requires that the author update the tools before they gain functionality again. also "my way" does not exclude 3rd party tools, it just makes them explicitly unsupported. for example, you could have a utility that edits a construction and then spits out an appropriate text file that df could read.

other things that could be "rawified" to an editable save format:

work profiles
trade agreements
embark profiles
stockpile settings
squad rotations and equipment settings
job manager queues (would dovetail nicely with the building template, build all the doors/tables/chairs you need for that dining hall with one command!)

and some from future suggested items:
immigration manger requests (especially useful with the save embark profile)
custom automatic alert profiles



some of these would even be easy to have a simple "save" button in game.

the thing is these are all things that the interface does not yet support (well, most of them anyway, and none of them have an editable save that i am aware of). and the interface would need to support them anyway if we are going to make them available to a scripting language of some sort.

in short, when you get down to it you are asking for a parallel input interface for functions separate from the game interface so that you can change the style they are presented in with a 3rd party utility (ok, that was not so short). that utility may be more streamlined and intuitive. but those functions have not been written yet, and the need to be before we can even think about having a script for them. otherwise all you have is a glorified key press macro utility.   

Spoiler (click to show/hide)

Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz

Andir

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #16 on: December 17, 2009, 01:36:11 pm »

I'm not sure I understand how your way and his way differ at all... both of them require an interface to read the command line or the file.  If there was a CLI, could I open up your AI/Template file and paste a line from it into the game and have it interpreted?

If so, why not have a CLI (a single line to enter commands) that you can save to a template file...

Logged
"Having faith" that the bridge will not fall, implies that the bridge itself isn't that trustworthy. It's not that different from "I pray that the bridge will hold my weight."

lucusLoC

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #17 on: December 17, 2009, 03:42:40 pm »

the issue is one of form vs. function. if a script is to exist in game, the function for that script needs to exist in game ( i cannot assign "work profile x" to 10 dorfs if the games does not know how to assign a work profile). if the function exists it will need to be able to be accessed by the standard interface.

storing the function itself in a script is a bad way of doing it, in my opinion, since that makes it almost impossible to maintain. any change to the code will likely invalidate the function.

if you have the function contained internally and only have it access saved files of a standard format then it is much easier to prevent those files from becoming obsolete, since all you have to do is modify the parser to map to the new internal structure.

lets look at the above example example. i want to assign work profile x to some dorfs. with the scripting method i would call a script that would iterate through all the jobs for a dorf and change them to an appropriate setting. if i wanted to do 2 dorfs i would modify the script to select the first dorf, change all the settings then select the second and change all those settings. that would be a separate script.

now in all likelihood scripts would be generated on the fly by 3rd party applications, and all you would do is enter parameters and maybe load up presets.

but the whole concept of "work profile x" is stored and implemented in the script itself, the game has no idea what a saved profile is, all it know are that certain dorf have certain jobs enabled and how they got that way is a mystery.

if a command is depreciated it is likely that the entire script will be invalid, and consequently any app that builds those scripts.

if, however, the concept of a saved work profile was internal to the game, with its own function and structure, and its own save format, then it would be far more resistant to changes and those changes would have a known effect and be taken into account. that functionality could still be opened up to an API of some sort, but it would be a much simpler and shorter call.

you could argue that this puts all the work load on toady, but i would argue that it actually saves him work in the long run because he does not need to maintain a second interface to the game.
Logged
Quantum dumps are proof of "memory" being a perfectly normal dimension in DF. ~Gazz

ggeezz

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #18 on: December 18, 2009, 08:31:01 am »

i think you misunderstand my point. the reason we have memory hack tools like DC (or whatever the currently working tool is called) is because DF does not actually have the ability to do those functions. there is no way to manage dorfs en mass, and in order to expose that functionality in a script format the game has to be capable of doing it in the first place.

Toady wouldn't need to write functions to manage dwarfs en mass.  You only have to be able to change 1 job for 1 dwarf (which is already supported), then a tool can change all jobs for all dwarfs by repeating the 1 function as many times as necessary.

In general, Toady would only have to create the atomic functions, and then tools would create series of function calls that produce complex changes.

and "my way" is less breakable than "your way" simply by the virtue that "my way" is editable by whoever has the template. "your way" requires that the author update the tools before they gain functionality again. also "my way" does not exclude 3rd party tools, it just makes them explicitly unsupported. for example, you could have a utility that edits a construction and then spits out an appropriate text file that df could read.

That's not necessarily so.  One way to design a third party tool for such an interface (perhaps the best way) would be to read all codes from a configuration file.  Some of the third party tools already work in a similar fashion by reading memory offsets from a config.  This way a user would be able to update their own copy.  Or better yet the first person that updates it can share the configuration with everyone.
Logged

Andir

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #19 on: December 18, 2009, 08:41:53 am »

you could argue that this puts all the work load on toady, but i would argue that it actually saves him work in the long run because he does not need to maintain a second interface to the game.
You lost me because there's still an interface... the interface to run your scripts and the interface to give them access to the values they can change.  They have to have access to certain parts of his app.  The mere idea that an external script can modify internal variables without memory hacking or exposing those variables into an interface just doesn't fly.  Toady would still have to load in said scripts, hand them an object with all the variable accessors to let the script change those values.  No programming language that I'm aware of will let a script modify any value it sees fit, with the exception of javascript, actionscript, and a few others... but those aren't fast enough to process the amount of data Toady is and one could argue that they aren't languages, but script. They also aren't as "source secure" as the current method.
Logged
"Having faith" that the bridge will not fall, implies that the bridge itself isn't that trustworthy. It's not that different from "I pray that the bridge will hold my weight."

Grax

  • Bay Watcher
  • The Only.
    • View Profile
Re: The direction of the Interface
« Reply #20 on: December 18, 2009, 10:16:37 am »



Interface is great at all, nothing needed to be changed now. Maybe in far future versions, but not now.
Logged
Finis sanctificat media.

ggeezz

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #21 on: December 18, 2009, 10:24:23 am »

you could argue that this puts all the work load on toady, but i would argue that it actually saves him work in the long run because he does not need to maintain a second interface to the game.
You lost me because there's still an interface... the interface to run your scripts and the interface to give them access to the values they can change.  They have to have access to certain parts of his app.  The mere idea that an external script can modify internal variables without memory hacking or exposing those variables into an interface just doesn't fly.  Toady would still have to load in said scripts, hand them an object with all the variable accessors to let the script change those values.  No programming language that I'm aware of will let a script modify any value it sees fit, with the exception of javascript, actionscript, and a few others... but those aren't fast enough to process the amount of data Toady is and one could argue that they aren't languages, but script. They also aren't as "source secure" as the current method.

What I'm saying is that a 3rd party tool could create functionality that Toady doesn't write by building on atomic functions.

Right now, you can change 1 profession for 1 dwarf at a time.  That's atomic.  It can't be broken down any further.  You can also view the professions active for any dwarf.  Toady has written the game to allow this, but there's no programmatic interface for these same functions.

If there were a 3rd party tool could query the interface, show you a form and then perform 100 commands in the game to make your changes.

So Toady doesn't have to write an interface or functions to allow you to change multiple professions for multiple dwarves.  He only has to write the basic functions (Query all dwarves and Edit a single dwarf) and those can be combined to do anything.
« Last Edit: December 18, 2009, 10:27:03 am by ggeezz »
Logged

Andir

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #22 on: December 18, 2009, 03:49:40 pm »

you could argue that this puts all the work load on toady, but i would argue that it actually saves him work in the long run because he does not need to maintain a second interface to the game.
You lost me because there's still an interface... the interface to run your scripts and the interface to give them access to the values they can change.  They have to have access to certain parts of his app.  The mere idea that an external script can modify internal variables without memory hacking or exposing those variables into an interface just doesn't fly.  Toady would still have to load in said scripts, hand them an object with all the variable accessors to let the script change those values.  No programming language that I'm aware of will let a script modify any value it sees fit, with the exception of javascript, actionscript, and a few others... but those aren't fast enough to process the amount of data Toady is and one could argue that they aren't languages, but script. They also aren't as "source secure" as the current method.

What I'm saying is that a 3rd party tool could create functionality that Toady doesn't write by building on atomic functions.

Right now, you can change 1 profession for 1 dwarf at a time.  That's atomic.  It can't be broken down any further.  You can also view the professions active for any dwarf.  Toady has written the game to allow this, but there's no programmatic interface for these same functions.

If there were a 3rd party tool could query the interface, show you a form and then perform 100 commands in the game to make your changes.

So Toady doesn't have to write an interface or functions to allow you to change multiple professions for multiple dwarves.  He only has to write the basic functions (Query all dwarves and Edit a single dwarf) and those can be combined to do anything.
What you are describing is nothing more than:

> GET_CREATURE
Cat1, Cat2 (all creatures)
> GET_CREATURE Dwarf
Dwarf1, Dwarf2, Dwarf3, etc. (all creates of dwarf)
> GET_CREATURE 5, 60, 50
Dwarf12, Cat3 (all creatures at x, y, z)
> GET_PROFESSION
Cook, Farmer, etc.  (all professions)
> GET_PROFESSION Dwarf12
Miner, Farmer, etc. (all Dwarf12's professions)
> ASSIGN_PROFESSION Dwarf12 Miner
Dwarf12 is already Miner
> REMOVE_PROFESSION Dwarf12 Farmer
Success
> GET_CREATURE_INFO Dwarf12
Dwarf12: Urist McMuffin
Location: (5, 60, 50)
Professions: Miner, Cleaner, Transport_Stone
...etc.

Which can be done in a CLI as well... where's the difference?

[Disclaimer: I used arbitrary commands for example only...]
Logged
"Having faith" that the bridge will not fall, implies that the bridge itself isn't that trustworthy. It's not that different from "I pray that the bridge will hold my weight."

ggeezz

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #23 on: December 20, 2009, 11:31:41 am »

It could be done in a CLI, but it seems to me that would be rather slow if you were changing professions for 200 dwarfs.  I don't know though.  That's just my experience with CLIs.
Logged

Andir

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #24 on: December 20, 2009, 01:51:15 pm »

It could be done in a CLI, but it seems to me that would be rather slow if you were changing professions for 200 dwarfs.  I don't know though.  That's just my experience with CLIs.
What I'm getting at is: What you ask is no different.  Toady still has to have an API to do what you want and if he ever changes it, it will break something.  But Toady's main concern, from what I understand, is a third party tool dictating that his next update include something he doesn't want added, or having them control his updates.
Logged
"Having faith" that the bridge will not fall, implies that the bridge itself isn't that trustworthy. It's not that different from "I pray that the bridge will hold my weight."

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: The direction of the Interface
« Reply #25 on: December 20, 2009, 03:04:45 pm »

ggeezz, judging from what you said I'm guessing you've already seen Toady's statements about the risk involved with third party interfaces, but I'll post them here anyway for the benefit of anyone who might not have seen them:

Spoiler: first quote (click to show/hide)
Spoiler: second quote (click to show/hide)
Logged

ggeezz

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #26 on: December 21, 2009, 11:11:09 am »

It could be done in a CLI, but it seems to me that would be rather slow if you were changing professions for 200 dwarfs.  I don't know though.  That's just my experience with CLIs.
What I'm getting at is: What you ask is no different.  Toady still has to have an API to do what you want and if he ever changes it, it will break something.  But Toady's main concern, from what I understand, is a third party tool dictating that his next update include something he doesn't want added, or having them control his updates.

You can manage breakability.

If the function calls were strongly typed, then type mismatches would cause problems.  So you have loosely typed function calls to mitigate that problem.  You can handle deprecated calls by ignoring them.  You can handle new or deleted skills/professions/etc. by defining codes for them and ignoring calls to codes that don't exist.

I think there's a way to design the API such that breakability is a non-issue.  Yes, certain things will cease to work.  For example, you may assign a dwarf to be a cook, and it doesn't work because that profession doesn't exist anymore.  But that's not an issue.  And there may be professions missing, but that's a small and easily fixed issue.  It won't stop people from using the tool and shouldn't affect Toady's decision to add or remove professions/skills/etc.  Yes, people will want the tool to support the new professions, but all Toady will have to do is specify the codes for the new professions.  He doesn't have to work with anyone.

And then there's the issue of fragmentation.  I still think fragmentation is actually less likely if Toady provides "the right kind" of interface.  We already have Dwarf Companion.  People went to extreme measures (memory hacking) because there was great demand for what it supplies.  The lesson is that you cannot stop something that enough people desperately want.

The best way to keep a DF clone from gaining popularity is to keep people satisfied with DF.  The best way to keep game mods from gaining popularity is to solve the problems mods would solve.

Quote from: Toady
However, reflecting on the position I'd be in, there are things not to like about it.  How many threads were there about broken utilities when this version came out?  If more than half the player base comes in off a third party interface (and given how much the current interface sucks, and how much it is a source of first time downloaders dropping the game, this is not only imaginable, it is very, very likely), how would it be if it broke at each release?  There's no way to mitigate that without my direct involvement -- imagine a release down the line where you can suddenly move dwarven armies around on the world map, with a tactical view and various options.  That interface can't write itself, ...

There are two issues here.  First, if DC used an interface similar to what I propose it wouldn't "break" even with this mega-release.  And the parts that need updating would be trivial to fix.  All Toady would have to do is make a table with the new codes.  The same would apply to a theoretical digging/furniture tool.

But suppose a tool provided a complete interface overhaul, slick 3D graphics and such.  That would need major work and major involvement from Toady.

So it seems to me the best path is to facilitate things like DC and a designation tool (and make them forward compatible), but to discourage things like a "complete interface overhaul."  The best way to discourage a complete interface overhaul is to lessen demand by solving some of the problems the alternate interface would solve . . . like mass dwarf management and designation.

Suppose that it was very easy to do DC and you expect it to be easy to maintain.  And it was comparably hard to do an alternate interface and would likely be a nightmare to maintain.  Toady would be encouraging the former and discouraging the latter, which it seems is what he wants.

And when a new feature comes along like moving armies around a world map, it makes sense for Toady to write that first and then have 3rd parties tools after it has matured.  And if modders expect that an interface will come some months down the road, they'll be less likely to start memory hacking in the interim. 

And that brings up another point.  There's a large difference between an add-on tool like DC and a tool that "becomes the game" and takes over all interface elements.  Players should expect to play Toady's version of the game, to see new features as Toady intends them to be seen.  Otherwise we're heading towards the trouble he fears.

So it seems we should only have add-ons for mature parts of the game.  These parts are still changing, but those changes can be handled easily by publishing new codes.  And you discourage modifications to the new stuff with the expectation that it will eventually become mature stuff that's easy to work with.
« Last Edit: December 21, 2009, 11:16:10 am by ggeezz »
Logged

ggeezz

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #27 on: December 23, 2009, 09:20:43 am »

I was starting from certain assumptions, namely that Toady doesn't mind things like DC, but he is worried about things like Khazad (or what it may eventually become).

Can anyone confirm or correct?
Logged

sweitx

  • Bay Watcher
  • Sun Berry McSunshine
    • View Profile
Re: The direction of the Interface
« Reply #28 on: December 23, 2009, 05:12:11 pm »

In short, Toady's knows what he's doing, please stop bugging him with something that he already said "No" a couple of times before.
For those who do programming for a living, you understand how quickly subroutines gets entangled together, how a seemingly "simply" change to one will affect a dozen others.  Dwarf Fortress, given its complexity, is even more susceptible.  More so as it is a program that's under constant changes and overhaul.  A good analogy is you have a room that's partially furnished, Toady releasing an interface will be an equivalent of nailing some of the furnitures down so people can, say, decorate it.  But if Toady later need to make changes that involve moving those furnitures...
Logged
One of the toads decided to go for a swim in the moat - presumably because he could path through the moat to my dwarves. He is not charging in, just loitering in the moat.

The toad is having a nice relaxing swim.
The goblin mounted on his back, however, is drowning.

ggeezz

  • Bay Watcher
    • View Profile
Re: The direction of the Interface
« Reply #29 on: December 28, 2009, 09:29:09 am »

In short, Toady's knows what he's doing, please stop bugging him with something that he already said "No" a couple of times before.
For those who do programming for a living, you understand how quickly subroutines gets entangled together, how a seemingly "simply" change to one will affect a dozen others.  Dwarf Fortress, given its complexity, is even more susceptible.  More so as it is a program that's under constant changes and overhaul.  A good analogy is you have a room that's partially furnished, Toady releasing an interface will be an equivalent of nailing some of the furnitures down so people can, say, decorate it.  But if Toady later need to make changes that involve moving those furnitures...

I'm not suggesting Toady doesn't know what he's doing.  Obviously he does.  It seems he's also open to suggestions, which to me is a mark of knowing what you're rather than not knowing.

I program for a living.  I've written sets of functions that were horribly fragile.  The smallest change would break them.  Over the years I've learned a little about how to make them more robust and it's made my life much easier, though I still lack much skill/knowledge.

In short, interfaces do not have to hinder development, nor be so fragile.  The Agile philosophy and other related work has helped in this respect.  I think there are ways to create an interface that would cause mostly headache, and ways that would cause very little.  But I don't claim to have all the answers.

I just think that there IS a way for all of us, most importantly Toady, to have our cake and eat it too.  And to that end, I'm soliciting input.
Logged
Pages: 1 [2] 3