NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.3

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

Post Reply
eduardo_38
Engineer
Engineer
Posts: 15
Joined: 06 Oct 2008 16:17

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.15

Post by eduardo_38 »

I have an error with NoCAB on OpenTTD 0.7.0-RC2 installed from generic binaries.
Debug atched.
Attachments
Pantallazo-OpenTTD 0.7.0-RC2.png
Debug
(739.43 KiB) Downloaded 113 times
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.15

Post by Zutty »

You're missing a library file. Did you download NoCAB from the online content service?

Click on "Check Online Content" in the main OpenTTD menu screen, then select Queue.BinaryHeap from the list and click "Download". That should fix the problem.
PathZilla - A networking AI - Now with tram support.
eduardo_38
Engineer
Engineer
Posts: 15
Joined: 06 Oct 2008 16:17

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.15

Post by eduardo_38 »

Zutty wrote:You're missing a library file. Did you download NoCAB from the online content service?

Click on "Check Online Content" in the main OpenTTD menu screen, then select Queue.BinaryHeap from the list and click "Download". That should fix the problem.
I don't found "Queue.BinaryHeap" in the list.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.15

Post by Zutty »

Hmmm, thats odd. OK try the first step in this thread...

http://www.tt-forums.net/viewtopic.php?f=65&t=42159

Hope it works.
PathZilla - A networking AI - Now with tram support.
eduardo_38
Engineer
Engineer
Posts: 15
Joined: 06 Oct 2008 16:17

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.15

Post by eduardo_38 »

Zutty wrote:Hmmm, thats odd. OK try the first step in this thread...

http://www.tt-forums.net/viewtopic.php?f=65&t=42159

Hope it works.
I downloaded the libraries and now works. Thank you.
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.16

Post by Morloth »

Thx for helping out Zutty :).

New version is now available! This version fixes a bug in which NoCAB couldn't find a suitable place for a station / airfield if the town was to big; It only checked a 40x40 rectangle around the centre, if a town had bigger dimensions we were out of luck. Now we dynamically determine the size of the town.

But the biggest improvement is Load / Save functionality, yes it's finally here! :) It's only a preliminary version so do expect changes (and incompatibility issues later on) but as far as I could test it it works. The only 'problem' is that we don't save all data available to NoCAB at the point of saving. To conform to the guideline set here, we only save information about connections which are constructed. So all information inferred from the map / planning is lost when loading a game. This means that NoCAB will get a performance hit as it needs to calculate all this again. For larger maps this will be more of a problem than for smaller ones, but still... Also the current algorithm isn't optimized at the moment, I haven't checked saving / loading on larger maps than 512x512 when NoCAB has a lot of connections going but do expect some load time. When I have more time I'll try to do some optimizations and see if I can store more information to minimize the performance hit by loading a game.

defaultluser: be happy this is partially inspired by you ;).
- Bram
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.16

Post by fanioz »

Hehe, you must be have much time, with your quick update n awesome feature. Congratulations .. :-)
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by Morloth »

Thx guys :). But a bit of a false start I'm afraid...

Just came across a bug in the save / load function which occurred when the connection structure isn't a tree without interconnections. Thus if we have a connection from town A -> B and a connection between a factory F and town A the procedure would safe all connections from town A twice and this messed up a assertion check in NoCAB (i.e. no industry is served twice!).

I went through the code and fixed this issue, so save and load should work 100% correct now. Sorry for the trouble.
- Bram
Futchmacht
Engineer
Engineer
Posts: 7
Joined: 11 Apr 2009 07:01

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by Futchmacht »

Well i have to say your AI is in my opinion the best AI around right now good work.. (admiral AI is also very good but is a little messed up with bugs right now but i know that will change at some point :)

out of all the AI's it seems to not only make money but even when it competes against itself (and ME) it does not pick the same routes over and over again.. which for me is a major +.

most of the other ai's jam them selves to death. and some times even jams me up real good :) and i have to build new roads and tell buses and trucks to do u turns to get traffic flowing again.

personaly i like to use buses and trucks more then trains and planes (as they make money to fast) and it take away from the fun factor for me. when i play with only buses and trucks your ai kicks my ass..(1.17) which i was totaly happy about!!! it can build A LOT faster then i can lol.

some traffic jams still happen around the map some times.. but it think the problem is not with the AI's so much but tis the fact that when openttd increased the unit limits to 1000's the roads in the game cant handle the increased load and over time i have even some time due to not paying attention cause jams of my own when just pumping out buses like mad and running terminals dry. :)

if the devs are listining or if you can even do this as i cant (no programing skills :) .. but if the One Way roads in game now where able to handle one way traffic in BOTH lanes at the same time.. i think we could get rid of this problem.. or at leaste if the ai's jam the hell out of some place that i also have buses/trucks running i can go in there and save both our butts and upgrade the road :)

what do you think about that?
Speechless
Engineer
Engineer
Posts: 5
Joined: 02 Feb 2009 19:39

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by Speechless »

I have to say I like NoCab and how it plays.
On my current map it's earnings went skyhigh within no time and I had a hard time trying to beat it :bow:
However, I've arrived in the year 2045 and while building close to a 'NoCab city' I noticed loads of breakdowns.
While inspecting several vehicles I noticed they're all like fifty somethings years old and breakdown about 50 times after the last service :(
As you can imagine NoCab is loosing money real quick now and it's really easy to beat him/her right now.
Shouldn't the AI replace vehicles once they're getting old ?
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by Morloth »

Hi Futchmacht and Speechless,

