Trans AI .:19.07.23 :.
Moderator: OpenTTD Developers
Re: Trans AI .:10.03.07 :. (Rail-less)
fanioz has been gone over 2 years now, i don't think he'll be coming back
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
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
-
- Engineer
- Posts: 5
- Joined: 04 May 2013 09:55
Re: Trans AI .:10.03.07 :. (Rail-less)
Bug
- Attachments
-
- Unicorn Travel and Freight Co., 12th Apr 2021.png
- (134.16 KiB) Downloaded 6 times
Re: Trans AI .:10.03.07 :. (Rail-less)
Hi,
There's a new version of Trans AI on bananas and no word about it in this thread?
Time to mention it here,
but I'm sorry that my true intention was to make a bug report:
TransAI v. 130711, OpenTTD 1.3.1
This is the line in code where the bug happens:
The value of _Mgr_B could be 'null', I think it's not enough protected that this don't can happen.
And I had to disallow Planes for Trans or it bancrupts after short time because of the high infrastructure costs of airports.
There's a new version of Trans AI on bananas and no word about it in this thread?
Time to mention it here,
but I'm sorry that my true intention was to make a bug report:
TransAI v. 130711, OpenTTD 1.3.1
This is the line in code where the bug happens:
Code: Select all
if (!_Mgr_B.AllowTryStation(_S_Type)) return 2;
And I had to disallow Planes for Trans or it bancrupts after short time because of the high infrastructure costs of airports.
Re: Trans AI .:11.07.22 :. (Rail-less)
ThanksSteffl wrote:Hi,
There's a new version of Trans AI on bananas and no word about it in this thread?
Time to mention it here,
but I'm sorry that my true intention was to make a bug report:
TransAI v. 130711, OpenTTD 1.3.1
This is the line in code where the bug happens:
The value of _Mgr_B could be 'null', I think it's not enough protected that this don't can happen.Code: Select all
if (!_Mgr_B.AllowTryStation(_S_Type)) return 2;
Updated to v. 130722
Fix: Don't crash if no destination found (thanks to Steffl)
Fix : move to next cargo upon successful built
which NewGrf ?Steffl wrote: And I had to disallow Planes for Trans or it bancrupts after short time because of the high infrastructure costs of airports.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Trans AI .:11.07.22 :. (Rail-less)
Infrastructure maintenance is a new setting in OpenTTD 1.2+(?) itself. High infrastructure maintenance costs for airports might thus happen without any NewGRF being used.fanioz wrote: which NewGrf ?
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
-
- Engineer
- Posts: 23
- Joined: 18 Feb 2013 11:41
- Location: Jakarta, Indonesia
Re: Trans AI .:13.07.22 :. (Rail-less)
Hey man, will this AI works with CargoDist?
Regards, Akip
And yeah, his right. Your AI always bankrupt because airport's maintenance cost.Steffl wrote:And I had to disallow Planes for Trans or it bancrupts after short time because of the high infrastructure costs of airports.
Regards, Akip
Re: Trans AI .:13.07.22 :. (Rail-less)
Hi Fanioz, nice to see you again.
I see you fixed the "dont call me" error at events class (by deleting the lines).
I had done my own fix some time ago, by adding the missing events that triggered the try-catch, check it (currently there are dummy actions, but maybe you can do it better if needed)
Actually, I think the only useful for you could be ET_AIRCRAFT_DEST_TOO_FAR, to check bad behaviour, the others are only for AI/GS that can manage interactive stuff...
BTW, your AI works pretty well when starting from early eras (tested so far from 1700), but when it gets enough money it starts buying every competitor thats goes bankrupcy, taking over more and more useless stations around the map, making the game very ugly. Also it builds a ship depot for every sea route, wich leads to blockades in small water areas, and then I am forced to restart the AI to clean the messing...
I see you fixed the "dont call me" error at events class (by deleting the lines).
I had done my own fix some time ago, by adding the missing events that triggered the try-catch, check it (currently there are dummy actions, but maybe you can do it better if needed)
Code: Select all
// Patch: unsupported events, keep AI running
case AIEvent.ET_TOWN_FOUNDED:
Warn ("Unsupported event: ET_TOWN_FOUNDED");
break
case AIEvent.ET_AIRCRAFT_DEST_TOO_FAR:
Warn ("Unsupported event: ET_AIRCRAFT_DEST_TOO_FAR");
break
case AIEvent.ET_ADMIN_PORT:
Warn ("Unsupported event: ET_ADMIN_PORT");
break
case AIEvent.ET_WINDOW_WIDGET_CLICK:
Warn ("Unsupported event: ET_WINDOW_WIDGET_CLICK");
break
case AIEvent.ET_GOAL_QUESTION_ANSWER:
Warn ("Unsupported event: ET_GOAL_QUESTION_ANSWER");
break
// Patch end
BTW, your AI works pretty well when starting from early eras (tested so far from 1700), but when it gets enough money it starts buying every competitor thats goes bankrupcy, taking over more and more useless stations around the map, making the game very ugly. Also it builds a ship depot for every sea route, wich leads to blockades in small water areas, and then I am forced to restart the AI to clean the messing...
Re: Trans AI .:13.07.22 :. (Rail-less)
Trans crashes with Modulo by Zero error when trying to place an HQ while being Company #1 (0 in code).
if (counter % My.ID != 0) continue;
Formerly known as Samu
Re: Trans AI .:13.07.22 :. (Rail-less)
crashed: it took too long to save, while testing only ships for 100 years.
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [Water Tracker] sources: 1 dests: 1
dbg: [script] [1] [Water Tracker] max len: 42
dbg: [script] [1] [Water Tracker] original max len: 42
dbg: [script] [1] [Water Tracker] calculated multiplier: 1
dbg: [script] [1] [Water Tracker] Opening tile 1
dbg: [script] [1] [Water Tracker] nautical max len: 38
dbg: [script] [1] [Water Tracker] path finding # -1
dbg: [script] [1] [Events Check] No more event to save
dbg: [script] [1] [Water Tracker] path finding succeed
dbg: [script] [1] [Water Connector] est. Cost 262
dbg: [script] [1] [I] [Water Connector] Have 262 [true] -> Good Job ^_^
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [I] [Water Tracker] sources: 1 dests: 1
dbg: [script] [1] [I] [Water Tracker] max len: 44
dbg: [script] [1] [I] [Water Tracker] original max len: 44
dbg: [script] [1] [I] [Water Tracker] calculated multiplier: 1
dbg: [script] [1] [I] [Water Tracker] Opening tile 1
dbg: [script] [1] [I] [Water Tracker] nautical max len: 40
dbg: [script] [1] [I] [Water Tracker] path finding # -1
dbg: [script] [1] [I] [Events Check] No more event to save
dbg: [net] [udp] advertising to master server
dbg: [script] [1] [I] [Events Check] No more event to save
dbg: [script] [1] [E] This script took too long to Save.
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
dbg: [script] [1] [I] Please report the error to the following URL:
dbg: [script] [1] [I] http://dev.openttdcoop.org/projects/ai-trans/issues
- Attachments
-
- Trans Angel, 1st Dec 2016.sav
- last month alive
- (1.34 MiB) Downloaded 175 times
-
- Trans Angel, 1st Jan 2017.sav
- already dead
- (1.34 MiB) Downloaded 169 times
-
- openttdCore1.cfg
- server config
- (11.62 KiB) Downloaded 168 times
Formerly known as Samu
Re: Trans AI .:13.07.22 :. (Rail-less)
Too long to save again.
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [W] [Water Connector] failed: ERR_SITE_UNSUITABLE
dbg: [script] [1] [Water Tracker] sources: 1 dests: 1
dbg: [script] [1] [Water Tracker] max len: 20
dbg: [script] [1] [Water Tracker] original max len: 20
dbg: [script] [1] [Water Tracker] calculated multiplier: 1
dbg: [script] [1] [Water Tracker] Opening tile 1
dbg: [script] [1] [Water Tracker] nautical max len: 20
dbg: [script] [1] [Water Tracker] path finding # -1
dbg: [script] [1] [W] [Water Tracker] path finding failed
dbg: [script] [1] [Water Tracker] sources: 1 dests: 1
dbg: [script] [1] [Water Tracker] max len: 20
dbg: [script] [1] [Water Tracker] original max len: 20
dbg: [script] [1] [I] [Water Tracker] calculated multiplier: 1
dbg: [script] [1] [I] [Water Tracker] Opening tile 1
dbg: [script] [1] [I] [Water Tracker] nautical max len: 20
dbg: [script] [1] [I] [Water Tracker] path finding # -1
dbg: [script] [1] [W] [Water Tracker] path finding failed
dbg: [script] [1] [I] [Water Tracker] sources: 1 dests: 1
dbg: [script] [1] [I] [Water Tracker] max len: 39
dbg: [script] [1] [I] [Water Tracker] original max len: 39
dbg: [script] [1] [I] [Water Tracker] calculated multiplier: 1
dbg: [script] [1] [I] [Water Tracker] Opening tile 1
dbg: [script] [1] [I] [Water Tracker] nautical max len: 35
dbg: [script] [1] [I] [Water Tracker] path finding # -1
dbg: [script] [1] [I] [Events Check] No more event to save
dbg: [script] [1] [E] This script took too long to Save.
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
dbg: [script] [1] [I] Please report the error to the following URL:
dbg: [script] [1] [I] http://dev.openttdcoop.org/projects/ai-trans/issues
- Attachments
-
- Trans Moon, 1st Dec 2018.sav
- last month alive
- (1.17 MiB) Downloaded 169 times
-
- Trans Moon, 1st Jan 2019.sav
- already dead
- (1.17 MiB) Downloaded 169 times
-
- openttdCore2.cfg
- server config
- (11.62 KiB) Downloaded 170 times
Formerly known as Samu
Re: Trans AI .:13.07.22 :. (Rail-less)
Trans is massing ships on the same route, but they get lost.
Formerly known as Samu
Re: Trans AI .:13.07.22 :. (Rail-less)
workaround:xarick wrote:Trans crashes with Modulo by Zero error when trying to place an HQ while being Company #1 (0 in code).
if (counter % My.ID != 0) continue;
Code: Select all
if (My.ID !=0 && counter % My.ID != 0) continue;
Re: Trans AI .:13.07.22 :. (Rail-less)
Crashed right after buying Chopper
- Attachments
-
- Unnamed, 1963-02-17.sav
- (331.94 KiB) Downloaded 161 times
-
- Unnamed, 1963-03-09.png
- (358.98 KiB) Not downloaded yet
Formerly known as Samu
Re: Trans AI .:13.07.22 :. (Rail-less)
Hello, I've not try CargoDist yet. I can't comment on this.Akip Nax Dhagadoe wrote:Hey man, will this AI works with CargoDist?
Akip Nax Dhagadoe wrote:And yeah, his right. Your AI always bankrupt because airport's maintenance cost.Steffl wrote:And I had to disallow Planes for Trans or it bancrupts after short time because of the high infrastructure costs of airports.
Regards, Akip
I'll fix ; disallow aircraft to build if the infrastructure maintenance setting is activated
Thanks, I'll look into "ET_AIRCRAFT_DEST_TOO_FAR" to see what can I do with that. The reason for deleting "dont call me" line was because I dont want to handle every AIEvent brodcasted.HGus wrote:Hi Fanioz, nice to see you again.
I see you fixed the "dont call me" error at events class (by deleting the lines).
I had done my own fix some time ago, by adding the missing events that triggered the try-catch, check it (currently there are dummy actions, but maybe you can do it better if needed) Actually, I think the only useful for you could be ET_AIRCRAFT_DEST_TOO_FAR, to check bad behaviour, the others are only for AI/GS that can manage interactive stuff...
Thanks, noted for the later-than-sooner versionHGus wrote: BTW, your AI works pretty well when starting from early eras (tested so far from 1700), but when it gets enough money it starts buying every competitor thats goes bankrupcy, taking over more and more useless stations around the map, making the game very ugly. Also it builds a ship depot for every sea route, wich leads to blockades in small water areas, and then I am forced to restart the AI to clean the messing...
Thanks, fixed.xarick wrote:Trans crashes with Modulo by Zero error when trying to place an HQ while being Company #1 (0 in code).if (counter % My.ID != 0) continue;
xarick wrote:crashed: it took too long to save, while testing only ships for 100 years.
Thanks, fixed. That was because it check structure of data to be saved, and run out of Ops available.
xarick wrote:Trans is massing ships on the same route, but they get lost.
Thanks, noted, Perhaps, it is time to employ buoy ..
xarick wrote:Crashed right after buying Chopper
Thanks, fixed. That was because Valuator need either bool or integer return value from a function
Re: Trans AI .:18.04.11 :. (Rail-less)
Bump.....
Version 180411 is available on BaBaNaNaS, as well as on first post.
* 180411
Fixes: Not connecting air route with infrastructure maintenance setting activated. Thanks Steffl
Fixes: crashes with Modulo by Zero error when trying to place an HQ while being Company #1 (0 in code). Thanks xarick
Fixes: Crashed due to return value of a function is neither bool nor integer, when being used as Valuator. Thanks xarick
Fixes: AI forced to be stopped due to it took too long to save. Thanks xarick
Version 180411 is available on BaBaNaNaS, as well as on first post.
* 180411
Fixes: Not connecting air route with infrastructure maintenance setting activated. Thanks Steffl
Fixes: crashes with Modulo by Zero error when trying to place an HQ while being Company #1 (0 in code). Thanks xarick
Fixes: Crashed due to return value of a function is neither bool nor integer, when being used as Valuator. Thanks xarick
Fixes: AI forced to be stopped due to it took too long to save. Thanks xarick
Re: Trans AI .:18.05.06 :. (Rail Alpha)
Bump for the new version. We are now at 180506. Trans is available on BaNaNaS, as well as on first post.
Now, the the ships has buoys in their route. And I re-introduce the rail service. But now only build one train, on one rail.
Let see the changelog.
* 180506
General: Moving repository to git and uses GitHub as issue tracker
Bundling: Now using PowerShell script to bundling package for Bananas
CodeChange: General Pathfinder Optimization
CodeChange: General code CleanUp
Codechange:[Load/Save]:Refactoring service route table
Codechange: Optimize water pathfinder for buoys
Feature: Trans.Rail is back online (alpha stage). Right now we only support for running one train
Feature: Trans.Water now can build buoys
Feature: Closing route if it was not producing/accepting anymore
Feature: If infrastructure maintenance activated in game, we would close the aircraft route
Feature: [Debug] Add option to "break" in game
Feature: [Debug] Make a distinct between build sign for path finding and other sign
Fixes:[Save] max. 25 levels deep
Fixes: Do not deleting station if being used by other route
Fixes:Find nearby depot should be reachable (now for Road & Water)
Fixes:Checking AITile.HasTransportType should be done on next iteration
Fixes: Build depot for water now inline
Fixes: Put a limit distance to find a depot
And more logs can be seen at the repository.
And... Happy Bhirtday to me
Now, the the ships has buoys in their route. And I re-introduce the rail service. But now only build one train, on one rail.
Let see the changelog.
* 180506
General: Moving repository to git and uses GitHub as issue tracker
Bundling: Now using PowerShell script to bundling package for Bananas
CodeChange: General Pathfinder Optimization
CodeChange: General code CleanUp
Codechange:[Load/Save]:Refactoring service route table
Codechange: Optimize water pathfinder for buoys
Feature: Trans.Rail is back online (alpha stage). Right now we only support for running one train
Feature: Trans.Water now can build buoys
Feature: Closing route if it was not producing/accepting anymore
Feature: If infrastructure maintenance activated in game, we would close the aircraft route
Feature: [Debug] Add option to "break" in game
Feature: [Debug] Make a distinct between build sign for path finding and other sign
Fixes:[Save] max. 25 levels deep
Fixes: Do not deleting station if being used by other route
Fixes:Find nearby depot should be reachable (now for Road & Water)
Fixes:Checking AITile.HasTransportType should be done on next iteration
Fixes: Build depot for water now inline
Fixes: Put a limit distance to find a depot
And more logs can be seen at the repository.
And... Happy Bhirtday to me
Re: Trans AI .:18.06.22 :.
We are at 180622. Check it out at Bananas or first post
Introducing some features and fixes some bugs, here are the highlights:
Trans.Rail now could handle two train on single track
Trans.Rail will try to build the second track
Trans.Rail now could handle more train on double track
Trans.Rail Uses Dual line Terminus station
Continue building current train route if loaded from a save game
Fixes:[PF] Rail PT cannot detect existing bridge/tunnel
Fixes: GetReplacement() should build a replacement vehicle
Fixes: Save the route built state
Fixes: Don't build station entry if not built station
Fixes: Re-order priority for closing route and adding vehicle
Fixes: Don't crash if got an invalid industry ID
Fixes: Don't Crash if only have one depot
Fixes: Don't crash if Airport first tiles was hangar. (When uses heliport depot type airport)
Fixes: Don't go thru back of rail signal
Fixes: Crash due to no start/end point saved
Fixes: Build rail depot on the same level
Fixes: Rail not removed if depot is not built near station
Check out more at changelog.txt
Introducing some features and fixes some bugs, here are the highlights:
Trans.Rail now could handle two train on single track
Trans.Rail will try to build the second track
Trans.Rail now could handle more train on double track
Trans.Rail Uses Dual line Terminus station
Continue building current train route if loaded from a save game
Fixes:[PF] Rail PT cannot detect existing bridge/tunnel
Fixes: GetReplacement() should build a replacement vehicle
Fixes: Save the route built state
Fixes: Don't build station entry if not built station
Fixes: Re-order priority for closing route and adding vehicle
Fixes: Don't crash if got an invalid industry ID
Fixes: Don't Crash if only have one depot
Fixes: Don't crash if Airport first tiles was hangar. (When uses heliport depot type airport)
Fixes: Don't go thru back of rail signal
Fixes: Crash due to no start/end point saved
Fixes: Build rail depot on the same level
Fixes: Rail not removed if depot is not built near station
Check out more at changelog.txt
Re: Trans AI .:18.06.22 :.
CPU evaluator crash
- Attachments
-
- Unnamed, 1931-07-17.png
- (284.43 KiB) Not downloaded yet
Formerly known as Samu
Re: Trans AI .:18.06.22 :.
Another cpu evaluator crash
- Attachments
-
- Unnamed, 1962-09-26.png
- (153.92 KiB) Not downloaded yet
-
- Unnamed, 1962-09-28.sav
- (4.65 MiB) Downloaded 154 times
Formerly known as Samu
Re: Trans AI .:18.06.22 :.
xarick wrote:Another cpu evaluator crash
Thanks for the report. But I have no idea what was wrong. Is this related to #opcode limit or there was another thing that "limit" the valuator. I'll try to figure it out.xarick wrote:CPU evaluator crash
Who is online
Users browsing this forum: No registered users and 28 guests