NoCAB - Bleeding Edge edition Version 2.2a4

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9411
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCAB - Bleeding Edge edition - Version 2.0a5

Post by planetmaker »

Hi Morloth,

you might want to refine your Depot placing algorithm. In your screenshot I find two Depots which are connected to at least one direction of the track by a 90° curve; that is bound to cause huge trouble, if "allow trains 90° curve" setting is off.

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoCAB - Bleeding Edge edition - Version 2.0a5

Post by Kogut »

The bridges are really in style of AI :P
I'm waiting for first working networking rail ai! (choo choo have that stupid bug resulting in constantly losing games and sitting and doing nothing)
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoCAB - Bleeding Edge edition - Version 2.0a5

Post by Zuu »

Just a little terminology thing. What you call "front to front"-station is usually in the (Open)TTD community refereed to as terminus stations. ( http://wiki.openttd.org/Railway_Stations#Terminus ) Or did you mean something else?

Looks like you have done some good amount of work to get that far. If you have two parallel tracks with a depot on each side, your current track building outside of the depot could cause problems. That said I do see how much easier it is to implement it your way and that you probably took the easier way to get started.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a5

Post by Morloth »

Thanks for the replies everone :).
planetmaker wrote:Hi Morloth,

you might want to refine your Depot placing algorithm. In your screenshot I find two Depots which are connected to at least one direction of the track by a 90° curve; that is bound to cause huge trouble, if "allow trains 90° curve" setting is off.
Yes, that is very true. Depot layout it another item on my list to fix, I think it's a good idea to separate the depot a little more from the rail road with a couple of rail tiles so it doesn't block incoming trains.
Kogut wrote:The bridges are really in style of AI :P
I'm waiting for first working networking rail ai! (choo choo have that stupid bug resulting in constantly losing games and sitting and doing nothing)
I would sugest Denver & Rio Grande as a good train AI, it builds proper stations and does very well in my tests :).
Zuu wrote:Just a little terminology thing. What you call "front to front"-station is usually in the (Open)TTD community refereed to as terminus stations. ( http://wiki.openttd.org/Railway_Stations#Terminus ) Or did you mean something else?
Yes, that's the one I meant! I'm sorry I'm not too familiar with all this terminology but I'll use Terminus from now on :).
Zuu wrote:Looks like you have done some good amount of work to get that far. If you have two parallel tracks with a depot on each side, your current track building outside of the depot could cause problems. That said I do see how much easier it is to implement it your way and that you probably took the easier way to get started.
I'm not entirely sure what you're referring to, could you elaborate a little bit more on this point?

- Bram

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoCAB - Bleeding Edge edition - Version 2.0a5

Post by Zuu »

This is the situation I was thinking about:
Pennton Transport, 26th Jan 1950.png
Pennton Transport, 26th Jan 1950.png (14.35 KiB) Viewed 2036 times
Regardless of signal types this makes it possible for trains to make a very slow U-turn by using the two depots. I'm not sure if the path-finder will find the possible U-turn, but if it does that will take quite a while to accomplish and block both directions for a while.

If you use regular (old) block signals which I see you have done in your screenshot, then only one train can be present in a block at the time. In this example that means that only one train can pass the depot-area making it a short single-direction track. At best it will only cause slowdowns. At worst it could cause a gridlock if it is situated close to a station.

With path-signals you could make it so trains could pass in both directions as long as their paths do not interfere. Still the U-turn would be possible and the U-turn could potentially as well cause a gridlock if you are unlucky.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by Morloth »

New version! With loads of improvements :). The list is below:

- Improvements to the pathfinder.
- Improved signal placing.
- Rail tracks can now be shared.
- Better depot placement.
- Place signals further apart.
- Better station placement.
- Better use of bridges to cross rail tracks.

Open issues:
* Rail network is a mess (getting lesser of a mess :)).
* We do not upgrade when new rail tiles become available, in fact we can only work with the first basic rail type.
* Build HQ at the start of the game.
* Handle building errors better.

Getting close to a release! :D
Bram

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by Zuu »