Thanks for your feedback. It would be better if we had more control over the traffic jams by introducing things like highways, etc. I experimented with a couple of schemes with one-way traffic and see if it would reduce jams but unfortunately it's quite hard for the pathfinder used in OpenTTD to select the best or 'optimal' path for every individual vehicle so they tend to use the same route. But of course only increasing the amount of traffic flow a road can handle will in the end only increase traffic and sooner or later you'll hit the same boundary (just like real life ;) ).

I'm currently unable to work on NoCAB due to other obligations, but once I have time I'll introduce some configurable parameters to NoCAB (e.g. disabling certain transportation types, etc) and will add an option to enable the 'NiceCAB' which will have an incentive not to target already served industries. But I'm happy the randomness already introduced works to your satisfaction :).

I'm a little surprised the vehicle didn't get auto updated in your game. I use the internal auto update feature for all vehicles, but as sucinum already observed this strategy fails spectacularly for ships so I will have to switch to manual mode in any case. If you could provide me with a safe game where this has happened that will certainly help and I'll try to address it as soon as I have more time on my hands :).

Once again thanks for your feedback!
- Bram
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by planetmaker »

Morloth wrote:the pathfinder used in OpenTTD to select the best or 'optimal' path for every individual vehicle so they tend to use the same route.
If you have means to detect a jam, you might resort to using drive-through road stops in order to direct vehicles along certain roads / alternative roads. That might be used to have vehicles with different orders use different roads, thus reducing the probability of huge jams. It will, of course, fail, if there is heavy interference by other AIs (probably the same, just another instance of it :P )
Speechless
Engineer
Engineer
Posts: 5
Joined: 02 Feb 2009 19:39

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by Speechless »

Hmmm, while reading this thread I noticed the subject which mentions v1.17
Ingame however I see NoCab 1.15 so it seems I'm running an older version which was download april 3rd.
I've just download v1.17 to see what happens but I'm not sure if that affects a running game ?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by planetmaker »

It usually doesn't.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by Zuu »

If you want to change the version used in your current game, you need to download the new version, but also remove the old version. Also the new version of NoCab must tell OpenTTD that it can load the save game using the old NoCab.

To remove the 1.15 NoCab you need to find and remove its .tar file, possible found in your content_download folder. (you can also move it to the OpenTTD root directory if you just want to deactivate it)


But then I can't say anything about issues you might get doing so with NoCab. If you want to report errors you should really use the same AI version through the entire game.
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 - Trucks, Busses, Airplanes and Ships! v1.17

Post by Morloth »

planetmaker wrote:
Morloth wrote:the pathfinder used in OpenTTD to select the best or 'optimal' path for every individual vehicle so they tend to use the same route.
If you have means to detect a jam, you might resort to using drive-through road stops in order to direct vehicles along certain roads / alternative roads. That might be used to have vehicles with different orders use different roads, thus reducing the probability of huge jams. It will, of course, fail, if there is heavy interference by other AIs (probably the same, just another instance of it :P )
Yeah... might be more then a little hard to do. But I have several ideas to steer vehicles around towns if they have no business there as most jams seems to occur in towns, especially if competitors use drive-through bus stops and make their busses wait in the middle of the street.
Speechless wrote:Hmmm, while reading this thread I noticed the subject which mentions v1.17
Ingame however I see NoCab 1.15 so it seems I'm running an older version which was download april 3rd.
I've just download v1.17 to see what happens but I'm not sure if that affects a running game ?
It shouldn't affect a running game, version 1.15 didn't have a load / save function which means the load function won't be called during loading. So the only effect you'll see is that the new version won't update excising connections and double connect existing ones. But let me know if you run into any trouble loading your running game.
sucinum
Engineer
Engineer
Posts: 17
Joined: 06 Apr 2009 19:46

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by sucinum »

The auto-replacement might not work because the vehincles are obsolute now - only the very same vehincle gets swapped. It doesn't work with newer versions, you have to upgrade manually and can't rely on auto-replacement alone.

I still think jams are not because of pathfinder issues or not enough roads, but simply by the cause that 40-50 busses are too much for a single connection - especially with only a single station or bridges/tunnels involved (no overtaking of broken down vehincles there). I rather have a fix on the root of the problem instead of a workaround.

A jam should be detectable, it's possible to calculate the optimal driving time of a connection and then compare it with reality.
Speechless
Engineer
Engineer
Posts: 5
Joined: 02 Feb 2009 19:39

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by Speechless »

sucinum wrote:The auto-replacement might not work because the vehincles are obsolute now - only the very same vehincle gets swapped. It doesn't work with newer versions, you have to upgrade manually and can't rely on auto-replacement alone.
Just checked the very old vehicles and they're obsolete indeed.
Two examples in 2048 :

MPS Regal
71 years old
29 breakdowns since last service

Blakewell Luckett LB-8
79 years old
2 breakdowns since last repair
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCab - Trucks, Busses, Airplanes and Ships! v1.17

Post by Morloth »

All issues have been solved in the newest version of NoCAB - Bleeding Edge edition v1.18a1. I required an order which wasn't in the current version of the NoAI framework but was added by Yexo last night (thx! :) ). From now on the main development will be on the bleeding edge edition until a new stable release of OpenTTD emerges or new bugs pop up in this version.

The way I solved it now is by adding a conditional order which forces a vehicle to go to the depot if its age is equal or higher than the max age of the engine. Upon detecting a stop vehicle in a depot which has an age equal or higher than that number it will be replaced by a new vehicle and sold.

Thanks for all the feedback!
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google Adsense [Bot] and 15 guests