Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat Aug 18, 2018 7:04 am

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
 Post subject: ShipAI
PostPosted: Mon Nov 21, 2016 11:46 am 
Offline
Engineer
Engineer

Joined: Sun Oct 23, 2016 9:37 pm
Posts: 7
AI that operates only ships (both freight and PAX), it's heavily based on HeliFerry AI and shouldn't be played with it together.

It supports:
- autoreplacing vehicle model when the new, better model appears
- selling unprofitable vehicles
- autoreplacing old vehicles with new ones

Download: https://github.com/mmuszkow/ShipAI/archive/master.zip
The code is available on my github: https://github.com/mmuszkow/ShipAI


Top
   
 Post subject: Re: ShipAI
PostPosted: Sun Jun 04, 2017 3:19 pm 
Offline
Engineer
Engineer

Joined: Mon Jul 21, 2008 4:11 pm
Posts: 10
Location: Polska/Poland
Hi. Is this normal for this AI to place so many buoys?
And another thing, have a look at this screenshot: http://imgur.com/W7hbh5q . This yellow line is the route ship takes. It's really unefficient.

I like this AI and it's really great that ships are used to transport a lot of different cargos but my map full of islands was extremely cluttered with buoys after few years. And those poor ships which wasted a lot of time going along the coast when it was 5x closer to cut the way like on the screenshot above.


Top
   
 Post subject: Re: ShipAI
PostPosted: Fri Jun 09, 2017 2:25 pm 
Offline
Engineer
Engineer

Joined: Sun Oct 23, 2016 9:37 pm
Posts: 7
lucj@n wrote:
Is this normal for this AI to place so many buoys?
Yes, boys are placed every 25 tiles. This is made to avoid ships getting lost and to improve the pathfinder performance ( see: viewtopic.php?t=75339 ).
lucj@n wrote:
And another thing, have a look at this screenshot: http://imgur.com/W7hbh5q . This yellow line is the route ship takes. It's really unefficient.
The 2 pathfinders used by the AI (straight line, coast) were chosen because of their speed. The price for that, in case of the coast pathfinder, is that it sometimes gives sub-optimal routes.


Top
   
 Post subject: Re: ShipAI
PostPosted: Mon Jun 12, 2017 1:46 pm 
Offline
Engineer
Engineer

Joined: Mon Jul 21, 2008 4:11 pm
Posts: 10
Location: Polska/Poland
mjm wrote:
...
ok, that makes sense.
Dzięki.


Top
   
 Post subject: Re: ShipAI
PostPosted: Wed Aug 09, 2017 12:20 pm 
Offline
Engineer
Engineer

Joined: Sun Oct 23, 2016 9:37 pm
Posts: 7
Update, v4 (available on bananas)

The biggest change is that ShipAI can now use canals for the freight cargo.
In order to use canals, AI needs to have it enabled in settings and 2x max loan in it's budget.
The max canal length is limited to 50 tiles and no aqueducts or inner-locks are used to reduce the costs.

There are also few minor changes regarding the main AI logic (improved maintenance time, more expensive cargo first) and performance.


Top
   
 Post subject: Re: ShipAI
PostPosted: Mon Nov 27, 2017 10:57 am 
Offline
Engineer
Engineer

Joined: Sun Jul 14, 2013 12:33 pm
Posts: 86
Location: Netherlands
Crash of ShipAI version 4 right after starting because using a valuator inside a valuator on the latest versions of OpenTTD are time limited.
This is without any NewGRF, 1024x1024 map.

PS. It might be useful to upgrade your API compatibility to a newer version than 0.7. That would give you access to newer API functions.


Attachments:
File comment: Crash log ShipAI v4.
Unnamed, Jan 23rd, 1955.png [291.99 KiB]
Not downloaded yet
Top
   
 Post subject: Re: ShipAI
PostPosted: Mon Feb 26, 2018 7:05 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Thu Feb 26, 2015 12:52 am
Posts: 215
cpu evaluator crash

