MailAI

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

Brumi
President
President
Posts: 904
Joined: 18 Jul 2009 17:54

Re: MailAI

Post by Brumi » 25 Jul 2011 15:58

MailAI crashes if only trains or only road vehicles are enabled. See the savegames in this post: http://www.tt-forums.net/viewtopic.php?p=959512#p959512

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 26 Jul 2011 21:15

Thanks for bringing this up!

My MailAI seemed to be crashing because of a badly renamed variable. (this test used AIGameSettings.IsValid("vehicle.max_roadveh") instead of disabling the AIGameSettings.IsDisabledVehicleType) It's fixed in the new version.

I've also changed some variables so it will build routes on this kind of maps the test has been using. MailAI is more of a fluff AI and it won't likely be making profits with such small towns but I offcourse want it to score a little better then the -20 it got now. :)

It has been six months since I uploaded a version, can someone confirm if the tar file is working correctly either here or on Bananas (it says it's not yet available atm).
There's also a new version up on openttdcoop
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: MailAI

Post by Kogut » 02 Oct 2011 17:59

MailAI crashed with loooooong error message (so long that location of error is unavailable)
Attachments
Przechwytywanie.PNG
(156.54 KiB) Downloaded 5 times
Przechwytywanie.PNG
(79.16 KiB) Downloaded 5 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 06 Oct 2011 14:19

Thanks for bringing this up, it'll probably be when trying to build the rail network for a new route, this always spills many many variables :)

I was considering starting development of version three of mailai today so I'll have a look at it soon.

If you have any comments on the AI's behavior this would be a good time to post them as I'm considering writing some sections from scratch.
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

R-TEAM
Engineer
Engineer
Posts: 52
Joined: 19 Jan 2005 10:34
Location: Germany

Re: MailAI

Post by R-TEAM » 21 Jul 2013 17:18

Hi,

dont know will this be updated .... :)
But as suggestion :
MailAI runs primary good with roads - but if you use an "hardGame" like pack or costchangeNewGRF with the same result, the AI fails most time to build an rail connection or fail later with the costs of the rail-build+Train-costs+Maintaince-costs ...
So it would be nice to have an option like "Yes-but not as first transport way" for trains ... ;)

Regards
R-TEAM

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 24 Aug 2013 09:02

Thank you R-TEAM for the suggestion, I didn't think anybody was still using mailAI.

I have changed my career since my last update in 2011 (now working on cruise lines with awfull and expensive satelite internet connection) and haven't had much time to code but just a few days ago I felt the itch to come back to openTTD. Depending on how my other projects go I might pick this up again as I really liked the mailAI concept. So any other suggestions you might have are welcome.

Thanks again,
Hephi
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 30 Sep 2013 10:58

Good news everyone!

Version 2.0 is now available for download both here (in the first post of the thread), ingame or from Bananas.

The AI will now re-use stations when they have enough mail waiting resulting in more complex patterns then just the PtP lines.

Hope you enjoy...
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

Yajna
Engineer
Engineer
Posts: 13
Joined: 02 Oct 2013 15:44

Re: MailAI

Post by Yajna » 06 Oct 2013 06:50

Glad to hear you are still out there and interested in the project.

I ran MailAI today. It was set to Chieftan level in the AI parameters. I don't know if it's related to that parameter or not, but after MailAI established itself it waited/took 10 years before it built anything. Then, unfortunately, after 7 years of delivering mail it crashed.
MailAI Err.png
MailAI Err.png (458.91 KiB) Viewed 3994 times
Attachments
MailAI Error FullScr.png
(126.67 KiB) Downloaded 2 times

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 06 Oct 2013 08:18

I think I know where this error comes from, it's almost always a pathfinding problem. Probably the same reason it took so long to build the first time as well.
I'll upload a patched version later today or tomorrow. Thanks for reporting.

Edited to let you know the new version is up! Fixed the bug (was a typo) and also fixed electrifying rail when it becomes available while I was at it. :)
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

Yajna
Engineer
Engineer
Posts: 13
Joined: 02 Oct 2013 15:44

Re: MailAI

Post by Yajna » 08 Oct 2013 19:01

I gave the updated version a run. Easiness set to Elves.
No crash through 30 years of play. Cool.
But this time instead of taking 10 years to build anything, it took 15.
And at 30 years since it started running (15 since first station), it has 6 stations (three inter-city routes) and 6 RVs. Still no train.
It's great that it didn't crash. Just wondering if this rate of development is intentional.

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 09 Oct 2013 11:17

What kind of map are you playing on? Lot's of hills or only small towns will hinder rail development. Most of the time when it's doing 'nothing' it is actually trying to find a path with the railpathfinder.
There is a small chance the GRF you're playing with messes with the engine-chooser so it might help if you tell me what GRF's you're using relating to vehicles.
Are you using a mod that changes the base cost? Maybe rail is too expensive?
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

Yajna
Engineer
Engineer
Posts: 13
Joined: 02 Oct 2013 15:44

Re: MailAI

Post by Yajna » 09 Oct 2013 14:46

