Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Nil Eyeglazed

Pages: 1 ... 38 39 [40] 41 42 ... 86
586
DF Dwarf Mode Discussion / Re: The Pied Piper
« on: August 30, 2011, 03:24:25 pm »
the Pied Piper, bridge variation, COULD be used as an emergency entrance as well. (Which is what I thought it was for, to get people inside if they're outside when the siege shows up.) IF you close your gates, put out an alert, and then activate the entrances, then everyone outside will march to the nearest emergency entrance, step on the pressure plate, march up to the wall, and fall a safe 1Z into a corridor below.

There's two problems with using pressure plates/hatches for emergency fort access:

1) Building destroyers

2) No way to make a pressure plate triggerable by only citizens and not invaders

Here's what I would start with for an emergency entrance:

Code: [Select]
######
h^hhC#
######

h is hatch: middle is over a down stairs leading to your fort, first and third are over channels; ^ is pressure plate (citizens trigger) linked to all hatches and the door;
C is construction designated for removal; best to link leftmost hatch to lever so you can turn it off when desired

Now, outside dwarves path to the construction, find no path when they get there, and no path to anything outside, but now there's a staircase going down into your fortress.  The hatches form a sort of airlock, so there's never a path into your fortress at the same time as there's a path into the device.  Very close invaders still have a remote possibility of making it in along with your dwarf, but it's only a small chance, and there shouldn't be many of them.  Dwarves shouldn't path up while the hatches are open, because it's not a path to anything interesting or anything that needs doing, but if they do, they won't be able to leave the device.

To protect against building destroyers, you need something like:
Code: [Select]
 
######################
^bbbbbbbbbbbbbbbh^hhC#
######################

Right section is as above; b is bridge over channel; left ^ is pressure plate (only invaders trigger) linked to bridge

It's ugly, but it'll keep out trolls.  Won't work against titans.

If what you want to do is drop all of your dwarves into a deep, deep pit, you build:

Code: [Select]
 
###################
bbbbbbbbbbbbbbb^hC#
###################

Pressure plate is citizens trigger, linked to both bridge and pressure plate

It's not very pretty.  Not good for emergency access, because you drop near-by invaders as well, and invaders may wander onto the pressure plate themselves (if pursuing a path to a dropped dwarf, maybe?)

Longer bridge is better; fastest possible dwarves will escape this one.  If you don't want to drop all of your dwarves, it's easy to filter by assigned jobs or specific (adult) dwarf-- replace the construction with profiled lever, or with a workshop.  If you want to filter out adults and only grab children, you build pressure-plate controlled access onto the left like so:

Code: [Select]
 
##
^h
##

You just set the pressure plate to only trigger at certain weights-- 35k+ should keep out even small adults, although it might keep out some large adolescents as well.    Build it with a lower value (15k+?  Needs testing) and leave it open to institute an "Only huge children survive to age 3" eugenics program-- they won't accept the job as a baby.  As with all of these designs, you'll want to be able to block access with a door/bridge to prevent job spam.

587
DF Dwarf Mode Discussion / Stockpile Hacks: The Undump
« on: August 30, 2011, 02:34:35 pm »
Edited to represent latest research.

You may want to check out http://dwarffortresswiki.org/index.php/User:Vasiln/Undump for pretty diagrams that are probably easier to read, as well as a design variant that's more reliable, at the expense of greater complexity.

Code: [Select]
 
###
#s#
#b#
#h#
#s#
#^#
.t.

h is hatch over channel, b is bridge over channel, ^ is pressure plate (citizens trigger) linked to hatch and bridge, # is wall, s is a single stockpile that spans over the hatch and is set to take from stockpile t
. is floor (or whatever), t is stockpile with same settings as s, created after stockpile s
Orientation and build order may or may not matter

To spell it out, stockpile generates a "bring item" job, but when the dwarf tries to bring an item to the right-most stockpile job, he finds no path, and drops his item.  Luckily, he's already standing on a stockpile (with the same settings) when he drops the item, so he doesn't keep on trying to move that item.