Code:
dbg: [script] [0] [I] Building LVST ship between Trudingville Farm(producer) and Gronfingley Factory(acceptor)
dbg: [script] [0] [E] Failed to build dock: ERR_AREA_NOT_CLEAR
dbg: [script] [0] [I] Building LVST ship between Keston Farm(producer) and Grenningpool Falls Factory(acceptor)
dbg: [script] [0] [I] Building LVST ship between Quarnbury Farm(producer) and Nindham Factory(acceptor)
dbg: [script] [0] [I] Building LVST ship between Hunnway Farm(producer) and Hunnway Factory(acceptor)
dbg: [script] [0] [I] Building LVST ship between Nuntborough Farm(producer) and Drundworth Factory(acceptor)
dbg: [script] [0] [I] Building LVST ship between Barningpool Farm(producer) and Fruham Factory(acceptor)
dbg: [script] [0] [I] Building LVST ship between Wrondingville Farm(producer) and Garfinghill Factory(acceptor)
dbg: [script] [0] [S] Your script made an error: excessive CPU usage in valuator function
dbg: [script] [0] [S]
dbg: [script] [0] [S] *FUNCTION [GetCargoAcceptingCoastTiles()] shipai-4\town.nut line [20]
dbg: [script] [0] [S] *FUNCTION [_val_TownCanHaveDock()] shipai-4\town.nut line [43]
dbg: [script] [0] [S] *FUNCTION [Valuate()] NATIVE line [-1]
dbg: [script] [0] [S] *FUNCTION [GetTownsThatCanHaveDock()] shipai-4\freight.nut line [27]
dbg: [script] [0] [S] *FUNCTION [BuildTownFreightRoutes()] shipai-4\freight.nut line [55]
dbg: [script] [0] [S] *FUNCTION [Start()] shipai-4\main.nut line [30]
dbg: [script] [0] [S]
dbg: [script] [0] [S] [tiles] INSTANCE
dbg: [script] [0] [S] [cargo] 5
dbg: [script] [0] [S] [range] 20
dbg: [script] [0] [S] [this] INSTANCE
dbg: [script] [0] [S] [cargo] 5
dbg: [script] [0] [S] [range] 20
dbg: [script] [0] [S] [town_id] 51
dbg: [script] [0] [S] [this] TABLE
dbg: [script] [0] [S] [towns] INSTANCE
dbg: [script] [0] [S] [cargo] 5
dbg: [script] [0] [S] [this] INSTANCE
dbg: [script] [0] [S] [producers] INSTANCE
dbg: [script] [0] [S] [min_capacity] 160
dbg: [script] [0] [S] [cargo] 5
dbg: [script] [0] [S] [cargos] INSTANCE
dbg: [script] [0] [S] [ships_built] 0
dbg: [script] [0] [S] [this] INSTANCE
dbg: [script] [0] [S] [new_freights] 302
dbg: [script] [0] [S] [ferry] INSTANCE
dbg: [script] [0] [S] [freight] INSTANCE
dbg: [script] [0] [S] [this] INSTANCE
dbg: [script] [0] [S] Your script made an error: excessive CPU usage in valuator function
dbg: [script] [0] [S]
dbg: [script] [0] [S] *FUNCTION [GetTownsThatCanHaveDock()] shipai-4\freight.nut line [27]
dbg: [script] [0] [S] *FUNCTION [BuildTownFreightRoutes()] shipai-4\freight.nut line [55]
dbg: [script] [0] [S] *FUNCTION [Start()] shipai-4\main.nut line [30]
dbg: [script] [0] [S]
dbg: [script] [0] [S] [towns] INSTANCE
dbg: [script] [0] [S] [cargo] 5
dbg: [script] [0] [S] [this] INSTANCE
dbg: [script] [0] [S] [producers] INSTANCE
dbg: [script] [0] [S] [min_capacity] 160
dbg: [script] [0] [S] [cargo] 5
dbg: [script] [0] [S] [cargos] INSTANCE
dbg: [script] [0] [S] [ships_built] 0
dbg: [script] [0] [S] [this] INSTANCE
dbg: [script] [0] [S] [new_freights] 302
dbg: [script] [0] [S] [ferry] INSTANCE
dbg: [script] [0] [S] [freight] INSTANCE
dbg: [script] [0] [S] [this] INSTANCE
dbg: [script] The script died unexpectedly.
One of the running scripts crashed. Please report this to the script author with a screenshot of the AI/Game Script Debug Window


Attachments:
ShipAI, 1st Jan 1957.sav [1.17 MiB]
Downloaded 19 times

_________________
Formerly known as Samu
Top
   
 Post subject: Re: ShipAI
PostPosted: Wed Mar 07, 2018 10:48 pm 
Offline
Engineer
Engineer

Joined: Sun Oct 23, 2016 9:37 pm
Posts: 7
Please check the new version (v5) from https://github.com/mmuszkow/ShipAI/archive/master.zip
I've splitted the problems AI was lagging on into smaller chunks and now the operations should take short enough not to raise the "excessive CPU usage in valuator". If everything is Ok, I'll put it on bananas shortly.

Quote:
PS. It might be useful to upgrade your API compatibility to a newer version than 0.7. That would give you access to newer API functions.
I always use the doc for trunk version and functions from there. I never lacked any. Is there any other point in increasing the min compatibile version?

edit: v5 was put on bananas.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.