Logic Signals patch
Moderator: OpenTTD Developers
Re: Logic Signals patch
Very cool 2457.
These 1:1 splits were in my mind, among other things, when making this patch. Very happy to see it is working.
I have no idea why using a newGRF trainset broke it though. Maybe someone with more knowledge can answer this one.
These 1:1 splits were in my mind, among other things, when making this patch. Very happy to see it is working.
I have no idea why using a newGRF trainset broke it though. Maybe someone with more knowledge can answer this one.
Re: Logic Signals patch
hmm, actualy i was thinking moooar people will post here.
but seems like i was wrong
oh well, i still do hope this patch makes it into one of the nighlys, and then to stable, it is allready far too
good to leave it out. actualy since the introduction of PBS signals this is the first thing that has my full attention.
finaly something to get rid of the "logic tracks".
but seems like i was wrong

oh well, i still do hope this patch makes it into one of the nighlys, and then to stable, it is allready far too
good to leave it out. actualy since the introduction of PBS signals this is the first thing that has my full attention.
finaly something to get rid of the "logic tracks".
The Prophet -thx Pikka-
Re: Logic Signals patch
Has anyone else tried the patch? Did it work as expected? I am waiting for more feedback as well. 

- JacobD88
- Chief Executive
- Posts: 708
- Joined: 16 Aug 2008 17:51
- Location: Long Eaton, Nottinghamshire. UK
- Contact:
Re: Logic Signals patch
I've applied the patch and have found it really useful; although ultimately it may be worth looking at expanding it's features to encompass all of the features available to TTDP players as described here;
http://uwe.s2000.at/ttdx/signal/restric ... hp?lang=en
OTTD is far behind TTDP in terms of signalling and i hope that your work will continue to go some way to improving that situation. Other than that i don't really have any suggestions, but will report any bugs

http://uwe.s2000.at/ttdx/signal/restric ... hp?lang=en
OTTD is far behind TTDP in terms of signalling and i hope that your work will continue to go some way to improving that situation. Other than that i don't really have any suggestions, but will report any bugs


High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS

My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
Re: Logic Signals patch
actualy the TTDX style of signals i would not prefer...
I better like this approach.
Actualy there may be a few more , not jut or and xor logic, and a switch to make the default signal behaviour switch between block and pbs.
it should be in the trunk/nightly, for sure.
sofar i em extreemly statisfied.
if at least 4 people post here, i can set up a server with the patched version, so we can experiment in multiplayer.
i can leave it on 24/7.
I better like this approach.
Actualy there may be a few more , not jut or and xor logic, and a switch to make the default signal behaviour switch between block and pbs.
it should be in the trunk/nightly, for sure.
sofar i em extreemly statisfied.
if at least 4 people post here, i can set up a server with the patched version, so we can experiment in multiplayer.
i can leave it on 24/7.
The Prophet -thx Pikka-
Re: Logic Signals patch
Code: Select all
SignalProgram::AddLink
SignalProgram::RemoveLink
SignalProgram::ClearAllLinks
Code: Select all
+/**
+ * The main command for editing a signal program.
+ * @param tile The tile which contains the edited signal.
+ * @param flags Internal command handler stuff.
+ * @param p1 Bitstuffed items
+ * - p1 = (bit 0-2) - The Track part of the signal program tile.
+ * - p1 = (bit 3-5) - Subcommand to execute.
+ * - p1 = (bit 6-7) - The value to set to the signal program.
+ * @param p2 Target SignalReference for linking of two signals
+ * @return the cost of this operation (which is free), or an error
+ */
+CommandCost CmdProgramLogicSignal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
+{
+ Track track = (Track) GB(p1, 0, 3);
+ uint32 sub_cmd = GB(p1, 3, 3);
+ uint32 value = GB(p1, 6, 2);
+
...
+
+ if (sub_cmd == 1) {
Code: Select all
-extern const uint16 SAVEGAME_VERSION = 185; ///< Current savegame version of OpenTTD.
+extern const uint16 SAVEGAME_VERSION = 200; ///< Current savegame version of OpenTTD.
AI API
I notice that your patch do not yet address AI support. This is something that in general should be separated into a second patch in a patch queue. Eg. please consider to add it, but use HG queues or the Git equivalent to separate AI support into a separate .patch file as AI support include quite a few bit of generated code which will create a somewhat long patch on itself.
That said, for your initial patch, you should run src/script/api/generate_widget.sh to update the GSWindow class which include references to all widgets in the game.
All files related to AI (and Game Script) API is located in src/script. Eg. add code to src/script/api/script_rail.*, document API additions in src/script/api/ai_changelog.cpp, run src/script/api/squirrel_export.sh to generate some new glue code. If it makes sense, programming signals can possible be included all in AIRail, but it may need also new API classes for the API to make sense. Maybe there should be a AIProgrammingSignalList that list all tiles that contain a programming signal.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Logic Signals patch
Thanks for the feedback Zuu and others.
As we know, there now exists a few different patches for advanced signal types in openttd. My patch is one way to do things, but I am not saying in any way it's the best or correct approach. The community needs to have a discussion of what new signal type (if any) should be added to openttd, and eventually included in trunk.
That being said, I am likely not going to continue development of this patch in the immediate future. The reason is that interest in my patch appeared relatively low in the end. If that changes, I will try to become more active with it.
So lets start the discussion of what new signal type should be included in trunk, if any.
As we know, there now exists a few different patches for advanced signal types in openttd. My patch is one way to do things, but I am not saying in any way it's the best or correct approach. The community needs to have a discussion of what new signal type (if any) should be added to openttd, and eventually included in trunk.
That being said, I am likely not going to continue development of this patch in the immediate future. The reason is that interest in my patch appeared relatively low in the end. If that changes, I will try to become more active with it.
So lets start the discussion of what new signal type should be included in trunk, if any.
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Logic Signals patch
Well, there was already a comprehensive post by Eddi on page 1 of this thread, and there were also hints to take a look on TTDPatch which already implemented both programmable and restricted signals (amongst others).maddy_ wrote: That being said, I am likely not going to continue development of this patch in the immediate future. The reason is that interest in my patch appeared relatively low in the end. If that changes, I will try to become more active with it.
So lets start the discussion of what new signal type should be included in trunk, if any.
Just to re-iterate myself, most important would be restrictive signals. These would allow to split lines according to train´s needs, thus getting rid of spoiling the map with "waypoints" and the need to include them into schedules. OTOH, programmable signals are a bit more exotic, and have already turned out to address only a minority of players. But o/c we´d need both of them, at least in the long run.

The current lack of advanced signalling is a severe handicap in OTTD, and it would be an important step forward to include this feature.
regards
Michael
- MasterMeNL
- Engineer
- Posts: 86
- Joined: 12 Oct 2012 17:16
- Location: Netherlands
Re: Logic Signals patch
I haven't seen anything like it really. Care to explain?maddy_ wrote:As we know, there now exists a few different patches for advanced signal types in openttd. My patch is one way to do things, but I am not saying in any way it's the best or correct approach. The community needs to have a discussion of what new signal type (if any) should be added to openttd, and eventually included in trunk.
Interest is pretty high if you'd ask me, it's just that OpenTTD doesn't have that big of a playbase and even less check out the forums and actually want to mess around with patches because it can be very difficult if you've never done anything like it before.maddy_ wrote:The reason is that interest in my patch appeared relatively low in the end. If that changes, I will try to become more active with it.
Maybe put some sort of [compiled] tag in the thread name so people know. And "OpenTTD Development" doesn't sound like a download area for actual new game functions, something should really change here.
I'm willing to help if I can do anything at all, maybe uploading new binaries or something similar?
Edit: I just made a new thread here, it includes this patch and 3 others. I'm planning to upload more things soon.
Regards,
Melvin.
Re: Logic Signals patch
How about rail signs?michael blunck wrote:Just to re-iterate myself, most important would be restrictive signals.
I mean a kind of signals with fallowing characteristics:
- The way it affects movement of a train can be based on the train.
- It's static (don't change in time).
- Have nice looking sprites allowing you to differentiate rules.
- no pass
- pax/freight only
- short/long only
- fast/slow engine only
![Pleased :]](./images/smilies/pleased.gif)
Re: Logic Signals patch
I thought somebody made patch for that back then ?adf88 wrote:How about rail signs?
For example:
- no pass
- pax/freight only
- short/long only
- fast/slow engine only
YNM = yoursNotMine - Don't get it ?
「ヨーッスノットマイン」もと申します。
「ヨーッスノットマイン」もと申します。
Re: Logic Signals patch
Like this one?YNM wrote:I thought somebody made patch for that back then ?adf88 wrote:How about rail signs?
For example:
- no pass
- pax/freight only
- short/long only
- fast/slow engine only
Formerly known as UseYourIllusion.
Java Scenario Found Here - Version 2 out
[tweɪ̂ pû tɕʰì wɔ̀ mǐlɤ lû tɕʰìŋ nì pɑ́ŋmɑ̌ŋ]
Java Scenario Found Here - Version 2 out
[tweɪ̂ pû tɕʰì wɔ̀ mǐlɤ lû tɕʰìŋ nì pɑ́ŋmɑ̌ŋ]
Re: Logic Signals patch
The key of my suggestion is "Have nice looking sprites allowing you to differentiate rules.". This means non-programmable probably (you can just build a sign of a certain type).
![Pleased :]](./images/smilies/pleased.gif)
Re: Logic Signals patch
Maddy,
Thanks for making this patch. I have a bug report. I am trying V2 of this build here.... http://www.tt-forums.net/viewtopic.php?f=33&t=68654
It seems that the regular path signals and regular one-way path signals are both broken. They are behaving like block signals. Makes it impossible to make big stations. Let me know if you need a save file or anything.
Thanks,
Guvnor
Edit: In the attached screenshot, the second train refuses to pass the one-way path signal to enter the second bay of the station.
Thanks for making this patch. I have a bug report. I am trying V2 of this build here.... http://www.tt-forums.net/viewtopic.php?f=33&t=68654
It seems that the regular path signals and regular one-way path signals are both broken. They are behaving like block signals. Makes it impossible to make big stations. Let me know if you need a save file or anything.
Thanks,
Guvnor
Edit: In the attached screenshot, the second train refuses to pass the one-way path signal to enter the second bay of the station.
- Attachments
-
- broken path signals.PNG (1.01 MiB) Viewed 2710 times
- MasterMeNL
- Engineer
- Posts: 86
- Joined: 12 Oct 2012 17:16
- Location: Netherlands
Re: Logic Signals patch
I just tested V2 and it works properly.Guvnor wrote:Maddy,
Thanks for making this patch. I have a bug report. I am trying V2 of this build here.... http://www.tt-forums.net/viewtopic.php?f=33&t=68654
It seems that the regular path signals and regular one-way path signals are both broken. They are behaving like block signals. Makes it impossible to make big stations. Let me know if you need a save file or anything.
Thanks,
Guvnor
Edit: In the attached screenshot, the second train refuses to pass the one-way path signal to enter the second bay of the station.
I think you used a programmable signal instead of a one-way path-signal, their graphics are currently the same. You test if it is a programmable one by using the program-a-signal button thing, it has the same icon as the options menu.
A programmable signal is also green when no train is behind it (like a block signal) if not programmed, while a path signal is always red until the train asks if it's allowed to continue.
Regards,
Melvin.
Re: Logic Signals patch
I had originally been running V5 of your patch pack Melvin and it was crashing so I reverted to V2 so I could continue to play the same map. But I believe the save file wasn't compatible and so the signals were off (which is what prompted my post above). I have since started a new map with V2 and have had no problems so far.MasterMeNL wrote:I just tested V2 and it works properly.Guvnor wrote:Maddy,
Thanks for making this patch. I have a bug report. I am trying V2 of this build here.... http://www.tt-forums.net/viewtopic.php?f=33&t=68654
It seems that the regular path signals and regular one-way path signals are both broken. They are behaving like block signals. Makes it impossible to make big stations. Let me know if you need a save file or anything.
Thanks,
Guvnor
Edit: In the attached screenshot, the second train refuses to pass the one-way path signal to enter the second bay of the station.
I think you used a programmable signal instead of a one-way path-signal, their graphics are currently the same. You test if it is a programmable one by using the program-a-signal button thing, it has the same icon as the options menu.
A programmable signal is also green when no train is behind it (like a block signal) if not programmed, while a path signal is always red until the train asks if it's allowed to continue.
Regards,
Melvin.
Guvnor
- MasterMeNL
- Engineer
- Posts: 86
- Joined: 12 Oct 2012 17:16
- Location: Netherlands
Re: Logic Signals patch
I have only found 1 bug so far which I added on the post of the compilation pack. It happens when a path signal checks a tunnel or bridge with signals on it. It always crashes for some reason. But besides that there shouldn't be any problems or I'm not aware of them.Guvnor wrote:I had originally been running V5 of your patch pack Melvin and it was crashing so I reverted to V2 so I could continue to play the same map. But I believe the save file wasn't compatible and so the signals were off (which is what prompted my post above). I have since started a new map with V2 and have had no problems so far.
Guvnor
Regards,
Melvin.
Re: Logic Signals patch
I have difficulty with signal logic. No matter what signal color and logic operation I choose, the train is not moving.
I would expect, that if signal is not programmed ( default state ), it should let trains to pass.
I would expect, that if signal is not programmed ( default state ), it should let trains to pass.
- Attachments
-
- blocking the train.png (144.16 KiB) Viewed 2707 times
- MasterMeNL
- Engineer
- Posts: 86
- Joined: 12 Oct 2012 17:16
- Location: Netherlands
Re: Logic Signals patch
I think that if it's not programmed it acts like a block/path signal to prevent crashes.Muzzly wrote:I have difficulty with signal logic. No matter what signal color and logic operation I choose, the train is not moving.
I would expect, that if signal is not programmed ( default state ), it should let trains to pass.
Regards,
Melvin.
Re: Logic Signals patch
I tested it a bit more. I seems that in a circle should always be at least two path signals in order train to move. Sorry, it was not your fault. With two programmable signals (with default green light) it also works !!!
Train window status has confused me. Should it not be "Waiting for free path" for pragrammable signal too?
Train window status has confused me. Should it not be "Waiting for free path" for pragrammable signal too?
- Attachments
-
- works with two signals.png (76.44 KiB) Viewed 7481 times
-
- different status.png (71.78 KiB) Viewed 7481 times
Who is online
Users browsing this forum: No registered users and 22 guests