First, I'd like to thank you for all your time and effort. I know nothing about coding and I really appreciate that there are people out there working on AI development.

The first two times I ran MailAI (10 & 15 years before anything built) it was on a very flat 1024x1024 temperate map with a normal number of towns (same map seed). There were 10 other AIs running as well. No game scripts running. The following NewGRFs: US Town Names 1.0, Total Town Replacement Set 3.14, American Road Replacement Set, Total Bridge Renewal Set Version 1.2-Modified for ARRS, Industrial Stations Renewal v0.9.1, Beul's Mono&Maglev conversion.

Ran MailAI another three times. These last three times MailAI was the only AI on the map. No game scripts running. AI debug indicated 170+ towns big enough for sorting station (by Jan 1950) and 1300+ possible mail routes (showed in late 1958) on all three maps.
1) Very flat, 1024x1024 temperate map with a normal number of towns (random map seed). Same NewGRFs listed above. Nothing built by Jan 1960.
2) Very flat, 1024x1024 temperate map with a normal number of towns (random map seed). Same NewGRFs listed above. Late 1958, first rail route built and a few months later first local mail truck service.
3) Very flat, 1024x1024 temperate map with a normal number of towns (same map seed as #2). NewGRFs as above but without Industrial Stations Renewal and Beul's Mono&Maglev. Late 1958, first rail route built and a few months later first local mail truck service.

Again, perhaps that timeframe is perfectly intended and expected. I don't need an AI to race out of the blocks and spam the map with vehicles in its first two years. Only passing along my experience as an end-user. It just feels to me like MailAI takes a long time to put its wheels on the ground. Thanks for all your efforts.

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 09 Oct 2013 20:15

Thank you for the nice description. I will have a look myself in the next few days. It should not take that long before starting to build so something is not completely as it should be here. :)
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

R-TEAM
Engineer
Engineer
Posts: 52
Joined: 19 Jan 2005 10:34
Location: Germany

Re: MailAI

Post by R-TEAM » 09 Oct 2013 20:18

Hi,

i have MailAI testet in my comparsion between AIs http://www.tt-forums.net/viewtopic.php?f=65&t=59643, BUT, i have this with the last 1.x version - and with setting "dont use trains".

He have only build Truck routes, and this good ..
Have the new 2.0 and 2.1 version not testet.
ATM few free time - and wait for an actual spring2013 pack relase ..

Regards
R-TEAM

Yajna
Engineer
Engineer
Posts: 13
Joined: 02 Oct 2013 15:44

Re: MailAI

Post by Yajna » 11 Oct 2013 13:29

I went back through my advanced settings one by one. I changed competitor build speed from slow to medium. (Medium is the default value. I don't remember changing it from default, but clearly I did. :o )

Ran MailAI alone and with 3 other AI. MailAI built by Nov. 1952 and Aug. 1953 respectively. Much faster than before. Significant difference between default of medium competitor build speed and slow setting.

It's embarrassing that it seems a missed setting on my end caused the slow behavior in MailAI, even worse to say nothing at all.

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 11 Oct 2013 14:32

Version 2.2 now up!

I don't know if the build speed setting does anything at all, never looked into that.
MailAI version 2.1 was slow when it came to populating the possible routes on maps that were bigger like 1024*1024,
the new version has been changed so it will not take that long anymore, meybe half a year or so to get the possible routes populated.

Also in the new version a saving algorithm is now in place so it will save money to built a train route instead of spending all on new truck routes.
The difference is noticeable! It will now built a lot lot more train routes then it used to.

Minor bugfix as well to road depot placement and when using existing train stations for new lines.

Hope you enjoy and please continue letting me know where I can improve.
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

Yajna
Engineer
Engineer
Posts: 13
Joined: 02 Oct 2013 15:44

Re: MailAI

Post by Yajna » 16 Oct 2013 20:04

Definitely building faster and with more trains. Nice.

Attaching a debug png from a crash that happened twice today. Both times it happened right after the debug says it's building a route between Cuba and Centreville.
Attachments
O'Donnell & Co., 17th Apr 1958 - Copy.png
(115.26 KiB) Downloaded 1 time

Hephi
Engineer
Engineer
Posts: 69
Joined: 25 Oct 2009 09:56
Location: Belgium

Re: MailAI

Post by Hephi » 16 Oct 2013 20:19

I think it's because the town name is *Cuba* including the *. I'll have a look next time I have a minute to spare. Thanks for reporting.
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------

User avatar
Core Xii
Traffic Manager
Traffic Manager
Posts: 228
Joined: 08 Apr 2008 09:47
Location: Finland
Contact:

Re: MailAI

Post by Core Xii » 17 Oct 2013 18:17

Hephi wrote:I think it's because the town name is *Cuba* including the *. I'll have a look next time I have a minute to spare. Thanks for reporting.
I think you're mistaking double quotes for asterisks. In the stack dump it reads: [town_name] "Cuba" (because it's a string)

User avatar
WWTBAM
Moderator
Moderator
Posts: 3681
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: MailAI

Post by WWTBAM » 17 Oct 2013 23:09

I would say the same thing.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest