Bay 12 Games Forum

Please login or register.

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

Author Topic: Open letter to Mr. Toady - helping with DF development?  (Read 4249 times)

Kaelis Asur

  • Bay Watcher
    • View Profile
Open letter to Mr. Toady - helping with DF development?
« on: June 28, 2008, 06:05:44 pm »

Hi there.

Im new to these forums, and to the game itself. I first heard about Dwarf Fortress about a year ago, but was frightened off by the lack of visuals. But recently i got to know that the game employs procedural generation, so i just had to force myself to suffer through the ASCII 'graphics', and got hooked immediately. At first it seemed strange that such an impressive game has such poor presentation and handling, but now that i know DF is all written by a single programmer, its understandable, and im simply awed. Truly, a monumental work for a single person. I salute you, Sir Toady.



Still, mastering the interface and efficiently managing the fortress is a daunting task. Being a programmer, i immediately started thinking about providing new management options. Since the game ASCII visuals made it look like its simply a console output, the obvious thing to do would be to redirect input and output streams to another application, right? Wrong. After spending few hours researching the idea, ive discovered custom tilesets and the fact that its actually tiles rendered by Opengl.

Then i stumbled upon this:
Quote from: Toady One
Dwarves was written solely for PDCurses and was in that state for more than two years.  OpenGL support was added only in January of last year (mainly for input reasons, since Curses input is iffy), and it simply copies the Curses display.  There's a lot of hard-coded 80x25 assumptions, and also the fact that Curses displays one tile per cell is very important.  Having things like a dwarf standing on a floor requires at least two tiles being displayed in the same cell, which requires the code to think differently about many things.  It's not impossible, but it's time-consuming.

So i started thinking about overcoming these limitations with as little effort as possible.

Thus, heres an interesting idea i came up with.



---------------------------------------------------------------------------------------------



First off, there are three (probably obvious) assumptions about the way DF is written is that i make:
a) There is a two dimensional array (25x80) of integers that is used to tell OpenGL which tiles should be rendered. Each integer represents a single tile (character) - 97 for a, 98 for b, 125 for }, etc. Ill call this array the 'render array'.

b) The game loop can be reduced to this pseudocode:
Code: [Select]
GameLoop()
{
Logic();
Input();
Update();
Output();
Render();
}
Where:
Logic() - processing game logic/simulation, the logical state of game, game mechanics (the map and world, units, objects, orders, actions, movement etc)
Input() - processes keyboard and mouse input and manages interface logic (map, menus, cursor) according to user input and to game logic. so it actually handles the logic of input, menus, map, orders, and cursor
Output() - updates the interface and map state (basically everything that should appear on the screen) according to Input() (user changing menus ...) and Logic() (units moving around ...), and writes the current state to the render array
Render() - renders the tiles to screen using render array as a guideline

c)  Input() and Output() are separate, independet and can be multiplied.

c) essentially means that it would be possible to have, for example, Input1 and Input2, each separately (but in the same frame) handling user input and interface, and Output1 and Output2, each separately writing the render array (to array1 and array2). Output1 would get the info on what exactly to write from Input1, and Output2 from Input2. Ultimately this is like having two separate viewports of the game, bar the actual rendering.





Now, the core of my idea is this modification of game loop:
Code: [Select]
GameLoop()
{
Logic();
InterpreterInput();
Output1();
Output2();
InterpreterRender();
}

Input1();
Input2();
The main concept here is the interpreter. It receives all keyboard and mouse input (instead of Input() ), but not just that. The interpreter is a full-fledged GUI and renderer, with windows, buttons, sliders, combo boxes and whatnot, and - of course - with fully customizable tile rendering. It doesnt replace the logic of current game input and gui, though. It builds on top of it instead.

Input1 and Input2 are outside the loop. Thats because normally, Input() needs to be called whenever theres any keyboard or mouse input, but now the InterpreterInput() handles all keyboard/mouse input. But it doesnt handle the underlaying, original gui, which still needs to be processed. This is achieved by selectively calling Input1() and Input2() from InterpreterInput() and passing parameters generated by InterpreterInput() as input for them, essentialy faking keyboard/mouse input.

Next up is Render() replaced with InterpreterRender(). Theres no need for the old OpenGL 'ASCII' renderer, since the new interpreter is going to handle visuals. It takes both render arrays from Output1() and Output2(), and processes them into its own gui and map.





For example, if you click in the interpreter on designations button, the first input function is called with 'd' key event as a paremeter sent from the interpreter. But if you click on units button, the second input function is called with 'u' key event. Similarily, in the interpreter there are two menu panels, left and bottom one. Left one receives render array from Output1() (designations), bottom receives array from Output2() (units).



Heres a more sophisticated example. Imagine you have three Inputs and Outputs. Normally that would be like having three windows of DF that work on the same instance of game, with separate gui and input.

First 'window' is this:

It is used for map display; all map scrolling and view options input (events from interpreter like pressing button) get sent there.