Nice work Morloth! Haven't tested it yet but will do it for sure later.


Perhaps also bridge road?

While it doesn't benefit you to bridge other companies road it us usually seen as good behaviour to do so. I've noticed that there is one AI (trAns?) which bridge roads but still most of them don't.

That said, on the todo for ClulelessPlus is already to make it react on road vehicle crashes and try to replace the railway crossing with a bridge instead since you can never count on other AIs nor players to be kind and always make railway bridges. :-)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by Morloth »

I didn't actually consider building bridges over roads, but I think I'll include it as an option.

Here are a couple of screenshots of the current version. Enjoy :),
Unnamed, 13th Jun 1951.png
Unnamed, 29th Mar 1952.png
Unnamed, 14th Oct 1958.png

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9411
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by planetmaker »

Ah, that looks like a nice improvement on the previous builds :-) I shall give it a test somewhen soon, hopefully. Especially the depot placement shows a huge improvement :-)

Two comments, though, also on the recent building style as shown:
- The tracks seem to get build always with a loop so that it crosses itself. That's certainly not efficient and a bit excentric style (but no real problem).
- In the last image, lower right corner near the steel plan: there you got a (possibly) 90° curve at the station entrance. The lower station track cannot be reached from the right incoming track.

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by Morloth »

planetmaker wrote:Ah, that looks like a nice improvement on the previous builds :-) I shall give it a test somewhen soon, hopefully. Especially the depot placement shows a huge improvement :-)
Thx :). I'm quite happy that the rail roads don't get jammed that often any more.
planetmaker wrote:Two comments, though, also on the recent building style as shown:
- The tracks seem to get build always with a loop so that it crosses itself. That's certainly not efficient and a bit excentric style (but no real problem).
This is not always the case. It really depends what is easier to build according to the pathfinder. But it does happen every now and then. But I don't really see it as a major problem.
planetmaker wrote:- In the last image, lower right corner near the steel plan: there you got a (possibly) 90° curve at the station entrance. The lower station track cannot be reached from the right incoming track.
Ah, yes. I was quite surprised by that too. But they are actually valid 45° turns. It just looks a little messed up:
Odd connection.
Odd connection.

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9411
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by planetmaker »

Hi,

how would a train from A get to B or vice versa? If that's not possible, there's no point to join the tracks in front of the station in the first place or to add the station track indicated by A.
Attachments
track combinations
track combinations
tracks_nocab_edited.png (19.86 KiB) Viewed 1955 times

User avatar
Dimme
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 30 Jul 2008 12:42
Location: Trondheim, Norway

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by Dimme »

This looks really promising Morloth!
planetmaker wrote: - The tracks seem to get build always with a loop so that it crosses itself. That's certainly not efficient and a bit excentric style (but no real problem).
I agree, but as a side note: I've tried to play in this way, with rails crossing each other somewhat randomly, and it ends up looking really different from when you plan everything thoroughly. It looks a bit like somewhat ordered chaos, and you need to think to fix it when you want to increase efficiency.
Try my modular airports minigame!

Image

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by Morloth »

Here is a working example of such a connection in progress. It's not very beautiful but it works I suppose ;).
Drindingbury Transport, 24th Aug 1966.png

User avatar
Dimme
Transport Coordinator
Transport Coordinator
Posts: 277
Joined: 30 Jul 2008 12:42
Location: Trondheim, Norway

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by Dimme »

Now they can't get from the southern depot to the southern station track, but maybe they don't do that anyway?
Try my modular airports minigame!

Image

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9411
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by planetmaker »

Hm, yes and no. Everything is reachable from the track. But a train from the depot will only reach the upper station track. I'd try to avoid such constructions and go for 45° only in all cases. Earlier or later such constructions are bound to give problems.

The signaling needs improvement. The station entries are guared by exit(?) signals. And I see an entry(?) signal after the station (or is it a one-way path signal?).

All this said: don't take my feedback please as negative criticism. I know from image processing how difficult it is to put seemingly simple concepts and things into (near) fool-proof algorithms and from what I see your track generation algorithm is already one of the best around; I just try to give you hints how to become even better :-)

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a6

Post by Morloth »

No worries planetmaker, I'm happy with all the feedback I can get even if it happens to be negative. But you're absolutely right, the signals still need work as do some rail constructions. I'm not a player of OpenTTD myself, so any feedback from expert players is only good for improving my AI as you said yourself :). I'm currently working on improving the signalling and removing rail tracks if construction of a connection failed. Think I'm going to focus afterwards on upgrading the rail tracks to electric / monorail / etc.

As always thanks for all the feedback and keep those bugs coming! :)

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a7

Post by Morloth »

Just about to leave to The Netherlands, so I'll leave you guys with the most recent version. Biggest improvement is that it will remove all the stations / rail pieces if it fails to complete a train connection. This makes it much easier to play with it ;).

Complete change log:
- If we failed to build a rail connection, remove everything we've build!
- Improved vehicle management.
- Better station placement (again ;).
- Don't allow crossing rails any more (make a bridge or share the rail!).

See you guys after the weekend!
Bram

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a8

Post by Morloth »

Back! And a new version is ready. The following changes have been made:

- Better station placement, reserve room for connecting the other platforms.
- Don't allow the rails to cross any more, only sharing is allowed.
- Fixed save / load problems.
- Don't build 'wagons' for other vehicles but trains.
- Station upgrade when new rail types become available.
- Fixed a bug by Kogut (http://www.tt-forums.net/viewtopic.php?p=862403#p862403).
- Fix train orders for bidirectional directions.
- Disable terminus stations.
- Place stations closer to towns.
- Rails are no longer build through roads.

Known issues:
* Build HQ at the start of the game.
* Handle building errors better.
* Sometimes we building 'into' a bridge.
* Pathfinder is not optimized at all!
* During upgrading to a better rail type it sometimes gets stuck...

Enjoy the new version! :)
- Bram

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a9

Post by Morloth »

New update! This one includes huge improvements to the rail construction process, it's faster and doesn't fail as often as the previous version. Also, this version doesn't (at least, should not have ;) ) any issues with the new API (thanks to NekoMaster for reporting this). The most important changes are listed below:

- Various improvements made to the pathfinder, including a fail safe options in case it takes too long.
- Different building strategy: First find the best places for the trains stations, build them, do terraforming to allow a good connection to the other platforms and find the best routes.
- Resolved incompatibility with the newest API for NoAI.
- Don't allow the pathfinder to build on roads.
- Don't build signals in front of the depots any more!

This week I'll be working on improving vehicle management and make sure all the vehicles are nicely put into a group. Maybe I'll also reintroduce shared orders, provided I don't run into the same issues as last time. Once all that is done, there are still some issues to solve as listed below:

Open issues:
* Build HQ at the start of the game.
* Handle building errors better.
* Sometimes we building 'into' a bridge.
* Pathfinder is not optimized at all!
* During upgrading to a better rail type it sometimes gets stuck...

However I'm quite confident that a release shouldn't be too long away (say 2 weeks maybe? :)).
Thanks for all your feedback and hope you enjoy this new version!
Bram

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Bleeding Edge edition - Version 2.0a10

Post by Morloth »

New version! This version includes a couple of optimizations which makes NoCAB way way way more competitive and allows it to build rail and road networks a lot faster. The complete changelog is below:

- Don't build a signal in front of the depot (it itself contains one!).
- Updated cost scheme for finding paths for roads and rails.
- Optimized decision making code, NoCAB is now way more competitive! :)
- Better calculate the projected costs of a rail network.
- Various improvements to the pathfinder.
- We now group vehicles together into groups instead of trying to keep track of the manually.

Open issues:
* Build HQ at the start of the game.
* Handle building errors better.
* Sometimes we building 'into' a bridge.
* During upgrading to a better rail type it gets stuck when rail types are shared.
* For some strange reason rail tiles are deleted from a finsihed connection...

Enjoy the new version!
Bram

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests