NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.1.3
Moderator: OpenTTD Developers
Re: NoCab - Making AIs cry since 2008 [Update: revision 186]
Something I noticed is that because planes use 'full load', they have to wait until both passengers and mail capacity is filled. 'Full load any' would be more appropriate because now planes are waiting ages for more mail to come while the passenger capacity is filled. Because of this, throughput is mediocre and planes are waiting in the hangar.
EDIT: it even went bankrupt in my game because of this!
EDIT: it even went bankrupt in my game because of this!
- Attachments
-
- Geen naam, 1 Mrt 1945#1.png
- (213.13 KiB) Downloaded 125 times
Re: NoCab - Making AIs cry since 2008 [Update: revision 186]
Thanks for the feedback! To address your bugs / questions:
* On a more general note:
I'm currently rewriting some parts of the AI to make the code more readable and to eliminate code duplication. The code is as good as finished, I'm only polishing it up so it is as good (or even better) as the current version . So look out for a new release this week!
- Bram
I haven't heard of shared orders (I'm not a regular player, I like my computer do the work for me ). But this sounds like a great idea! One of the next things I'm going to introduce is the updating of existing connections, so the AI starts of with relative short connections to make some money; Later these will be extended to longer connections to make more money. Shared orders will certainly help, thanks for the tip!SirkoZ wrote:Now for some comments about your otherwise nice AI (r186):
-it doesn't use shared orders (why?)
This is simply the implementation of the current algorithm. I have no intention to change this as it doesn't effect the overall performance.SirkoZ wrote:-no matter how much money it has, it always borrows whenever buying new vehicles (I 'cheated' and built it some air-lines to bring in some money)
This is true and intentional, ideally we want no vehicles waiting for cargo on both ends of the connection. So in the beginning more and more stations will be build if the AI detects that vehicles are waiting on either side. As a consequence less stations will be used as less vehicles are needed to transport all cargo, I have no intention to change this as it can never hurt to have more stations .SirkoZ wrote:-it overexpands the unloading stations (which are almost empty after introduction of faster lorries)
Autch! Bankrupt ey? I will adopt your solution as I did notice this when I was testing but because the planes in 1950 can only transport 8 packages of mail it didn't pose a problem. But I see your planes can carry more, so I will include this fix in the next revision .bokkie wrote:Something I noticed is that because planes use 'full load', they have to wait until both passengers and mail capacity is filled. 'Full load any' would be more appropriate because now planes are waiting ages for more mail to come while the passenger capacity is filled. Because of this, throughput is mediocre and planes are waiting in the hangar.
EDIT: it even went bankrupt in my game because of this!
* On a more general note:
I'm currently rewriting some parts of the AI to make the code more readable and to eliminate code duplication. The code is as good as finished, I'm only polishing it up so it is as good (or even better) as the current version . So look out for a new release this week!
- Bram
Re: NoCab - Making AIs cry since 2008 [Update: revision 186]
That's really nice!...So look out for a new release this week!
BTW - another suggestion - in that savegame of mine (a few posts back) NoCAB hasn't built any airports, it did try once that I know of. It would really help the AI to build at least a few heliports/helicopters once every so many years because with inflation and default road set it's really difficult to stay afloat with having to renew/replace all those vehicles (profits (with default vehicle set) are meager as soon as the connections have inclines/turns).
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: NoCab - Making AIs cry since 2008 [Update: revision 186]
New version is out . Its quite a code overhaul and made a couple of optimizations as well. Nothing really special, but this will prepare the way for my next 2 implementations:
* Connection upgrade manager; If a connection is established it's now fixed and won't change. We want to be able to alter the connection by redirecting all vehicles to a longer route or replace a small airport with a larger one, etc.
* Ships! I already started on this implementation and won't take to long to implement.
More to come soon peeps, I'll give you a teaser as soon as I have ships working as well . Don't expect it to soon though, I'm currently overloaded with school work .
- Bram
* Connection upgrade manager; If a connection is established it's now fixed and won't change. We want to be able to alter the connection by redirecting all vehicles to a longer route or replace a small airport with a larger one, etc.
* Ships! I already started on this implementation and won't take to long to implement.
This will be implemented as one of the next features for this AI. I fully agree this is necessary. Also note that the situation will likely not occur any more, because I lifted the min 1000 population restriction on airplane connections. Instead I fully rely on my heuristics.SirkoZ wrote:That's really nice!...So look out for a new release this week!
BTW - another suggestion - in that savegame of mine (a few posts back) NoCAB hasn't built any airports, it did try once that I know of. It would really help the AI to build at least a few heliports/helicopters once every so many years because with inflation and default road set it's really difficult to stay afloat with having to renew/replace all those vehicles (profits (with default vehicle set) are meager as soon as the connections have inclines/turns).
More to come soon peeps, I'll give you a teaser as soon as I have ships working as well . Don't expect it to soon though, I'm currently overloaded with school work .
- Bram
Re: NoCab - Making AIs cry since 2008 [Update: revision 192]
Great, thanks!
Will test it.
Will test it.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: NoCab - Making AIs cry since 2008 [Update: revision 192]
As promised:
TEASER ALERT! Don't expect a release to soon though, I'm still very very busy with school (in fact I shouldn't have implemented this ). So don't expect a release till after next week. Happy building everyone!
- Bram
TEASER ALERT! Don't expect a release to soon though, I'm still very very busy with school (in fact I shouldn't have implemented this ). So don't expect a release till after next week. Happy building everyone!
- Bram
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: NoCab - Making AIs cry since 2008 [Update: revision 192]
Will the ships travel diagonally?
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Re: NoCab - Making AIs cry since 2008 [Update: revision 192]
What kind of a question is that, athanasios?
Anyhow - I have run the latest version (r192) through with the r14578(76) OTTD and it went quite well except for:
-still no shared orders
-AI was somewhat slow to autoreplace its vehicles despite year being over 2000 and having built 2 backup plane rides at the beginning (AI had enough money).
-oh and the third one: quite a few loading and unloading stations are simply huge with some being sqeezed against the hillside....too many bays (vehicles don't/can't use them all).
EDIT: And there's a really strange thing - it appears there is a bug in the AI framework because if look at the Autoreplace window for my planes (only heli's and DC-9's) there are other planes in there and the numbers are way off - several ten thousand of them
Here's the savegame:
Anyhow - I have run the latest version (r192) through with the r14578(76) OTTD and it went quite well except for:
-still no shared orders
-AI was somewhat slow to autoreplace its vehicles despite year being over 2000 and having built 2 backup plane rides at the beginning (AI had enough money).
-oh and the third one: quite a few loading and unloading stations are simply huge with some being sqeezed against the hillside....too many bays (vehicles don't/can't use them all).
EDIT: And there's a really strange thing - it appears there is a bug in the AI framework because if look at the Autoreplace window for my planes (only heli's and DC-9's) there are other planes in there and the numbers are way off - several ten thousand of them
Here's the savegame:
- Attachments
-
- Harzdorf Transport, 10th Jun 2053.sav
- savegame
- (671.04 KiB) Downloaded 162 times
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: NoCab - Making AIs cry since 2008 [Update: revision 192]
An other quick teaser
- Bram
Well.. yesathanasios wrote:Will the ships travel diagonally?
Jup, this will be implemented after I finished ships.SirkoZ wrote: Anyhow - I have run the latest version (r192) through with the r14578(76) OTTD and it went quite well except for:
-still no shared orders
Hmmz... I haven't tested that feature in detail. I solely rely in the autoupdate feature. But I expect that I didn't save up any money to do the actual auto replacement. Will look into it!SirkoZ wrote: -AI was somewhat slow to autoreplace its vehicles despite year being over 2000 and having built 2 backup plane rides at the beginning (AI had enough money).
I'm currently rewriting / updating the pathfinder so it can handle more generic cases. The current implementation simply finds an other route from any empty tile next to a road station without taking the usability of that tile into consideration. Will look into that as well once I'm done with ships .SirkoZ wrote: -oh and the third one: quite a few loading and unloading stations are simply huge with some being sqeezed against the hillside....too many bays (vehicles don't/can't use them all).
That's odd... For some reason I'm unable to open your save game so I couldn't check myself. But thanks again for the feedback and expect a release within 2 weeks .SirkoZ wrote: EDIT: And there's a really strange thing - it appears there is a bug in the AI framework because if look at the Autoreplace window for my planes (only heli's and DC-9's) there are other planes in there and the numbers are way off - several ten thousand of them
- Bram
Re: NoCab - Making AIs cry since 2008 [Update: revision 192]
That's nice. Anyhow - for my saved game you need the NewGRF found in my signature (link) - the Only_decrease neutraliser (forgot to mention).
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: NoCab - Making AIs cry since 2008 [Update: revision 192]
It's here!!! Ships are implemented .
While there is still a lot to do, some highlights of this release:
* Shared orders are implemented! (by popular request ).
* Buoys are nicely spaced from on another so they don't overcrowd the map.
* Some map analysis is done to determine which industries / towns can be served by ships. At the moment this binding is static, so if towns grow this won't be taken into account (yet). Oil rigs are also served .
* Pathfinder partially rewritten which is now way more dynamic .
Stuff to do before next release:
* Code clean up
* Documentation
* More testing!
I hope some of you can help me with the latter, because as the AI gets bigger and bigger it's more important to detect small flaws so I don't have to repair them way later which might affect other aspects of the AI. Thanks to all of you who helped me so far, it's really appreciated and help me a lot!
To sign off with, a picture of the latest version and reply to some forum posts:
While there is still a lot to do, some highlights of this release:
* Shared orders are implemented! (by popular request ).
* Buoys are nicely spaced from on another so they don't overcrowd the map.
* Some map analysis is done to determine which industries / towns can be served by ships. At the moment this binding is static, so if towns grow this won't be taken into account (yet). Oil rigs are also served .
* Pathfinder partially rewritten which is now way more dynamic .
Stuff to do before next release:
* Code clean up
* Documentation
* More testing!
I hope some of you can help me with the latter, because as the AI gets bigger and bigger it's more important to detect small flaws so I don't have to repair them way later which might affect other aspects of the AI. Thanks to all of you who helped me so far, it's really appreciated and help me a lot!
To sign off with, a picture of the latest version and reply to some forum posts:
That worked, thanks . I notice NoCAB doesn't replace airplanes as is to be expected because it won't build 'big' planes on small airfields. Next step will be to update existing connections (my next big project before I tackle trains). But nice to see in action though, I never ran my AI for so long; Good to see it can survive for more then 100 years .SirkoZ wrote:That's nice. Anyhow - for my saved game you need the NewGRF found in my signature (link) - the Only_decrease neutraliser (forgot to mention).
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 197]
I'm a bit fuzzy about Shared orders at this point. Now that I've implemented it I see some weird behaviour coming from (but possibly not limited to) ships. It seems that if one ship decides to go for maintenance, all ships follow suite! Only for a couple of seconds where they all decide not to go to the depot at all and return to their routes, only to turn around again 20 seconds later...
Anyone any clue what could be going on here?
Anyone any clue what could be going on here?
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 197]
Can you post a savegame that demonstrates this problem?Morloth wrote:I'm a bit fuzzy about Shared orders at this point. Now that I've implemented it I see some weird behaviour coming from (but possibly not limited to) ships. It seems that if one ship decides to go for maintenance, all ships follow suite! Only for a couple of seconds where they all decide not to go to the depot at all and return to their routes, only to turn around again 20 seconds later...
Anyone any clue what could be going on here?
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 197]
Alas I don't. But I've removed the AIOF_SERVICE_IF_NEEDED order for ships which seems to be helping. Now I only use it for road vehicles, but I'm not sure how they are affected by this.Yexo wrote:Can you post a savegame that demonstrates this problem?Morloth wrote:I'm a bit fuzzy about Shared orders at this point. Now that I've implemented it I see some weird behaviour coming from (but possibly not limited to) ships. It seems that if one ship decides to go for maintenance, all ships follow suite! Only for a couple of seconds where they all decide not to go to the depot at all and return to their routes, only to turn around again 20 seconds later...
Anyone any clue what could be going on here?
I'll look into this into more detail later this week.
Good night!
Bram
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 205]
Hey everyone,
I quickly want to say sorry for the vast amount of updates over the last couple of days, development has been going very quickly and I didn't want to leave you in the dark . Now that the main features are implemented I will slowly move towards a stable release cycle like Yexo and Zutty use for AdmiralAI and Convoy respectively. I will consider this implementation with busses / trucks / ships and airplanes as the release candidate for version 1.
The roadmap look as follows:
Version 1, RC1 (revision 205) - now
Version 1, RC2 - Only if bugs show up
Version 1, FINAL - Somewhere this month
- Code clean up + documentation.
Version 2:
* Advisor to update existing connections, which means:
- Migration to larger routes.
- Vehicle replacement.
- Replacement of airports.
Version 3:
* Trams / Trains implementation.
Version 4:
* Start looking at terrain analysis, mainly to speed up the algorithms.
* This version should be able to compete with average / good human players.
Version 5:
* Make a 'human friendly' version which will focus more on aesthetic qualities like the use of smart rail road design, etc.
This is the plan for the coming X months, hope it's worth the ride . As a last note, bug fixes between releases will have a simply numbering system like 1.4, 3.2, etc. You can always get the very latest version of the SVN server (see first post), but consider this as a bleeding edge version which might (it should...) not work or contain other bugs.
Take care and happy building,
Bram
I quickly want to say sorry for the vast amount of updates over the last couple of days, development has been going very quickly and I didn't want to leave you in the dark . Now that the main features are implemented I will slowly move towards a stable release cycle like Yexo and Zutty use for AdmiralAI and Convoy respectively. I will consider this implementation with busses / trucks / ships and airplanes as the release candidate for version 1.
The roadmap look as follows:
Version 1, RC1 (revision 205) - now
Version 1, RC2 - Only if bugs show up
Version 1, FINAL - Somewhere this month
- Code clean up + documentation.
Version 2:
* Advisor to update existing connections, which means:
- Migration to larger routes.
- Vehicle replacement.
- Replacement of airports.
Version 3:
* Trams / Trains implementation.
Version 4:
* Start looking at terrain analysis, mainly to speed up the algorithms.
* This version should be able to compete with average / good human players.
Version 5:
* Make a 'human friendly' version which will focus more on aesthetic qualities like the use of smart rail road design, etc.
This is the plan for the coming X months, hope it's worth the ride . As a last note, bug fixes between releases will have a simply numbering system like 1.4, 3.2, etc. You can always get the very latest version of the SVN server (see first post), but consider this as a bleeding edge version which might (it should...) not work or contain other bugs.
Take care and happy building,
Bram
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 205]
Seems ships do not go so diagonally-ship goes wrong way=zig-zag. Pretty good old pathfinder wise.
- Attachments
-
- drunk_ship.png (12.27 KiB) Viewed 4716 times
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 205]
Thx for your feedback athanasios, but could you be a little bit more specific about this/ Just showing 1 line doesn't make it look zig-zaggy to me .athanasios wrote:Seems ships do not go so diagonally-ship goes wrong way=zig-zag. Pretty good old pathfinder wise.
But you're right that the pathfinder doesn't find the optimal routes in this sense and this has been by design. Non-admissible heuristics produce results faster but you lose optimality, that's the trade-off. However, I'm currently looking into admissible heuristics and for road vehicles they are quite promising and very fast ^^. For ships I am exploring the same capabilities and again it looks very promising. For those interested: The general idea is to do a reachability analysis first before finding an optimal path, thus during the planning phase we use a non-admissible heuristic to find a path ASAP. But then during the construction phase we calculate the proper route.
I will do some more testing and include an optimal algorithm in version 1 final.
Thanks for your feedback!
P.S. There was a little flaw in the pathfinder where it would count diagonal tiles as straight once and vice-versa. This will be fixed in the final version.
Last edited by Morloth on 19 Nov 2008 13:02, edited 1 time in total.
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 205]
Wow - quite a lot changes since I've last been here.
I really like your development plan, Morloth, I can hardly wait version 3.
I have still to test the ship-added version 1 (r205).
BTW - athanasios ships not going diagonally is dependent upon pathfinder (Original) and not on AI implementation, however it might be possible to make AI so it uses its own pathfinder? I don't know.
I really like your development plan, Morloth, I can hardly wait version 3.
I have still to test the ship-added version 1 (r205).
BTW - athanasios ships not going diagonally is dependent upon pathfinder (Original) and not on AI implementation, however it might be possible to make AI so it uses its own pathfinder? I don't know.
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 205]
Thx, lets hope it works out as well as it looks on paper .SirkoZ wrote:I really like your development plan, Morloth, I can hardly wait version 3.
athanasios actually has a valid point here. The pathfinder in r205 constructs zig-zag patterns, becaues of the heuristic it doesn't discriminate between diagonal and straight nodes, so the zig-zag pattern will look as good to the pathfinder as a straight line. So /\/\/\/\/ == ---------. In fact it will prefer zig-zag lines because the diagonal lines will take it close to the goal (it thinks).SirkoZ wrote:BTW - athanasios ships not going diagonally is dependent upon pathfinder (Original) and not on AI implementation, however it might be possible to make AI so it uses its own pathfinder? I don't know.
See the following example:
Code: Select all
w = water
s = start
g = goal
# = land
* = found path
g##########
w####w#####
w###www####
wwwwwwwwwws
wwwwwwwwwww
Non-admissible:
g##########
*####*#####
*###*w*####
w***www***s
wwwwwwwwwww
Admissible (optimal!):
g##########
*####w#####
*###www####
w*********s
wwwwwwwwwww
- Bram
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: NoCab - Trucks, Busses, Airplanes and Ships! [Revision 205]
SirkoZ: I suppose that is what Morloth is up to. And that is what we want to get rid of.
I hope you can find a solution, because it looks very ugly. There is open sea there without obstacles (no land in the middle), but the ship prefers to zig zag. Good luck.
I hope you can find a solution, because it looks very ugly. There is open sea there without obstacles (no land in the middle), but the ship prefers to zig zag. Good luck.
Code: Select all
Current:
g***wwwwwww
www*wwwwwww
wwww***wwww
wwwwwww*www
wwwwwww*www
wwwwwwww*ww
wwwwwwww**s
Optimal:
g****wwwwww
wwwww*wwwww
wwwwww*wwww
wwwwwww*www
wwwwwwww*ww
wwwwwwwww*w
wwwwwwwwwws
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Who is online
Users browsing this forum: No registered users and 23 guests