Second and third one:

Second is used for all operations (so digging, building placement, orders ...). However, only the middle part is passed to interpreter as output, the left tab serves only for input purpouses, and the actual visuals of operations (ie. placing a building) are rendered by the interpreter on map display from first window. Output from middle part is used as info for interpreter's 'operation' interface.

Third is used for interpreter's 'look around' interface (obviously, 'k' look around from DF). So its in permanent look around state (by sending 'k' as key event to it and not giving any other input except cursor movement) and only middle tab is sent as an output. The actual cursor is, of course, renderend on the map from first window.





I am aware that this idea of mine seems extremely and unnecesarily complicated, but there are a few significant advantages of this approach:
- Despite its apparent complexity, it is actually quite easy and doesnt need too much work to implement, which is an important factor, from what ive gathered. Copy&paste Output() and Input() changing some names so that they dont duplicate, remove pause from menus (when you open up any menu, the game pauses), provide an entry point in Output() for input events from interpreter (could be as simple as changing every if(keyboad.keydown()==97) to if(InterpreterKeyEvent.keydown()==97) etc), and make the render arrays available for interpreter
- The only real work involved is the actual interpreter (so renderer, gui, interpreters logic and input). It has a great potential to be developed by a third party (see next point) and, providing its not too complicated and documented well enough, it should be easy to add new features during further game development (for example, a third party writes the core framework and creates example interface, but if need be, is expanded by the game developer).
- The interpreter is pretty much separate and independent from the main game guts, which means it can be easily written and maintaned by someone who has no knowledge of DF source. It could also be external, so the game and its development wouldnt depend on it.
- It can be as comprehensive and advanced as one wants, or as simple as just two DF windows displayed and handled simultaneously but independetly.



---------------------------------------------------------------------------------------------



Or, if all else falls, just 'downgrade' DF to a console application, allowing for redirection of input and output stream. Such a simple change would be enough to write utilities that greatly improve interface capabilities.



In any case, i would like to inquire about the possibility of actively helping with development of Dwarf Fortress, and offer my help.
Logged

Fieari

  • Bay Watcher
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #1 on: June 28, 2008, 07:03:36 pm »

Asking to help with coding DF happens often enough that it gets its own FAQ answer.  As much as we'd like to, no, Toady refuses all help:
Quote from: FAQ
# Will you make Dwarf Fortress open-source so the community can speed development and fix bugs?

No. We don't want to associate with other people at a quasi-professional level, since this would make development less enjoyable. This is not a job for us; it is our personal mission.
# But will you make Dwarf Fortress open-source for forks and tinkering?

No. Heavily diluting Dwarf Fortress adds a strong element of unpredictability to our support, and your donations are our sole source of income. While donations might not be affected at all, it's not a risk we can take at this point if the project is to continue.
# Use my tileset or music files or mods or writing or pseudocode!

We are not taking submissions, but you can share them with others at the Forums and The Dwarf Fortress Wiki.
# But then how can I help with this project?

There is information at the support page.

By support, you can paypal him money or mail him a check.

Toady has, on the other hand, been known to release his older works as open source.  So if he ever gets bored with Dwarf Fortress, he'll likely do the same.  But as long as he's coding it, he doesn't want to work with anyone but himself.  Oh, and his brother.

Sorry.
Logged

Kagus

  • Bay Watcher
  • Olive oil. Don't you?
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #2 on: June 28, 2008, 07:16:37 pm »

Kobold Quest is open source and in need of a good developer.  You can check it out in the "Other Games" category.

Haven

  • Bay Watcher
  • Studiously Avoidant
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #3 on: June 28, 2008, 08:03:20 pm »

Quote
# But will you make Dwarf Fortress open-source for forks and tinkering?

No. Heavily diluting Dwarf Fortress adds a strong element of unpredictability to our support, and your donations are our sole source of income. While donations might not be affected at all, it's not a risk we can take at this point if the project is to continue.

So, if someone paid him a guarenteed fifty whole-bucketloads-of-monies a So-Often, he would let people mess with DF?
Logged

Fieari

  • Bay Watcher
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #4 on: June 28, 2008, 08:17:40 pm »

You willing to pay him, oh, say, $50k / year with no ROI other than DF?
Logged

Haven

  • Bay Watcher
  • Studiously Avoidant
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #5 on: June 28, 2008, 08:39:54 pm »

If I ever come across the proper cash, it'd be a good investment to gain one's dream game. Having come off the Oblivion mod-playing spree, I think many a DF problem could be properly solved by throwing more people at it, without sacrificing too much of the unique thing.

Admittedly, 50k would be about 1k a week, but if I had a million bucks, I could invest to get at least 150k a year, leaving me enough to fund my second-favourite hobby AND live fairly well.

Now I just have to either wait 15 years or win the lotto.
Logged

Torak

  • Bay Watcher
  • God of Gods of Blood.
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #6 on: June 28, 2008, 08:45:31 pm »

