Transport Tycoon Forums
https://www.tt-forums.net/

LED counter
https://www.tt-forums.net/viewtopic.php?f=29&t=37902
Page 1 of 4

Author:  Igloo [ Sun Jun 08, 2008 7:08 pm ]
Post subject:  LED counter

While playing this game, messing around with train signals, I wondered whether it was possible to create electronic circuitry with the help of signals, trains and tracks. After several days of trial and error, the attached save game is the result.
In short: I have made a ´LED´ display that counts the amount of times a train passes a certain track (see image, showing the number 3). At this moment the display will only count to 7, and then reset.

In terms of efficiency, we're doing not so well: the display takes a couple of days to update, which gives it a clock speed of approximately 0.000002 Hertz (consider that regular computers are into the gigaherz range).

Attachment:
LED.png
LED.png [ 27.19 KiB | Viewed 18007 times ]

This savegame runs on the latest stable build of OpenTTD (0.6.1.0).

Check it out :)

Attachments:
Iglandir2.sav [705.83 KiB]
Downloaded 1409 times

Author:  Core Xii [ Sun Jun 08, 2008 7:23 pm ]
Post subject:  Re: LED counter

That's wicked, but how about a little closer zoom screenie?

Author:  broodje [ Sun Jun 08, 2008 7:34 pm ]
Post subject:  Re: LED counter

You sir.... you've got way to much time on your hands! Incredible fun to watch. It took me some time to find out where the clock was though, I hadn't noticed the passenger line was such an important part of the design. Show's quite well that conditional orders aren't needed to make a nice switch board, or should I regard your design as 'too low level' to be usable? ;).

Author:  moki [ Sun Jun 08, 2008 8:01 pm ]
Post subject:  Re: LED counter

I guess, the "computer" could be made slightly faster by using maglev trains in the switches as well as in the "display", though I still don't know how exactly this thing works after staring at it for ten minutes... :shock: quite impressive, to say the least...

Author:  Tom0004 [ Sun Jun 08, 2008 8:39 pm ]
Post subject:  Re: LED counter

This is some what mad.

Well done !! 8)

Author:  zypa [ Sun Jun 08, 2008 10:40 pm ]
Post subject:  Re: LED counter

This is sick ;)
How much time did you "waste" on this savegame?

Author:  AntBUK [ Sun Jun 08, 2008 11:53 pm ]
Post subject:  Re: LED counter

Sounds like somebody needs to discover a copy of WireWorld...

Author:  Roujin [ Mon Jun 09, 2008 2:43 am ]
Post subject:  Re: LED counter

Interesting.. I've started to make some comments on it with signs, but I've given up on the magic that's happening in the east oO It's too late right now for such things :shock: here's my commented save file for those who are interested in it.

Unfortunately I've done it with trunk, not 0.6.1, so you'll need trunk/nightly too to load it...

Here's also a screenshot.

Attachments:
File comment: comments by me. Work by Igloo. ;)
LED comments.png [66.01 KiB]
Downloaded 1655 times
File comment: The savegame. Made with r13419.
Iglandir2 comments.sav [707.02 KiB]
Downloaded 631 times

Author:  Draakon [ Mon Jun 09, 2008 7:48 am ]
Post subject:  Re: LED counter

So what this does is count how many trains pass on a certain line?

Author:  Igloo [ Mon Jun 09, 2008 9:51 am ]
Post subject:  Re: LED counter

Thanks for all the replies, and yes I am slightly mad ;-). This project took several days of slow and steady improvement.

The savegame contains a network that counts the trains that pass from east to west along the maglev line. However, it does take quite some time to update because the network is quite slow. Updating the system to maglev is possible, however, when I did that not all gates worked correctly so I stuck with railroad.

Roujin: you deciphered it correctly =]. Tonight after work and soccer I'll post a version including more details.

Author:  Roujin [ Mon Jun 09, 2008 10:38 am ]
Post subject:  Re: LED counter

Igloo wrote:
Thanks for all the replies, and yes I am slightly mad ;-). This project took several days of slow and steady improvement.

The savegame contains a network that counts the trains that pass from east to west along the maglev line. However, it does take quite some time to update because the network is quite slow. Updating the system to maglev is possible, however, when I did that not all gates worked correctly so I stuck with railroad.

Roujin: you deciphered it correctly =]. Tonight after work and soccer I'll post a version including more details.


