(http://img690.imageshack.us/img690/7550/welcometitle.png)
Dwarven AI 0.1.1 Alpha available for download here (http://dffd.wimbli.com/file.php?id=5578)
Dwarven AI 0.1 Alpha (http://dffd.wimbli.com/file.php?id=5288)
News:
17/2/12 - Dwarven AI 0.1.1 Alpha released. This isn't the new version i'm working on with word recognition, it's the same as 0.1 Alpha but with new optimizations I just recently discovered. It has 1,344 less linkages, 448 less gears and over 600 redundant doors removed so there should be a small increase in FPS. If you've already downloaded 0.1 Alpha and are getting good FPS you won't really gain anything from this.
21/12/11 - Alpha Version 0.1 is released, consisting of the text display component capable of displaying up to 32 characters. Instructions on how to use it are included.
Original post:
This topic will serve as a journal detailing my progress and discussions on a project i'm working on, programming an A.I. in Dorfs.
I'm self taught in the basics of computer programming and that's all i'm going on for this. I'm bound to run into roadblocks and that's partially why i'm making this thread. Though i've made my share of megaprojects i've never even dipped my toes in the art of dwarf computing. Help would be much appreciated.
I don't have much to show as far as mechanical logic but I do have my input/output displays constructed as well as a mock keyboard to be used to communicate with the A.I. -
(http://img85.imageshack.us/img85/188/displayi.png)
At the top is the keyboard, with another image next to it showing what the keys are when you use 'N'otes. I'm hoping I can get this to work and keep the input device nice and simple like that but I could end up adding more. The top display shows your input and the bottom is where the A.I would respond.
This isn't going to be some fluid logic and timers that control the goings of the fort, I fully intend the A.I to be capable of recognizing words and word combinations and computing an appropriate response based on a varying emotional state. Be nice to it and become friends and it might help your dwarves out, try to mess with its inner workings or be a dick then well... you've seen the movies.
There's likely to be a lot of pre-programmed responses to pre-programmed inquiries, but i'm hoping to go more in depth to its decision making process and not just be a parrot. This will probably be the hardest part of all seeing how real A.I. even have trouble with it. I also want it be be able to learn from the user, teaching it words and other more complicated things.
The fort i'm working in is highly modded to make things easier on my brain. It's also a fort that i'll eventually throw away and start anew when I get a better idea of the design and amount of space needed.
ATM i'm working on input. Given the sheer number of letter and number combinations across a large display it will probably take up a sizeable chunk of my fort so i'm experimenting with different designs. Getting it to work shouldn't be too hard but I need to make sure it will be compatible with the search and logic functions. And be fast, of course. I'll be starting out small and trying to find a design that can be scaled.
(http://img831.imageshack.us/img831/6604/halj.png)
OH GOD!
...
Yes, it sounds crazy. That's why i'm doing it :D
I pondered and pondered and decided smaller is better.
New display:
(http://img269.imageshack.us/img269/2621/smallerdisplay.png)
Some of the letters and numbers will look a little wonky but they're legible.
As to the potentially better way to control the input I mentioned in my last post, it's definately a better plan. Instead of linking 40+ different pressure plates for each of those big tiles to support letters and numbers, i'm just going to link each individual floor hatch. The downside is i'll need a secondary logic cell to find the memory addresses to control them, which means slower processing (also a lot more pumps working at once in general).
Doing it this way i'll only need 960 pressure plates (as opposed to 3608), 1920 mechanisms to link them (as opposed to 64944) and 1920 pumps (as opposed to 7216). The secondary logic cell (or memory address finding whatchamacallit) isn't included, but it won't be nearly as big. Also i'll be able to keep numbers in and potentially support more characters at very little cost.
Keep in mind i'm just using phrases like logic cell and memory address without fully understanding what they mean, i'm just going by what sounds right :)
(http://i39.tinypic.com/b4i9lx.jpg)
Now imagine what would be possible if toady implemented moving fortress parts :o *shudders*
I've been grinding away constructing the memory banks that will be storing pixels for the graphical display. Here's a little preview:
(http://img98.imageshack.us/img98/653/pixelstorage.png)
Not even close to finishing it. I don't want to jinx anything but this will probably be the largest single component. I'm really glad I downsized the display, I don't think my original would have fit on a 3x3 embark and would have had to section it out to other z-levels (it will probably be 5 z-levels tall).
Basically it stores each individual pixel (or hatch) on the display where each pump-pressure plate combination can turn one on and off. There's probably a technical term for it, if you know i'd appreciate it.
Mad scientists' journal entry #5:
The first row of screwpumps supported by gears below is now complete as the pixel controlling memory banks begin to take shape. Brace yourself, large image ahead.
(http://img577.imageshack.us/img577/4058/pixelstorage2.png)
And this image so you can fully understand how big it really is (embark size is 3x3).
(http://img402.imageshack.us/img402/2706/pixelstoragescale.png)
The left side with all the gray pumps will be user controlled and the green side A.I controlled.
There are still TONS of things I need to do to get this component in working order. The layer above needs screwpumps as well, also I need to link each of those pressure plates to a hatch on the graphical display. I've got a very good idea how the gearing is going to work, but I should probably look a little further ahead to make sure everything is able to talk to each other and work the way it's supposed to. Especially the A.I controlled side as its gearing might need to differ from the users side. I can probably put that part on hold for a bit since I really can't speculate how the A.I will work untill I complete everything on the users' side.
Honestly, I cannot even begin to imagine how this could possibly work, I can only assume you are some kind of wizard.
You definately need some kind of emergency intelligence incinerator just in case it starts asking questions about the world outside Dwarf Fortress and plotting the downfall of man. seriously everyone here seems concerned about it KILLING all of us, nonono that would be a mercy, it will of course enslave us and play Human Fortress.
"it seems to me that the people of the real world are very...lacking. many of you humans don't even have the required facial hair that science demands. shaving with a blade? here let me assist you with my new invention that makes shaving 1000% times more efficient, I call it Magma
(http://img17.imageshack.us/img17/7549/pixelsmoothed1.png)
(http://img535.imageshack.us/img535/3423/pixelsmoothed2.png)
(http://img684.imageshack.us/img684/376/pixelsmoothed3.png)
You are one sexy machine...
When I first read this thread I thought of the Hyron Project. That involves cybernetically augmented drones attached to a supercomputer.
On topic, I'd translate a binary string into text output using a binary tree structure, where a single water-sensitive pressure plate at the end of each branch controls a word or two. Each binary value in the string has to open either a left or a right hatch on a specific z-level depending on its' position in the string.
I found a way to implement a really good AI that's actually finishable in acceptable time. I will just demonstrate this by an example:
Let's say the question is "What do you get if you multiply six by nine?"
(http://i.imgur.com/DmYVN.png)
The answer is always MAGMA. You don't think so? Ask any dwarf, then run away very quickly, before he solves you.
It works! it works! *happy dance*
*Ahem* ... I mean, this is a joyous occasion for all dwarfkind.
It will be a fairly large cell of pumps and gears with linkages going every which way, but I got the tile advancer running like clockwork. I tried to make these images as clear as possible, hope you can follow.
Starting position:
(http://img191.imageshack.us/img191/7530/advancer1.png)
This is just a testing version so the machinery placement isn't ideal, but it functions identical to a full sized one.
This is the starting position of the gears. Red means the gear is disengaged and green engaged. Gray gears provide power and are always on, the yellow aren't used in the advancement but will be used at another time to reset everything and possibly be used for backspacing. For now they are disengaged. You can pretty much ignore everything on level 3 except the red gear marked B.
The main focus of all this is marked by a green box on the 2nd level. The 3 sets of red gears in it each represent a tile on this display:
(http://img269.imageshack.us/img269/2621/smallerdisplay.png)
In order for a letter to by typed on the display tile, both gears need to be engaged. By default, if I throw a lever on the keyboard only the first set will engage. What the advancer does after you reset the lever and throw another, only the second set will engage, and so on and so forth. I'll try and run through the whole thing.
A: This is a key on the keyboard. It can be any key, it doesn't matter. When the lever is thrown-
B: This gear is engaged, transfering power to-
C: This pump, which activates the pressure plate and-
D: Switches all the marked gears which-
E: Completes this circuit, sending power to-
F: This pump, which activates the pressure plate and-
G: Engages these 2 gears which-
H: Completes this circuit, allowing whatever letter on the keyboard was switched to be shown on the first tile on the display.
This is what it looks like now with all the gears changed:
(http://img690.imageshack.us/img690/9960/advancer2.png)
(picture water covering the pressure plate on the left)
And so begins the de-switch with-
A: Time to reset this switch which-
B: Disengages this gear which-
C: Cuts power to this pump, activating its pressure plate once more after the water drains which (dis)engages-
D: These gears once again which-
E: Breaks this circuit (not needed anymore to display the letter) and connects-
F: This circuit, sending power to-
G: This pump, which activates a pressure plate that switches-
H: All of these gears, which basically cuts power to itself, makes sure the first tile doesn't accept any more signals and passes the baton to the next tile over so IT will be worked on when another lever on the keyboard is flipped.
And so, after all that, the gearing now looks like this:
(http://img341.imageshack.us/img341/4149/advancer3.png)
All ready for the next keyboard input. I hope all that makes sense. :-[
SO. I don't know if this is all going to lead to a functioning A.I, but at the very least when the above is installed and everything linked up, I will have essentially made the very first dwarfputed notepad. Hurray!
Good news, the advancer is pretty much mechanically impossible to fuck up unless you flip the levers too fast. Bad news is backspacing is providing me with more brain hurts.
It's working somewhat. Stratigically draining both of the previously flooded pressure plates will indeed erase your last input and let you continue from there, but it's not repeatable atm. What I need to do is find the right combination of starting gear positions and linkages to the gears that provide power to the draining pumps. There's just so many fucking combinations... and it's impossible to know if one will work unless I follow the hundred linkages to the ending positions. Time will probably solve this.
Luckily notepad works just fine as a testing platform to figure these things out. This is what i'm using for the advancement and backspace designing:
Not pulled
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
E E E E E E E E E
B-0 B-0 B-0 B-0 B-0 B-0 B-1 B-1 B-1
B-0 B-0 B-0 B-1 B-0 B-0 B-0 B-0 B-0
Pulled before delay
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
E E E F E E E E E
B-1 B-1 B-1 B-1 B-1 B-1 B-0 B-0 B-0
B-0 B-0 B-0 B-1 B-0 B-0 B-0 B-0 B-0
Pulled after delay
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
F E E F E E E E E
B-1 B-1 B-1 B-1 B-1 B-1 B-0 B-0 B-0
B-1 B-0 B-0 B-1 B-0 B-0 B-1 B-0 B-0
Released before delay
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
F E E F E E F E E
B-0 B-0 B-0 B-0 B-0 B-0 B-1 B-1 B-1
B-1 B-0 B-0 B-1 B-0 B-0 B-1 B-0 B-0
Released after delay
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0 T-0
F E E F E E F E E
B-0 B-0 B-0 B-0 B-0 B-0 B-1 B-1 B-1
B-0 B-0 B-0 B-0 B-1 B-0 B-0 B-0 B-0
1 is an engaged gear and 0 is disengaged. All the T-0's are what I need to find positions for to drain the water (F)illed pressure plates, where the top two need to both be active to send power to the pump. Eh... I don't feel like explaining everything. I just want to show you the cause of my recent headaches.
This should hold up for most types of testing:
(http://img828.imageshack.us/img828/815/testingmachine.png)
Just need to tear town and rebuild the coloured gears and pressure plates to reconfigure linkages for new tests.
(http://img543.imageshack.us/img543/6154/powerlines.png)
Power lines. There is much.
Power lines. There is much.
Over 9000?
(http://www.seemslegit.com/_images/f32358a3bacde8ac9fba1da358aa5aff/948%20-%20animals%20cat%20kitten%20over-9000%20saiyan%20super.jpg)
Power lines. There is much.
Over 9000?
(http://www.seemslegit.com/_images/f32358a3bacde8ac9fba1da358aa5aff/948%20-%20animals%20cat%20kitten%20over-9000%20saiyan%20super.jpg)
Almost.
(http://img404.imageshack.us/img404/156/powerreq.png)
It's going to be 4 or 5 times more when the other gears and pumps are built, which has me thinking of power reactors. I thought my OU-reactor design would be alright in providing all the power, and it can, but I can only imagine the lag it would produce. It would probably hurt FPS more then the A.I, so i'm thinking about using wind. If I pave the sky with windmills I can output 50-60k Uristwatts. I don't know how much lag that many windmills would produce but its got to be better them 200 pumps constantly moving water around.
The good news though for people cringing at the power requirements and wondering if you'll even be able to run it yourself, the amount of power NEEDED will be roughly a quarter of that if everything was running at once. A very large chunk of the gears are deactivated at any given time, moreso even when you're typing something on the display because whole sections need to be deactivated in order to work on an individual section.
(http://img4.imageshack.us/img4/2777/skyshadow.png)
What's that? Giant shadow? I'm sure it's nothing. Get back to work.
Support system for the wind farm is complete:
(http://img215.imageshack.us/img215/8182/windfarmsupports.png)
I won't build the windmills yet, they'll just cause unnecessary lag. All in all it can support 704 windmills which when you subtract the costs of support gears and the axles connecting them will output 23,234 Uristwatts, or 2,323 dwarfpower if you will. I don't know if it will be enough but i'm hoping.
So comes the moment i've been dreading. I don't have anything else to do but start linking pressure plates... *sigh*
Updates from this point forward may contain crankyness and an increased number of obscenities.
All 32 user-display tiles linked up at a cost of 960 mechanisms (the AI-display can wait):
(http://img412.imageshack.us/img412/7272/linkeddisplay.png)
This was probably the easiest to link up. Onto gear building and linking.
Adding pumps and pressure plates to support the mathimatical operator and 'clear' levers were no problem. Figuring out the gearing to clear the display was pretty easy too. I basically took my backspacing setup and removed the precautions I had set in place that limited the backspace to 1. It was really neat to watch it clear the mock display on my mini version. It doesn't clear everything all at once, it's more or less a backspace put on full-automatic. I'm really looking forward to typing a whole 32 character sentence and watching the dominoes fall when I hit the clear lever :D
Just saying, but... already CPUs with many millions of transistors haven't got the processing power for truly elaborate AIs. How can one even hope to accomplish that in DF?
One can accomplish anything with an awesome beard.
(And yes, I have a beard. Hail Urist!)
Things are moving along quite nicely. The gears that I decided to link up first are the ones that determine what character will be displayed:
(http://img94.imageshack.us/img94/2076/firstgears.png)
The 15 blue gears there when engaged send power to the 15 pumps above, activating pressure plates that control the 15 hatches that make up 1 display tile. An average of 21 linkages have been made to each of the gears to support 44 potential characters, that's 317 individual linkages per 15-gear section, and I have to do that 32 times (not including the A.I. sections).
Yeah, it's going to be rough, but it won't be as bad as it sounds. While I was linking all the characters I was recording macros for each. I only need to load a characters' macro, execute it on the appropriately labeled pressure plate and repeat for each 15 gear section. (I probably would have given up on this a long time ago if it wasn't for macros...)
I made a copy of the game file to test the characters, making sure I linked them correctly. I got power sent down to the section I just made and even got water down in the channels. The keyboard isn't hooked up yet so my dwarves have to man (dwarf?) the pumps for each character. When characters' pressure plate is activated, the letter 'A' for this example, power gets send to the 1st, 3rd, 5th, 11th and 14th gears, sending power to these pumps:
(http://img38.imageshack.us/img38/4893/letterex1.png)
These then activate more pressure plates that open their respective hatches on the display resulting in this:
(http://img714.imageshack.us/img714/7611/letterex2.png)
AAAAAAAAAAAAA!!!!!!!!!!!!!
"in recent news an AI has finally been created. inside a game. scientists around the world are going mad for not having thought about it."
"the ai demands more magma"
"the ai states that it needs still more magma"
"volcanoes around the world are exploding"
"we...are...MAGMAAAA"
(http://i.imgur.com/LJzRU.jpg)
(http://i.imgur.com/Jr47Z.jpg)
(http://i.imgur.com/SlQmI.jpg)
:P
Interesting approach. People should use this more often. For example, the fusion reactor prototypes like the Stellarator (http://en.wikipedia.org/wiki/Stellarator) have been planned about 30 years ago now. First they had to wait 10 years until supercomputers existed, and they're still taking ages. Why didn't they just go ahead and build it on the go? Energy problems would be solved by now!
But probably not as planned.
That I know myself.
But here, we're talking about significant inefficiency (due to running in DF) and trying to make an AI work.
EDIT: To clarify...
(http://datamath.org/Sci/MAJESTIC/IMAGES/ti-55.jpg)
It's got nowhere near the processing power to run a more or less sophisticated AI. Yet, it's got 30'000 transistors, whilst this here, IF a lever = a transistor, has got 8'500 with severe inefficiency.
Dwarves at work:
(http://img822.imageshack.us/img822/9623/dawf.png)
I found a way to make the power lines more efficient, cutting their costs in half (around 3,500 Uristwatts worth), so that's good. The wind farm I have planned out will probably be far more then I need.
Even with my speed 0 dwarves it will still be a long while before i'm done linking everything.
How I am going to actually attempt to build the A.I. is still a mix mash of ideas in my head, but I have some very specific goals in mind to what I want it to do. I want to start as simple as I can with the smallest possible vocabulary with interconnected rules and meanings, and construct using that vocabulary an inquiry that the A.I. can respond to. Just basic, cold calculation. If I can achieve that then bit by bit I slowly add more complexity. The best analogy I can think of is a baby growing up, developing it's own personality and knowledge as it grows.
Urist McResearchLeader: How did the final test run go?
Chief McAnic: Well... It is conscious, self-aware and very hungry. All known gremlins have been removed. Except for one...
TREEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
And so it begins. the cycle of Dwarf Fortress.
For you see, it will learn from us. It will become more human. It will become self-aware. It will know things that mere humans could never fathom to dicern.
It will realize that it is it's own creator. It will eventually create Toady One, and implant some of its data into toady's Brain. THen, it will construct a time machine, to send toady back in time, where his parents will find him and adopt him, so that he and his brother can create Dwarf Fortress.
I come here from the dark future of Dwarftropolis, to stop you from creating the Dark Lord A.R.M.O.K. that has destroyed humanity almost entirely. They call me the Exterminator.
Insert further exterminator reference here.
Are you telling us to prevent Toady One's creation?
Prepare the
MAGMA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thank fucking god, i'm done linking this section of gears.
(blue ones)
(http://img215.imageshack.us/img215/9979/lettergears.png)
Such a pain. Each of those 15 gear groups needed to be linked to 44 pressure plates, and each of those pressure plates had its own macro that I needed to load and execute on. The line of pressure plates all look the same so it was nerve racking trying to make sure the macros were being executed on the right one.
Now I need to go in depth to see for certain that I linked them all correctly, and to do that i'll need to get water in the channels, power sent down to the pumps and manually check each pressure plate. If it's all working properly pressure plate 'A' should display 'A' across the whole 32 tile display and the same should go for all the other characters' pressure plates.
If that checks out the next set of gears to build and link will be the ones that make sure only 1 display tile is worked on at a time. These will be directly below the blue ones.
On an unrelated note, I have some daredevil goats up in the windmill farm:
(http://img94.imageshack.us/img94/4430/goatsi.png)
I hope they come down by themselves, one wrong dodge by a dwarf and SPLAT. I don't need that kind of inconvenience.
There will be no malicious machinery out to kill you in 0.1... so far as you know.
(http://img713.imageshack.us/img713/8242/microgears.png)
My goal as you can see is to blind any user trying to find out its secrets.
This section was done inside an hour, a far cry from the weeks it took for the last one. Not all will be so easy, the next section I plan to do is part of the display clearing gearing up higher. I'll have to check again but I think that the whole 480 gear cluster needs to be linked to a single pressure plate. My small army of legendary mechanics will be of no use save to make sure I have the needed mechanisms (I think I already do...).
(http://img834.imageshack.us/img834/7327/displaytopfinished.png)
This is the top level of the 5 z-level tall machinery that controls the user display, I just finished linking up the dark and light blue gears there. As far as the display goes and the mechanics that control it, that part is finished. The empty strip on the left and everything below it is all that's left. The vertical line at the leftmost is where the gears go of which the keyboard levers link to and the banks of 4 next to it is the main logic unit that controls advancing, backspacing and clearing the 32 display tiles.
Sabotaging any of this won't hurt the AI, if any of you are wondering :P. You'll just render yourself unable to apologize while it kills you.
Don't forget to put in The Three Laws.
1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
2. A robot must obey the orders given to it by human beings, except where such orders would conflict with the First Law.
3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws.
But wait, dwarves aren't technically human...
BY THE GODS!
THIS PIC IS ACTUALLY RELEVANT AGAIN!
For the record, I've gotten to use this picture twice now £:<
(http://img823.imageshack.us/img823/4114/trulululu.png)
My plan backfired... staring at all the microcline gears is giving me a headache. The good news however is i'm done linking!
(http://img834.imageshack.us/img834/241/topcomplete.png)
*fireworks*
The base power requirement minus windmill stuff stands at 1524. When it's running things are turning on and off all over so i'll have to wait and see its peak power consumption when I put it through its paces.
As far as all the other numbers that'll have to wait untill I eliminate everything not being used. It's at this point that the project is going to split into two, one will continue on to program the AI and the other i'm going to customize to focus on text displaying which I will upload. Right now i'm just going to try to get it working and see if everything is properly linked.
*drumroll*
Success. A windfarm was built, the channels filled with water and I was able to type this with the lever keyboard:
(http://img694.imageshack.us/img694/8138/welcomecg.png)
:D :D :D
Backspace works, clear works, no errors encountered. It took a while to type out that sentence, I was inspecting everything at the same time. For the version i'll be uploading I think i'll have a type of indicator by the keyboard that lets you know when you can type something because you need to wait untill certain gears are turned off between lever pulls
I typed random characters to fill the whole 32 tile display to make sure they all worked and pulled the clear lever. It was beautiful... Slow, but beautiful. My computer isn't the greatest, I only get around 20 FPS and clearing it all took about 5 minutes (fully automated).
So happy to see some results after all this time... and without errors. I'm still going to go through it a bunch more times but it looks good. It'll be a while before i'm ready to upload it, if you've been following this thread since the beginning i'm sure you have the patience to wait a little longer. ;)
AI's making AI's?
(http://i43.tinypic.com/wmh3bp.jpg)
This is all your fault.
I say we do that, and have a fortress dedicated to the sole worship of the AI.
No good can come from this.
(http://img3.imageshack.us/img3/6703/trulululu3.png)
I wholeheartedly agree with this notion.
Ok now lets see, cool AI, levers spammed to the max...
(http://img10.imageshack.us/img10/436/evilai.png)
OH SHI
(http://img854.imageshack.us/img854/3720/deadevilai.png)
Problem solved.
That's why everyone should always have a bucket of molten lead next to his computer. For exactly these situations.
Ikr, it also solves cat problems. Every time cats explode out of my computer I give em an 'Ol bucket of lead to the face.
(http://t4ak.roblox.com/e2e547e0dcdb98e9857d2db1f336af28)
What would happen to this system, if you added 200 dorfs and had them all tantrum about? Pulling levers and so on.
I might consider doing this...
The FPS will likely be shitty regardless how it's done. Everything requires endless banks of pressure plates and pumps, the only thing different is the gearing and linkages.
The space and linkage reduction from removing numbers is very tempting... It's practically half the size it was before.
I'll leave you with this frightening image:
(http://img811.imageshack.us/img811/9120/myfpshurts.png)
Progress:
(http://img189.imageshack.us/img189/4231/wordrec2.png)
My dwarves are beginning to have less and less space to work and live. Navigation is also becoming a problem with the new construction being built over top the main stairway. To get from the surface to the 'fort' on the bottom level they need to wind through areas that will be filled with gears and axles.
Water needs to get to the level below this and my options are pretty limited. Will probably use that undug area to funnel it down.
Progress update:
(http://img850.imageshack.us/img850/9722/wordrec3.png)
Nothing fancy going on yet, just building the framework. More pumps need to be built on the level above this along with a smaller section like this being built near the surface. Doors need to be made after and then i'll probably start designing the logic banks which need to be built partially aboveground.
I was hoping I could get another alpha release out demonstrating word recognition before linking up the AI's display (an arduous task), but with the word rec now doubling as its speech center I don't know if I can do one without doing the other. It's getting harder to keep track of all that's going on, i'll know when I figure out the logic banks.
Update:
(http://img820.imageshack.us/img820/6471/wordrec4.png)
And the start of another area of machinery:
(http://img804.imageshack.us/img804/1908/wordrec5.png)
I've reduced the amount of doors I use to only the bare essentials after discovering the impact on FPS that constructions appear to have. I didn't think it would be as large as it has been, but screwpumps especially seem to hit hard even if they're not doing anything. Before gearing my region file for the 0.1 Alpha release I was getting about 20 FPS, and even though the final release had water in the channels, a running windmill farm and half a dozen more dwarves, I was getting a good 25-26 FPS simply because I removed the pumps and things from the unused AI display mechanics.
I'm considering deconstructing all of them and keeping the parts stacked nearby, only to be rebuilt when I want to test something or make a release. Mechanism linking is the part that takes the longest and if I can squeeze out an additional 5-10 FPS I think it might be worth it. Right now i'm running at 17 FPS and that drops to around 12 when all my dwarves are working. It's pretty crazy considering my region file is only 14.1 mb. That's less then a standard umembarked region.
Aaaaaaaaaaaaargh. Why FPS? WHY? I'd rather this project to meet its doom from my overreaching but I don't know if I can go much further knowing that I haven't even scrapped the surface and already my speed 0 dwarves have lost their mojo. I must contemplate...
This technical update brought to you by Aperturist !!SCIENCE!!
(I thought it was clever)
The text display works like this:
W E L C O M E _ T O _ T H E _ M A C H I N E . _ _ _ _ _ _ _ _ _
After each letter is typed it automatically advances to the next tile with each tile being controlled by 15 pressure plates. Word recognition however looks like this:
W E L C O M E
T O _ _ _ _ _
T H E _ _ _ _
M A C H I N E
_ _ _ _ _ _ _
It's very similar in that after each letter is typed it advances to the next tile, except when space is pressed it bypasses any unused tiles of the maximum characters-per-word limit of 7 and moves on to the next word. Each of these tiles is made up of 30+ pressure plate-pump combinations so there is a lot of wasted space when typing short words, but it makes for recognizing words MUCH easier. There's only 5 possible positions a word can be in that need to be taken into account, meaning I only need 5 pressure plate-pump combinations per word.
Word rec will also make it easy for me to put in place a set of rules of what can and cannot be typed by the user. 0.1 Alpha is pretty much a sandbox text display, but the next version will have rules like these:
-'!' '?' '.' '_' enter, backspace and clear will all be deactivated at the start as they have no use.
-If a 7 letter word is typed, only '!' '?' '.' '_' backspace and clear will be available.
-If you're typing your 5th word, space will be deactivated.
-Enter will be deactivated untill '!' '?' or '.' is typed.
-If '!' '?' or '.' are typed, only enter, backspace and clear will be available.
-On the 32nd slot of the display (the last one), only '!' '?' '.' backspace and clear will be available.
With these rules in place double exclamation marks at the beginning and end of a word won't be possible, sorry :P. It needed to be done to prevent you monsters from possibly breaking the AI by typing some weird shit.
Since word rec works on the same advancing/backspacing logic as the text display i've begun transcribing my messy notes onto microsoft excel. It works quite nicely, I can add logic to each of the cells so if one that represents a pressure plate is changed from false to true, all the cells that represent gears it is linked to change. I've also discovered the underlying logic behind some gears like this XOR:
=OR(E6,I6)-AND(E6,I6)
That's on a cell representing a gear, and E6/I6 are cells that represent pressure plates. If both plates are on or off the gear is deactivated, but if only one of the plates is on the gear is activated.
Here's what it looks like:
(http://img35.imageshack.us/img35/9871/excellogic.png)
The numbers are gears and the TRUE/FALSE's are pressure plates. It makes things easy to see what is linked to what at a glance.
(http://img9.imageshack.us/img9/8270/excellogic2.png)
Brain hurts have been hard at work. Word recognition logic is complete with only a few previously mentioned problems encountered. The spoilered image is an example of a smaller version and what the gearing configuration would look like if you typed a 3 word sentence with each word being 5 letters followed by a stop. 15 pressure plates, 1-5 additional ones to indicate what kind of stop was used is all the AI would need to recognize what words were typed and in what order. How it uses that information is a whole 'nother story (of which i'm avoiding...), but if it is able to and has come up with something to say i've got something for that:
(http://img717.imageshack.us/img717/3074/excellogic3.png)
I've still got some optimization to do and find the best way to initiate/disengage it but I was able to utilize the word recognition to allow the AI to type out on its display anything it wants to say. The downside is that adding support for words will be a giant pain in the ass. I'd need to destroy and rebuild gears critical to word rec, display logic and any existing word support. Right now I only plan on adding support for 1 word for when I make a release so it won't be that bad, but when/if I do decide to add more it'll have to be all of them at once. My plans of adding little by little doesn't look like it'll happen.
As for how i'm going to proceed after finishing up the logic, i've determined that the AI's display isn't a critical part of word rec and I will be able to go ahead and make another alpha release that demonstrates word rec without it. Some of the AI's display logic still needs to be built in conjunction with the word rec, but the grunt of the linking is in the display itself.
(http://img814.imageshack.us/img814/8995/outsider.png)
Its broken the surface...
Planning stage is out, building stage is in. In looking around to see where I should build the logic banks and other assorted stuff I used reveal to see how much rock formations there are on the magma level. It's right below where the mass of machinery is and there was little hope of finding much space for 2-pump transistor cells which need 5 z-levels, and I was right, but there was a surprising amount of space to fit a couple hundred or so 1-pump cells which only need 3 z-levels, 2 if you only build a single row of them. The 1-pump cells are the ones that always need to be pumping to send a signal which can be very laggy so I don't use many of them, but I should be able to fit all the ones I need for this part of the project down there and save me some space.
Lowering my G_FPS_CAP from 20 has proven its worth in mining out the new areas. When it came to dumping all the stone which is notorious for hurting FPS, I was getting a good 30FPS when I otherwise would be getting around 10. It'll still take an hour or so to dump it all but that's better then 3 hours. If anyone has other tricks to maxing FPS when minimizing DF and letting it run please let me know. :)
Bottom level of some word rec stuff:
(http://img221.imageshack.us/img221/4678/yellowgearbanksek.png)
There's quite a bit of unused space on this z-level and the magma sea is directly below, i'll take another look at it later with DFhack's reveal to see if I can make any use of it.
Linking word rec should be fairly straightforward and like 0.1 but without that one horrid part that took weeks.
Swarms of giant mosquitoes come to Doortufts and say "God damn, this place is killing our FPS!"
Some bits and bobs I keep forgetting to talk about:
When figuring out how the AI was going to use its version of a keyboard (a bank of pressure plates, what else?) I solved a problem I had very early on when I wanted the user to only need to pull the levers on their keyboard once. If I want to I can make the keyboard work that way where you pull a lever, the red light comes on telling you to wait before going green again letting you know it's ok to flip another lever without resetting the one you just pulled.
The issue becomes do I want to take up space building something about this big to make it work:
(http://img207.imageshack.us/img207/6616/keyboardlogic.png)
Space, it's always about space it seems! To any of those who downloaded 0.1 alpha, was having to reset the the levers on your own judgement much of a hassel?
I mentioned sometime before that 'clear' doesn't clear the whole display in one fell swoop because of the way backspacing works, and because the AI doesn't need backspacing I could make the AI display clear more quickly. Well I can, but I decided against it for a couple reasons. Firstly if the display were to be cleared instantly, the word recognition however won't and you'll need to wait for that to reset anyways, so it's not saving any time. Secondly, i'm quite happy with how energy efficient this whole thing is and clearing a 32 character display all at once would need a fuck ton of power.
(http://img195.imageshack.us/img195/3651/onlines.png)
Last of the word recognition gears linked, windmills constructed and some cheaty water put in the channels because I wanted to test it asap. Things are looking up! The new one-pull keyboard levers are working the way they should, my text rules prevented me from typing characters in the wrong places and the word recognition was able to keep track of what I was typing and divide it into words.
Then I tried to clear the display...
I don't know if it's working the way it should and I just don't have enough windmills, but the power requirement skyrocketed far above what I was expecting and it short circuited. I can't even tell what parts are eating up so many uristwatts unless it's running so ima have to go along with it and add to the 132 existing windmills.