Signal speed

Tell us your ideas for how to make the game better.

Signal speed

Postby Denis » Fri Aug 14, 2015 7:32 am

I've just started experimenting a bit with more complex logic. I should say "less simple" really. I've just set things up so I can switch the behaviour by changing one wire. Anyways, to do that I have one thruster (N) wired directly from a node, and another thruster (W) wired through an OR-gate (the goal being to move diagonally).

I was surprised when I powered the robot. There is a delay on the line going through the OR-gate, so the robot moves north, as that line gets hot first, then after a delay the W thruster gets hot and the robot moves NW.

Is this as intended? It can make for interesting effects, but I foresee a headache down the road for really complex logic and debuging those. Am I wrong? What do people that are at that level think?
Denis
 
Posts: 138
Joined: Wed Jul 01, 2015 12:17 pm

Re: Signal speed

Postby worfc » Fri Aug 14, 2015 7:51 am

Ha! Funny, when I saw the subject line, I thought you were working with the thing I call "signals" (more in a bit) and I was mentally preparing my answer for THAT question when I read your post.

Gate Delay: Yes, it's a thing in the game and is by design. FWIW, it's also a real thing in electronics -- that is, if you apply power to a wire from A => B and from A => OR gate => B' at the same time, B will get powered a tiny bit before B'.

It can be an annoyance but, if you know about it and think about it a bit, it can be used to great advantage. But the important thing is: it's how things work, and you don't have to worry about it being randomly "fixed" in some future update and breaking all of your brilliant circuitry.

Signals: In addition to the hot-cold state of wires and gate delay, many things also push what I (and, by extension, the game) call "Signals." For example, the "item selected" pin on your inventory drawer, when it is hot, also pushes an item signal and a count signal. These can be fed into an item sensor and a numeric comparator to determine if they're the matching ones and, if so, those sensors' outputs go hot. So, for example, you could create a circuit that says "if the selected item is wood, and I have > 180 of them, then craft a bunch of charcoal" (or whatever.)

Note, too, that there are text-registers and text-comparators. So you can push the output of a text register (say, "PICK") up the antenna, and another robot can look for input from his antenna and compare against PICK, MAKE, PLNT, and take appropriate action, based on which msg he receives.

"Signals" travel with the "hot"-ness of a wire. If the wire is hot, the input-end has received signals from the output end. (Outputs push signals, just as they push their hot/cold state, toward inputs.)

Some day ("On the list!") there will be a probe that you can use to poke around to see what signals are on the line. This will help with design & debugging.

There was something else I wanted to add about signals, but I can't remember, now. Later today, I'll copy this answer to the wiki; maybe it'll come to me then. :)
Posted by WORFC, board admin, moderator, game author.

Please LIKE us on Facebook
You can also follow us on twitter: @roboFarmCraft
Check out the development blog (short updates 1-3x/week.)
User avatar
worfc
Site Admin
 
Posts: 226
Joined: Wed Apr 15, 2015 5:08 pm

Re: Signal speed

Postby Denis » Fri Aug 14, 2015 7:47 pm

Gate delay: Ok that's cool. Does it explain variability? I have a circuit that moves up and down one row, then moves to the next row and moves up and down, etc. The "move to the next row" part is not always doing the same thing. Sometimes it moves one row, sometimes it moves two rows. Sometimes it moves directly north instead of NE to move one row, etc.
Denis
 
Posts: 138
Joined: Wed Jul 01, 2015 12:17 pm

Re: Signal speed

Postby worfc » Fri Aug 14, 2015 10:22 pm

Denis wrote:Gate delay: Ok that's cool. Does it explain variability? I have a circuit that moves up and down one row, then moves to the next row and moves up and down, etc. The "move to the next row" part is not always doing the same thing. Sometimes it moves one row, sometimes it moves two rows. Sometimes it moves directly north instead of NE to move one row, etc.


I only have limited experience in this area, but I believe the program to be deterministic. The variability you are experiencing may be "different test conditions." For example, my "ping-pong back & forth, changing rows" bot worked great so long as he was just walking/hoeing but, if he bumped something with a saw, it screwed-up the end result.

