NoNoCAB

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

xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: NoNoCAB

Post by xarick »

NoNoCAB v5, the aircraft is bringing batteries, but the airport is not close enough to the toy factory.
Attachments
screenshot#78.png
(485.06 KiB) Not downloaded yet
NoNoCAB - v5, 2024-02-14.sav
(2.04 MiB) Downloaded 235 times
Formerly known as Samu
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: NoNoCAB

Post by xarick »

NoNoCAB v5, dock blocks access to adjacent dock. Ship can't reach dock.
Attachments
NoNoCAB - v5, 1975-11-23.sav
(1.05 MiB) Downloaded 246 times
screenshot#79.png
(152.5 KiB) Not downloaded yet
Formerly known as Samu
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: NoNoCAB

Post by Wormnest »

Thanks for reporting the problems. I thought I had those things fixed but apparently there's still some corner cases left.
I will have a look at it but it will probably take a while before i have time.
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: NoNoCAB

Post by xarick »

Crash while upgrading rail
Attachments
Unnamed, 1970-03-24.png
(124.12 KiB) Not downloaded yet
Unnamed, 1970-03-23.sav
(18.28 MiB) Downloaded 228 times
Formerly known as Samu
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: NoNoCAB

Post by xarick »

The index 'len' does not exist
Attachments
R04-G05 - NoNoCAB vs CluelessPlus - 7,366 days.sav
(212.23 KiB) Downloaded 200 times
Unnamed, 1970-03-20.png
(222.12 KiB) Not downloaded yet
Formerly known as Samu
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: NoNoCAB

Post by Wormnest »

Thank you everyone for the bug reports and comments here and on IRC. Version 6 is out now, available on bananas.

List of changes:
  • Fix: Crash if industry disappeared while we were building a route using it.
  • Fix: Crash when vehicleGroupID is null.
  • Fix: Crash when there is no rail track available for a certain train engine.
  • Fix: Airports could be built too far from an accepting industry.
  • Fix: Don't build dock if there is another dock next to us and turned towards us.
  • Fix: Make sure we don't get into an endless loop.
As always please report any crashes, bugs and other problems here. That way I can try to do something about it.
phobos2077
Engineer
Engineer
Posts: 25
Joined: 13 Nov 2019 16:17

Re: NoNoCAB

Post by phobos2077 »

I've been playing a very long game (1850-1922 currently) with JGRPP and a day length of 2. Using Iron Horse, eGRVTS 2, av8 and FISH2. FIRS 3 is the industry set with "arctic basic" industry. I've added several different AI's to see how they perform, and what can I say...

- Convoy AI drags for a bit with it's road vehicles but inevitable becomes unprofitable and closes and a few years.
- Admiral AI fares much better initially. But after some time it also fails to keep the profits up.
- NoCab worked for a while but then started outright crashing so I had to disable it and replace with this fork... Which brings me to..

- NoNoCab holds strong for the whole time. It only has 2 trains for the entire map (though I haven't restricted it to not use trains, but have disabled "city to city" trains). It has around 500 RVs currently, a LOT of ships (it's an water focused map) and aircraft (zeppelins). And it makes profit... a whole damn lot of it. Currently AI company has around 30% more value than mine. Which is just astonishing assuming AI can't actually cheat? Don't really understand how it manages to make so much profit though. I guess it focuses less on trains which have very narrow profit margin in this set (Iron Horse), and more on ships which are extremely lucrative at all eras of the game.

So if NoNoCab is not cheating, I got to say this is an awesome competitor. Undercuts my attempts to maximize cargo delivery at every corner (so industries has to split cargo 50/50, leaving my lines less used). At one point it even built an airport right where I had planned it (bought land in a big 9x9 square, but forgot to buy blocks inside of the square... I was in for a surprise!). Builds a lot of tracks and roads which I can't remove but have to build over/under (which is a lot of fun). And most importantly it keeps the world look more realistic by connecting everything where I lacked attention to do so and keeps industries from closing down.

I wonder how can I undermine the station rating for AI so I can get a larger piece of the pie? :P Or should I just look for other opportunities? Since I've restricted it from using trains to connect cities, I got almost all of the passenger traffic for myself. Though in my game passengers don't make nearly as much profit as cargo does. But it is very fun to manage a huge cargodist network.
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: NoNoCAB

Post by Wormnest »

Thank you for your kind words. I'm glad you like the way NoNoCab is working for you.