What it functions as is a sort of quantum stockpile, but with normal stockpile sorting, without having to designate anything or reclaim anything, and you can still use the "dump" function to drop things in the magma.  This isn't just nice for reasons of space and automation-- since this stockpile is never full, it also means that if there is an item on the map that can be put in this stockpile, and your dwarves can path, it WILL be stockpiled.

Doesn't always play nice with other stockpiles, since it can hold infinite goods, but "take from" settings work fine.

Works slowly.  Consider expanding stockpile t for a sufficiently sized reserve in cases of high throughput (raw materials, etc).

An earlier iteration saw very slow dwarves occasionally making it to the last stockpile square, thus breaking the undump; the addition of the bridge doubles the length of time that the lure tile is inaccessible.  Haven't seen any problems since I started using the bridge.  EDIT: Stuff still makes it to the lure.  See the wiki page linked above for a different version that's functioning perfectly so far.

It's not uncommon for dwarves to drop goods on the pressure plate instead of the stockpile; that's one of the reasons there's the feeder stockpile, which will prevent infinite loops that could otherwise occur.  In my experience, about 1/3 of the goods make it to the pressure plate, and 2/3 to the stockpile, but this probably depends on the dwarves and the items in question.

If your dwarves are both drawing from and delivering to the undump, dwarves will occasionally drop an item on the way to the stockpile.  So don't use it for food (or anything else that will rot off of a stockpile.)

I think there are a huge number of applications:

1) Zero workshop clutter: Since any number of things can be stored on the tile, you can put your masons to work making doors nonstop and never have to worry about the size of your door stockpile.  Brewer's are another on of those shops that always give me trouble.  EDIT: Use with caution for stills.  Use of bins or barrels can lead to hauling loops.

2) Raw material: This can put a stockpile a single tile from a workshop-- a sorted stockpile, that you don't need to manage.  They're small enough that you can easily have separate stockpiles for individual raw materials, blocked off however you'd like.

3) Mini Mass Pit: Only ever need a single hatch for your mass pit.  Requires diagonal redesign, with an untriggered hatch east or west of the southern s stockpile tile, but that shouldn't break functionality.  Don't have to worry about empty cages with this plan, but you can always build one for the empty cages if that's what you want.

4) Socks: Dear God, socks.  Never again fear that an unowned sock is exposed to the wind and the rain.

5) Trade goods: No more bins necessary.  All goods you'll ever want to trade, right next to the depot.

6) Refuse: Tiny design means you don't have to worry about it getting cluttered up with goblin corpses, and it's easy to leave a single tile open to air.  If you don't care about getting any bones out of them, it can be designed to be magma-floodable.  EDIT: Refuse attracts vermin; vermin attracts cats.  Cats don't trigger pressure plates, and they kill vermin and can leave the vermin on inaccessible stockpile squares.  Use with caution.

7) Mandated goods: Mayor like quivers, and now you have 500 of them-- can't even run a designate dump on your front porch to clear the goblins because of prohibition of exporting quivers?  Here's how you store those goods, and whenever the mayor drops his export mandate, they're all in a nice single square, ready for designate-dump.

Poor applications:

1) Food.  It won't always make it to the stockpile square, and will rot.

2) Drinks.  They don't rot, but to stockpile them, you need to enable barrels, and that has the potential to lead to an endless loop of pick the barrel up, drop the barrel.

