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

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

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.14

Post by Morloth »

SirkoZ wrote:By the way - what's up with latest 'Cabs (2.0.1x) not building any ships (especially when I set max. road vehicles to 0)?
Darn! Just noticed it just now. Fixed it now, so it will be fixed in the next release (hopefully today).
SirkoZ wrote:Any while describing fastness of '.1x of 'Cabs - it's not faster - it's in fact - slower/choppier than 2.0.7; black being white, yes?
No, at least not as far as I've noticed. But I'll look into this and come back to you.

Thanks for notifying me :).
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.14

Post by Lord Aro »

similar to a screenshot some posts ago i caught this:
Attachments
funny.png
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.14

Post by SirkoZ »

Morloth wrote:Darn! Just noticed it just now. Fixed it now, so it will be fixed in the next release (hopefully today).

...No, at least not as far as I've noticed. But I'll look into this and come back to you.

Thanks for notifying me :).
Thank you for the prompt reply and fix. 8)
Lord Aro wrote:similar to a screenshot some posts ago i caught this:
Though somewhat funny - it is the shortest path...well - probably not really but as jaggies in 3D graphics - this and those come from approximating diagonal line with squares/pixels...
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.14

Post by planetmaker »

SirkoZ wrote:Though somewhat funny - it is the shortest path...well - probably not really but as jaggies in 3D graphics - this and those come from approximating diagonal line with squares/pixels...
Not really... a slope is always "longer" than a flat tile as there's the possibility that the vehicle slows down due to it.
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Morloth »

New update, this should fix most problems :).

Changelog:
* Ships are now constructable again.
* Allow NoCAB to spend more money on new connections.
* Penalize turns and bridges more for road vehicles.

Thanks for the reports!
Bram
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by planetmaker »

Morloth wrote: * Penalize turns and bridges more for road vehicles.
I don't think it's necessary to penalize a bridge in general as a bridge does not necessarily mean a height difference in the road level.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Kogut »

But bridges costs more and...
Attachments
Przechwytywanie.PNG
Przechwytywanie.PNG (134.69 KiB) Viewed 3894 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Morloth »

Kogut wrote:But bridges costs more and...
:'(. I'll have a look later this week to see what I can do.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Kogut »

Morloth wrote:
Kogut wrote:But bridges costs more and...
:'(. I'll have a look later this week to see what I can do.
It is copy paste for planetmaker from Lord Aro's post. http://www.tt-forums.net/viewtopic.php?p=882031#p882031
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Morloth »

Kogut wrote:
Morloth wrote:
Kogut wrote:But bridges costs more and...
:'(. I'll have a look later this week to see what I can do.
It is copy paste for planetmaker from Lord Aro's post. http://www.tt-forums.net/viewtopic.php?p=882031#p882031
Aaaaah! Ok! No problem than ^^
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Lord Aro »

Kogut wrote:
Morloth wrote:
Kogut wrote:But bridges costs more and...
:'(. I'll have a look later this week to see what I can do.
It is copy paste for planetmaker from Lord Aro's post. http://www.tt-forums.net/viewtopic.php?p=882031#p882031
you should of quoted me then X(
:]
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Kogut »

crash
Attachments
Przechwytywanie.PNG
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
mwyeoh
Engineer
Engineer
Posts: 28
Joined: 21 May 2009 05:36
Location: Perth, Australia

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by mwyeoh »

Just reporting a crash too

NoCAB 2.0.16

OTTD 1.0.2-RC1
Attachments
MWYEOH  Locomotive, 3rd Aug 1966.png
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Kogut »

similar
Attachments
Przechwytywanie.PNG
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Morloth »

Kogut wrote:similar
Are you using and NewGRFs by any chance? Because I don't see the problem in the code just glancing over it.

The other bug is fixed btw :).
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.15

Post by Kogut »

Morloth wrote:
Kogut wrote:similar
Are you using and NewGRFs by any chance? Because I don't see the problem in the code just glancing over it.

The other bug is fixed btw :).
Swedish houses
Total bridge replacement set
YARRS
ISR
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.16

Post by Morloth »

Prementioned bugs are fixed now :). Thanks for the reports!

- Get the correct bridge length for pathfinding.
- Make sure to return false if a road station couldn't be build.
- Correctly detect bidirectional connections.
- Don't use static values anymore connection length is now determined by the speed of the vehicle and how much it can travel in a set amount of days.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.16

Post by planetmaker »

Morloth wrote:- Don't use static values anymore connection length is now determined by the speed of the vehicle and how much it can travel in a set amount of days.
I'm curious on how you go for that.

Especially with newgrfs there are a number of pitfalls in that area, the actual travel time cannot queried reliably beforehand:
- speed can change with refit
- speed can change with load amount (or basically any thing you can think of, if the newgrf author is evil, like 1km/h only on April 1st)
- slope speed depends upon the acceleration settings (realistic vs. original, both for trains and road vehicles)
- slope speed depends upon the setting for the steepness of slopes
- speed can change for trains when certain wagons are (not) attached
- speed of rail vehicles can be limited by the track type (if played with rail types newgrfs)
- speed of planes depends on the plane speed multiplier 1/1, 1/2 or 1/4
- overall speed of vehicles depends upon breakdown settings
- average speed of RV depends on the amount and busyness of level crossings
- average speed for RV and trains depends upon the busyness of their route and whether there are stations on the way (possibly blocked by other vehicles)
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.16

Post by Morloth »

planetmaker wrote:
Morloth wrote:- Don't use static values anymore connection length is now determined by the speed of the vehicle and how much it can travel in a set amount of days.
I'm curious on how you go for that.

Especially with newgrfs there are a number of pitfalls in that area, the actual travel time cannot queried reliably beforehand:
...
What I mean with this setting is that the connections NoCAB will consider are no longer determined by a fixed value, e.g. only consider connections who's manhattan distance is less than X. Instead NoCAB considers every connection which, with the current vehicle's speed, can we served within X days (I now use 100). This is a very simplified function, but it is only used for the preliminary selection of connection we might want to build. Once we have this ordered list we use the pathfinders to get better estimates.

But you're right that there are many variables to consider and I only use the standard values at the moment. So if there are changed the calculated estimates will be more off. But to go down your list:

Not considered:
- speed can change with refit
- speed can change with load amount (or basically any thing you can think of, if the newgrf author is evil, like 1km/h only on April 1st)
- slope speed depends upon the acceleration settings (realistic vs. original, both for trains and road vehicles)
- slope speed depends upon the setting for the steepness of slopes
- speed can change for trains when certain wagons are (not) attached
- average speed of RV depends on the amount and busyness of level crossings
- average speed for RV and trains depends upon the busyness of their route and whether there are stations on the way (possibly blocked by other vehicles)

Planned for future:
- speed of rail vehicles can be limited by the track type (if played with rail types newgrfs)

Already considered:
- speed of planes depends on the plane speed multiplier 1/1, 1/2 or 1/4
- overall speed of vehicles depends upon breakdown settings

So yes, if NewGRFs will mess with these values there is little NoCAB can do to detect this at the moment. Some functions (like the speed of a refitted vehicle) are not yet exposed by NoAI (as far as I know). But as more functions become available I'll definitely consider including them.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoCAB - Trains, Trucks, Busses, Aircraft and Ships! v2.0.16

Post by planetmaker »

Sounds reasonable :-) Agreed also that rail types might be a nifty feature :-). Caring for (own and other) road stops on the way for RV might be a good thing for the future, though, too. After all they can be a MAJOR source of jams.
Morloth wrote: So yes, if NewGRFs will mess with these values there is little NoCAB can do to detect this at the moment. Some functions (like the speed of a refitted vehicle) are not yet exposed by NoAI (as far as I know). But as more functions become available I'll definitely consider including them.
That's a principle problem. I have my doubts whether it CAN even be exposed. It's after all not even exposed to the player and OpenTTD doesn't know it itself before the refit is executed (similar for a number of other newgrf things); I just listed it for completeness :-)

In any case: great progress; I'm always amazed at how quick you are to fix bugs and churn out a new, improved version :-) Kudos!
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests