Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Tue Mar 19, 2019 5:03 am

All times are UTC




Post new topic  Reply to topic  [ 63 posts ]  Go to page Previous 1 2 3 4 Next
Author Message
 Post subject: Re: LED counter
PostPosted: Thu Jun 12, 2008 2:04 pm 
Offline
Engineer
Engineer

Joined: Thu Jun 12, 2008 1:34 pm
Posts: 5
This is awesome, very well done! I am thinking about the posibilities atm, what about a self regulating network :shock:

Example:

- Power station (a)
- Coal mines (b and c)
- Trains (<\> = network direction)
- Presignaling according to a memory track ( ! )

..................................................
.________<___[--a--]_____.....
/............................................\...
|.............................................|..
.\!______[--b--]_____>____/...
...\_____________[--c--]__/.....
..................................................

Each train has the orders to drop all cargo at the power station and thats it, no pick up orders what so ever. After it has finished the drop off, it moves on the mainline and starts heading to the power station to drop off again! But this is were the fun starts, the network forces the train to move to one of the two coal mines before it reach the power station again. The network makes the track descision by checking a bit (train) that says 1 if there is allready a train heading to/in the station or 0 if there is no train yet on that part of the track. When the train reaches the station it will autopick the coal thats waiting and move on.

I dont have this working yet, but it unlocks some cool posibilities, however dont expect some clean networking ;). I like the idea of simply unleaching some trains on the network with only 1 order to get them into action, and let the network do the job!

btw: when I give a train really no orders, the pathfinding doesnt seem to check the signals ahead. example: The moment a train reaches a T junction he randomly picks an option not looking at the next signal, so a sec after he chose the path he can stand still because the next signal has been red all the time... Is there a way to avoid this stupid behaviour when without using orders?


Top
   
 Post subject: Re: LED counter
PostPosted: Thu Jun 12, 2008 9:35 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 11:28 pm
Posts: 14
Hertogjan: the savegame uses a half-adder to count. Once you have the basic logical gates building an adder is not that hard a task (it is quite cumbersome though). The commented save game contains isolated examples of the gates (AND, OR and NOT). Using those it is possible to make an adder, which indeed is quite large and very, _very_ slow ;-P.

Tjark: it would be realy cool if those gates could be used in a meaningful network :D.

_________________
if triangles had a god, He would have three sides


Top
   
 Post subject: Re: LED counter
PostPosted: Thu Jun 12, 2008 10:28 pm 
Offline
Engineer
Engineer

Joined: Thu Jun 12, 2008 10:00 pm
Posts: 10
So who's willing to build a complete ALU that can accept user input in the form of ordering trains to proceed without signals?


Top
   
 Post subject: Re: LED counter
PostPosted: Sat Jun 14, 2008 8:13 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Wed Sep 22, 2004 2:56 pm
Posts: 132
Location: 10.0.1.254
Hello Igloo,

that is really amazing what you did. I think #openttdcoop will be able to use the gates, I already shrunk the size of the gates to make them react faster. I think this is the main problem of the gates. The delay could cause jams because the state of the output is not changing at the same time as the input changes.

Anyway I really like your work and it reminds me of a a shiftback system, I created. I'll have a closer look at your circuit and maybe try some things on my own.

p.s.: it looks like you mixed the signs of the logic gates in your commented savegame -> the ORs should be ANDs and the AND should be an OR gate (at your half adders).


Best Regards,
Osai

_________________
Image

Image
#openttdcoop blog | #openttdcoop wiki | #openttdcoop public server | #openttdcoop member zone | #openttdcoop networking guides |
#openttdcoop Scenario Quest/Competition


Top
   
 Post subject: Re: LED counter
PostPosted: Sun Jun 15, 2008 6:53 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 11:28 pm
Posts: 14
Hey osai,

thanks for the reply. I've read some of the articles on openttdcoop over the past weeks, I never expected people were that busy with this game =].

The speed is indeed a problem. This can be solved partly by smaller trains and partly by smaller gates. It is probably possible to make gates that are fast enough to be used in a network. Provided that the trains used in the network are not too small.