Ugh. I originally thought this topic would be about Mr T, since the index cuts the topic off at "Re: Open letter to Mr. T". Also, the fact that you're asking to help development is silly, since Toady has explicitly stated many, many, many times that he is going to be the only one who codes and programs DF, unless some multi-billion publisher gives him the money to code it with no restrictions, deadlines, or requirements.
Logged
As you journey to the center of the world, feel free to read the death announcements of those dwarves that suffer your neglect.

One billion b-balls dribbling simultaneously throughout the galaxy. One trillion b-balls being slam dunked through a hoop throughout the cosmos. I can feel every single b-ball that has ever existed at my fingertips, I can feel their collective knowledge channeling through my veins. Every jumpshot, every rebound and three-pointer, every layup, dunk and free throw.

Okenido

  • Bay Watcher
  • Loli Advocate
    • View Profile
    • New Various Nonsense
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #7 on: June 28, 2008, 08:52:43 pm »

And I do hope you know that presentation is going to come last...
Logged

I3erent

  • Bay Watcher
  • The mounted dwarf has gone bErZeRk
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #8 on: June 28, 2008, 08:53:52 pm »

But if you were to actually take some time with kobold quest and do some work to show you may catch his eye more with your suggestion.
Logged
quot;I got really stoned a couple days ago and ended up talking to THIS GUY. anyway... I''m really drunk now. The guy said: There is this application called "Mya" MI-AH that makes animations of people that he paid $2000 for. F- that Jazz ARMOK ROCKS. FIGHT THE MAN, GO TEAM!

Tahin

  • Bay Watcher
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #9 on: June 28, 2008, 10:45:40 pm »

Actually, isn't the presentation arc coming after the army arc?
Logged

Angellus

  • Guest
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #10 on: June 29, 2008, 01:30:21 am »

Actually, isn't the presentation arc coming after the army arc?
yups, I agree with Toady you know, I like the way his sick goblin/kobolt-mangling mind works, no need 'polluting' that :)
Logged

MaxVance

  • Bay Watcher
  • Legendary Internet User
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #11 on: June 29, 2008, 01:32:27 am »

As I've said before and will likely say again in the future, DF is nowhere close to being finished. Toady released DF because he thought a few people would enjoy an alpha of it like with his previous games. This game, however, became extraordinarily popular.

As for offering help, don't bother at least until it's "finished." Aside from donating money, the best way to contribute is to post suggestions for mechanics or features. He has been known to implement user requests. I sure do love talking straight out of my ass.
Logged

McDoomhammer

  • Bay Watcher
  • Uses: Ore of irony
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #12 on: June 29, 2008, 05:08:52 am »

Quote
# But will you make Dwarf Fortress open-source for forks and tinkering?

No. Heavily diluting Dwarf Fortress adds a strong element of unpredictability to our support, and your donations are our sole source of income. While donations might not be affected at all, it's not a risk we can take at this point if the project is to continue.

So, if someone paid him a guarenteed fifty whole-bucketloads-of-monies a So-Often, he would let people mess with DF?

I suspect that, despite what is implied by that quote, even if he were handed One Meelyun Dollarz, he would continue working on DF alone, because it's his.  *If* he opened it up to public tinkering at all, it would be once he decided it was completely finished.
Logged
"KILL, KILL, KILL! NOTHING SHALL STAND BETWEEN US AND THE CEREAL BAR!"
-The Violent Council of Breakfast

Kaelis Asur

  • Bay Watcher
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #13 on: June 29, 2008, 09:48:00 am »

I was hoping that the reason why Toady refuses any help is that hes afraid to be dependent on a third party and he doesnt want the third part to tell him whats good or bad and what needs to be done. Which doesnt need to be the case.

Mind you, i didnt explicitly state i want to help with coding of DF. Admittedly, that would be a dream come true, but im fully aware thats not gonna happen. But there are other things that need to be done during game development, besides coding - data preparation, external tools, documentation, etc. In the example my 'interpreter' idea, as already stated, it could be done externally, much like other DF utilities currently available. Or, to give another example, Toady gives some info necessary for interaction between the game and interpreter, someone codes the interpreter (without any need for DF source or knowledge about its inner workings), sends the code to Toady and he just adds it to his source/project and compiles as an alternate version of DF.

Ultimately, my point is that help with coding is not the only kind of help that can be offered. Besides donations, of course.



But if you were to actually take some time with kobold quest and do some work to show you may catch his eye more with your suggestion.
That is an interesting idea. Where can i find some solid info on this Kobold Quest? Ive found the game itself and its source, also a few threads on forums, but nothing else.
« Last Edit: June 29, 2008, 10:06:46 am by Kaelis Asur »
Logged

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: Open letter to Mr. Toady - helping with DF development?
« Reply #14 on: June 29, 2008, 11:19:15 am »

I did some work on it, and some work on LCS.  Do you want me to mail you the newest source that I modified?  It added in basic AI for the kobolds and some other things.
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.
Pages: [1] 2 3