If you can snap a screen-shot of a circuit that behaves differently under otherwise-identical circumstances ("time" doesn't count!), I'd be happy to investigate.

(NOTE: Rather than a screenshot, if you've used a nickname with your farm, you can say "copy my farm 'denis' and do __foo__", which makes it easy for me to associate that copy of the farm with a bug report.)
Posted by WORFC, board admin, moderator, game author.

Please LIKE us on Facebook
You can also follow us on twitter: @roboFarmCraft
Check out the development blog (short updates 1-3x/week.)
User avatar
worfc
Site Admin
 
Posts: 226
Joined: Wed Apr 15, 2015 5:08 pm

Re: Signal speed

Postby worfc » Fri Aug 14, 2015 10:46 pm

Oh, here's one variable part, though: bumpers.

The robot only faces 1-of-4 directions (soon to be fixed with new art! :) ), but he can travel in any of 8 directions (N, NE, E, SE, S, SW, W, NW). Whatever direction the robot is moving, the bumpers feel first "forward", then randomly either 1/8 left or 1/8 right, then the other one.

So, if something about your circuit is based on a bumper feeling something not-dead-ahead, it could be variable based on the fact that sometimes what is felt-first is a bit left, then a bit right.

However (and this is somewhat key), the bumpers combine their entire list of what they feel (ahead, left & right) all in one go, before that information (felt-something or -not) is passed to the circuit.

So, if your circuit is sensing hot-or-not, then none of this matters. However, if you're using signals, the sensors tend to take the first-signal that is of the type they sense (i.e., an item sensor looks for the first item bumped, not every-item-bumped), so the order that those signals are "in" the bumper matters.

"Clear as mud", right? :)
Posted by WORFC, board admin, moderator, game author.

Please LIKE us on Facebook
You can also follow us on twitter: @roboFarmCraft
Check out the development blog (short updates 1-3x/week.)
User avatar
worfc
Site Admin
 
Posts: 226
Joined: Wed Apr 15, 2015 5:08 pm

Re: Signal speed

Postby Denis » Sat Aug 15, 2015 5:51 am

It must be the bumpers then. It's compounded by the fact that I'm always moving in diagonal and the bumpers are left-right.
Denis
 
Posts: 138
Joined: Wed Jul 01, 2015 12:17 pm

Re: Signal speed

Postby Denis » Sat Aug 15, 2015 5:05 pm

Ok here is my circuit. I highlighted the four nodes I use as isometric-thrusters (power that node, move in the corresponding direction).

This moves up a row (I select the hoe) going NW, then turns around and go down that same row (I select the dibble and plant). Then it's supposed to move one row NE and go up the next row (hoe), etc.

circuit_1.jpg
circuit_1.jpg (191.55 KiB) Viewed 3767 times
Denis
 
Posts: 138
Joined: Wed Jul 01, 2015 12:17 pm

Re: Signal speed

Postby Denis » Sat Aug 15, 2015 5:14 pm

Oh, that reminds me. I placed the iso-thrusters-nodes at the corresponding directions so I can easily remember which one is which. If I could place a text label next to the nodes I could perhaps arrange them more neatly, although I haven't thought about it much yet. Just thinking out loud.
Denis
 
Posts: 138
Joined: Wed Jul 01, 2015 12:17 pm

Re: Signal speed

Postby rkda » Sun Aug 16, 2015 2:12 am

This is very cool...to see your logic and early automation.

One suggestion for cleaning up the middle...move the NODE that powers the arm and tool, up out of the way (near the arm) and power it with a separate gate (NOT or LATCH), so that you don't have those wires running all the way to the battery, through the middle of the rest of your circuitry.

Otherwise...this looks great.

I had a similar setup, for the thrusters at one point, but never could get the bumpers to behave in a reasonable way until I got a rock sensor, so I mostly ignored them. You seem to have figured out some of what I missed along the way.
User avatar
rkda
 
Posts: 66
Joined: Sun May 10, 2015 3:20 pm

Re: Signal speed

Postby Denis » Sun Aug 16, 2015 6:15 am

This works because this moves (row by row) in the NE direction, so I use the N and E bumpers, otherwise it gets tripped by the trees on the previous row. At first I had it wired to the N and S bumpers but changed the S to E and it works. I found that it's better to start by seeds that take a longer time to grow, otherwise (say with twopine seeds) the tree obscure the view too quickly. So I end with the twopine seeds.

I've only recently made this and now I'm planting all the seeds I have on me instead of planting and harvesting what I need at a particular moment. I have more seeds in a chest but I don't use them really, I pick more up by harvesting mostly.

Thanks for the tip on clearing the center, I'll try that! :)
Denis
 
Posts: 138
Joined: Wed Jul 01, 2015 12:17 pm

Next

Return to Gameplay Feedback

Who is online

Users browsing this forum: No registered users and 1 guest

cron