I'm also playing with a dropping version of this-- instead of the near stockpile square, I have another hatch, combined with a one-way, goblin-grinder style path to the undump that automatically drops goods on the way out.  So far, this is working without a hitch (I've got it dropping skulls into magma), but there's the theoretical potential for dropping a dwarf rather than his goods when doing this.  So far, it hasn't happened, so I imagine the risk is slight.  (You can make a foolproof dropping undump, but it's incredibly complicated and runs really, really slow.)


EDIT: Just a warning, because people seem really excited about this-- while I've tested this, it's not always been in a real-fortress environment.  I've been testing using super-fast dwarves (EDIT: slow dwarf test later in thread), and maybe that affects things.  Even then, there's an occasional problem, and I don't know exactly how many headaches this would cause vs. how many headaches it would resolve.  So I'm looking forward to anybody's real-fortress reports of the design-- there's always room for it to not function as well as intended.  EDIT2: I've edited this post as I've performed further testing, and I believe that the design given above, within the limits specified, is functional and useful.  Some of this thread is in reference to previous designs that aren't as useful.  Last tested, v34.02.

588
DF Dwarf Mode Discussion / Re: The Pied Piper
« on: August 30, 2011, 03:27:26 am »
This doesn't work: hatches activate instantly.  The dwarf will step onto the plate, and the hatch opens immediately.  Without a path, the dwarf will cancel the job and wander off.  Replace the two hatches with a drawbridge that raises towards the plate.  This will cause the dwarf to step on the plate, and walk forward.  100 ticks later, the bridge will raise, forming a wall, and negating any "fling" from the bridge, due to the 1x1 space.  With an empty space there now, the dwarf falls straight down, and the bridge resets.

Good luck doing this in time to get all your dwarves inside during a siege.

The point's not to drop them-- it's to summon them.  (You're right, though, that a bridge based construction similar to this could be used for dropping dwarves, if that's your thing.  I'm pretty sure you'd need to reload it every once in a while though.  Still, it would be more useful for most people than my device.)

What you do is build several of these deep in your fortress.  Depending on population, you might need a lot, but they're simple so you can do that.  The dwarf gets there, cancels the job; 100 ticks later, the path opens up again, and some dwarf-- maybe the same dwarf-- takes the job.  You need a number of these proportional to your population, but every idler will get grabbed.  The further you place these from where you don't want your dwarves, the better.

The dwarves might wander off when they lose path, but the job is high enough priority that as long as one of these is unclaimed, they won't wander far, and you've already done your job by bringing them to a certain location.

It'll work nearly instantly-- almost as fast as you can pull a lever (and consider a high-speed creature-based switch if that's not happening fast enough for you).  Remove construction is a super high priority job.

I envision using this to control year-long flow through a fortress.  With slightly more than your population, you can bring your entire population to any particular point in your fortress just by flicking a switch.  As soon as you want them to return to work, you close the hatches.

EDIT: If you're not so hot on the idea of idler/child summoning, maybe you'll see the value in a small variation-- I call it the Undump.  They're gonna be big one of these days.  One day, you'll say things like, "Yeah, I used to play DF, before undumps came along and ruined stockpiling."

Code: [Select]
 
#####
^shs#
#####
h is hatch; ^ is pressure plate, citizens trigger, linked to hatch; # is wall; s is stockpile (same type)

Single tile stockpile while preserving dump functionality, without having to mark anything as dump.  Tested.  Works.  No bins necessary, etc.  Works great for mechanisms, doors, bags, corpses, hair, skulls, ammo, even stone should you feel the urge for a clean fortress.

589
DF Dwarf Mode Discussion / The Pied Piper
« on: August 30, 2011, 03:00:57 am »
Tired of your dwarves wandering outside during your sieges?  Burrows never seem good enough with so many idlers?  Don't want to keep track of your children?  Try the Pied Piper!

Code: [Select]
 
#####
^hhC#
#####

^ is pressure plate linked to first left hatch, citizens trigger; h is hatch (right hatch is connected to lever for turning it off); C is a constructed wall designated for removal

Build a few of these, throw the lever to give your dwarves a path, and watch them come tumbling in!

Features include:

Attracts children and other worthless citizens! (Warning: does not attract animals or the handless)
Easily toggleable!
High priority job!
Never needs winding!
Easily expandable!
So small, you can store it in the closet!
Can be used to guide movement to any part of your fortress, at the flick of a switch!


Once you've tried one Pied Piper, you won't be satisfied until you have two hundred!

590
Then again, I might just build one.

Here is my plan for 16 bits of memory.  I plan to have 8 of these, to run 4 bit instructions taking a 4 bit address argument and to have 8-bit data bytes.  Of course, you can always use more than 1 byte to store a value.



First thing you might notice is that 16 bits are a lot more streamlined than our single bit with addressing goblin.  We can use a single goblin to read from or write to the specified bit.  That unfortunately means he's going to be moving slower though.