NoNoCab and all other AI's can't do things that normal human players can't do. If that is what you mean then no, NoNoCab doesn't cheat.
NoNoCab and it's predecessor NoCab try to compute the most profitable town/industry to town/industry connections and computes the expected profits for all available cargo types and then builds the ones that it expects to be the most profitable. Of course expectations don't always come true but in that case it will destroy that connection again after a while.

The amount of trains with NoNoCab, especially on larger maps are usually fairly low. The problem is that most profitable for trains are often fairly long routes. Making longer train routes for AI's is not that easy since there are a lot of things that can go wrong in finding a good spot for all the tracks both ways. Especially on hilly maps and/or maps with a lot of water it can be difficult for the pathfinder to find a route that works since an AI can only see ahead once square at a time.
Besides these technical difficulties things like high costs for trains and things like that of course also influence train routes being built.
Inego
Engineer
Engineer
Posts: 1
Joined: 13 Oct 2020 01:07

Re: NoNoCAB

Post by Inego »

After having played with various AIs for some time, I find NoNoCAB v6 to be the strongest one, and even cruel for a beginner like me :D
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: NoNoCAB

Post by xarick »

NoNoCAB placed a ship depot blocking passage to a lock. His ships and mine are blocked.
Attachments
Unnamed, 1965-09-20.png
(510.64 KiB) Not downloaded yet
Unnamed, 1965-09-23.sav
(8.3 MiB) Downloaded 137 times
Formerly known as Samu
lukasz2891
Engineer
Engineer
Posts: 3
Joined: 05 Jan 2022 10:50

Re: NoNoCAB

Post by lukasz2891 »

Hello :) Is there anybody here? I’m observing very big problems with renewing vehicles by nonocab. After reaching the life-period, the vehicle goes to a depot, as it’s defined in its plan. But nothing happens there. Vehicles remain in depo. Now I have year 2060 in my game, 13 NoNoCab v6 opponnents and all of them behave same - a lot lot lot of trucks, ships and trains not upgraded. Their lines are died.
Attachments
Ursus Transport, 2078-05-12.sav
(3.01 MiB) Downloaded 102 times
Last edited by lukasz2891 on 06 Jan 2022 19:37, edited 1 time in total.
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: NoNoCAB

Post by Wormnest »

Can you attach a savegame that shows the problem?
lukasz2891
Engineer
Engineer
Posts: 3
Joined: 05 Jan 2022 10:50

Re: NoNoCAB

Post by lukasz2891 »

I've added to the previous post
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: NoNoCAB

Post by Wormnest »

Thanks. This was mostly AI #3, having lost a lot of its connections. Most likely it ran out of time saving all its connections (including complete road and rail paths). In that case it stops saving before it crashes. However, when loading a save where that happened some of the connections can't be loaded because they were not saved.

In the end this cause vehicles to wait in depots when they got to old. However, since our vehicle manager lost track of them, they were never removed.

I improved things a bit, by checking once in a while if there are vehicles not belonging to any known connection. Stations are also deleted, once all vehicles are gone. However, rail and road pieces and depots are not deleted. That would need a lot more work, for which I don't have time at the moment.

New version 7 is out on bananas :D
lukasz2891
Engineer
Engineer
Posts: 3
Joined: 05 Jan 2022 10:50

Re: NoNoCAB

Post by lukasz2891 »

Works great ;) Now everything is living again. Yes, it would be nice to have tracks also removed after the line has closed. With roads it seems to be hard.
User avatar
Maddog45353
Engineer
Engineer
Posts: 112
Joined: 26 Jun 2013 09:00

Re: NoNoCAB

Post by Maddog45353 »

ai wont use newgrf trains like iron horse 2 as far as i found
LoneBlackWolf
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: NoNoCAB

Post by xarick »

Got a crash
Attachments
screenshot#7.png
(191.83 KiB) Not downloaded yet
nonocab crash.sav
(7.79 MiB) Downloaded 78 times
Formerly known as Samu
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: NoNoCAB

Post by Wormnest »

Thanks for reporting. Fixed locally, publishing a new version might take a while.
eszeikial
Engineer
Engineer
Posts: 2
Joined: 11 Oct 2022 08:15

Re: NoNoCAB

Post by eszeikial »

:bow:
Attachments
nocabCrash.png
nocabCrash.png (34.87 KiB) Viewed 2053 times
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: NoNoCAB

Post by Wormnest »

Thanks for the report. What size map are you using? NoNoCAB ran out of memory. There is now a memory limit per AI. See Settings, Competitors, Computer Players, Max Memory per script.

The help text there says, that you may have to increase the amount if you play on large maps. This AI is indeed known to use quite a bit of memory, so if you use large maps, try to increase this amount if you have enough memory on your computer.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

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