Looking forward to it. I didn't really get the rest (where I didn't place signs) yesterday, e.g. why there's two 3-bit numbers, of which one is increased as soon as the passenger train reaches the point I've labelled "start of mechanism", and the other is adapted to what the first one holds as soon as the passenger train reaches the point "checkpoint 1".
Also the eastern part which probably counts up by one and then handles overflows and such was too confusing for me to be understood in each detail :? I also failed to understand what your structures there using trains with ~3 wagons exactly do.

Author:  CommanderZ [ Mon Jun 09, 2008 5:54 pm ]
Post subject:  Re: LED counter

That's awesome. I had to laugh when I was looking at the refreshing display.

Btw, couldn't "tunnels can cross each other" cheat make your work easier?

Author:  Frostregen [ Mon Jun 09, 2008 8:42 pm ]
Post subject:  Re: LED counter

Impressive :)
Reminds me of the old NAND-Signals Patch ;)

Author:  Igloo [ Mon Jun 09, 2008 10:31 pm ]
Post subject:  Re: LED counter

After playing this game for a while it became clear that the signals are very powerful. Which led me to wonder whether it is possible to build all logical gates in openTTD using only trains and signals. From there on it went downhill. The attached save game is the same save game I posted previously, but now with lots of comments.

Overview of the logic gates
In the system a green sign represents a value of 1 and a red sign represents a value of 0.

The OR gate is trivial:
Attachment:
OR.PNG
OR.PNG [ 19.74 KiB | Viewed 16673 times ]


The AND gate is not quite so simple. When the first train stops before the sign near Bit I or Bit 2 the presignals send the second train through the checkpoint. This turns the output to red. If both Bit I and II are green the trains will never go through the checkpoint.
Attachment:
NOT.PNG
NOT.PNG [ 23.1 KiB | Viewed 16687 times ]


The NOT gate was the hardest. By using a combination of presignals and standard signals it was possible to keep one piece of track occupied continuously if the input is green.
Attachment:
The attachment NOT.PNG is no longer available


The memory is simple in itself. However because the system does not use a clock-pulse it became more complex. To work around this problem the memory stores it's state internally before the output is updated. Hence two trains for each bit.

The other parts of the system are large combinations of ORs to convert binary numbers to decimal and to update the LED display on basis of the decimal value.

Author:  Igloo [ Mon Jun 09, 2008 10:34 pm ]
Post subject:  Re: LED counter

Apparently only three files can be included in a post :?

Attachments:
Iglandir comments.sav [708.15 KiB]
Downloaded 411 times

Author:  XeryusTC [ Mon Jun 09, 2008 11:03 pm ]
Post subject:  Re: LED counter

I've tried to do the logic gates too one day, OR is not so hard as it is the default of presignals. AND becauses a bit harder but isn't that hard to get as you can simply add an extra signal IIRC, it has been a while though.
I think I never got the NOT gate to work although I fiddled quite a bit with it.
I also remember having completed another logic gate but I don't know which one.

Kudos on the LED counter though, I haven't looked at it but it sure seems like it took you A LOT of time and thinking to make it work.

Author:  Ammler [ Tue Jun 10, 2008 7:38 am ]
Post subject:  Re: LED counter

OMG, that is crazy! ;-)

Nice to see, someone reached to make a NOT and AND (NAND) without patching: viewtopic.php?f=33&t=26364


Greets
Ammler

Author:  flake [ Wed Jun 11, 2008 9:43 pm ]
Post subject:  Re: LED counter

crazy :o

thank you for amazing me.

Author:  Roujin [ Wed Jun 11, 2008 9:48 pm ]
Post subject:  Re: LED counter

Thank you for posting the commented version. Now I also understand the eastern part. Who would have thought that these wacky constructions with the waypoints are nothing else than AND-gates? 8) Great job on managing to build them! :)

edit: now, how long will you take to build a turing machine out of rails, and emulate OpenTTD on it? :lol:

Author:  hertogjan [ Thu Jun 12, 2008 8:00 am ]
Post subject:  Re: LED counter

This is really nice :)
It reminds me of a similar program I once programmed in QBasic, which basically was a binary adder (the thing that adds two numbers, not the snake) using a train and a lot of switches. If one figures how to make the switches work reliably in OpenTTD, then one could make a binary adder in OpenTTD as well, although it will be quite large, I guess.

Page 1 of 4 All times are UTC
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.