Second thing you might notice is that everything is a little streamlined.  We still have 4 paths per bit, but we're reusing some of those paths.  Since our addressing goblin is guaranteed an addressable bit, we don't have to give him a backup path.  Our memory doesn't have the side doors either.  That's because I realized we don't need them.  We just send a trip to one of the hatches between memory states.  (By trip, I mean an open-close signal, like we get when pathing over a pressure plate.)  That's a little slower, and I might build doors in later.  I've got the room.

Next thing you might notice are two special memory bits.  They're versions of my memory 2.0.  That's because these are going to have special functionality.  Together, they will form a 16-bit clock that I can read from.  That's nice functionality for any programs we might write.  The first clock bit toggles from a clock signal, and each succeeding bit increments every time the last bit goes from 0 to 1.

But I can also write to them.  That's important for a couple of reasons.  One is that if my clock rolls over to 0 before I check for time>clock+100 (for instance) then my programs won't work.  So I want to be able to zero my clock.  The other reason is that 16 bytes aren't a lot of memory space, and I want to be able to use these clock bytes for regular computer purposes if I don't need my clock.

Wouldn't positions 0 and 1 make more sense for my clock bytes?  Or 14 and 15?  Yeah, but reading from clock is very timing dependent.  I want these bytes close to my addressing goblin.  In fact, my increment clock signal needs to open a hatch for each clock byte to prevent reading or writing during state transitions.  (I can already write without triggering the increment feature.)

There's one more thing I'm going to need, because if I want to use my clock bytes for regular data, I need to output to clock, to send Dostngosp along an alternate clock loop (so he keeps time) that doesn't increment my clock bytes.  I could make a special output instruction, since I now have room for 16 opcodes and only use 6, but instead I'm going to designate an output byte.  That means that the state of my clock (increment clock bytes, or don't increment) is going to be determined by one of my memory bits.

But I'll eventually want to output to other things as well, and I don't want to waste a byte on each output.  So we're going to need a way to write bits to memory instead of bytes.  Right now, we don't have that.  We'll need a new instruction for our cpu.

There's one other thing.  Our computer is going to run really, really slow.  It won't be able to keep up with the numbers on our clock.  So we're going to change our comparison instruction from a "jump if reg1=reg2" to a "jump if reg1>=reg2."  That'll work for clock programs, and it'll still work for FOR loops.  Mostly, we can use our exact same comparison design-- we already have an arm that fires if reg1 is 0 and reg2 is 1, and vice versa.  We're only going to have change how we handle the integration of 8 of those signals.

EDIT: Actually, I can read and write bits.  To toggle bit 0, for instance, I increment it once.  To read bit 7, I see if it's >=128.  Reading bit 0 takes a lot of operations and/or constants, and writing to bit 7 takes a lot of incrementation.  I don't think I'll have the memory to read bit 0 (but there's probably a trick to trade speed for memory.)  Someday I'll need bit-specific operations, probably a position shift, but for right now I won't worry about it.

Also, my output byte should also be an input byte, to report on the status of every device outputted to.  That way I can still have a lever controlling my drawbridge and maintain programmed drawbridge functionality.  So the output byte will need to be synced like the clock (outside input blocks read/write access via a hatch triggered with every write) to prevent simultaneous read and write operations.  This goes both ways (for the clock too).  Since I can't slow Dostngosp, I'm going to block access in anticipation of his write, as well as following his write.  Maybe I'll only allow a brief window to write.  I'll need adressor ground after all, for when no path is accessible due to outside writes.

591
DF Gameplay Questions / Re: The DF2010 Little Questions Thread
« on: August 29, 2011, 02:46:38 pm »
Alright, I was filling up a moat with water and a war dog decided to wait on the other side of the wall.  When I let the water in, I thought for sure it would have drowned, but for some reason it's just chilling and not drowning.  Is there an explanation for this?  It's submerged in 7/7 water and I threw a dwarf in for good measure and he's drowned while the dog hasn't.

They won't drown unless there's a ceiling above them or unless they get stunned.  A drop causes stunning.  Even in the case of stunning, there's a chance of survival.

592
DF Gameplay Questions / Re: Auto-Resetting Drop Trap
« on: August 29, 2011, 02:32:24 am »
If you had a lever hooked up to a hatch such that the lever-puller is dropped into a pit, then hooked up a pressure plate where the droppee would land, would the following sequence
Spoiler (click to show/hide)
occur?

As has been said, it won't work because your dwarf will stand on the lever square to pull, but other than that, your reasoning is correct.  The pressure plate will send a close signal that will automatically close the doors.  In fact, even if another dwarf was standing on a different pressure plate someplace opening the hatch, the close signal would still close the hatch.

This can cause problems for some designs; it can also be useful.  I've been using the effect frequently recently in creature-based logic machines.

It's true that you'll need to pull the lever twice-- as first pull will send close, second will send open-- but it's easy to just queue up two pull tasks for each lever; the same dwarf to accept the first job is almost guaranteed to accept the second job.

(The thing I do is to make a lever and a pressure plate in front of it.  The pressure plate is the trigger; the lever is connected to nothing, and is designed just to send a dwarf over the pressure plate.  That way my devices sort of automatically reset to base state.  Not what you want for a drawbridge, but what you want for your sort of device.)

Here's what I'd do for your sort of device:

Code: [Select]
 
#############
bbbbbbbbbb^l#
#############

b is bridge, ^ is pressure plate linked to bridge, l is unlinked lever


Dwarf walks over, trips the pressure plate; depending on speed, bridge drops him.  Longer bridge is better, as fast dwarves will get away before a ten-long bridge opens.  Close signal gets sent from pressure plate after drop, system returns to base state.

593
Most certainly yes, my first dwarf death ever on my first fortress was an impaled dwarf kiddie in my first danger room, the idiot mother brought it in with her

Lol, I'm not sure that the idiot mom knew that the fortress overseer was intending to try to impale her on spikes a few thousand times.  Not the first thing you think of when the boss tells you, "Quick!  Go station in the basement!"  She might have rethought elsewise.

You don't have to put all of your dwarves in a danger room, you know.  You could just station the ones without kids there.

594
DF Gameplay Questions / Re: The DF2010 Little Questions Thread
« on: August 29, 2011, 01:19:59 am »
Like? When I want 'em to go somewhere IMMEDIATELY, I kinda need 'em too. Set them all to make stone bins? x.x

Thanks for the help, btw.

In my forts, creating a big stone stockpile usually does wonders for pulling in idlers.  Just have to remember to delete it afterward.

(I can't use civilian alerts because I generally run close to 100% military.  Never seemed to work on unit members, even if inactive.  Maybe I never gave it enough of a chance.)

595
Just get the runesmith utility and set attributes your self, eliminates testing.

The thing is, it doesn't work.  First you have to know what causes a certain speed; as far as I know, that's not a solved problem.  Yes, agility and strength affect it, but so does something else, something unknown.
With an even larger sample size of goblins, we could test out various attributes and physical traits. Unless for some reason it is completely hidden, in which case we all owe a big thank you to Toady. This would work better with a more thorough sorting system using smaller speed intervals than greater and less than 10.

In fact, I think I'll look into building such a thing. Set all their attributes the same, let them sort out. Search for patterns based on height, size, etc. Using your current sorting system, I might be able to get results if the variances are great enough.

That would be pretty cool.  During the construction of my QA, I kept thinking about the possibility of more advanced sorting.  It's a much more difficult task than the kind of sorting I did-- 10/step is kind of a magical number, easiest to test for.

I've looked into the problem of speed before here ( http://www.bay12forums.com/smf/index.php?topic=91016.0 ) if that's any use to you.  Because it's a topic of interest to me, I've been looking for patterns in my goblin races, but I haven't noticed anything.

596
Just get the runesmith utility and set attributes your self, eliminates testing.

The thing is, it doesn't work.  First you have to know what causes a certain speed; as far as I know, that's not a solved problem.  Yes, agility and strength affect it, but so does something else, something unknown.

597
Comparison

So I said the only thing we haven't demonstrated is a compare function.  We want to look at two values and see if they're the same value.  Note that doing this for a 6 bit value is just the same as doing individually for 6 one-bit values-- if they all match up, we have identity.  If any of them don't, we don't.

This is really simple stuff-- it's what all that XOR NOR XERXES crap is.  I'm going to pretend they use that jargon just to make it look more complicated than it is :)