The labeling in the comments is as intended. It al depends how you define the 1's and 0's. I used: green light is a 1, red light is a 0. You probably looked at it the other way around.

I'm curious as to what your take is on these gates.

Igloo

_________________
if triangles had a god, He would have three sides


Top
   
 Post subject: Re: LED counter
PostPosted: Mon Jun 16, 2008 10:32 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Wed Sep 22, 2004 2:56 pm
Posts: 132
Location: 10.0.1.254
Igloo wrote:
The labeling in the comments is as intended. It al depends how you define the 1's and 0's. I used: green light is a 1, red light is a 0. You probably looked at it the other way around.

I'm curious as to what your take is on these gates.

Igloo


I really looked at this vice versa and still do. I am still working on this topic and will publish first results soon.

_________________
Image

Image
#openttdcoop blog | #openttdcoop wiki | #openttdcoop public server | #openttdcoop member zone | #openttdcoop networking guides |
#openttdcoop Scenario Quest/Competition


Top
   
 Post subject: Re: LED counter
PostPosted: Tue Jun 17, 2008 11:06 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Wed Apr 09, 2008 1:37 am
Posts: 178
Wow... Brilliant and ridiculous. I am very impressed... and somewhat disgusted.

:)

-Vox


Top
   
 Post subject: Re: LED counter
PostPosted: Tue Jun 17, 2008 11:12 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Wed Sep 22, 2004 2:56 pm
Posts: 132
Location: 10.0.1.254
Hello all,

I finally posted my report about logic gates (@ openttdcoop.org). Enjoy Reading. Part 2 will follow soon.

_________________
Image

Image
#openttdcoop blog | #openttdcoop wiki | #openttdcoop public server | #openttdcoop member zone | #openttdcoop networking guides |
#openttdcoop Scenario Quest/Competition


Top
   
 Post subject: Re: LED counter
PostPosted: Wed Jun 18, 2008 10:44 am 
Offline
Engineer
Engineer

Joined: Thu Jun 12, 2008 1:34 pm
Posts: 5
Really great job!! I am looking forward to part2! I am still strugling to get these gates to work in a normal network and really do something usefull, but I have made a somewhat decent loadbalancer with them allready!

-Tjark


Top
   
 Post subject: Re: LED counter
PostPosted: Wed Jun 18, 2008 12:23 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 11:28 pm
Posts: 14
Nice article Osai, though it is confusing as hell to see you reverted the meanings of the 0 and 1 ;-). That design of the OR gate is quite efficient.
Hereby an implementation of the NOT-gate using a different idea. it should be faster (did you compute those speeds, if so, how?).


Attachments:
NOT2.PNG
NOT2.PNG [ 23.36 KiB | Viewed 4153 times ]

_________________
if triangles had a god, He would have three sides
Top
   
 Post subject: Re: LED counter
PostPosted: Wed Jun 18, 2008 1:58 pm 
Offline
Engineer
Engineer

Joined: Thu Jun 12, 2008 1:34 pm
Posts: 5
Image

Trains are balanced between 2 mines by using a NOT load balancer with a memory track


Top
   
 Post subject: Re: LED counter
PostPosted: Wed Jun 18, 2008 4:19 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Wed Sep 22, 2004 2:56 pm
Posts: 132
Location: 10.0.1.254
Interesting solution for NOT, Igloo. Indeed it might be a little bit faster, but I also searched for the minimum size. I calculated the reaction times using a screen-recorder with an correctness of 1/25s :) I could make it more detailed though, but I am not sure how often the OpenTTD screen is redrawn per second. I'll talk about speed of logic gates in Part II.

I am still not sure, if I just mixed the definition of green/red, 0/1. Because you construction for OR seems not be a or. Of cause changing the definition turns AND in OR or vice versa, but the logic of the OpenTTD signals, which is hardcoded, doesn't change.
Can you please sign the input and output of your OR construction in your led counter savegame.
Another question: Did you use rs-flipflops for saving the binary state of your counter or is it just a hacky construction?

Regards,
Osai

_________________
Image

Image
#openttdcoop blog | #openttdcoop wiki | #openttdcoop public server | #openttdcoop member zone | #openttdcoop networking guides |
#openttdcoop Scenario Quest/Competition


Top
   
 Post subject: Re: LED counter
PostPosted: Wed Jun 18, 2008 8:21 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 11:28 pm
Posts: 14
Nice one, Tjark =]

Osai:

It is fun to play around with those constructions. Unfortunately those double loops takes quite a bit of space.

Indeed the OR you use is equivalent to my AND and vice versa. In the commented save game each gate is build separately in the northernmost corner. All gates there have the input in the north and the output to the south.

The memory is not a RS flipflop. The problem with the system is that there is no clock pulse. Hence a more difficult construct is used. It was thought out on the spot, but looking at wiki it is a Master-slave D flip-flop.

_________________
if triangles had a god, He would have three sides


Top
   
 Post subject: Re: LED counter
PostPosted: Tue Jun 24, 2008 1:57 am 
Offline
Engineer
Engineer

Joined: Thu Jun 12, 2008 10:00 pm
Posts: 10
Am I the only one who noticed the LED counter goes 1 - 2 - 7 - 4 - 5 - 6 - 1 (I think) or is it just me?


Top
   
 Post subject: Re: LED counter
PostPosted: Tue Jun 24, 2008 6:36 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9202
Location: Sol d
Caesius wrote:
Am I the only one who noticed the LED counter goes 1 - 2 - 7 - 4 - 5 - 6 - 1 (I think) or is it just me?

It's just you :P
No, I made the same observation with a savegame I downloaded a few days ago.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: LED counter
PostPosted: Tue Jun 24, 2008 5:50 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 11:28 pm
Posts: 14
That is true for one of the versions :cry: . The trains on the main railline where not synced correctly. When they are synced the counter does work as intended

_________________
if triangles had a god, He would have three sides


Top
   
 Post subject: Re: LED counter
PostPosted: Mon Jun 30, 2008 12:40 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Apr 10, 2006 11:15 am
Posts: 2
I've made a faster NOT gate based on the one Igloo posted. It's main feature is that the trains (hopefully) doesn't stop moving. It does take up a bit more space but I didn't really try to make it small. It's probably possible to make one that's smaller and even faster.


Attachments:
looping_not_gate.png
looping_not_gate.png [ 39.1 KiB | Viewed 3305 times ]
Top
   
 Post subject: Re: LED counter
PostPosted: Mon Jun 30, 2008 7:21 pm 
Offline
Engineer
Engineer

Joined: Mon Jun 30, 2008 6:27 pm
Posts: 7
Hello,
After reading what Tjark said about making a self regulating network i figured it would be possible and came up with this network using NOT-Gates, memory cells and some dummy trains. What it does is making sure there is always a train waiting to enter the loading station. It also takes a train of the network if there are too many and adds a new train every month.

EDIT: Save is made using OTTD 0.6.0


Attachments:
selfregnw.sav [403.35 KiB]
Downloaded 231 times
Top
   
 Post subject: Re: LED counter
PostPosted: Mon Jun 30, 2008 8:31 pm 
Offline
Engineer
Engineer

Joined: Mon May 19, 2008 11:28 pm
Posts: 14
Nice one, Mark! I've tried to figure it out, but I didn't think of this solution. Maybe it is possible to make this viable for a big network =].

Pixelz: I tried to copy your gate on my PC, but I can't get it working. When the input is green the train keeps running both the inner and outerloop, see picture.
Attachment:
Not_Pixelz.PNG
Not_Pixelz.PNG [ 61.33 KiB | Viewed 3136 times ]

_________________
if triangles had a god, He would have three sides


Top
   
 Post subject: Re: LED counter
PostPosted: Mon Jun 30, 2008 11:56 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Apr 10, 2006 11:15 am
Posts: 2
I've made a working example. The train sometimes loop like you described but it doesn't cause any flickering so it's all good.


Attachments:
not gate.sav [22.64 KiB]
Downloaded 123 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 63 posts ]  Go to page Previous 1 2 3 4 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.