So let's see what we have here.  We have two memory cells.  We have a comparison jiggeroo.  We have output memory.  If the values of our first two memory cells are equal, we're going to set output memory to 1; else, we're going to set it to 0.



Since there are 4 possible values of the contents of 2 bits, we've (once again) got four pathways for the goblin (erm, elf) to take, and only one is going to be open at any given time:

If neither are true, the hatches on the NW permit motion, and he goes up that way.  This is a NOR.  He triggers a pressure plate that sets output = 1.

If both are true, the doors in the SW permit motion, and he goes down that way.  This is an AND.  In conjunction with our previous NOR, this is an XNOR.  He triggers a pressure plate that sets output = 1.

If one is true and the other is false, one of the paths to east is open.  These two paths in conjunction are an XOR.  He triggers a plate that sets output = 0.

When he's all done, he returns to start and waits to receive the signal to do it again.

I built this to return true if values are equal, but you can see we can make any kind of comparison of two values with just hatches and doors.

Since we need to only return true if all 6 bits are true, we can make a special kind of memory cell that sees between bits.  It's just an elongated memory cell with 6 doors in the middle, each door linked to the state of the comparison (we don't actually need our little output elf that I showed here).  When all values are true, the goblin can move.  Otherwise, he can't.

Movie at http://mkv25.net/dfma/movie-2366-creaturelogicidentitycomparison

And there is every single tool we need to build a programmable computer without using any power-- without using anything but rock and dwarves and a lot of invaders.

I don't think I'm going to do it though.  No real point.

598
I'd try this but I don't think I can even grasp it, let alone comprehend it.

I'm happy to explain anything.  The fun in this for me is totally in figuring it out, and I think just a little bit of understanding can get the creative juices really flowing.  Basically, anything is possible.

One thing I don't mention very much is the basic layout of controlling goblin movement.  It's totally based on Fenwah's goblin grinder designs described at

http://www.bay12forums.com/smf/index.php?topic=62798.0

and I totally owe Fenwah a shout-out.  I think a lot of people missed the fact that Fenwah's real innovation wasn't the goblin grinder trap, but the high speed switches he (she?) designed.  I straight up ripped off one of those switch designs are my basic memory cell.  (I didn't even realize that until I just looked at the thread again).

Quote
1. While this DOES make it less dwarfy, it is easier to get 400+ cats or tame birds than goblins. To make up for it, drop failing cats/birds to give the clock a nice red coat.

Isn't there a breeding limit?  And it's hard to kill off cats to get a new test set.  In the meantime, the goblins send me about fifty invaders once or twice a year.

And they don't die of old age, don't have babies, don't eat or drink, don't sleep, don't go berserk or melancholy.  Flightless birds might be okay, but they still die of old age.

Mostly, I'm just not too familiar with domestic pathing, and by now I'm really confident about invader pathing.  Like, aren't cats trapimmune?  And what if they start pathing to some vermin in the same cell as the cat?  Plus, building these pressure plates with citizens trigger would mean build hell-- think of all those stuck dwarves.

Quote
2. Speed is measured in hundredths of a step between moves. To my knowledge, a creature cannot have a fractional speed.

You notice that I talk about delay, not speed.  That's because delay is something that I can observe, whereas speed is not-- although you can express either as a function of the other.  When I say that a creature has a 9.99 delay, one way to think about that is that it's a creature with 899 speed.  That means a 99% chance of moving at delay 10 with any given move, and a 1% chance of moving at delay 9.  The probabilistic nature of movement is one reason that I have to run creatures through the loop so many times, and even then, I can't have full, 100% confidence that they're actually delay 10.

Delay should be (speed+100)/100.  But attributes modify speed, and don't do so in integer based increments-- a creature with 900 speed and high agility, for instance, might function as if it had a speed of 850, so what would high agility do to a creature with base speed 100?  Same modifier would lead to fractional modified speed unless Toady rounds it, and he doesn't have to round it to the nearest whole number.  There are other modifiers too, ones that I don't understand.  But the overall picture is that I'm not going to work under the assumption that delay*100 is an integer.  Well, at least, I don't have full confidence in that assumption, even if I do believe it.  (Notice that I have been working under the assumption that some multiplier of delay is an integer.  Otherwise, there is no way that I can ever have any level of confidence in my delay 10 goblin.)  (Heavily edited this section because I got it wrong the first time-- so if you're saying, "Wait, you were wrong and you changed it!" you're correct.)

On preview:
Having watched the video, I have a question:

Why is it that you can forbid the doors even after goblin prisoners pass through them without the doors becoming claimed by the enemy and thus uncontrollable? Is it because the goblins are trying to escape rather than attack?

Wow.  That's a good question.  I've never even stopped to think about that.  I guess it must be because they're all captured and in flee mode.  (Just in case it's not clear, those are just manual switches that allow me to set memory values before my whole computer is finished.  They can be easily automated, as demonstrated by the memory and register cells.)

Okay, excuse my tangents, and permit me a new one.

I've just been making components so far, but it's time for the big picture.  I've got to figure out exactly how my processor is going to function.  There's got to be a flowchart:

1) Read 6-bit value from memory address pointed at by 3-bit next_instruction_address register into buffer (I was calling this a register before, but now I'm going to call it a buffer)

2) Increment next_instruction_address register

3) Copy first 3 bits of buffer to 3-bit next_instruction register

4) Copy last 3 bits of buffer to 3-bit instruction_target_address register

5) Evaluate next_instruction:

 a. 000: Jump: Set next_instruction_address equal to instruction_target_address
 b. 001: Read to register 1.  Write 6-bit value pointed at by instruction_target_address into buffer.  Copy buffer into 6-bit register_1.
 c. 010: Read to register 2.  Write 6-bit value pointed at by instruction_target_address into buffer.  Copy buffer into 6-bit register_2.
 d. 011: Write from register 1.  Copy 6 bit register_1 value into the memory cell pointed at by instruction_target__address
 e. 100: Increment register 1.  Add 1 to the 6-bit register_1 value.
 f. 101: Compare registers.  If register_1 is equal to register_2 then set next_instruction_address equal to instruction_target_address; otherwise, don't do anything

6) Repeat.

So to make this I'm going to need:
 a 6-bit buffer (writes to and reads from any memory; writes to and reads from register 1; writes to register 2, instruction register, and instruction_target register)
 a 6-bit register (write to or read from buffer; increments; compares to register 2)
 another 6-bit register (read from buffer; compares to register 1)
 a 3-bit next_instruction_address register (increments; reads from instruction_target register; addresses memory)
 a 3-bit instruction_target register (reads from buffer; writes to next_instruction_address; addresses memory)
 a 3 bit current instruction register (evaluate to determine instruction)

We know how to build increments.  We know how to build memory.  We know how to read and write.  We know how to address memory.  In fact, the only thing we need that we haven't already built is a compare function.  (We'd be better off using an add rather than an increment for instruction 100-- we can always store a 000001 someplace in memory.  Hell, we could design an add that outputs to register 2, store a 000000 in memory, and then we could free up instruction 010 also, although if we did so we'd probably want a write from register 2 instruction.  But increment's good enough for now.  After all, with a loop, we can add anything anyways.)

And with that, I'll have a programmable computer.  Of course, the only thing it'll really be able to do is run a FOR loop.  I've got space for two more instructions.  Any suggestions?

599
When I said memory 2.0 could do everything we wanted, I wasn't totally correct.

If we're ever going to build a computer. we need addressable memory.  That means that we want to be able to read any of a number of memory cells (specifying the cell, of course!) and do some operations on the info that memory contains.

Addressable Memory

So I think a lot of people think dwarven computing means XOR and NOT and stuff.  Those are fine, and if I can maintain interest, we'll get to them eventually.  But central to the idea of programmable computers is addressable memory, and I haven't seen anybody talk about it.

Now, eventually, we'll have to do a bunch of operations on our memory.  But we don't want to have to build that functionality into every memory cell!  So what we're going to do is assign minimum functionality to each memory cell that we have.  We're going to allow it to write to a register or read from a register.  That's all.  We're also going to specify exactly which memory cell we want to write to or read from.  When it gets to the register, we can do all sorts of operations on it there.  It's easier that way.



That's a big picture for a single bit of data.  Unfortunately, I think addressable memory is going to be expensive, space-wise.

Still, it's not like everything in that picture needs to be multiplied.  Each memory cell needs an addressing section, but we only need one register and one of each of the three address memories (well, more than that really, if we ever want to have more than 8 memory addresses).  We'll need at least one read/write toggle, but not one for every memory cell.

There are a few other things in that picture.  There are two levers.  One is a toggle for our register for testing purposes.  The other is a clock signal.

So what we want is to either write to memory from the register or write to the register from the memory.  We want it to be a specific memory cell.  And we want the whole system to return to normal when it's done.

The simplest part of this is the actual addressing.



Each signal contributes to what's called an AND, and also contributes to what's called an OR.  Each address refers to x, y, or z position, to make things easier for us to keep track of-- that's why it's three bit, but it's easily extensible to any number of bits you need.  In this case, we're pretending our cell is at position 1,1,1.  If all three address bits are in the right position for any given piece of memory, a path exists north, through a pressure plate that will read or write.  Otherwise, a path exists south-- that's just to bring our system to reset.  You'll see.  Note that both paths can't exist at the same time!  Only one path at a time for our poor goblins.

So let's pretend that our cell is being addressed.  Our goblin has four options, each guarded by two doors.  The leftmost paths both write to the register from memory; the higher doors specify that function, as determined by the state of our read/write cell.  The lower doors are set by the status of memory: if memory is true, we write true to the register.

Obv, the rightmost paths read from the register, and write to memory.

Again, notice that only one of the four paths can ever be open at once.

Notice what happens when the goblin is done writing whatever needs to be written: he runs to his original position.  We can use that pressure plate to evaluate whether all writes have been completed.

But for right now, that wouldn't make any sense, because there's only one write occurring.  So I've introduced a clock signal.  Every time I hit that lever, it's going to trigger the pressure plates leading from the goblin's position through both the AND and the OR gates.  Doing so will get the goblin to write, if he's in the chosen cell; otherwise, he'll run through the OR, basically, just to undo the hatch reset introduced by the clock signal.

This is a working design-- I've just tested it.  There's one problem, which is that the goblin running through the OR arm makes it through too quickly-- it takes a while before he has a path back through his reset position, and sometimes he goes through reset before it actually can be reset, dragging it our further.  So you want a longer OR arm if you're going to make this.

What if you don't want a 1 bit processor?  It's not complicated.  For each extra bit you want, you have another iteration of your memory-- all of your memory, uggh-- and another instance of your register bit.  The addressing memories, however, don't have to be duplicated.  Each addressing memory should instance every addressing section, regardless of bit location.

What if you want to address more than 8 (2^3) bits?  Do you need more doors?  No, you just need a translation service for each multi-bit chunk of memory.  With 6 bit addressing, you can do the same thing, just with 12 different goblins keeping track of column, row, and level.  The choice of three addressing doors (and three addressing bits for the demo) was totally arbitrary.

Here's a movie:

http://mkv25.net/dfma/movie-2365-creaturelogicaddressablememory

BTW-- not a computer dude, just figuring it out as I go along, please excuse any terms I'm using incorrectly.  EDIT: In fact, it's not an OR, it's a NAND gate.  If it was doors instead of hatches, it'd be an OR.  Kind of the opposite of an OR, kind of the opposite of an AND.

600
DF Dwarf Mode Discussion / Re: Dwarven... "Child Care"
« on: August 28, 2011, 02:13:50 am »
Uh, no, the children DO kill the animals.
I have actually had a child go into a rage before.
Trust me. It does happen. This happened in only two years, with ONE kid.
Spread that across 12 with 3-6.

You're right, I wasn't considering berserk children.

Still-- wouldn't going berserk be less likely with friends, and with more room for happiness-inducing stuff that larger chambers could afford without sacrificing creature density (because all of the children and all of the animals were in one room)?

Pages: 1 ... 38 39 [40] 41 42 ... 86